DeleteSliver supports call_id
[sfa.git] / sfa / managers / aggregate_manager_pl.py
index 9e0aa27..4b8f34d 100644 (file)
@@ -159,11 +159,11 @@ def CreateSliver(api, slice_xrn, creds, rspec, users, call_id):
     Create the sliver[s] (slice) at this aggregate.    
     Verify HRN and initialize the slice record in PLC if necessary.
     """
-    if Callids().already_handled(call_id): return False
+    if Callids().already_handled(call_id): return ""
 
     reg_objects = __get_registry_objects(slice_xrn, creds, users)
 
-    hrn, type = urn_to_hrn(slice_xrn)
+    (hrn, type) = urn_to_hrn(slice_xrn)
     peer = None
     slices = Slices(api)
     peer = slices.get_peer(hrn)
@@ -205,9 +205,8 @@ def CreateSliver(api, slice_xrn, creds, rspec, users, call_id):
             api.plshell.BindObjectToPeer(api.plauth, 'slice', slice.id, peer, 
                                          slice.peer_id)
 
-    # print network.toxml()
-
-    return True
+    # xxx - check this holds enough data for the client to understand what's happened
+    return network.toxml()
 
 
 def renew_slice(api, xrn, creds, expiration_time):
@@ -255,8 +254,9 @@ def reset_slice(api, xrn):
     # XX not implemented at this interface
     return 1
 
-def delete_slice(api, xrn, creds):
-    hrn, type = urn_to_hrn(xrn)
+def DeleteSliver(api, xrn, creds, call_id):
+    if Callids().already_handled(call_id): return ""
+    (hrn, type) = urn_to_hrn(xrn)
     slicename = hrn_to_pl_slicename(hrn)
     slices = api.plshell.GetSlices(api.plauth, {'name': slicename})
     if not slices: