Browse Source

Fix instances of events as strings instead of tuples

Although it technically works because the match use 'in' and events
are non-overlapping strings, the clear intent is for these to be
tuples and (x) is not a tuple, while (x,) is.

Change-Id: I316215d33a47a34839114fd41401f7c701c4ff21
tags/6.0.0.0b1
Terry Wilson 3 months ago
parent
commit
10ff6726d1

+ 3
- 3
networking_ovn/agent/metadata/agent.py View File

@@ -72,7 +72,7 @@ class PortBindingChassisEvent(row_event.RowEvent):
72 72
     def __init__(self, metadata_agent):
73 73
         self.agent = metadata_agent
74 74
         table = 'Port_Binding'
75
-        events = (self.ROW_UPDATE)
75
+        events = (self.ROW_UPDATE,)
76 76
         super(PortBindingChassisEvent, self).__init__(
77 77
             events, table, None)
78 78
         self.event_name = 'PortBindingChassisEvent'
@@ -109,7 +109,7 @@ class ChassisCreateEvent(row_event.RowEvent):
109 109
         self.agent = metadata_agent
110 110
         self.first_time = True
111 111
         table = 'Chassis'
112
-        events = (self.ROW_CREATE)
112
+        events = (self.ROW_CREATE,)
113 113
         super(ChassisCreateEvent, self).__init__(
114 114
             events, table, (('name', '=', self.agent.chassis),))
115 115
         self.event_name = 'ChassisCreateEvent'
@@ -128,7 +128,7 @@ class SbGlobalUpdateEvent(row_event.RowEvent):
128 128
     def __init__(self, metadata_agent):
129 129
         self.agent = metadata_agent
130 130
         table = 'SB_Global'
131
-        events = (self.ROW_UPDATE)
131
+        events = (self.ROW_UPDATE,)
132 132
         super(SbGlobalUpdateEvent, self).__init__(events, table, None)
133 133
         self.event_name = 'SbGlobalUpdateEvent'
134 134
 

+ 5
- 5
networking_ovn/ovsdb/ovsdb_monitor.py View File

@@ -98,7 +98,7 @@ class PortBindingChassisEvent(row_event.RowEvent):
98 98
         self.driver = driver
99 99
         self.l3_plugin = directory.get_plugin(constants.L3)
100 100
         table = 'Port_Binding'
101
-        events = (self.ROW_UPDATE)
101
+        events = (self.ROW_UPDATE,)
102 102
         super(PortBindingChassisEvent, self).__init__(
103 103
             events, table, (('type', '=', 'chassisredirect'),))
104 104
         self.event_name = 'PortBindingChassisEvent'
@@ -129,7 +129,7 @@ class LogicalSwitchPortCreateUpEvent(row_event.RowEvent):
129 129
     def __init__(self, driver):
130 130
         self.driver = driver
131 131
         table = 'Logical_Switch_Port'
132
-        events = (self.ROW_CREATE)
132
+        events = (self.ROW_CREATE,)
133 133
         super(LogicalSwitchPortCreateUpEvent, self).__init__(
134 134
             events, table, (('up', '=', True),))
135 135
         self.event_name = 'LogicalSwitchPortCreateUpEvent'
@@ -148,7 +148,7 @@ class LogicalSwitchPortCreateDownEvent(row_event.RowEvent):
148 148
     def __init__(self, driver):
149 149
         self.driver = driver
150 150
         table = 'Logical_Switch_Port'
151
-        events = (self.ROW_CREATE)
151
+        events = (self.ROW_CREATE,)
152 152
         super(LogicalSwitchPortCreateDownEvent, self).__init__(
153 153
             events, table, (('up', '=', False),))
154 154
         self.event_name = 'LogicalSwitchPortCreateDownEvent'
@@ -167,7 +167,7 @@ class LogicalSwitchPortUpdateUpEvent(row_event.RowEvent):
167 167
     def __init__(self, driver):
168 168
         self.driver = driver
169 169
         table = 'Logical_Switch_Port'
170
-        events = (self.ROW_UPDATE)
170
+        events = (self.ROW_UPDATE,)
171 171
         super(LogicalSwitchPortUpdateUpEvent, self).__init__(
172 172
             events, table, (('up', '=', True),),
173 173
             old_conditions=(('up', '=', False),))
@@ -187,7 +187,7 @@ class LogicalSwitchPortUpdateDownEvent(row_event.RowEvent):
187 187
     def __init__(self, driver):
188 188
         self.driver = driver
189 189
         table = 'Logical_Switch_Port'
190
-        events = (self.ROW_UPDATE)
190
+        events = (self.ROW_UPDATE,)
191 191
         super(LogicalSwitchPortUpdateDownEvent, self).__init__(
192 192
             events, table, (('up', '=', False),),
193 193
             old_conditions=(('up', '=', True),))

+ 1
- 1
networking_ovn/tests/functional/test_ovsdb_monitor.py View File

@@ -36,7 +36,7 @@ class WaitForMACBindingDeleteEvent(event.RowEvent):
36 36
         self.event = threading.Event()
37 37
         self.timeout = 15
38 38
         table = 'MAC_Binding'
39
-        events = (self.ROW_DELETE)
39
+        events = (self.ROW_DELETE,)
40 40
         conditions = (('_uuid', '=', entry),)
41 41
         super(WaitForMACBindingDeleteEvent, self).__init__(
42 42
             events, table, conditions)

Loading…
Cancel
Save