File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change 14
14
15
15
import copy
16
16
import datetime
17
+ import dbus
17
18
import json
18
19
import logging
19
20
import subprocess
@@ -112,11 +113,15 @@ def run_iterate(self):
112
113
if 'UNIT' not in data :
113
114
continue
114
115
# update internal storage
116
+ try :
117
+ unit_data = self .__systemd .get_unit (data ['UNIT' ])
118
+ except dbus .DBusException :
119
+ self .__logger .warning ('DBus exception recieved' , exc_info = True )
120
+ continue
115
121
with self .__lock :
116
- self .__states [
117
- data ['UNIT' ]] = self .__systemd .get_unit (data ['UNIT' ])
122
+ self .__states [data ['UNIT' ]] = unit_data
118
123
self .__lst = datetime .datetime .utcnow ()
119
- yield data ['UNIT' ], self . __states [ data [ 'UNIT' ]]
124
+ yield data ['UNIT' ], unit_data
120
125
except Exception :
121
126
self .__logger .warning ('Exception recieved' , exc_info = True )
122
127
self .__status = False
You can’t perform that action at this time.
0 commit comments