fix *os_config module backward diff (#35332)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
This commit is contained in:
parent
2f46f8f944
commit
cff4a2d26e
3 changed files with 24 additions and 3 deletions
|
@ -458,9 +458,16 @@ def main():
|
|||
base_config = NetworkConfig(indent=1, contents=contents, ignore_lines=diff_ignore_lines)
|
||||
|
||||
if running_config.sha1 != base_config.sha1:
|
||||
if module.params['diff_against'] == 'intended':
|
||||
before = running_config
|
||||
after = base_config
|
||||
elif module.params['diff_against'] in ('startup', 'running'):
|
||||
before = base_config
|
||||
after = running_config
|
||||
|
||||
result.update({
|
||||
'changed': True,
|
||||
'diff': {'before': str(base_config), 'after': str(running_config)}
|
||||
'diff': {'before': str(before), 'after': str(after)}
|
||||
})
|
||||
|
||||
module.exit_json(**result)
|
||||
|
|
|
@ -532,9 +532,16 @@ def main():
|
|||
base_config = NetworkConfig(indent=1, contents=contents, ignore_lines=diff_ignore_lines)
|
||||
|
||||
if running_config.sha1 != base_config.sha1:
|
||||
if module.params['diff_against'] == 'intended':
|
||||
before = running_config
|
||||
after = base_config
|
||||
elif module.params['diff_against'] in ('startup', 'running'):
|
||||
before = base_config
|
||||
after = running_config
|
||||
|
||||
result.update({
|
||||
'changed': True,
|
||||
'diff': {'before': str(base_config), 'after': str(running_config)}
|
||||
'diff': {'before': str(before), 'after': str(after)}
|
||||
})
|
||||
|
||||
module.exit_json(**result)
|
||||
|
|
|
@ -493,9 +493,16 @@ def main():
|
|||
base_config = NetworkConfig(indent=1, contents=contents, ignore_lines=diff_ignore_lines)
|
||||
|
||||
if running_config.sha1 != base_config.sha1:
|
||||
if module.params['diff_against'] == 'intended':
|
||||
before = running_config
|
||||
after = base_config
|
||||
elif module.params['diff_against'] in ('startup', 'running'):
|
||||
before = base_config
|
||||
after = running_config
|
||||
|
||||
result.update({
|
||||
'changed': True,
|
||||
'diff': {'before': str(base_config), 'after': str(running_config)}
|
||||
'diff': {'before': str(before), 'after': str(after)}
|
||||
})
|
||||
|
||||
module.exit_json(**result)
|
||||
|
|
Loading…
Reference in a new issue