Browse Source

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
changes/19/764819/2
Duc Truong 7 months ago
parent
commit
4f585a2e70
1 changed files with 4 additions and 3 deletions
  1. +4
    -3
      senlin/engine/actions/cluster_action.py

+ 4
- 3
senlin/engine/actions/cluster_action.py View File

@ -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…
Cancel
Save