Skip to content
Snippets Groups Projects
Commit e905a59c authored by Stéphane Diemer's avatar Stéphane Diemer
Browse files

Skip configuration download if SKYREACH_ACTIVATION_KEY is set to "no-dl"

parent 3e45b7b0
No related branches found
No related tags found
No related merge requests found
......@@ -32,14 +32,16 @@ def setup(interactive=True):
if req.status_code != 301:
raise Exception('Unexpected response from "%s": code %s, should have been 301.' % (sk_url, req.status_code))
# Get conf using API key if already set or using an activation key
req = None
api_key = utils.get_conf('SKYREACH_API_KEY')
if api_key:
act_key = utils.get_conf('SKYREACH_ACTIVATION_KEY')
req = None
if act_key == 'no-dl':
utils.log('\033[1;34m The activation key is set to "no-dl", skipping configuration download. \033[0m')
return
elif api_key:
req = requests.post(sk_url + '/erp/credentials/envsetup-conf.sh', params=dict(api_key=api_key), data=dict(public_key=public_key), verify=verify, timeout=20)
else:
act_key = utils.get_conf('SKYREACH_ACTIVATION_KEY')
if act_key:
req = requests.post(sk_url + '/erp/credentials/envsetup-conf.sh', data=dict(key=act_key, public_key=public_key), verify=verify, timeout=20)
elif act_key:
req = requests.post(sk_url + '/erp/credentials/envsetup-conf.sh', data=dict(key=act_key, public_key=public_key), verify=verify, timeout=20)
if req is None:
utils.log('\033[1;33m No activation key nor API key are set, skipping configuration download. \033[0m')
return
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment