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

Changed config loading error management.

parent b6117c4a
No related branches found
No related tags found
No related merge requests found
......@@ -61,7 +61,10 @@ class EnvSetup():
log('This script should be run as root user.')
sys.exit(1)
# Load conf
utils.load_conf()
conf = utils.load_conf()
if not conf:
log('No configuration loaded.')
sys.exit(1)
if args:
# Run command
for arg in args:
......
......@@ -52,7 +52,7 @@ def load_conf():
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:
sys.exit(1)
return dict()
# Load conf
with open(path, 'r') as fo:
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