Implement create_slice
[sfa.git] / sfa / managers / slice_manager_pl.py
index 72ea567..79fb38e 100644 (file)
@@ -55,11 +55,11 @@ def create_slice(api, xrn, rspec, origin_hrn=None):
     netspecs = spec.getDictsByTagName('NetSpec')
     for netspec in netspecs:
         net_hrn = netspec['name']
-        resources = {'start_time': start_time, 'end_time': end_time, 'networks': netspec}
+        resources = {'start_time': start_time, 'end_time': end_time, 'networks': {'NetSpec' : netspec}}
         resourceDict = {'RSpec': resources}
         tempspec.parseDict(resourceDict)
         rspecs[net_hrn] = tempspec.toxml()
-
+    
     #print "rspecs:", rspecs.keys()
     #print "aggregates:", aggregates.keys() 
     # send each rspec to the appropriate aggregate/sm
@@ -103,7 +103,7 @@ def get_ticket(api, xrn, rspec, origin_hrn=None):
     for netspec in netspecs:
         net_hrn = netspec['name']
         resources = {'start_time': 0, 'end_time': 0 , 
-                     'network': netspec}
+                     'network': {'NetSpec' : netspec}}
         resourceDict = {'RSpec': resources}
         temp_rspec.parseDict(resourceDict)
         rspecs[net_hrn] = temp_rspec.toxml() 
@@ -113,7 +113,7 @@ def get_ticket(api, xrn, rspec, origin_hrn=None):
     credential = api.getCredential()
     tickets = {}
     for net_hrn in rspecs:
-        net_urn = urn_to_hrn(net_hrn, 'authority')     
+        net_urn = urn_to_hrn(net_hrn)     
         try:
             # if we are directly connected to the aggregate then we can just
             # send them the request. if not, then we may be connected to an sm