vyos.vyos icon indicating copy to clipboard operation
vyos.vyos copied to clipboard

Fix change detection for recent Vyos versions

Open isundaylee opened this issue 4 months ago • 1 comments

Change Summary

Recent Vyos versions started returning this for no-change compare saved output:

No changes between working and saved configurations.

[edit]

instead of just [edit]. This causes vyos_config to always return a changed result. This PR fixes the issue by properly detecting both cases.

Types of changes

  • [x] Bug fix (non-breaking change which fixes an issue)
  • [ ] New feature (non-breaking change which adds functionality)
  • [ ] Code style update (formatting, renaming)
  • [ ] Refactoring (no functional changes)
  • [ ] Other (please describe):

Related Task(s)

N/A

Related PR(s)

N/A

Proposed changes

See "Change Summary" section.

How to test

Point my Ansible code to use a version of vyos.vyos with this patch in requirements.txt, run ansible-galaxy install -r requirements.yml --force, and verify that vyos_config now properly returns ok instead of changed when there are no changes.

- name: [email protected]:isundaylee/vyos.vyos.git
  type: git
  version: bug/vyos_config_changed

Checklist:

  • [x] I have read the CONTRIBUTING document
  • [ ] I have linked this PR to one or more Phabricator Task(s)
  • [ ] My commit headlines contain a valid Task id
  • [ ] My change requires a change to the documentation
  • [ ] I have updated the documentation accordingly

isundaylee avatar Sep 29 '24 20:09 isundaylee