Merge "Check if config param exists before using it"

This commit is contained in:
Zuul 2021-01-14 16:40:05 +00:00 committed by Gerrit Code Review
commit 95aa963209
1 changed files with 4 additions and 3 deletions

View File

@ -302,9 +302,10 @@ class ClusterAction(base.Action):
if config is not None: if config is not None:
# make sure config values are valid # make sure config values are valid
try: try:
stop_timeout = config['cluster.stop_timeout_before_update'] stop_timeout = config.get('cluster.stop_timeout_before_update')
config['cluster.stop_timeout_before_update'] = int( if stop_timeout:
stop_timeout) config['cluster.stop_timeout_before_update'] = int(
stop_timeout)
except Exception as e: except Exception as e:
return self.RES_ERROR, str(e) return self.RES_ERROR, str(e)