selfcheck.py: make selfcheck work if there is no systemd module

This commit is contained in:
Oleg Kalachev
2019-08-19 19:22:47 +03:00
parent cd34cc077b
commit 86d84e5c0a

View File

@@ -16,7 +16,6 @@ import traceback
from threading import Event
import numpy
import rospy
from systemd import journal
import tf2_ros
import tf2_geometry_msgs
from pymavlink import mavutil
@@ -620,6 +619,12 @@ def check_clever_service():
failure('clever.service is not running, try sudo systemctl restart clever')
return
try:
from systemd import journal
except ImportError:
failure('no python-systemd package, not the Clever image?')
return
j = journal.Reader()
j.this_boot()
j.add_match(_SYSTEMD_UNIT='clever.service')