Check if config param exists before using it
When using the cluster.stop_timeout_before_update config parameter, check if it exists before using it. That parameter is optional and should not error if it is not specified. Change-Id: Ic6b3172736f5cd348e391371f79defa1aeb790e6
This commit is contained in:
parent
028af9be62
commit
4f585a2e70
|
@ -302,9 +302,10 @@ class ClusterAction(base.Action):
|
|||
if config is not None:
|
||||
# make sure config values are valid
|
||||
try:
|
||||
stop_timeout = config['cluster.stop_timeout_before_update']
|
||||
config['cluster.stop_timeout_before_update'] = int(
|
||||
stop_timeout)
|
||||
stop_timeout = config.get('cluster.stop_timeout_before_update')
|
||||
if stop_timeout:
|
||||
config['cluster.stop_timeout_before_update'] = int(
|
||||
stop_timeout)
|
||||
except Exception as e:
|
||||
return self.RES_ERROR, str(e)
|
||||
|
||||
|
|
Loading…
Reference in New Issue