console/SWSCloudCore/settings.py

20 lines
478 B
Python
Raw Normal View History

2015-11-26 23:50:33 +03:00
# coding: utf-8
2016-04-09 16:52:33 +03:00
import sys
2015-11-26 23:50:33 +03:00
import os
import ConfigParser
2016-04-09 16:52:33 +03:00
default_file = '/etc/sws/cloud/settings.ini'
# default_file = '%s/gocloud.ini' % os.getenv('HOME')
settings_file = os.getenv('CLOUDNS_SETTINGS_FILE', default_file)
# current_path = os.path.dirname(os.path.abspath(__file__))
2015-11-26 23:50:33 +03:00
# setting file read
settings = ConfigParser.ConfigParser()
2016-04-09 16:52:33 +03:00
if os.path.exists(settings_file):
settings.read(settings_file)
2015-11-26 23:50:33 +03:00
else:
2016-04-09 16:52:33 +03:00
sys.exit('settings file not found: %s' % settings_file)