From 828256cf6485ce10a0fc610ff524200e24ce0738 Mon Sep 17 00:00:00 2001 From: Tony Mack Date: Mon, 26 Jan 2009 23:08:39 +0000 Subject: [PATCH] formatting --- plc/slicemgr.py | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) 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): """ -- 2.47.0