From: Tony Mack Date: Mon, 26 Jan 2009 23:08:39 +0000 (+0000) Subject: formatting X-Git-Tag: sfa-0.9-0@14641~710 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=828256cf6485ce10a0fc610ff524200e24ce0738;p=sfa.git formatting --- diff --git a/plc/slicemgr.py b/plc/slicemgr.py index ed40691c..0f28d544 100644 --- a/plc/slicemgr.py +++ b/plc/slicemgr.py @@ -147,24 +147,24 @@ class SliceMgr(GeniServer): f.close() def load_components(self): - """ - Read cached list of nodes and slices. - """ - print "loading nodes" - # Read component list from cached file - if os.path.exists(self.components_file): - f = open(self.components_file, 'r') - self.components = eval(f.read()) - f.close() + """ + Read cached list of nodes and slices. + """ + print "loading nodes" + # Read component list from cached file + if os.path.exists(self.components_file): + f = open(self.components_file, 'r') + self.components = eval(f.read()) + f.close() - time_format = "%Y-%m-%d %H:%M:%S" - if os.path.exists(self.timestamp_file): - f = open(self.timestamp_file, 'r') - timestamp = str(f.read()).split(".")[0] - self.timestamp = datetime.datetime.fromtimestamp(time.mktime(time.strptime(timestamp, time_format))) - delta = datetime.timedelta(hours=self.components_ttl) + time_format = "%Y-%m-%d %H:%M:%S" + if os.path.exists(self.timestamp_file): + f = open(self.timestamp_file, 'r') + timestamp = str(f.read()).split(".")[0] + self.timestamp = datetime.datetime.fromtimestamp(time.mktime(time.strptime(timestamp, time_format))) + delta = datetime.timedelta(hours=self.components_ttl) self.threshold = self.timestamp + delta - f.close() + f.close() def load_policy(self): """