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.py
diff --git
a/sfa/managers/aggregate_manager.py
b/sfa/managers/aggregate_manager.py
index
a31efc6
..
2fbdf3d
100644
(file)
--- a/
sfa/managers/aggregate_manager.py
+++ b/
sfa/managers/aggregate_manager.py
@@
-25,8
+25,8
@@
class AggregateManager:
def __init__ (self):
# xxx Thierry : caching at the aggregate level sounds wrong...
def __init__ (self):
# xxx Thierry : caching at the aggregate level sounds wrong...
-
#
self.caching=True
- self.caching=False
+ self.caching=True
+
#
self.caching=False
def GetVersion(self, api, options={}):
def GetVersion(self, api, options={}):
@@
-38,14
+38,14
@@
class AggregateManager:
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': 2,
+ 'geni_api': api.config.SFA_AGGREGATE_API_VERSION,
'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)
@@
-254,7
+254,7
@@
class AggregateManager:
return 1
def DeleteSliver(self, api, xrn, creds, options={}):
return 1
def DeleteSliver(self, api, xrn, creds, options={}):
- call_id = option.get('call_id')
+ call_id = option
s
.get('call_id')
if Callids().already_handled(call_id): return ""
(hrn, _) = urn_to_hrn(xrn)
slicename = hrn_to_pl_slicename(hrn)
if Callids().already_handled(call_id): return ""
(hrn, _) = urn_to_hrn(xrn)
slicename = hrn_to_pl_slicename(hrn)
@@
-275,7
+275,7
@@
class AggregateManager:
return 1
def ListSlices(self, api, creds, options={}):
return 1
def ListSlices(self, api, creds, options={}):
- call_id = option.get('call_id')
+ call_id = option
s
.get('call_id')
if Callids().already_handled(call_id): return []
# look in cache first
if self.caching and api.cache:
if Callids().already_handled(call_id): return []
# look in cache first
if self.caching and api.cache:
@@
-295,23
+295,24
@@
class AggregateManager:
return slice_urns
def ListResources(self, api, creds, options={}):
return slice_urns
def ListResources(self, api, creds, options={}):
- call_id = option.get('call_id')
+ call_id = option
s
.get('call_id')
if Callids().already_handled(call_id): return ""
# get slice's hrn from options
xrn = options.get('geni_slice_urn', None)
if Callids().already_handled(call_id): return ""
# get slice's hrn from options
xrn = options.get('geni_slice_urn', None)
+ cached = options.get('cached', True)
(hrn, _) = urn_to_hrn(xrn)
version_manager = VersionManager()
# get the rspec's return format from options
(hrn, _) = urn_to_hrn(xrn)
version_manager = VersionManager()
# get the rspec's return format from options
- rspec_version = version_manager.get_version(options.get('rspec_version'))
- version_string = "rspec_%s" % (rspec_version
.to_string()
)
+ rspec_version = version_manager.get_version(options.get('
geni_
rspec_version'))
+ version_string = "rspec_%s" % (rspec_version)
#panos adding the info option to the caching key (can be improved)
if options.get('info'):
version_string = version_string + "_"+options.get('info', 'default')
# look in cache first
#panos adding the info option to the caching key (can be improved)
if options.get('info'):
version_string = version_string + "_"+options.get('info', 'default')
# look in cache first
- if self.caching and api.cache and not xrn:
+ if self.caching and api.cache and not xrn
and cached
:
rspec = api.cache.get(version_string)
if rspec:
api.logger.info("aggregate.ListResources: returning cached value for hrn %s"%hrn)
rspec = api.cache.get(version_string)
if rspec:
api.logger.info("aggregate.ListResources: returning cached value for hrn %s"%hrn)
@@
-319,8
+320,8
@@
class AggregateManager:
#panos: passing user-defined options
#print "manager options = ",options
#panos: passing user-defined options
#print "manager options = ",options
- aggregate = Aggregate(api
, options
)
- rspec = aggregate.get_rspec(slice_xrn=xrn, version=rspec_version)
+ aggregate = Aggregate(api)
+ rspec = aggregate.get_rspec(slice_xrn=xrn, version=rspec_version
, options=options
)
# cache the result
if self.caching and api.cache and not xrn:
# cache the result
if self.caching and api.cache and not xrn: