def read_config(path = 'aetros.yml', logger=None):
path = os.path.normpath(os.path.expanduser(path))
config = {
'dockerfile': None,
'command': None,
'install': None,
'ignore': None,
'image': None,
'server': None,
'parameters': {},
'servers': None,
'before_command': [],
}
if os.path.exists(path):
f = open(path, 'r')
custom_config = yaml.safe_load(f)
if custom_config is None:
custom_config = {}
if 'storage_dir' in custom_config:
del custom_config['storage_dir']
config.update(custom_config)
logger and logger.debug('Config loaded from ' + os.path.realpath(path))
if 'parameters' not in config:
config['parameters'] = {}
return config
评论列表
文章目录