Merge "Fix dict update"
This commit is contained in:
commit
066a5ef497
@ -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
|
||||
|
@ -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': {
|
||||
|
Loading…
x
Reference in New Issue
Block a user