]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Correct typo for matching non-dict ovsdb rows
authorTerry Wilson <twilson@redhat.com>
Fri, 17 Apr 2015 21:13:09 +0000 (16:13 -0500)
committerTerry Wilson <twilson@redhat.com>
Fri, 17 Apr 2015 21:16:10 +0000 (16:16 -0500)
As can be seen just above, the correct operator for the equality
test is '=' and not '=='. This match isn't currently being used
in the neutron code, but will be used by the OVN driver.

The previous code would also raise NotImplemented when there was
no match.

Change-Id: I17ac85d1ad68d3e207225db300f65c0df1f6e1ad

neutron/agent/ovsdb/native/idlutils.py

index ba0508eaf56f2f2692e497874201e69ae483dcd2..22aa0008a363289cf03b41ee0f564ab0b7e099b6 100644 (file)
@@ -169,10 +169,12 @@ def condition_match(row, condition):
     elif isinstance(match, list):
         raise NotImplementedError()
     else:
-        if op == '==' and val != match:
-            matched = False
-        elif op == '!=' and val == match:
-            matched = False
+        if op == '=':
+            if val != match:
+                matched = False
+        elif op == '!=':
+            if val == match:
+                matched = False
         else:
             raise NotImplementedError()
     return matched