formatting
authorTony Mack <tmack@cs.princeton.edu>
Mon, 26 Jan 2009 23:08:39 +0000 (23:08 +0000)
committerTony Mack <tmack@cs.princeton.edu>
Mon, 26 Jan 2009 23:08:39 +0000 (23:08 +0000)
plc/slicemgr.py

index ed40691..0f28d54 100644 (file)
@@ -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):
         """