aboutsummaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorSteve McIntyre <steve.mcintyre@linaro.org>2014-12-02 17:14:36 +0000
committerSteve McIntyre <steve.mcintyre@linaro.org>2014-12-02 17:14:36 +0000
commitb67f3917740d4e5d86106d10dcc24528c0c9272d (patch)
treeacfd838fea3a082b8a1833d95f1ce30db42e34c5 /db
parente03de000860a12d4ce55953024269789e7ce4904 (diff)
Add get_ports_by_switch() helper method
Change-Id: I7c78d607a323e02443c1ff582b8a9b9b4ad23402
Diffstat (limited to 'db')
-rw-r--r--db/db.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/db/db.py b/db/db.py
index 014d7de..97d4b18 100644
--- a/db/db.py
+++ b/db/db.py
@@ -215,6 +215,9 @@ class VlanDB:
def get_port_name(self, port_id):
return self._get_element("port_name", "port", "port_id", port_id)
+ def get_ports_by_switch(self, switch_id):
+ return self._get_multi_elements("port_id", "port", "switch_id", switch_id)
+
def get_vlan_name(self, vlan_id):
return self._get_element("vlan_name", "vlan", "vlan_id", vlan_id)