update switch state after inserting all machines

Change-Id: I6ec68cb3f7a1d97ded843fc7a022227854a7b9ca
This commit is contained in:
grace.yu 2014-10-09 18:03:14 -07:00
parent f8224c2617
commit 4287cf3d10

@ -73,7 +73,6 @@ def _poll_switch(ip_addr, credentials, req_obj='mac', oper="SCAN"):
)
logging.info('poll switch result: %s' % str(results))
state = under_monitoring
machine_dicts = {}
for machine in results:
mac = machine['mac']
@ -90,6 +89,7 @@ def _poll_switch(ip_addr, credentials, req_obj='mac', oper="SCAN"):
machine_dicts[mac]['vlans'].extend(vlans)
logging.debug('update switch %s state to under monitoring', ip_addr)
state = under_monitoring
return (
{'vendor': vendor, 'state': state, 'err_msg': err_msg},
machine_dicts.values()