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:
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.