]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test-network: read link attribute at any depth
authorDan Streetman <ddstreet@canonical.com>
Thu, 31 Oct 2019 14:15:53 +0000 (10:15 -0400)
committerDan Streetman <ddstreet@canonical.com>
Thu, 5 Dec 2019 22:50:15 +0000 (17:50 -0500)
test/test-network/systemd-networkd-tests.py

index bcfcc3fbeb389bf8994af8fe0d537b42ef0734fe..415b3ef82b02f427f5ca5aa0dffba53df4ec54d7 100755 (executable)
@@ -216,8 +216,8 @@ def tearDownModule():
     for u in running_units:
         check_output(f'systemctl start {u}')
 
-def read_link_attr(link, dev, attribute):
-    with open(os.path.join(os.path.join(os.path.join('/sys/class/net/', link), dev), attribute)) as f:
+def read_link_attr(*args):
+    with open(os.path.join('/sys/class/net/', *args)) as f:
         return f.readline().strip()
 
 def read_bridge_port_attr(bridge, link, attribute):