Fixing module behavior when route_target_both is used (#20076)
(cherry picked from commit 9b2bdf2df6
)
This commit is contained in:
parent
d1ed72ad37
commit
66481d3d2f
1 changed files with 14 additions and 0 deletions
|
@ -208,12 +208,26 @@ def apply_key_map(key_map, table):
|
|||
return new_dict
|
||||
|
||||
|
||||
def fix_proposed(proposed_commands):
|
||||
new_proposed = {}
|
||||
for key, value in proposed_commands.items():
|
||||
if key == 'route-target both':
|
||||
new_proposed['route-target export'] = value
|
||||
new_proposed['route-target import'] = value
|
||||
else:
|
||||
new_proposed[key] = value
|
||||
return new_proposed
|
||||
|
||||
|
||||
def state_present(module, existing, proposed):
|
||||
commands = list()
|
||||
parents = list()
|
||||
proposed_commands = apply_key_map(PARAM_TO_COMMAND_KEYMAP, proposed)
|
||||
existing_commands = apply_key_map(PARAM_TO_COMMAND_KEYMAP, existing)
|
||||
|
||||
if proposed_commands.get('route-target both'):
|
||||
proposed_commands = fix_proposed(proposed_commands)
|
||||
|
||||
for key, value in proposed_commands.items():
|
||||
if key.startswith('route-target'):
|
||||
if value == ['default']:
|
||||
|
|
Loading…
Reference in a new issue