Merge "Fix dict update"

This commit is contained in:
Zuul 2019-04-18 18:30:07 +00:00 committed by Gerrit Code Review
commit 066a5ef497
2 changed files with 13 additions and 1 deletions

View File

@ -1962,3 +1962,15 @@ def get_vswitch_type(dbapi):
def is_initial_config_complete():
return os.path.isfile(tsc.INITIAL_CONFIG_COMPLETE_FLAG)
def recur_update(orig_dict, new_dict):
for key, val in new_dict.iteritems():
if isinstance(val, collections.Mapping):
tmp = recur_update(orig_dict.get(key, {}), val)
orig_dict[key] = tmp
elif isinstance(val, list) and isinstance(orig_dict.get(key), list):
orig_dict[key] = orig_dict.get[key] + val
else:
orig_dict[key] = new_dict[key]
return orig_dict

View File

@ -93,7 +93,7 @@ class NeutronHelm(openstack.OpenstackBaseHelm):
def update_dynamic_options(self, overrides):
if utils.is_virtual():
overrides.update({
utils.recur_update(overrides, {
'plugins': {
'ml2_conf': {
'ovs_driver': {