deeper pass on xmlrpclib vs xmlrpc.client as well as configparser
[sfa.git] / sfa / managers / aggregate_manager_eucalyptus.py
index b83afe4..2356f33 100644 (file)
@@ -17,22 +17,19 @@ from sqlobject import *
 
 from sfa.util.faults import InvalidRSpec 
 from sfa.util.xrn import urn_to_hrn, Xrn
-from sfa.util.plxrn import slicename_to_hrn
 from sfa.util.callids import Callids
 #comes with its own logging
 #from sfa.util.sfalogging import logger
 from sfa.util.version import version_core
+
 from sfa.trust.credential import Credential
-from sfa.plc.plaggregate import PlAggregate
-# No Slice symbol in there
-#from sfa.plc.plslices import Slice, Slices
-from sfa.plc.plslices import PlSlices
+
 from sfa.rspecs.version_manager import VersionManager
 from sfa.rspecs.rspec import RSpec
-# not sure what this used to be nor where it is now defined
-#from sfa.rspecs.sfa_rspec import sfa_rspec_version
-# most likely this should now be
-#from sfa.rspecs.version_manager import VersionManager
+
+from sfa.planetlab.plaggregate import PlAggregate
+from sfa.planetlab.plslices import PlSlices
+from sfa.planetlab.plxrn import slicename_to_hrn
 
 ##
 # Meta data of an instance.
@@ -82,7 +79,7 @@ class EucaInstance(SQLObject):
                 self.instance_id = instance.id
 
         # If there is an error, destroy itself.
-        except EC2ResponseError, ec2RespErr:
+        except EC2ResponseError as ec2RespErr:
             errTree = ET.fromstring(ec2RespErr.body)
             msg = errTree.find('.//Message')
             logger.error(msg.text)
@@ -527,7 +524,7 @@ class AggregateManagerEucalyptus:
                     instList.append(instInfoDict)
                 AggregateManagerEucalyptus.cloud['instances'] = instancesDict
     
-        except EC2ResponseError, ec2RespErr:
+        except EC2ResponseError as ec2RespErr:
             errTree = ET.fromstring(ec2RespErr.body)
             errMsgE = errTree.find('.//Message')
             logger.error(errMsgE.text)
@@ -647,7 +644,7 @@ class AggregateManagerEucalyptus:
                                         ramdisk_id = instRamDisk,
                                         key_pair   = instKey,
                                         inst_type  = instType,
-                                        meta       = Meta(start_time=datetime.datetime.now()))
+                                        meta       = Meta(start_time=datetime.datetime.utcnow()))
                 eucaInst.reserveInstance(conn, pubKeys)
     
         # xxx - should return altered rspec 
@@ -664,7 +661,7 @@ class AggregateManagerEucalyptus:
     
         try:
             os.makedirs(outdir)
-        except OSError, e:
+        except OSError as e:
             if e.errno != errno.EEXIST:
                 raise