From: Sapan Bhatia Date: Wed, 15 Jul 2009 13:16:55 +0000 (+0000) Subject: Last bit of code injection that hits the mainline (not max, not vini) code path X-Git-Tag: sfa-0.9-0@14641~48 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=0a46798e96b4b6ee4529e01abb19757714b996d6;p=sfa.git Last bit of code injection that hits the mainline (not max, not vini) code path --- diff --git a/sfa/methods/create_slice.py b/sfa/methods/create_slice.py index 9d89c4f8..122da36a 100644 --- a/sfa/methods/create_slice.py +++ b/sfa/methods/create_slice.py @@ -7,6 +7,9 @@ from sfa.util.method import Method from sfa.util.parameter import Parameter, Mixed from sfa.trust.auth import Auth from sfa.plc.slices import Slices +# RSpecManager_pl is not used. This is just to resolve issues with the dynamic __import__ that comes later. +import sfa.rspecs.aggregates.rspec_manager_pl + class create_slice(Method): """ @@ -29,8 +32,14 @@ class create_slice(Method): returns = Parameter(int, "1 if successful") def call(self, cred, hrn, rspec): - self.api.auth.check(cred, 'createslice') - slices = Slices(self.api) - slices.create_slice(hrn, rspec) + sfa_aggregate_type = Config().get_aggregate_rspec_type() + if (sfa_aggregate_type == 'pl'): + self.api.auth.check(cred, 'createslice') + slices = Slices(self.api) + slices.create_slice(hrn, rspec) + else: + # To clean up after July 21 - SB + rspec_manager = __import__("sfa.rspecs.aggregates.rspec_manager_"+sfa_aggregate_type) + rspec = rspec_manager.create_slice(hrn, rspec) return 1