Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

configverify: T6642: verify_interface_exists requires config_dict arg #3961

Merged
merged 1 commit into from
Aug 12, 2024

Conversation

jestabro
Copy link
Contributor

@jestabro jestabro commented Aug 9, 2024

Change Summary

The function verify_interface_exists requires access to the ambient config_dict, rather than its own instantiation using ConfigTreeQuery, in order to get the correct working config representation under configd and at boot. Including the root path 'interfaces' for the syntactical verification test as a config_dict key similar to the case of with_pki would interfere with script-specific path searches (e.g. interfaces_bonding.py); consequently, the dict of path 'interfaces' is included as an attribute of the class ConfigDict.

This construction appears redundant in the case of, say, interfaces_ethernet.py, but is of the right generality to cover all cases.

Types of changes

  • 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)
  • Migration from an old Vyatta component to vyos-1x, please link to related PR inside obsoleted component
  • Other (please describe):

Related Task(s)

Related PR(s)

#3960

Component(s) name

Proposed changes

How to test

Smoketest result

Checklist:

  • I have read the CONTRIBUTING document
  • I have linked this PR to one or more Phabricator Task(s)
  • I have run the components SMOKETESTS if applicable
  • My commit headlines contain a valid Task id
  • My change requires a change to the documentation
  • I have updated the documentation accordingly

@jestabro jestabro self-assigned this Aug 9, 2024
Copy link

github-actions bot commented Aug 9, 2024

👍
No issues in PR Title / Commit Title

@jestabro jestabro force-pushed the verify-interface-exists-config branch from 81b7917 to 1bc7947 Compare August 9, 2024 12:58
@jestabro jestabro marked this pull request as ready for review August 9, 2024 12:58
@jestabro jestabro requested a review from a team as a code owner August 9, 2024 12:58
The function verify_interface_exists requires a reference to the ambient
config_dict rather than creating an instance. As access is required to
the 'interfaces' path, provide as attribute of class ConfigDict, so as
not to confuse path searches of script-specific config_dict instances.
@jestabro jestabro force-pushed the verify-interface-exists-config branch from 1bc7947 to 5f23b72 Compare August 12, 2024 16:57
Copy link

✅ No issues found in unused-imports check.. Please refer the workflow run

@jestabro jestabro merged commit 37a012c into vyos:current Aug 12, 2024
13 of 14 checks passed
@jestabro
Copy link
Contributor Author

@Mergifyio backport circinus

Copy link
Contributor

mergify bot commented Aug 12, 2024

backport circinus

✅ Backports have been created

@jestabro
Copy link
Contributor Author

@Mergifyio backport sagitta

Copy link
Contributor

mergify bot commented Aug 13, 2024

backport sagitta

✅ Backports have been created

c-po added a commit that referenced this pull request Aug 13, 2024
configverify: T6642: verify_interface_exists requires config_dict arg (backport #3961)
c-po added a commit that referenced this pull request Aug 19, 2024
configverify: T6642: verify_interface_exists requires config_dict arg (backport #3961)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

3 participants