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

T7182: use Config instead of ConfigTreeQuery for get_interface_dict #4354

Merged
merged 2 commits into from
Feb 19, 2025

Conversation

jestabro
Copy link
Contributor

@jestabro jestabro commented Feb 19, 2025

Change summary

The recent change to vyos-netplug-dhcp-client to use get_interface_dict (T5103; 8faf67c) requires the use of Config over ConfigTreeQueery for full support of the underlying get_config_dict (namely, keyword arg with_pki); this is preferred over extending ConfigTreeQuery at this time, as the latter is due for revision/simplification.

It remains an open question, currently under investigation, as to why this is missed by smoketests, however, the above change is clearly needed for backport to follow 8faf67c in 1.4.2.

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)

How to test / Smoketest result

Without change:

root@vyos:/etc/netplug# ./vyos-netplug-dhcp-client eth1 in
...
Traceback (most recent call last):
  File "/etc/netplug/./vyos-netplug-dhcp-client", line 55, in <module>
    _, interface_config = get_interface_dict(config, interface_path[:-1], ifname=interface, with_pki=True)
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/vyos/configdict.py", line 456, in get_interface_dict
    dict = config.get_config_dict(base + [ifname], key_mangling=('-', '_'),
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: ConfigTreeQuery.get_config_dict() got an unexpected keyword argument 'with_pki'

With fix:

root@vyos:/home/vyos# ./vyos-netplug-dhcp-client eth1 in
root@vyos:/home/vyos# 

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 Feb 19, 2025
@jestabro jestabro requested a review from a team as a code owner February 19, 2025 18:07
Copy link

github-actions bot commented Feb 19, 2025

👍
No issues in PR Title / Commit Title

@c-po c-po enabled auto-merge February 19, 2025 19:26
@c-po c-po disabled auto-merge February 19, 2025 19:26
@c-po c-po merged commit d3398e3 into vyos:current Feb 19, 2025
19 checks passed
Copy link

CI integration 👍 passed!

Details

CI logs

  • CLI Smoketests (no interfaces) 👍 passed
  • CLI Smoketests (interfaces only) 👍 passed
  • Config tests 👍 passed
  • RAID1 tests 👍 passed
  • TPM tests 👍 passed

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