- # To clean up after July 21 - SB
- rspec_manager = __import__("sfa.rspecs.aggregates.rspec_manager_"+sfa_aggregate_type, fromlist = ["sfa.rspecs.aggregates"])
- rspec = rspec_manager.get_rspec(hrn)
-
- return rspec
+ rspec = rspec_manager.get_rspec(self.api, hrn)
+
+ # Filter the outgoing rspec using sfatables
+ if self.api.interface=='slicemgr':
+ outgoing_rules = SFATablesRules('FORWARD-OUTGOING')
+ else:
+ outgoing_rules = SFATablesRules('OUTGOING')
+ if outgoing_rules.sorted_rule_list:
+ request_context = rspec_manager.fetch_context(
+ hrn,
+ Credential(string=caller_cred).get_gid_caller().get_hrn(),
+ outgoing_rules.contexts)
+ outgoing_rules.set_context(request_context)
+ filtered_rspec = outgoing_rules.apply(rspec)
+ return filtered_rspec
+ else:
+ return rspec