From: Sapan Bhatia Date: Fri, 17 Jul 2009 18:06:47 +0000 (+0000) Subject: Almost done ! :) X-Git-Tag: sfa-0.9-0@14641~18 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=d0d4a1a11e155c8d7b8843e31725936153648d78;p=sfa.git Almost done ! :) --- diff --git a/sfa/rspecs/aggregates/rspec_manager_max.py b/sfa/rspecs/aggregates/rspec_manager_max.py index b40568b6..65ace0e4 100644 --- a/sfa/rspecs/aggregates/rspec_manager_max.py +++ b/sfa/rspecs/aggregates/rspec_manager_max.py @@ -67,12 +67,16 @@ def get_interface_map(): return topology +def allocations_to_rspec(allocations): + rspec = xml.dom.minidom.parse(SFA_MAX_DEFAULT_RSPEC) + req = rspec.firstChild.appendChild(rspec.createElement("request")) + pdb.set_trace() + for (iname,ip) in allocations: + ifspec = req.appendChild(rspec.createElement("ifspec")) + ifspec.setAttribute("name","tns:"+iname) + ifspec.setAttribute("ip",ip) -#def allocations_to_rspec(allocations): -# rspec = xml.minidom.parseFile(SFA_MAX_DEFAULT_RSPEC) -# req = rspec.firstChild.appendChild(rspec.createElement("request")) -# for a in allocations: -# (link, + return rspec.toxml() def if_endpoints(ifs): @@ -127,7 +131,7 @@ def alloc_nodes(api,hrn, requested_ifs): requested_nodes = if_endpoints(requested_ifs) - #create_slice_max_aggregate(api, hrn, requested_nodes) + create_slice_max_aggregate(api, hrn, requested_nodes) # Taken from slices.py @@ -317,7 +321,7 @@ def main(): t = get_interface_map() r = Rspec() rspec_xml = open(sys.argv[1]).read() - create_slice(None,'foo',rspec_xml) + get_rspec(None,'foo') if __name__ == "__main__": main()