summaryrefslogtreecommitdiff
path: root/tests/test-ovsdb.py
diff options
context:
space:
mode:
authorAlex Wang <alexw@nicira.com>2015-04-29 10:41:39 -0700
committerAlex Wang <alexw@nicira.com>2015-04-29 13:46:32 -0700
commit1aa2bf92505da27320b37b53244fb9715062ab04 (patch)
treebfff9ba8b71c8e0fc4806b508ee7985e40cefd33 /tests/test-ovsdb.py
parent4237026e52f6bfa1dac0162dd82f7bb3f26c833d (diff)
downloadopenvswitch-1aa2bf92505da27320b37b53244fb9715062ab04.tar.gz
test-ovsdb: Fix conditional statement.
Old version of python does not support the following conditional statement syntax in one assignment: var = value1 if cond else value2 This commit fixes it by convert it back to use two assignments. Signed-off-by: Alex Wang <alexw@nicira.com> Acked-by: Russell Bryant <rbryant@redhat.com>
Diffstat (limited to 'tests/test-ovsdb.py')
-rw-r--r--tests/test-ovsdb.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/test-ovsdb.py b/tests/test-ovsdb.py
index 250f67114..4f8d7cac5 100644
--- a/tests/test-ovsdb.py
+++ b/tests/test-ovsdb.py
@@ -240,7 +240,10 @@ def idl_set(idl, commands, step):
old_notify = idl.notify
def notify(event, row, updates=None):
- upcol = updates._data.keys()[0] if updates else None
+ if updates:
+ upcol = updates._data.keys()[0]
+ else:
+ upcol = None
events.append("%s|%s|%s" % (event, row.i, upcol))
idl.notify = old_notify