mirror of
https://github.com/platformio/platformio-core.git
synced 2025-07-30 10:07:14 +02:00
Add support for both CHE_APIs
This commit is contained in:
@ -274,10 +274,10 @@ def get_cid():
|
|||||||
_uid = None
|
_uid = None
|
||||||
if getenv("C9_UID"):
|
if getenv("C9_UID"):
|
||||||
_uid = getenv("C9_UID")
|
_uid = getenv("C9_UID")
|
||||||
elif getenv("CHE_API_ENDPOINT"):
|
elif getenv("CHE_API", getenv("CHE_API_ENDPOINT")):
|
||||||
try:
|
try:
|
||||||
_uid = requests.get("{api}/user?token={token}".format(
|
_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")
|
"USER_TOKEN"))).json().get("id")
|
||||||
except: # pylint: disable=bare-except
|
except: # pylint: disable=bare-except
|
||||||
pass
|
pass
|
||||||
|
@ -56,7 +56,7 @@ def on_platformio_start(ctx, force, caller):
|
|||||||
caller = "C9"
|
caller = "C9"
|
||||||
elif getenv("USER") == "cabox":
|
elif getenv("USER") == "cabox":
|
||||||
caller = "CA"
|
caller = "CA"
|
||||||
elif getenv("CHE_API_ENDPOINT"):
|
elif getenv("CHE_API", getenv("CHE_API_ENDPOINT")):
|
||||||
caller = "Che"
|
caller = "Che"
|
||||||
|
|
||||||
app.set_session_var("command_ctx", ctx)
|
app.set_session_var("command_ctx", ctx)
|
||||||
|
Reference in New Issue
Block a user