mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-08-22 14:01:42 -07:00
don't retrieve config in running_config when config is provided for diff (#41400)
* don't retrieve config in running_config when config is provided for diff Signed-off-by: Trishna Guha <trishnaguha17@gmail.com> * fix for eos, nxos Signed-off-by: Trishna Guha <trishnaguha17@gmail.com> * add integration test Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
This commit is contained in:
parent
a4f49ed648
commit
8ab0d654f3
9 changed files with 106 additions and 6 deletions
|
@ -410,7 +410,7 @@ def main():
|
|||
|
||||
result['changed'] = True
|
||||
|
||||
running_config = None
|
||||
running_config = module.params['running_config']
|
||||
startup_config = None
|
||||
|
||||
diff_ignore_lines = module.params['diff_ignore_lines']
|
||||
|
@ -435,7 +435,7 @@ def main():
|
|||
output = run_commands(module, {'command': 'show running-config', 'output': 'text'})
|
||||
contents = output[0]
|
||||
else:
|
||||
contents = running_config.config_text
|
||||
contents = running_config
|
||||
|
||||
# recreate the object in order to process diff_ignore_lines
|
||||
running_config = NetworkConfig(indent=1, contents=contents, ignore_lines=diff_ignore_lines)
|
||||
|
|
|
@ -447,7 +447,7 @@ def main():
|
|||
|
||||
result['changed'] = True
|
||||
|
||||
running_config = None
|
||||
running_config = module.params['running_config']
|
||||
startup_config = None
|
||||
|
||||
diff_ignore_lines = module.params['diff_ignore_lines']
|
||||
|
@ -470,7 +470,7 @@ def main():
|
|||
output = run_commands(module, 'show running-config')
|
||||
contents = output[0]
|
||||
else:
|
||||
contents = running_config.config_text
|
||||
contents = running_config
|
||||
|
||||
# recreate the object in order to process diff_ignore_lines
|
||||
running_config = NetworkConfig(indent=1, contents=contents, ignore_lines=diff_ignore_lines)
|
||||
|
|
|
@ -444,7 +444,7 @@ def main():
|
|||
|
||||
result['changed'] = True
|
||||
|
||||
running_config = None
|
||||
running_config = module.params['running_config']
|
||||
startup_config = None
|
||||
|
||||
diff_ignore_lines = module.params['diff_ignore_lines']
|
||||
|
@ -467,7 +467,7 @@ def main():
|
|||
output = execute_show_commands(module, 'show running-config')
|
||||
contents = output[0]
|
||||
else:
|
||||
contents = running_config.config_text
|
||||
contents = running_config
|
||||
|
||||
# recreate the object in order to process diff_ignore_lines
|
||||
running_config = NetworkConfig(indent=1, contents=contents, ignore_lines=diff_ignore_lines)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue