mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 05:42:50 +00: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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user