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

@ -101,7 +101,20 @@ def test_json(node, compute):
"width": node.width,
"height": node.height,
"symbol": node.symbol,
"label": node.label
"label": node.label,
"port_name_format": "Ethernet{0}",
"port_segment_size": 0,
"first_port_name": None,
"ports": [
{
"adapter_number": 0,
"data_link_types": {"Ethernet": "DLT_EN10MB"},
"link_type": "ethernet",
"name": "Ethernet0",
"port_number": 0,
"short_name": "e0/0"
}
]
}
assert node.__json__(topology_dump=True) == {
"compute_id": str(compute.id),
@ -117,7 +130,10 @@ def test_json(node, compute):
"width": node.width,
"height": node.height,
"symbol": node.symbol,
"label": node.label
"label": node.label,
"port_name_format": "Ethernet{0}",
"port_segment_size": 0,
"first_port_name": None
}