Commit 96fad709 authored by Bartłomiej Piotrowski's avatar Bartłomiej Piotrowski
Browse files

zabbix-agent: format systemd-units-failed.py with black

parent a7d683d8
......@@ -3,12 +3,14 @@
import dbus
ignore = set(['syncrepo.service', 'syncrepo_arch32.service'])
ignore = set(["syncrepo.service", "syncrepo_arch32.service"])
bus = dbus.SystemBus()
systemd1 = bus.get_object('org.freedesktop.systemd1', '/org/freedesktop/systemd1')
systemd1_manager = dbus.Interface(systemd1, dbus_interface='org.freedesktop.systemd1.Manager')
systemd1 = bus.get_object("org.freedesktop.systemd1", "/org/freedesktop/systemd1")
systemd1_manager = dbus.Interface(
systemd1, dbus_interface="org.freedesktop.systemd1.Manager"
)
units = systemd1_manager.ListUnits()
for unit in filter(lambda u: u[3] == 'failed' and u[0] not in ignore, units):
for unit in filter(lambda u: u[3] == "failed" and u[0] not in ignore, units):
print(unit[0])
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment