X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=sfa%2Fmanagers%2Faggregate_manager.py;h=0bf5d9f2d5a4120bc79507c348c7924fb1157af1;hb=8f367b9457f47ba1e3b8a56eea8ed5c9b1e52eed;hp=0b97c63877b2a8c382cabeeaa400eb60945e4711;hpb=8bf2388afc7410f17bc0c2b716aef89b3e52ab94;p=sfa.git diff --git a/sfa/managers/aggregate_manager.py b/sfa/managers/aggregate_manager.py index 0b97c638..0bf5d9f2 100644 --- a/sfa/managers/aggregate_manager.py +++ b/sfa/managers/aggregate_manager.py @@ -4,6 +4,8 @@ from sfa.util.version import version_core from sfa.util.xrn import Xrn from sfa.util.callids import Callids from sfa.util.sfalogging import logger +from sfa.util.faults import SfaInvalidArgument, InvalidRSpecVersion + class AggregateManager: @@ -56,7 +58,6 @@ class AggregateManager: 'geni_api_versions': {'3': 'http://%s:%s' % (socket.gethostname(), api.config.sfa_aggregate_port)}, 'geni_single_allocation': 0, # Accept operations that act on as subset of slivers in a given state. 'geni_allocate': 'geni_many',# Multiple slivers can exist and be incrementally added, including those which connect or overlap in some way. - 'geni_best_effort': 'true', 'geni_credential_types': cred_types, } version.update(version_generic) @@ -119,6 +120,17 @@ class AggregateManager: """ call_id = options.get('call_id') if Callids().already_handled(call_id): return "" + + # make sure geni_rspec_version is specified in options + if 'geni_rspec_version' not in options: + msg = 'geni_rspec_version is required and must be set in options struct' + raise SfaInvalidArgument(msg, 'geni_rspec_version') + # make sure we support the requested rspec version + version_manager = VersionManager() + rspec_version = version_manager.get_version(options['geni_rspec_version']) + if not rspec_version: + raise InvalidRSpecVersion(options['geni_rspec_version']) + return self.driver.provision(xrns, options) def Delete(self, api, xrns, creds, options): @@ -134,7 +146,7 @@ class AggregateManager: def PerformOperationalAction(self, api, xrns, creds, action, options={}): call_id = options.get('call_id') if Callids().already_handled(call_id): return True - return self.driver.performOperationalAction(xrns, action, options) + return self.driver.perform_operational_action(xrns, action, options) def Shutdown(self, api, xrn, creds, options={}): call_id = options.get('call_id')