aboutsummaryrefslogtreecommitdiff
path: root/whatmaps/command.py
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2014-12-28 14:49:03 +0100
committerGuido Günther <agx@sigxcpu.org>2014-12-28 14:59:02 +0100
commit9b32d5e86ef7ad4b4e802ec8fb16b21fb47d45b8 (patch)
tree31c5335278ccebfaeeb10a41ac632a426d2e07f9 /whatmaps/command.py
parent8c5b2930b37f7cf6fd0a44e4283bf2c79fbc13bd (diff)
Fix service name parsing for systemd >= 215
Newer systemd put a colored bullet point '●' in front of the service name output: # sudo systemctl status 971 ● libvirtd.service - Virtualization daemon ... Skip that.
Diffstat (limited to 'whatmaps/command.py')
-rwxr-xr-xwhatmaps/command.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/whatmaps/command.py b/whatmaps/command.py
index 0a4eb7b..d0f5c3e 100755
--- a/whatmaps/command.py
+++ b/whatmaps/command.py
@@ -113,7 +113,12 @@ def find_systemd_units(procmap, distro):
for dummy, procs in procmap.items():
for proc in procs:
- unit = Systemd.process_to_unit(proc)
+ try:
+ unit = Systemd.process_to_unit(proc)
+ except ValueError as e:
+ logging.warning("No systemd unit found for '%s': %s"
+ "- restart manually" % (proc.exe, e))
+ continue
if not unit:
logging.warning("No systemd unit found for '%s'"
"- restart manually" % proc.exe)