mirror of
https://github.com/GNS3/gns3-server.git
synced 2025-01-18 07:23:47 +02:00
Drop cloud from config
This commit is contained in:
parent
a3e4b81837
commit
2679c03fe2
@ -61,15 +61,13 @@ class Config(object):
|
|||||||
|
|
||||||
appdata = os.path.expandvars("%APPDATA%")
|
appdata = os.path.expandvars("%APPDATA%")
|
||||||
common_appdata = os.path.expandvars("%COMMON_APPDATA%")
|
common_appdata = os.path.expandvars("%COMMON_APPDATA%")
|
||||||
self._cloud_file = os.path.join(appdata, appname, "cloud.ini")
|
|
||||||
filename = "server.ini"
|
filename = "server.ini"
|
||||||
if self._files is None:
|
if self._files is None:
|
||||||
self._files = [os.path.join(appdata, appname, filename),
|
self._files = [os.path.join(appdata, appname, filename),
|
||||||
os.path.join(appdata, appname + ".ini"),
|
os.path.join(appdata, appname + ".ini"),
|
||||||
os.path.join(common_appdata, appname, filename),
|
os.path.join(common_appdata, appname, filename),
|
||||||
os.path.join(common_appdata, appname + ".ini"),
|
os.path.join(common_appdata, appname + ".ini"),
|
||||||
filename,
|
filename]
|
||||||
self._cloud_file]
|
|
||||||
else:
|
else:
|
||||||
|
|
||||||
# On UNIX-like platforms, the configuration file location can be one of the following:
|
# On UNIX-like platforms, the configuration file location can be one of the following:
|
||||||
@ -84,20 +82,16 @@ class Config(object):
|
|||||||
else:
|
else:
|
||||||
appname = "GNS3"
|
appname = "GNS3"
|
||||||
home = os.path.expanduser("~")
|
home = os.path.expanduser("~")
|
||||||
self._cloud_file = os.path.join(home, ".config", appname, "cloud.conf")
|
|
||||||
filename = "server.conf"
|
filename = "server.conf"
|
||||||
if self._files is None:
|
if self._files is None:
|
||||||
self._files = [os.path.join(home, ".config", appname, filename),
|
self._files = [os.path.join(home, ".config", appname, filename),
|
||||||
os.path.join(home, ".config", appname + ".conf"),
|
os.path.join(home, ".config", appname + ".conf"),
|
||||||
os.path.join("/etc/xdg", appname, filename),
|
os.path.join("/etc/xdg", appname, filename),
|
||||||
os.path.join("/etc/xdg", appname + ".conf"),
|
os.path.join("/etc/xdg", appname + ".conf"),
|
||||||
filename,
|
filename]
|
||||||
self._cloud_file]
|
|
||||||
|
|
||||||
self._config = configparser.ConfigParser()
|
self._config = configparser.ConfigParser()
|
||||||
self.read_config()
|
self.read_config()
|
||||||
self._cloud_config = configparser.ConfigParser()
|
|
||||||
self.read_cloud_config()
|
|
||||||
|
|
||||||
def reload(self):
|
def reload(self):
|
||||||
"""
|
"""
|
||||||
@ -108,20 +102,9 @@ class Config(object):
|
|||||||
for section in self._override_config:
|
for section in self._override_config:
|
||||||
self.set_section_config(section, self._override_config[section])
|
self.set_section_config(section, self._override_config[section])
|
||||||
|
|
||||||
def list_cloud_config_file(self):
|
|
||||||
return self._cloud_file
|
|
||||||
|
|
||||||
def get_config_files(self):
|
def get_config_files(self):
|
||||||
return self._watched_files
|
return self._watched_files
|
||||||
|
|
||||||
def read_cloud_config(self):
|
|
||||||
parsed_file = self._cloud_config.read(self._cloud_file)
|
|
||||||
if not self._cloud_config.has_section(CLOUD_SERVER):
|
|
||||||
self._cloud_config.add_section(CLOUD_SERVER)
|
|
||||||
|
|
||||||
def cloud_settings(self):
|
|
||||||
return self._cloud_config[CLOUD_SERVER]
|
|
||||||
|
|
||||||
def read_config(self):
|
def read_config(self):
|
||||||
"""
|
"""
|
||||||
Read the configuration files.
|
Read the configuration files.
|
||||||
|
Loading…
Reference in New Issue
Block a user