Skip to content

Commit

Permalink
edgeos_config - added diff result
Browse files Browse the repository at this point in the history
Co-authored-by: Felix Fontein <[email protected]>
  • Loading branch information
virtualguy and felixfontein committed Jan 21, 2021
1 parent f93f0e8 commit af8b621
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 2 additions & 0 deletions changelogs/fragments/add-edgeos-config-diff.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
minor_changes:
- "edgeos_config - added diff result when applying configuration changes (https://github.com/ansible-collections/community.network/pull/184)."
3 changes: 1 addition & 2 deletions plugins/module_utils/network/edgeos/edgeos.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,7 @@ def load_config(module, commands, commit=False, comment=None):
out = to_text(out, errors='surrogate_or_strict')

if not out.startswith('No changes'):
out = connection.get('show')
diff = to_text(out, errors='surrogate_or_strict').strip()
diff = out.strip()

if commit:
try:
Expand Down
4 changes: 3 additions & 1 deletion plugins/modules/network/edgeos/edgeos_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,8 +255,10 @@ def run(module, result):
comment = module.params['comment']

if commands:
load_config(module, commands, commit=commit, comment=comment)
prepared_diff = {}
prepared_diff['prepared'] = load_config(module, commands, commit=commit, comment=comment)

result['diff'] = prepared_diff
result['changed'] = True


Expand Down

0 comments on commit af8b621

Please sign in to comment.