one less loop
@@ -212,9 +212,9 @@ class Update_Switch_State(Monitor_Helper_Base):
changed = False
if self.first_time:
self.first_time = False
- # TODO db call to see if really need to run things
- # TODO needs work
- if self.r:
+ # db call to see if really need to run things
+ # TODO - still not right
+ if self.r != None:
try:
mac_addresses = self.r.smembers('mac_addresses')
for mac in mac_addresses:
@@ -235,6 +235,7 @@ class Update_Switch_State(Monitor_Helper_Base):
self.logger.error('Unable to get MAC information for {0} from Redis because {1}'.format(mac, str(e)))
except Exception as e: # pragma: no cover
self.logger.error('Unable to get existing DB information from Redis because {0}'.format(str(e)))
+ else:
for machine in machines:
end_point = EndPoint(machine, state='KNOWN')
self.poseidon_logger.info(
