diff options
author | Steve McIntyre <steve.mcintyre@linaro.org> | 2014-12-05 16:22:44 +0000 |
---|---|---|
committer | Steve McIntyre <steve.mcintyre@linaro.org> | 2014-12-05 16:22:44 +0000 |
commit | 8c64d952434e84df643749cf760d60ed5d6f87fc (patch) | |
tree | eb28c8963dc4b1bd4b93e5cdce8b3fea08604bf5 /db | |
parent | 7310657d0a0fe9615160944f5559872ed8e4e135 (diff) |
Check the port exists in set_port_is_locked
Change-Id: Ie8bedafc0a84bdab537b4152d73718f1b3a399fd
Diffstat (limited to 'db')
-rw-r--r-- | db/db.py | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -330,6 +330,9 @@ class VlanDB: # settings on the port. Use this to lock down ports that are used # for PDUs and other core infrastructure def set_port_is_locked(self, port_id, is_locked): + port = self.get_port_by_id(port_id) + if port is None: + raise InputError("Port %s does not exist" % port_id) try: sql = "UPDATE port SET is_locked=%s WHERE port_id=%s" data = (is_locked, port_id) |