aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve McIntyre <steve.mcintyre@linaro.org>2014-12-21 23:31:12 +0000
committerSteve McIntyre <steve.mcintyre@linaro.org>2014-12-21 23:31:12 +0000
commitb9b0aa522e549c518e5a1ef3f302b2a8e3681be8 (patch)
tree986203342d6d4bb93a1d00dc2c14ee67ee8b076f
parentfeb6452857669cd2ef85bfcdd4cf6576a7f464e5 (diff)
downloadvland-b9b0aa522e549c518e5a1ef3f302b2a8e3681be8.tar.gz
Add get_vlan_tag_by_id()
Change-Id: I314f7fcdbf19b7f4fdcc5466236a3e8305291a2a
-rw-r--r--db/db.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/db/db.py b/db/db.py
index e1a0126..0b50420 100644
--- a/db/db.py
+++ b/db/db.py
@@ -407,6 +407,13 @@ class VlanDB:
def get_vlan_name_by_id(self, vlan_id):
return self._get_element("vlan_name", "vlan", "vlan_id", vlan_id)
+ # Simple lookup: look up a VLAN by ID, and return the tag of that
+ # VLAN.
+ #
+ # Returns None on failure.
+ def get_vlan_tag_by_id(self, vlan_id):
+ return self._get_element("tag", "vlan", "vlan_id", vlan_id)
+
# Grab one row of a query on one column; useful as a quick wrapper
def _get_row(self, table, field, value):