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
7c02ef4f
Commit
7c02ef4f
authored
6 years ago
by
Stéphane Diemer
Browse files
Options
Downloads
Patches
Plain Diff
Removed deprecated conf download.
parent
e6a654b5
No related branches found
Branches containing commit
No related tags found
Tags containing commit
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
+6
-19
6 additions, 19 deletions
...w_server_deployment/1.Download_envsetup_config/0_setup.py
with
6 additions
and
19 deletions
3.New_server_deployment/1.Download_envsetup_config/0_setup.py
+
6
−
19
View file @
7c02ef4f
...
@@ -29,25 +29,12 @@ def setup(interactive=True):
...
@@ -29,25 +29,12 @@ def setup(interactive=True):
req
=
requests
.
head
(
sk_url
,
verify
=
verify
,
timeout
=
20
)
req
=
requests
.
head
(
sk_url
,
verify
=
verify
,
timeout
=
20
)
if
req
.
status_code
!=
301
:
if
req
.
status_code
!=
301
:
raise
Exception
(
'
Unexpected response from
"
%s
"
: code %s, should have been 301.
'
%
(
sk_url
,
req
.
status_code
))
raise
Exception
(
'
Unexpected response from
"
%s
"
: code %s, should have been 301.
'
%
(
sk_url
,
req
.
status_code
))
# Check version of skyreach
# Get conf using an activation key
req
=
requests
.
head
(
sk_url
+
'
/erp/credentials/envsetup-conf.sh
'
,
verify
=
verify
,
timeout
=
20
)
act_key
=
utils
.
get_conf
(
'
SKYREACH_ACTIVATION_KEY
'
)
use_activation_key
=
req
.
status_code
==
403
if
not
act_key
:
if
use_activation_key
:
utils
.
log
(
'
\033
[1;33m No activation key is set, skipping configuration download.
\033
[0m
'
)
# Get conf using an activation key
return
act_key
=
utils
.
get_conf
(
'
SKYREACH_ACTIVATION_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
not
act_key
:
utils
.
log
(
'
\033
[1;33m No activation key is set, skipping configuration download.
\033
[0m
'
)
return
req
=
requests
.
post
(
sk_url
+
'
/erp/credentials/envsetup-conf.sh
'
,
data
=
dict
(
key
=
act_key
,
public_key
=
public_key
),
verify
=
verify
,
timeout
=
20
)
else
:
# Get conf using an api key
# (deprecated, for compatibility, to be removed when Panel version will be > 5.2)
utils
.
log
(
'
\033
[1;33m Using deprecated way to get envsetup conf.
\033
[0m
'
)
api_key
=
utils
.
get_conf
(
'
SKYREACH_API_KEY
'
)
if
not
api_key
:
utils
.
log
(
'
\033
[1;33m No API key is set, skipping configuration download.
\033
[0m
'
)
return
req
=
requests
.
get
(
sk_url
+
'
/erp/credentials/
'
+
api_key
+
'
/conf.sh
'
,
verify
=
verify
,
timeout
=
20
)
# Write conf
# Write conf
if
req
.
status_code
!=
200
:
if
req
.
status_code
!=
200
:
if
len
(
req
.
text
)
>
300
:
if
len
(
req
.
text
)
>
300
:
...
...
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