Move the generation of the list of ports to the server

Ref #676
This commit is contained in:
Julien Duponchelle
2016-09-13 09:47:22 +02:00
parent f06c00fdb8
commit 2f0e2260ab
50 changed files with 1347 additions and 240 deletions

View File

@ -57,7 +57,7 @@ class EthernetSwitchHandler:
request.match_info["project_id"],
request.json.get("node_id"),
device_type="ethernet_switch",
ports=request.json.get("ports"))
ports=request.json.get("ports_mapping"))
# On Linux, use the generic switch
# builtin_manager = Builtin.instance()
@ -112,8 +112,8 @@ class EthernetSwitchHandler:
node = dynamips_manager.get_device(request.match_info["node_id"], project_id=request.match_info["project_id"])
if "name" in request.json and node.name != request.json["name"]:
yield from node.set_name(request.json["name"])
if "ports" in request.json:
node.ports = request.json["ports"]
if "ports_mapping" in request.json:
node.ports_mapping = request.json["ports_mapping"]
# builtin_manager = Builtin.instance()
# node = builtin_manager.get_node(request.match_info["node_id"], project_id=request.match_info["project_id"])