Browse Source

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 6 years ago
parent
commit
3e407cfe2e
1 changed files with 2 additions and 2 deletions
  1. 2 2
      python.d/monit.chart.py

+ 2 - 2
python.d/monit.chart.py

@@ -128,7 +128,7 @@ class Service(UrlService):
                 if service_category == 'process':
                     for subnode in ('uptime', 'threads', 'children'):
                         subnode_value = service_node.find(subnode)
-                        if subnode_value == None:
+                        if subnode_value is None:
                             continue
                         if subnode == 'uptime' and int(subnode_value.text) < 0:
                             self.debug('Skipping bugged metrics with negative uptime (monit before v5.16')
@@ -140,7 +140,7 @@ class Service(UrlService):
 
                 if service_category == 'host':
                     subnode_value = service_node.find('./icmp/responsetime')
-                    if subnode_value == None:
+                    if subnode_value is None:
                         continue
                     dimension_key = 'host_latency_{0}'.format(service_name)
                     if dimension_key not in self.charts['host_latency']: