create an l2gateway
stack@l2gwosc50:~$ lgc --device
name=d1,interface_names="i1|300;i3|400" --device name=d2,interface_names="i2|100#200" gwtest -v Created a new l2_gateway:
+-----------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Field | Value |
+-----------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| devices | {"interfaces": [{"segmentation_id": 300, "name": "i1"}, {"segmentation_id": 400, "name": "i3"}], "id": "437ca139-6e0f-4248-9d94-e6717769e80d", "device_name": "d1"} |
| | {"interfaces": [{"segmentation_id": 100, "name": "i2"}, {"segmentation_id": "200", "name": "i2"}], "id": "45e9bb5c-1601-4fc3-95c1-ead5f57fcaa8", "device_name": "d2"} |
| id | 27e14aa5-8d57-4758-96a0-8ede20c7d6cc |
| name | gwtest |
| tenant_id | 18a47cd1e8b24527bb124621f0090018 |
+-----------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
Since the input is :
"l2_gateway": {"name": "gwtest", "devices": [{"interfaces":
[{"segmentation_id": ["300"], "name": "i1"}, {"segmentation_id": ["400"], "name": "i3"}], "device_name": "d1"}, {"interfaces": [{"segmentation_id": ["100", "200"], "name": "i2"}], "device_name": "d2"}]}} Actual :
Output :
RESP BODY: {"l2_gateway": {"tenant_id":
"18a47cd1e8b24527bb124621f0090018", "id": "27e14aa5-8d57-4758-96a0-8ede20c7d6cc", "devices": [{"interfaces": [{"segmentation_id": 300, "name": "i1"}, {"segmentation_id": 400, "name": "i3"}], "id": "437ca139-6e0f-4248-9d94-e6717769e80d", "device_name": "d1"}, {"interfaces": [{"segmentation_id": 100, "name": "i2"}, {"segmentation_id": "200", "name": "i2"}], "id": "45e9bb5c-1601-4fc3-95c1-ead5f57fcaa8", "device_name": "d2"}], "name": "gwtest"}} Expected output:
Output :
{"l2_gateway": {"tenant_id": "18a47cd1e8b24527bb124621f0090018", "id": "27e14aa5-8d57-4758-96a0-8ede20c7d6cc", "devices": [{"interfaces": [{"segmentation_id": 300, "name": "i1"}, {"segmentation_id": 400,
"name": "i3"}], "id": "437ca139-6e0f-4248-9d94-e6717769e80d", "device_name": "d1"}, {"interfaces": [{"segmentation_id": [100,200], "name": "i2"}], "id": "45e9bb5c-1601-4fc3-95c1-ead5f57fcaa8", "device_name": "d2"}], "name": "gwtest"}}
Fix proposed : /review. openstack. org/#/c/ 174790/
https:/