merged namespace
[sfa.git] / sfa / methods / CreateSliver.py
index bcca6b3..8b45917 100644 (file)
@@ -3,9 +3,7 @@ from sfa.util.namespace import *
 from sfa.util.method import Method
 from sfa.util.parameter import Parameter, Mixed
 from sfa.util.sfatablesRuntime import run_sfatables
-import sys
 from sfa.trust.credential import Credential
-from sfa.util.sfalogging import logger
 
 class CreateSliver(Method):
     """
@@ -19,7 +17,7 @@ class CreateSliver(Method):
     @param rspec (string) rspec to allocate
     
     """
-    interfaces = ['aggregate', 'slicemgr', 'geni_am']
+    interfaces = ['aggregate', 'slicemgr']
     accepts = [
         Parameter(str, "Slice URN"),
         Mixed(Parameter(str, "Credential string"),
@@ -29,8 +27,6 @@ class CreateSliver(Method):
         ]
     returns = Parameter(str, "Allocated RSpec")
 
-
-
     def call(self, slice_xrn, creds, rspec, users):
         hrn, type = urn_to_hrn(slice_xrn)
 
@@ -43,14 +39,11 @@ class CreateSliver(Method):
         manager = self.api.get_interface_manager()
         
         # flter rspec through sfatables
-        if self.api.interface in ['aggregate', 'geni_am']:
-            chain_name = 'OUTGOING'
+        if self.api.interface in ['aggregate']:
+            chain_name = 'INCOMING'
         elif self.api.interface in ['slicemgr']:
-            chain_name = 'FORWARD-OUTGOING'
+            chain_name = 'FORWARD-INCOMING'
         rspec = run_sfatables(chain_name, hrn, origin_hrn, rspec)
-        allocated = manager.create_slice(self.api, slice_xrn, valid_creds, rspec, users)
-        if allocated:
-            return rspec
+        allocated = manager.create_slice(self.api, slice_xrn, creds, rspec, users)
 
-        return ''
-    
+        return rspec