From b255ca26d93c5cd6e77afb9929700309e640194c Mon Sep 17 00:00:00 2001 From: Steve McIntyre Date: Mon, 22 Dec 2014 01:46:27 +0000 Subject: Remove un-needed restore_base_vlan() method It doesn't actually gain anything over just calling set_current_vlan() Change-Id: If87678f2d9eebd9e73a392bd84a03f8e53621db4 --- db/db.py | 25 ------------------------- 1 file changed, 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 = [] -- cgit v1.2.1