mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 21:32:49 +00:00
bug fix for eos_config module
This addresses a bug in the eos_config module that would prevent it from running properly. The module should now properly process the config and the candidate
This commit is contained in:
committed by
Matt Clay
parent
c5255a1d9e
commit
bc9aacd832
@@ -216,7 +216,8 @@ def main():
|
|||||||
lines = module.params['lines']
|
lines = module.params['lines']
|
||||||
parents = module.params['parents'] or list()
|
parents = module.params['parents'] or list()
|
||||||
|
|
||||||
result = dict(changed=False)
|
before = module.params['before']
|
||||||
|
after = module.params['after']
|
||||||
|
|
||||||
match = module.params['match']
|
match = module.params['match']
|
||||||
replace = module.params['replace']
|
replace = module.params['replace']
|
||||||
@@ -249,17 +250,12 @@ def main():
|
|||||||
candidate = list(parents)
|
candidate = list(parents)
|
||||||
candidate.extend(lines)
|
candidate.extend(lines)
|
||||||
|
|
||||||
if not line.parents:
|
if before:
|
||||||
if line.text not in toplevel:
|
candidate[:0] = before
|
||||||
expand(line, commands)
|
|
||||||
else:
|
|
||||||
item = compare(line, config, ignore_missing)
|
|
||||||
if item:
|
|
||||||
expand(item, commands)
|
|
||||||
|
|
||||||
commands = flatten(commands, list())
|
if after:
|
||||||
|
candidate.extend(after)
|
||||||
|
|
||||||
if commands:
|
|
||||||
if not module.check_mode:
|
if not module.check_mode:
|
||||||
response = module.configure(candidate)
|
response = module.configure(candidate)
|
||||||
result['response'] = response
|
result['response'] = response
|
||||||
|
|||||||
Reference in New Issue
Block a user