From e020733c48fe36df351ad04f1ea8f697769c2ef4 Mon Sep 17 00:00:00 2001 From: Tony Mack Date: Wed, 11 Mar 2009 01:19:50 +0000 Subject: [PATCH] fix bug when comparing timestamps --- geni/slicemgr.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/geni/slicemgr.py b/geni/slicemgr.py index 0a8b1e68..b3aafea4 100644 --- a/geni/slicemgr.py +++ b/geni/slicemgr.py @@ -247,9 +247,13 @@ class SliceMgr(GeniServer): Return a list of components managed by this slice manager. """ # Reload components list - now = datetime.datetime.now() - if not self.nodes.has_key('threshold') or not self.nodes['threshold'] or not self.nodes.has_key('timestamp') or not self.nodes['timestamp'] or now > self.nodes['threshold']: + if not self.nodes.has_key('threshold') or not self.nodes['threshold'] or not self.nodes.has_key('timestamp') or not self.nodes['timestamp']: self.refresh_components() + else: + now = datetime.datetime.now() + threshold = datetime.datetime.fromtimestamp(time.mktime(time.strptime(self.nodes['threshold'], self.time_format))) + if now > threshold: + self.refresh_components() return self.nodes[format] -- 2.47.0