test-ovsdb: Fix conditional statement.
authorAlex Wang <alexw@nicira.com>
Wed, 29 Apr 2015 17:41:39 +0000 (10:41 -0700)
committerAlex Wang <alexw@nicira.com>
Wed, 29 Apr 2015 20:46:32 +0000 (13:46 -0700)
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>
tests/test-ovsdb.py

index 250f671..4f8d7ca 100644 (file)
@@ -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