From: Dan Streetman Date: Thu, 31 Oct 2019 14:15:53 +0000 (-0400) Subject: test-network: read link attribute at any depth X-Git-Tag: v245-rc1~269^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=befd4b8b60dd01a3bea9bb0730fd6e83d3714256;p=thirdparty%2Fsystemd.git test-network: read link attribute at any depth --- diff --git a/test/test-network/systemd-networkd-tests.py b/test/test-network/systemd-networkd-tests.py index bcfcc3fbeb3..415b3ef82b0 100755 --- a/test/test-network/systemd-networkd-tests.py +++ b/test/test-network/systemd-networkd-tests.py @@ -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):