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
eb305240
Commit
eb305240
authored
8 years ago
by
Stéphane Diemer
Browse files
Options
Downloads
Patches
Plain Diff
Changed config management.
parent
5ac73e15
No related branches found
No related tags found
No related merge requests found
Changes
23
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
envsetup.py
+0
-1
0 additions, 1 deletion
envsetup.py
global-conf.sh
+18
-1
18 additions, 1 deletion
global-conf.sh
utils.py
+5
-2
5 additions, 2 deletions
utils.py
with
23 additions
and
4 deletions
envsetup.py
+
0
−
1
View file @
eb305240
...
@@ -156,7 +156,6 @@ class EnvSetup():
...
@@ -156,7 +156,6 @@ class EnvSetup():
if
target
==
str
(
action
[
'
index
'
])
and
action
[
'
fct
'
]:
if
target
==
str
(
action
[
'
index
'
])
and
action
[
'
fct
'
]:
found
=
True
found
=
True
log
(
'
Starting action %s: %s setup.
'
%
(
action
[
'
index
'
],
action
[
'
label
'
]))
log
(
'
Starting action %s: %s setup.
'
%
(
action
[
'
index
'
],
action
[
'
label
'
]))
log
(
'
Please wait, the setup is in progress...
'
)
try
:
try
:
os
.
chdir
(
action
[
'
path
'
])
os
.
chdir
(
action
[
'
path
'
])
if
isinstance
(
action
[
'
fct
'
],
str
):
if
isinstance
(
action
[
'
fct
'
],
str
):
...
...
This diff is collapsed.
Click to expand it.
default
-conf.sh
→
global
-conf.sh
+
18
−
1
View file @
eb305240
#!/bin/bash
#!/bin/bash
# Envsetup default configuration file
# DO NOT EDIT THIS FILE!
# DO NOT EDIT THIS FILE!
# Put your local configuration in conf.sh
# Put your local configuration in conf.sh
# Default configuration values
# ----------------------------
# -- Constants --
# -- Constants --
CYAN
=
'\033[0;36m'
CYAN
=
'\033[0;36m'
GREEN
=
'\033[0;32m'
GREEN
=
'\033[0;32m'
...
@@ -119,3 +122,17 @@ HA_LB1='ha-lb3'
...
@@ -119,3 +122,17 @@ HA_LB1='ha-lb3'
HA_LB1_IP
=
'192.168.41.177'
HA_LB1_IP
=
'192.168.41.177'
HA_LB2
=
HA_LB2
=
HA_LB2_IP
=
HA_LB2_IP
=
# Upstream configuration override
# -------------------------------
# (file generated by Panel / Skyreach)
if
[
-f
"/root/envsetup/auto-generated-conf.sh"
]
;
then
source
"/root/envsetup/auto-generated-conf.sh"
fi
# Local configuration override
# ----------------------------
if
[
-f
"/root/envsetup/conf.sh"
]
;
then
source
"/root/envsetup/conf.sh"
fi
This diff is collapsed.
Click to expand it.
utils.py
+
5
−
2
View file @
eb305240
...
@@ -6,7 +6,8 @@ import subprocess
...
@@ -6,7 +6,8 @@ import subprocess
import
sys
import
sys
DEFAULT_CONF_PATH
=
'
default-conf.sh
'
DEFAULT_CONF_PATH
=
'
global-conf.sh
'
AUTO_CONF_PATH
=
'
auto-generated-conf.sh
'
CONF_PATH
=
'
conf.sh
'
CONF_PATH
=
'
conf.sh
'
CONF
=
dict
()
CONF
=
dict
()
...
@@ -51,15 +52,17 @@ def load_conf():
...
@@ -51,15 +52,17 @@ def load_conf():
base_dir
=
get_dir
(
__file__
)
base_dir
=
get_dir
(
__file__
)
files
=
(
files
=
(
(
os
.
path
.
join
(
base_dir
,
DEFAULT_CONF_PATH
),
True
),
(
os
.
path
.
join
(
base_dir
,
DEFAULT_CONF_PATH
),
True
),
(
os
.
path
.
join
(
base_dir
,
AUTO_CONF_PATH
),
False
),
(
os
.
path
.
join
(
base_dir
,
CONF_PATH
),
False
),
(
os
.
path
.
join
(
base_dir
,
CONF_PATH
),
False
),
)
)
only_default
=
True
only_default
=
True
override
=
OrderedDict
()
override
=
OrderedDict
()
for
path
,
is_default
in
files
:
for
path
,
is_default
in
files
:
if
not
os
.
path
.
exists
(
path
):
if
not
os
.
path
.
exists
(
path
):
log
(
'
The configuration file for EnvSetup script does not exist.
\n
Path of configuration file: %s
'
%
path
,
error
=
True
)
if
is_default
:
if
is_default
:
log
(
'
The configuration file for EnvSetup script does not exist.
\n
Path of configuration file: %s
'
%
path
,
error
=
True
)
return
dict
()
return
dict
()
continue
# Load conf
# Load conf
with
open
(
path
,
'
r
'
)
as
fo
:
with
open
(
path
,
'
r
'
)
as
fo
:
content
=
fo
.
read
()
content
=
fo
.
read
()
...
...
This diff is collapsed.
Click to expand it.
Prev
1
2
Next
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