Skip to content

Commit

Permalink
test-ovsdb: Fix conditional statement.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
yew011 committed Apr 29, 2015
1 parent 4237026 commit 1aa2bf9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tests/test-ovsdb.py
Expand Up @@ -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

Expand Down

0 comments on commit 1aa2bf9

Please sign in to comment.