From 76a65e92384b3f95d88869ec3e4f8f8c83ef2ad4 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Sun, 30 Oct 2016 23:31:51 +0200 Subject: [PATCH] Add support for both CHE_APIs --- platformio/app.py | 4 ++-- platformio/maintenance.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/platformio/app.py b/platformio/app.py index 34a2a7d1..4dba84fc 100644 --- a/platformio/app.py +++ b/platformio/app.py @@ -274,10 +274,10 @@ def get_cid(): _uid = None if getenv("C9_UID"): _uid = getenv("C9_UID") - elif getenv("CHE_API_ENDPOINT"): + elif getenv("CHE_API", getenv("CHE_API_ENDPOINT")): try: _uid = requests.get("{api}/user?token={token}".format( - api=getenv("CHE_API_ENDPOINT"), token=getenv( + api=getenv("CHE_API", getenv("CHE_API_ENDPOINT")), token=getenv( "USER_TOKEN"))).json().get("id") except: # pylint: disable=bare-except pass diff --git a/platformio/maintenance.py b/platformio/maintenance.py index ef686331..498f441a 100644 --- a/platformio/maintenance.py +++ b/platformio/maintenance.py @@ -56,7 +56,7 @@ def on_platformio_start(ctx, force, caller): caller = "C9" elif getenv("USER") == "cabox": caller = "CA" - elif getenv("CHE_API_ENDPOINT"): + elif getenv("CHE_API", getenv("CHE_API_ENDPOINT")): caller = "Che" app.set_session_var("command_ctx", ctx)