WIP: Adding VLAN ID to Port objects via Tags

Adds a module to store and retrieve VLAN IDs using Tags on the Port
model. Also, VLAN ID data is attached to Port descriptions, where
appropriate,  obtained via port show API requests.

Along with necessary unit tests.
This commit is contained in:
Clif Houck
2015-08-31 17:08:52 -05:00
parent 8dc27e7495
commit 8fb86aa58f
6 changed files with 333 additions and 2 deletions

View File

@@ -23,6 +23,7 @@ from oslo_log import log as logging
from quark.db import ip_types
from quark import network_strategy
from quark import port_vlan_id
from quark import protocols
@@ -179,6 +180,11 @@ def _port_dict(port, fields=None):
# NOTE(mdietz): more pythonic key in dict check fails here. Leave as get
if port.get("bridge"):
res["bridge"] = port["bridge"]
vlan_id = port_vlan_id.retrieve_vlan_id(port)
if vlan_id:
res["vlan_id"] = vlan_id
return res