style cleanup

This commit is contained in:
Sandy Walsh
2011-02-16 18:35:43 -08:00
parent 3834e01220
commit ba6be95c6a

View File

@@ -84,14 +84,16 @@ def _call_novatools(zone):
os = novatools.OpenStack(zone.username, zone.password, zone.api_url) os = novatools.OpenStack(zone.username, zone.password, zone.api_url)
return os.zones.info()._info return os.zones.info()._info
def _poll_zone(zone): def _poll_zone(zone):
"""Eventlet worker to poll a zone.""" """Eventlet worker to poll a zone."""
logging.debug("_POLL_ZONE: STARTING") logging.debug(_("Polling zone: %s") % zone.api_url)
try: try:
zone.update_metadata(_call_novatools(zone)) zone.update_metadata(_call_novatools(zone))
except Exception, e: except Exception, e:
zone.log_error(e) zone.log_error(e)
class ZoneManager(object): class ZoneManager(object):
"""Keeps the zone states updated.""" """Keeps the zone states updated."""
def __init__(self): def __init__(self):
@@ -122,10 +124,9 @@ class ZoneManager(object):
def ping(self, context=None): def ping(self, context=None):
"""Ping should be called periodically to update zone status.""" """Ping should be called periodically to update zone status."""
logging.debug("ZoneManager PING")
diff = datetime.now() - self.last_zone_db_check diff = datetime.now() - self.last_zone_db_check
if diff.seconds >= FLAGS.zone_db_check_interval: if diff.seconds >= FLAGS.zone_db_check_interval:
logging.debug("ZoneManager RECHECKING DB ") logging.debug("Updating zone cache from db.")
self.last_zone_db_check = datetime.now() self.last_zone_db_check = datetime.now()
self._refresh_from_db(context) self._refresh_from_db(context)
self._poll_zones(context) self._poll_zones(context)