]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test-network: drop duplicated definition of networkd_pid()
authorYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 12 Mar 2026 07:15:47 +0000 (16:15 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 12 Mar 2026 19:44:12 +0000 (04:44 +0900)
test/test-network/systemd-networkd-tests.py

index 1f3a99a040a52d61cd1cb7f226b7cade214dfd06..835f31656e839031f07940dfabab17494cb49b6c 100755 (executable)
@@ -987,7 +987,7 @@ def networkd_invocation_id():
     return check_output('systemctl show --value -p InvocationID systemd-networkd.service')
 
 def networkd_pid():
-    return check_output('systemctl show --value -p MainPID systemd-networkd.service')
+    return int(check_output('systemctl show --value -p MainPID systemd-networkd.service'))
 
 def read_networkd_log(invocation_id=None, since=None):
     if not invocation_id:
@@ -1051,9 +1051,6 @@ def restart_networkd(show_logs=True):
     pid = networkd_pid()
     print(f'Restarted systemd-networkd.service: PID={pid}, Invocation ID={invocation_id}')
 
-def networkd_pid():
-    return int(check_output('systemctl show --value -p MainPID systemd-networkd.service'))
-
 def networkctl(*args):
     # Do not call networkctl if networkd is in failed state.
     # Otherwise, networkd may be restarted and we may get wrong results.