aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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