-
Notifications
You must be signed in to change notification settings - Fork 19
24.04 backport of pure Python implementation for rtnetlink & nl80211 #163
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
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)
|
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 |
|
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' |
|
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.
Chris-Peterson444
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks!
dbungert
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
This is a backport of the following PRs:
Also picked up some CI backports so CI actually runs.
https://launchpad.net/bugs/2139131