From: Tony Mack Date: Tue, 1 Dec 2009 20:11:36 +0000 (+0000) Subject: use interface managers X-Git-Tag: sfa-0.9-7~251 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=ca919c9060fa4670442fbe8778263cc16dbb2b2f;p=sfa.git use interface managers --- diff --git a/sfa/methods/start_slice.py b/sfa/methods/start_slice.py index 44826e51..5032a721 100644 --- a/sfa/methods/start_slice.py +++ b/sfa/methods/start_slice.py @@ -36,7 +36,23 @@ class start_slice(Method): client_gid_str = client_gid.save_to_string(save_parents=True) self.api.auth.authenticateGid(client_gid_str, [cred, hrn], request_hash) self.api.auth.check(cred, 'startslice') - slices = Slices(self.api) - slices.start_slice(hrn) - + + # send the call to the right manager + manager_base = 'sfa.managers' + if self.api.interface in ['component']: + mgr_type = self.api.config.SFA_CM_TYPE + manager_module = manger_base+= ".component_manager_%s" % mgr_type + manager = __import__(manager_module, manager_base) + manager.start_slice(self.api, hrn) + elif self.api.interface in ['aggregate']: + mgr_type = self.api.config.SFA_AGGREGATE_TYPE + manager_module = manger_base+= ".agregate_manager_%s" % mgr_type + manager = __import__(manager_module, manager_base) + manager.start_slice(self.api, hrn) + elif self.api.interface in ['slicemngr']: + mgr_type = self.api.config.SFA_SM_TYPE + manager_module = manger_base+= ".slice_manager_%s" % mgr_type + manager = __import__(manager_module, manager_base) + manager.start_slice(self.api, hrn) + return 1 diff --git a/sfa/methods/stop_slice.py b/sfa/methods/stop_slice.py index 97c56636..58f1640d 100644 --- a/sfa/methods/stop_slice.py +++ b/sfa/methods/stop_slice.py @@ -36,7 +36,23 @@ class stop_slice(Method): client_gid_str = client_gid.save_to_string(save_parents=True) self.api.auth.authenticateGid(client_gid_str, [cred, hrn], request_hash) self.api.auth.check(cred, 'stopslice') - slices = Slices(self.api) - slices.stop_slice(hrn) - + + # send the call to the right manager + manager_base = 'sfa.managers' + if self.api.interface in ['component']: + mgr_type = self.api.config.SFA_CM_TYPE + manager_module = manger_base+= ".component_manager_%s" % mgr_type + manager = __import__(manager_module, manager_base) + manager.stop_slice(self.api, hrn) + elif self.api.interface in ['aggregate']: + mgr_type = self.api.config.SFA_AGGREGATE_TYPE + manager_module = manger_base+= ".agregate_manager_%s" % mgr_type + manager = __import__(manager_module, manager_base) + manager.stop_slice(self.api, hrn) + elif self.api.interface in ['slicemngr']: + mgr_type = self.api.config.SFA_SM_TYPE + manager_module = manger_base+= ".slice_manager_%s" % mgr_type + manager = __import__(manager_module, manager_base) + manager.stop_slice(self.api, hrn) + return 1