X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=sfa%2Fmanagers%2Faggregate_manager_openflow.py;h=7a965dc08b51b9d35b31a169ad04fe5ab4ad0829;hb=4ff67c801ceeb1d0c7ca2863c2b7bf8152182b8f;hp=6d12446d9e8c1261158f056f1265b46ce463cc82;hpb=3109c266ca3a5df2364e52502479adcc2f995d68;p=sfa.git diff --git a/sfa/managers/aggregate_manager_openflow.py b/sfa/managers/aggregate_manager_openflow.py index 6d12446d..7a965dc0 100755 --- a/sfa/managers/aggregate_manager_openflow.py +++ b/sfa/managers/aggregate_manager_openflow.py @@ -9,11 +9,12 @@ import struct #from soaplib.serializers.clazz import * from sfa.util.faults import * -from sfa.util.namespace import urn_to_hrn +from sfa.util.xrn import urn_to_hrn from sfa.util.rspec import RSpec from sfa.server.registry import Registries from sfa.util.config import Config from sfa.plc.nodes import * +from sfa.util.callids import Callids # Message IDs for all the SFA light calls # This will be used by the aggrMgr controller @@ -110,9 +111,11 @@ def reset_slices(cred, xrn): if DEBUG: print "Received reset_slices call" return msg_aggrMgr(SFA_RESET_SLICES) -def create_slice(cred, xrn, rspec): +def CreateSliver(cred, xrn, rspec, call_id): + if Callids().already_handled(call_id): return False + hrn = urn_to_hrn(xrn)[0] - if DEBUG: print "Received create_slice call" + if DEBUG: print "Received CreateSliver call" slice_id = generate_slide_id(cred, hrn) msg = struct.pack('> B%ds%ds' % (len(slice_id)+1, len(rspec)), SFA_CREATE_SLICE, slice_id, rspec) @@ -132,9 +135,10 @@ def create_slice(cred, xrn, rspec): print "IO error" return 0 -def get_rspec(cred, xrn=None): +# Thierry : this would need to handle call_id like the other AMs but is outdated... +def ListResources(cred, xrn=None): hrn = urn_to_hrn(xrn)[0] - if DEBUG: print "Received get_rspec call" + if DEBUG: print "Received ListResources call" slice_id = generate_slide_id(cred, hrn) msg = struct.pack('> B%ds' % len(slice_id), SFA_GET_RESOURCES, slice_id) @@ -167,7 +171,7 @@ def main(): r = RSpec() r.parseFile(sys.argv[1]) rspec = r.toDict() - create_slice(None,'plc',rspec) + CreateSliver(None,'plc',rspec,'call-id-plc') if __name__ == "__main__": main()