sfatables hook bug fix
authorAnil-Kumar Vengalil <Anil-Kumar.Vengalil@sophia.inria.fr>
Thu, 8 Oct 2009 15:33:22 +0000 (15:33 +0000)
committerAnil-Kumar Vengalil <Anil-Kumar.Vengalil@sophia.inria.fr>
Thu, 8 Oct 2009 15:33:22 +0000 (15:33 +0000)
sfa/methods/create_slice.py

index bd86efa..db36db2 100644 (file)
@@ -11,7 +11,7 @@ from sfa.util.config import Config
 # RSpecManager_pl is not used. It's used to make sure the module is in place.
 import sfa.rspecs.aggregates.rspec_manager_pl
 from sfa.trust.credential import Credential
-#from sfatables.runtime import SFATablesRules
+from sfatables.runtime import SFATablesRules
 
 
 class create_slice(Method):
@@ -45,15 +45,15 @@ class create_slice(Method):
 
         sfa_aggregate_type = Config().get_aggregate_rspec_type()
         rspec_manager = __import__("sfa.rspecs.aggregates.rspec_manager_"+sfa_aggregate_type, fromlist = ["sfa.rspecs.aggregates"])
-        # Filter the incoming rspec using sfatables
-        #incoming_rules = SFATablesRules('OUTGOING')
+        #Filter the incoming rspec using sfatables
+        incoming_rules = SFATablesRules('OUTGOING')
             
         #incoming_rules.set_slice(hrn) # This is a temporary kludge. Eventually, we'd like to fetch the context requested by the match/target
 
-        #contexts = incoming_rules.contexts
-        #request_context = rspec_manager.get_context(hrn, Credential(string=caller_cred.get_gid_caller().get_hrn()), contexts)
-        #incoming_rules.set_context(request_context)
-        #rspec = incoming_rules.apply(requested_rspec)
+        contexts = incoming_rules.contexts
+        request_context = rspec_manager.fetch_context(hrn, Credential(string=caller_cred).get_gid_caller().get_hrn(), contexts)
+        incoming_rules.set_context(request_context)
+        rspec = incoming_rules.apply(requested_rspec)
         rspec = requested_rspec