test-network: drop duplicated definition of networkd_pid()
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user