@cryptotaxi247 / netdata-1 / commits / 3e407cfe2

Fix LGTM complaints in monit module. (#4237)

LGTM (correctly) complains about usage of the equality operator for checking if a value is None. This commit updates the two remaining instances of this in our Python code, thus removing two errors from LGTM's listing. This changes no actual functionality of the module it modifies.

Austin S. Hemmelgarn committed Sep 20, 2018 at 11:55 UTC 3e407cfe2e08100676a3e86595ce125a24152ad5
1 file changed +2 -2
python.d/monit.chart.py
+2 -2
@@ -128,7 +128,7 @@ class Service(UrlService):
128 if service_category == 'process':
129 for subnode in ('uptime', 'threads', 'children'):
130 subnode_value = service_node.find(subnode)
131 - if subnode_value == None:
131 + if subnode_value is None:
132 continue
133 if subnode == 'uptime' and int(subnode_value.text) < 0:
134 self.debug('Skipping bugged metrics with negative uptime (monit before v5.16')
@@ -140,7 +140,7 @@ class Service(UrlService):
140
141 if service_category == 'host':
142 subnode_value = service_node.find('./icmp/responsetime')
143 - if subnode_value == None:
143 + if subnode_value is None:
144 continue
145 dimension_key = 'host_latency_{0}'.format(service_name)
146 if dimension_key not in self.charts['host_latency']: