Merge branch 'master' into eucalyptus-devel
[sfa.git] / sfa / managers / aggregate_manager_max.py
index 0b37bb3..9f99bcf 100644 (file)
@@ -254,8 +254,8 @@ def create_slice_max_aggregate(api, hrn, nodes):
     return 1
 
 
-def get_rspec(api, creds, options, call_id):
-    if not Callids().should_handle_call_id(call_id): return ""
+def ListResources(api, creds, options, call_id):
+    if Callids().already_handled(call_id): return ""
     # get slice's hrn from options
     xrn = options.get('geni_slice_urn', '')
     hrn, type = urn_to_hrn(xrn)
@@ -271,7 +271,9 @@ def get_rspec(api, creds, options, call_id):
     return (ret_rspec)
 
 
-def create_slice(api, xrn, creds, rspec_xml, users):
+def CreateSliver(api, xrn, creds, rspec_xml, users, call_id):
+    if Callids().already_handled(call_id): return ""
+
     global topology
     hrn = urn_to_hrn(xrn)[0]
     topology = get_interface_map()
@@ -318,7 +320,9 @@ def create_slice(api, xrn, creds, rspec_xml, users):
 
     unlock_state_file()
 
-    return True
+    # xxx - should return altered rspec 
+    # with enough data for the client to understand what's happened
+    return rspec_xml
 
 def rspec_to_allocations(rspec):
     ifs = []
@@ -335,8 +339,8 @@ def main():
     t = get_interface_map()
     r = RSpec()
     rspec_xml = open(sys.argv[1]).read()
-    #get_rspec(None,'foo')
-    create_slice(None, "plc.princeton.sap0", rspec_xml)
+    #ListResources(None,'foo')
+    CreateSliver(None, "plc.princeton.sap0", rspec_xml, 'call-id-sap0')
     
 if __name__ == "__main__":
     main()