def reset(self):
     """
     resets all watchdogs
     """
     print "reset"
     for gguid in self.getGGUIDS():
         self.redis.delete(watchdog.getHSetKey(gguid))
 def reset(self):
     """
     resets all watchdogs
     """
     print "reset"
     for gguid in self.getGGUIDS():
         self.redis.delete(watchdog.getHSetKey(gguid))
 def setWatchdogEvent(self, alert, pprint=True):
     res = self.rediscl.hset(watchdog.getHSetKey(alert.gid), "%s_%s" % (alert.nid, alert.category), alert)
     if pprint:
         print alert
     return res
 def getWatchdogEvent(self,gguid,nid,category):
     key="%s_%s"%(nid,category)
     obj=json.loads(self.redis.hget(watchdog.getHSetKey(gguid),key))
     wde=WatchdogEvent(ddict=obj)
     return wde
 def iterateWatchdogEvents(self,gguid):
     for key in self.redis.hkeys(watchdog.getHSetKey(gguid)):
         nid,category=key.split("_")
         yield self.getWatchdogEvent(gguid,nid,category)
 def setWatchdogEvent(self, alert, pprint=True):
     res = self.rediscl.hset(watchdog.getHSetKey(alert.gid),
                             "%s_%s" % (alert.nid, alert.category), alert)
     if pprint:
         print alert
     return res
 def getWatchdogEvent(self, gguid, nid, category):
     key = "%s_%s" % (nid, category)
     obj = json.loads(self.redis.hget(watchdog.getHSetKey(gguid), key))
     wde = WatchdogEvent(ddict=obj)
     return wde
 def iterateWatchdogEvents(self, gguid):
     for key in self.redis.hkeys(watchdog.getHSetKey(gguid)):
         nid, category = key.split("_")
         yield self.getWatchdogEvent(gguid, nid, category)