aboutsummaryrefslogtreecommitdiff
path: root/util.py
diff options
context:
space:
mode:
authorSteve McIntyre <steve.mcintyre@linaro.org>2015-01-23 18:05:13 +0000
committerSteve McIntyre <steve.mcintyre@linaro.org>2015-01-23 18:05:13 +0000
commit5b0de003d8514b941679c1c1825c31470a38c2f6 (patch)
tree41124b18c7ee09af99ebb7a9753c88690d5311df /util.py
parent10dc663d13528be064ba364e53c68d95ac790813 (diff)
Fix string comparisons on port mode
"is not" doesn't work here. :-( Change-Id: I6e9db2ab64a7b7468a705bc6a534a9ada209bd95
Diffstat (limited to 'util.py')
-rw-r--r--util.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/util.py b/util.py
index 42a8bc0..463b91d 100644
--- a/util.py
+++ b/util.py
@@ -426,8 +426,8 @@ class VlanUtil:
config = state.config
# 1. Sanity-check inputs
- if mode is not 'access' and mode is not 'trunk':
- raise InputError("Port mode %s is not a valid option: try 'access' or 'trunk" % mode)
+ if mode != 'access' and mode != 'trunk':
+ raise InputError("Port mode '%s' is not a valid option: try 'access' or 'trunk'" % mode)
port = db.get_port_by_id(port_id)
if port is None:
raise InputError("Port ID %d does not exist" % port_id)