Add support for both CHE_APIs

This commit is contained in:
Ivan Kravets
2016-10-30 23:31:51 +02:00
parent ef7bbe5aa6
commit 76a65e9238
2 changed files with 3 additions and 3 deletions

View File

@ -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

View File

@ -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)