Merge "Check if config param exists before using it"
This commit is contained in:
commit
95aa963209
|
@ -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)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue