mirror of
https://github.com/CumulusNetworks/ifupdown2.git
synced 2024-05-06 15:54:50 +00:00
policymanager: merge module policy instead of overriding duplicates
When module policies are split up in seperate files ifupdown2 doesn't merge them together but simply overrides duplicates. This pathc fixes the issue and merge the related policies together. Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
This commit is contained in:
@@ -61,8 +61,9 @@ class policymanager():
|
||||
|
||||
for module in system_array.keys():
|
||||
if self.system_policy_array.has_key(module):
|
||||
self.logger.debug('warning: overwriting system module %s from file %s' \
|
||||
% (module,filename))
|
||||
self.logger.debug("policymanager: merging system module %s policy with file %s" % (module, filename))
|
||||
self.system_policy_array[module].update(system_array[module])
|
||||
else:
|
||||
self.system_policy_array[module] = system_array[module]
|
||||
|
||||
# take care of user defined policy defaults
|
||||
@@ -84,6 +85,10 @@ class policymanager():
|
||||
# warn user that we are overriding the system module setting
|
||||
self.logger.debug('warning: overwriting system with user module %s from file %s' \
|
||||
% (module,filename))
|
||||
if module in self.user_policy_array:
|
||||
self.logger.debug("policymanager: merging user module %s policy with file %s" % (module, filename))
|
||||
self.user_policy_array[module].update(user_array[module])
|
||||
else:
|
||||
self.user_policy_array[module] = user_array[module]
|
||||
return
|
||||
|
||||
|
Reference in New Issue
Block a user