Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
envsetup
Manage
Activity
Members
Plan
Redmine
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mediaserver
envsetup
Commits
e905a59c
Commit
e905a59c
authored
5 years ago
by
Stéphane Diemer
Browse files
Options
Downloads
Patches
Plain Diff
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
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
3.New_server_deployment/1.Download_envsetup_config/0_setup.py
+8
-6
8 additions, 6 deletions
...w_server_deployment/1.Download_envsetup_config/0_setup.py
with
8 additions
and
6 deletions
3.New_server_deployment/1.Download_envsetup_config/0_setup.py
+
8
−
6
View file @
e905a59c
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment