Repository navigation
Conversation
…prefixes Strip double quotes as well as single quotes when comparing candidate and running lines, and match delete paths on whole words instead of \b, which also matched before '/', '.' and '-'. Drop the unused diff_config() helper in vyos_config.py, an old copy of the same logic.
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Change Summary
Two bugs in the
match: linediff ofplugins/cliconf/vyos.pyget_diff():set interfaces ethernet eth0 description "uplink core"never matched the runningdescription 'uplink core', so the task reportedchangedon every run.deletelines were matched withre.match(item + r"\b").\balso matches before/,.or-, sodelete ... address 10.0.0.1matched the runningaddress '10.0.0.1/24'and the module sent a delete for a node that does not exist, failing the commit.This strips double quotes too and requires whitespace or end of line after the deleted path. It also removes
diff_config()fromplugins/modules/vyos_config.py, an unused older copy of the same logic.Types of changes
Related Task(s)
Related PR(s)
Component(s) name
vyos_config (cliconf)
Proposed changes
plugins/cliconf/vyos.py: strip"as well as'; delete match(\s|$)instead of\b.plugins/modules/vyos_config.py: remove the unuseddiff_config().test_vyos_config.py, plus a changelog fragment.How to test
Test results
Without the cliconf change both new tests fail.
Tested against VyOS versions:
Checklist:
changelogs/fragmentsto describe the changes