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
Merge branch 'upstreammaster'
[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
3f2d512
..
228361d
100644
(file)
--- a/
sfa/managers/aggregate_manager_eucalyptus.py
+++ b/
sfa/managers/aggregate_manager_eucalyptus.py
@@
-17,19
+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.server.sfaapi import SfaApi
-from sfa.plc.aggregate import Aggregate
-from sfa.plc.slices import Slice, Slices
+
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
+
+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.
@@
-283,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()
@@
-444,7
+444,8
@@
class AggregateManagerEucalyptus:
port=eucaPort,
path=srvPath)
port=eucaPort,
path=srvPath)
- def ListResources(api, creds, options, call_id):
+ def ListResources(api, creds, options):
+ call_id = options.get('call_id')
if Callids().already_handled(call_id): return ""
# get slice's hrn from options
xrn = options.get('geni_slice_urn', '')
if Callids().already_handled(call_id): return ""
# get slice's hrn from options
xrn = options.get('geni_slice_urn', '')
@@
-540,14
+541,15
@@
class AggregateManagerEucalyptus:
"""
Hook called via 'sfi.py create'
"""
"""
Hook called via 'sfi.py create'
"""
- def CreateSliver(api, slice_xrn, creds, xml, users, call_id):
+ def CreateSliver(api, slice_xrn, creds, xml, users, options):
+ call_id = options.get('call_id')
if Callids().already_handled(call_id): return ""
logger = logging.getLogger('EucaAggregate')
logger.debug("In CreateSliver")
if Callids().already_handled(call_id): return ""
logger = logging.getLogger('EucaAggregate')
logger.debug("In CreateSliver")
- aggregate =
Aggregate(api
)
- slices =
Slices(api
)
+ aggregate =
PlAggregate(self.driver
)
+ 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)
@@
-677,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):
+ def GetVersion(api
, options
):
version_manager = VersionManager()
ad_rspec_versions = []
version_manager = VersionManager()
ad_rspec_versions = []
@@
-687,13
+689,13
@@
class AggregateManagerEucalyptus:
ad_rspec_versions.append(rspec_version.to_dict())
if rspec_version.content_type in ['*', 'request']:
request_rspec_versions.append(rspec_version.to_dict())
ad_rspec_versions.append(rspec_version.to_dict())
if rspec_version.content_type in ['*', 'request']:
request_rspec_versions.append(rspec_version.to_dict())
- default_rspec_version = version_manager.get_version("sfa 1").to_dict()
xrn=Xrn(api.hrn)
version_more = {'interface':'aggregate',
xrn=Xrn(api.hrn)
version_more = {'interface':'aggregate',
+ 'sfa': 1,
+ 'geni_api': '2',
'testbed':'myplc',
'hrn':xrn.get_hrn(),
'testbed':'myplc',
'hrn':xrn.get_hrn(),
- 'request_rspec_versions': request_rspec_versions,
- 'ad_rspec_versions': ad_rspec_versions,
- 'default_ad_rspec': default_rspec_version
+ 'geni_request_rspec_versions': request_rspec_versions,
+ 'geni_ad_rspec_versions': ad_rspec_versions,
}
return version_core(version_more)
}
return version_core(version_more)