24.04 backport of pure Python implementation for rtnetlink & nl80211#163
Merged
ogayot merged 12 commits intocanonical:ubuntu/noblefrom Jan 29, 2026
Merged
24.04 backport of pure Python implementation for rtnetlink & nl80211#163ogayot merged 12 commits intocanonical:ubuntu/noblefrom
ogayot merged 12 commits intocanonical:ubuntu/noblefrom
Conversation
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com> (cherry picked from commit ccfc3e2)
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com> (cherry picked from commit ca9dd8c)
This is a first step to reimplement probert.rtnetlink in pure Python using pyroute2. While libnl supports caches, pyroute2 doesn't so we need to implement it ourselves. Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com> (cherry picked from commit db46d80)
Based on the libnl implementation of caches, we now have a LinkCache, RouteCache and AddrCache. This should provide all the features needed to reimplement the rtnetlink module in python. Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com> (cherry picked from commit 1773634)
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com> (cherry picked from commit cd20754)
Member
Author
|
Testing in a core22 snap shows the following error: TypeError: NetlinkMixIn.__init__() got an unexpected keyword argument 'groups'Unfortunately, support for netlink groups came in with pyroute2 0.7.3: svinota/pyroute2#997 |
Member
Author
|
Another issue: File "probert/nl80211.py", line 111, in dump_scan_results
if (ssid := bss.get_nested("NL80211_BSS_INFORMATION_ELEMENTS"
File "pr2modules/netlink/__init__.py", line 1151, get_nested
pointer = pointer.get_attr(attr)
AttributeError: "dict" object has no attribute 'get_attr' |
Member
Author
|
Works when using against pyroute2 from core24 or the backport in PPA https://launchpad.net/~subiquity/+archive/ubuntu/core22 |
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com> (cherry picked from commit 3769a65)
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com> (cherry picked from commit 2f226cf)
`imp` has been removed as of python3.12. https://docs.python.org/3.12/library/imp.html We could migrate to importlib, but this is about python2 compat and we don't need that anymore, so just delete stuff. (reimplement curtin 1667812bc4b2393776a8ee32d558b6ffe37d3b11 here) (cherry picked from commit d855222)
(cherry picked from commit 9fb7baa)
(cherry picked from commit 4eef8e1)
3c105e1 to
e2164cc
Compare
When building the debian package, dh_missing complains that files in probert/rtnetlink/tests are not installed. We could add them to debian/not-installed but really we don't want them in the package at all. Drop them along with other existing test modules. Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com> (cherry picked from commit a714e0a)
(cherry picked from commit 0499c1d) Updated to remove inclusion of test data since we removed it previously.
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.
This is a backport of the following PRs:
Also picked up some CI backports so CI actually runs.
https://launchpad.net/bugs/2139131