mirror of
https://github.com/GNS3/gns3-server.git
synced 2024-12-19 04:47:54 +00:00
Handle a missing cloud server section in the config file
This commit is contained in:
parent
7830bf8b1a
commit
3a157b5e6d
@ -26,6 +26,8 @@ import configparser
|
|||||||
import logging
|
import logging
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
CLOUD_SERVER = 'CLOUD_SERVER'
|
||||||
|
|
||||||
|
|
||||||
class Config(object):
|
class Config(object):
|
||||||
"""
|
"""
|
||||||
@ -81,9 +83,11 @@ class Config(object):
|
|||||||
|
|
||||||
def read_cloud_config(self):
|
def read_cloud_config(self):
|
||||||
parsed_file = self._cloud_config.read(self._cloud_file)
|
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):
|
def cloud_settings(self):
|
||||||
return self._cloud_config['CLOUD_SERVER']
|
return self._cloud_config[CLOUD_SERVER]
|
||||||
|
|
||||||
def read_config(self):
|
def read_config(self):
|
||||||
"""
|
"""
|
||||||
|
Loading…
Reference in New Issue
Block a user