Add fault-tolerant process of lack of OS section in daisy.conf

Change-Id: If55d34ddd41b87c24f51b4d19906184f25b8358f
This commit is contained in:
Zhou Ya 2016-10-13 20:21:01 +08:00
parent 5727ae2c0a
commit 8142320f2f

View File

@ -61,8 +61,10 @@ BACKENDS_UNINSTALL_ORDER = []
config = ConfigParser.ConfigParser()
config.read(daisy_cmn.daisy_conf_file)
OS_INSTALL_TYPE = 'pxe'
OS_INSTALL_TYPE = config.get("OS", "os_install_type")
try:
OS_INSTALL_TYPE = config.get("OS", "os_install_type")
except (ConfigParser.NoSectionError, ConfigParser.NoOptionError):
OS_INSTALL_TYPE = 'pxe'
def get_deployment_backends(req, cluster_id, backends_order):