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

Changed config management.

parent 5ac73e15
No related branches found
No related tags found
No related merge requests found
...@@ -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):
......
#!/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
...@@ -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.\nPath of configuration file: %s' % path, error=True)
if is_default: if is_default:
log('The configuration file for EnvSetup script does not exist.\nPath 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()
......
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