git://git.onelab.eu
/
sfa.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
deeper pass on xmlrpclib vs xmlrpc.client as well as configparser
[sfa.git]
/
sfa
/
managers
/
aggregate_manager_eucalyptus.py
diff --git
a/sfa/managers/aggregate_manager_eucalyptus.py
b/sfa/managers/aggregate_manager_eucalyptus.py
index
1021392
..
2356f33
100644
(file)
--- a/
sfa/managers/aggregate_manager_eucalyptus.py
+++ b/
sfa/managers/aggregate_manager_eucalyptus.py
@@
-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.faults import InvalidRSpec
from sfa.util.xrn import urn_to_hrn, Xrn
-from sfa.util.plxrn import hrn_to_pl_slicename, 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.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.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
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.
##
# Meta data of an instance.
@@
-82,7
+79,7
@@
class EucaInstance(SQLObject):
self.instance_id = instance.id
# If there is an error, destroy itself.
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)
errTree = ET.fromstring(ec2RespErr.body)
msg = errTree.find('.//Message')
logger.error(msg.text)
@@
-286,7
+283,7
@@
class AggregateManagerEucalyptus:
_inited=False
# the init_server mechanism has vanished
_inited=False
# the init_server mechanism has vanished
- def __init__ (self):
+ def __init__ (self
, config
):
if AggregateManagerEucalyptus._inited: return
AggregateManagerEucalyptus.init_server()
if AggregateManagerEucalyptus._inited: return
AggregateManagerEucalyptus.init_server()
@@
-447,7
+444,7
@@
class AggregateManagerEucalyptus:
port=eucaPort,
path=srvPath)
port=eucaPort,
path=srvPath)
- def ListResources(api, creds, options
={}
):
+ def ListResources(api, creds, options):
call_id = options.get('call_id')
if Callids().already_handled(call_id): return ""
# get slice's hrn from options
call_id = options.get('call_id')
if Callids().already_handled(call_id): return ""
# get slice's hrn from options
@@
-527,7
+524,7
@@
class AggregateManagerEucalyptus:
instList.append(instInfoDict)
AggregateManagerEucalyptus.cloud['instances'] = instancesDict
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)
errTree = ET.fromstring(ec2RespErr.body)
errMsgE = errTree.find('.//Message')
logger.error(errMsgE.text)
@@
-544,7
+541,7
@@
class AggregateManagerEucalyptus:
"""
Hook called via 'sfi.py create'
"""
"""
Hook called via 'sfi.py create'
"""
- def CreateSliver(api, slice_xrn, creds, xml, users, options
={}
):
+ def CreateSliver(api, slice_xrn, creds, xml, users, options):
call_id = options.get('call_id')
if Callids().already_handled(call_id): return ""
call_id = options.get('call_id')
if Callids().already_handled(call_id): return ""
@@
-552,7
+549,7
@@
class AggregateManagerEucalyptus:
logger.debug("In CreateSliver")
aggregate = PlAggregate(self.driver)
logger.debug("In CreateSliver")
aggregate = PlAggregate(self.driver)
- slices = PlSlices(
api
)
+ slices = PlSlices(
self.driver
)
(hrn, type) = urn_to_hrn(slice_xrn)
peer = slices.get_peer(hrn)
sfa_peer = slices.get_sfa_peer(hrn)
(hrn, type) = urn_to_hrn(slice_xrn)
peer = slices.get_peer(hrn)
sfa_peer = slices.get_sfa_peer(hrn)
@@
-647,7
+644,7
@@
class AggregateManagerEucalyptus:
ramdisk_id = instRamDisk,
key_pair = instKey,
inst_type = instType,
ramdisk_id = instRamDisk,
key_pair = instKey,
inst_type = instType,
- meta = Meta(start_time=datetime.datetime.now()))
+ meta = Meta(start_time=datetime.datetime.
utc
now()))
eucaInst.reserveInstance(conn, pubKeys)
# xxx - should return altered rspec
eucaInst.reserveInstance(conn, pubKeys)
# xxx - should return altered rspec
@@
-664,7
+661,7
@@
class AggregateManagerEucalyptus:
try:
os.makedirs(outdir)
try:
os.makedirs(outdir)
- except OSError
,
e:
+ except OSError
as
e:
if e.errno != errno.EEXIST:
raise
if e.errno != errno.EEXIST:
raise
@@
-682,7
+679,7
@@
class AggregateManagerEucalyptus:
f.write("%s %s %s\n" % (instId, ipaddr, hrn))
f.close()
f.write("%s %s %s\n" % (instId, ipaddr, hrn))
f.close()
- def GetVersion(api, options
={}
):
+ def GetVersion(api, options):
version_manager = VersionManager()
ad_rspec_versions = []
version_manager = VersionManager()
ad_rspec_versions = []
@@
-695,7
+692,7
@@
class AggregateManagerEucalyptus:
xrn=Xrn(api.hrn)
version_more = {'interface':'aggregate',
'sfa': 1,
xrn=Xrn(api.hrn)
version_more = {'interface':'aggregate',
'sfa': 1,
- 'geni_api':
api.config.SFA_AGGREGATE_API_VERSION
,
+ 'geni_api':
'2'
,
'testbed':'myplc',
'hrn':xrn.get_hrn(),
'geni_request_rspec_versions': request_rspec_versions,
'testbed':'myplc',
'hrn':xrn.get_hrn(),
'geni_request_rspec_versions': request_rspec_versions,