test-network: drop duplicated definition of networkd_pid()

This commit is contained in:
Yu Watanabe
2026-03-13 04:44:12 +09:00
parent 3df88e836c
commit 67957b1464
+1 -4
View File
@@ -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.