aboutsummaryrefslogtreecommitdiff
path: root/db/db.py
diff options
context:
space:
mode:
authorSteve McIntyre <steve.mcintyre@linaro.org>2014-12-22 01:46:27 +0000
committerSteve McIntyre <steve.mcintyre@linaro.org>2014-12-22 01:46:27 +0000
commitb255ca26d93c5cd6e77afb9929700309e640194c (patch)
tree9d40688f0b45de5733ba01bac69256624970112d /db/db.py
parentb9b0aa522e549c518e5a1ef3f302b2a8e3681be8 (diff)
downloadvland-b255ca26d93c5cd6e77afb9929700309e640194c.tar.gz
Remove un-needed restore_base_vlan() method
It doesn't actually gain anything over just calling set_current_vlan() Change-Id: If87678f2d9eebd9e73a392bd84a03f8e53621db4
Diffstat (limited to 'db/db.py')
-rw-r--r--db/db.py25
1 files changed, 0 insertions, 25 deletions
diff --git a/db/db.py b/db/db.py
index 0b50420..b50bf48 100644
--- a/db/db.py
+++ b/db/db.py
@@ -540,31 +540,6 @@ class VlanDB:
raise
return port_id
- # Return a port back to its base VLAN
- #
- # Constraints:
- # 1. The port must already exist
- # 2. The port must not be a trunk port
- # 3. The port must not be locked
- def restore_base_vlan(self, port_id):
- port = self.get_port_by_id(port_id)
- if port is None:
- raise InputError("Port ID %d does not exist" % int(port_id))
-
- if port.is_trunk or port.is_locked:
- raise CriticalError("The port is locked")
-
- try:
- sql = "UPDATE port SET current_vlan_id=base_vlan_id WHERE port_id=%s RETURNING port_id"
- data = (port_id,)
- self.cursor.execute(sql, data)
- port_id = self.cursor.fetchone()[0]
- self.connection.commit()
- except:
- self.connection.rollback()
- raise
- return port_id
-
# Trivial helper function to return all the rows in a given table
def _dump_table(self, table):
result = []