node_manager_daemon_fkie: catch exception to pass the test on travis
@@ -53,6 +53,7 @@ class HddUsage(SensorInterface):
self._path = settings.param('sysmon/Disk/path', self._path)
def check_sensor(self):
+ try:
hdd = psutil.disk_usage(self._path)
diag_level = 0
diag_vals = []
@@ -68,6 +69,12 @@ class HddUsage(SensorInterface):
diag_vals.append(KeyValue(key='Free', value=hdd.free))
diag_vals.append(KeyValue(key='Free [%]', value='%.2f' % (100.0 - hdd.percent)))
diag_vals.append(KeyValue(key='Path', value=self._path))
+ except Exception as err:
+ warn_level = DiagnosticStatus.WARN
+ diag_msg = '%s' % err
+ diag_vals.append(KeyValue(key='Free', value="---"))
+ diag_vals.append(KeyValue(key='Free [%]', value="---"))
+ diag_vals.append(KeyValue(key='Path', value=self._path))
# Update status
with self.mutex:
