Check for empty attributes list
Patrick Koenig committed
Jun 11, 2017 at 01:29 UTC
963dbd678e72f17af4c113ec0b6ddf47c1daeb17
1 file changed
+4
-5
python.d/smartd_log.chart.py
+4
-5
@@ -198,11 +198,10 @@ class Service(SimpleService):
198
return result
199
200
# Use configured attributes, if present. If something goes wrong we don't care.
201
- if self.attr:
202
- try:
203
- ORDER = [attr for attr in self.attr.split() if attr in SMART_ATTR.keys()]
204
- except Exception:
205
- pass
201
+ try:
202
+ ORDER = [attr for attr in self.attr.split() if attr in SMART_ATTR.keys()] or ORDER
203
+ except Exception:
204
+ pass
205
self.order = [''.join(['attrid', i]) for i in ORDER]
206
self.definitions = dict()
207
units = 'raw' if self.raw_values else 'normalized'