diff options
Diffstat (limited to 'lib/python/apex/deploy_settings.py')
-rw-r--r-- | lib/python/apex/deploy_settings.py | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/lib/python/apex/deploy_settings.py b/lib/python/apex/deploy_settings.py index 5490c6e9..3133d7f8 100644 --- a/lib/python/apex/deploy_settings.py +++ b/lib/python/apex/deploy_settings.py @@ -11,6 +11,8 @@ import yaml import logging +from .common import utils + REQ_DEPLOY_SETTINGS = ['sdn_controller', 'odl_version', 'sdn_l3', @@ -19,9 +21,10 @@ REQ_DEPLOY_SETTINGS = ['sdn_controller', 'dataplane', 'sfc', 'vpn', - 'vpp'] + 'vpp', + 'ceph'] -OPT_DEPLOY_SETTINGS = ['performance', 'vsperf'] +OPT_DEPLOY_SETTINGS = ['performance', 'vsperf', 'ceph_device'] VALID_ROLES = ['Controller', 'Compute', 'ObjectStorage'] VALID_PERF_OPTS = ['kernel', 'nova', 'vpp'] @@ -38,7 +41,7 @@ class DeploySettings(dict): """ def __init__(self, filename): init_dict = {} - if type(filename) is str: + if isinstance(filename, str): with open(filename, 'r') as deploy_settings_file: init_dict = yaml.safe_load(deploy_settings_file) else: @@ -81,6 +84,8 @@ class DeploySettings(dict): if req_set not in deploy_options: if req_set == 'dataplane': self['deploy_options'][req_set] = 'ovs' + elif req_set == 'ceph': + self['deploy_options'][req_set] = True else: self['deploy_options'][req_set] = False @@ -162,12 +167,7 @@ class DeploySettings(dict): if 'performance' in self['deploy_options']: bash_str += self._dump_performance() bash_str += self._dump_deploy_options_array() - - if path: - with open(path, 'w') as file: - file.write(bash_str) - else: - print(bash_str) + utils.write_str(bash_str, path) class DeploySettingsException(Exception): |