3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-12-22 04:32:37 +01:00

test-runner: handle pyroute2 IW() between versions

It appears different versions of pyroute2 may or may not have
iwutil, and instead use pyroute2.IW() directly. Try the iwutil
way first, then pyroute2.IW()
This commit is contained in:
James Prestwood 2021-10-28 10:34:09 -07:00 committed by Denis Kenzior
parent 4d66e11b0c
commit 89407089cd

View File

@ -853,7 +853,11 @@ class TestContext(Namespace):
def discover_radios(self):
phys = []
iw = pyroute2.iwutil.IW()
try:
iw = pyroute2.iwutil.IW()
except:
iw = pyroute2.IW()
attrs = [phy['attrs'] for phy in iw.list_wiphy()]