aboutsummaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorSteve McIntyre <steve.mcintyre@linaro.org>2014-12-05 15:34:39 +0000
committerSteve McIntyre <steve.mcintyre@linaro.org>2014-12-05 15:34:39 +0000
commitf36550682f4c13eb33b8fca83811c58bfe990152 (patch)
tree65c5b0f3c85ce621762c2032a0fe34b70805a953 /db
parent50eb0606bb54117bb922be53f724586228d1e0cc (diff)
Reorder DB functions
Change-Id: I2b71a02d1e2cbde9e731363a2c4b63199c6293fb
Diffstat (limited to 'db')
-rw-r--r--db/db.py36
1 files changed, 18 insertions, 18 deletions
diff --git a/db/db.py b/db/db.py
index 13eb039..eedaeba 100644
--- a/db/db.py
+++ b/db/db.py
@@ -264,21 +264,21 @@ class VlanDB:
else:
return None
+ def get_switch(self, switch_id):
+ return self._get_row("switch", "switch_id", switch_id)
+
def get_switch_id(self, name):
return self._get_element("switch_id", "switch", "name", name)
- def get_port_id(self, name):
- return self._get_element("port_id", "port", "name", name)
-
- def get_vlan_id_by_name(self, name):
- return self._get_element("vlan_id", "vlan", "name", name)
-
- def get_vlan_id_by_tag(self, tag):
- return self._get_element("vlan_id", "vlan", "tag", tag)
-
def get_switch_name(self, switch_id):
return self._get_element("name", "switch", "switch_id", switch_id)
+ def get_port(self, port_id):
+ return self._get_row("port", "port_id", port_id)
+
+ def get_port_id(self, name):
+ return self._get_element("port_id", "port", "name", name)
+
def get_port_name(self, port_id):
return self._get_element("port_name", "port", "port_id", port_id)
@@ -294,6 +294,15 @@ class VlanDB:
def get_ports_by_base_vlan(self, vlan_id):
return self._get_multi_elements("port_id", "port", "base_vlan_id", vlan_id)
+ def get_vlan(self, vlan_id):
+ return self._get_row("vlan", "vlan_id", vlan_id)
+
+ def get_vlan_id_by_name(self, name):
+ return self._get_element("vlan_id", "vlan", "name", name)
+
+ def get_vlan_id_by_tag(self, tag):
+ return self._get_element("vlan_id", "vlan", "tag", tag)
+
def get_vlan_name(self, vlan_id):
return self._get_element("vlan_name", "vlan", "vlan_id", vlan_id)
@@ -316,15 +325,6 @@ class VlanDB:
self.cursor.execute(sql, data)
return self.cursor.fetchone()
- def get_switch(self, switch_id):
- return self._get_row("switch", "switch_id", switch_id)
-
- def get_port(self, port_id):
- return self._get_row("port", "port_id", port_id)
-
- def get_vlan(self, vlan_id):
- return self._get_row("vlan", "vlan_id", vlan_id)
-
# (Un)Lock a port in the database. This can only be done through
# the admin interface, and will stop API users from modifying
# settings on the port. Use this to lock down ports that are used