Skip to content

Commit

Permalink
ovsdb-idl: Use modern form of <monitor-requests>.
Browse files Browse the repository at this point in the history
Long ago, a <monitor-requests> object in the OVSDB protocol mapped a table
name to a single <monitor-request>.  Since then, it has mapped a table name
to an *array of* <monitor-request> objects, but the OVSDB IDL has never
been updated to use the modern form.  This commit makes that change.

Reported-by: Anil Jangam <[email protected]>
Signed-off-by: Ben Pfaff <[email protected]>
Acked-by: Justin Pettit <[email protected]>
  • Loading branch information
blp committed Mar 14, 2018
1 parent ee60eef commit 62bba60
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions AUTHORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,7 @@ André Ruß [email protected]
Andreas Beckmann [email protected]
Andrei Andone [email protected]
Andrey Korolyov [email protected]
Anil Jangam [email protected]
Anshuman Manral [email protected]
Anton Matsiuk [email protected]
Anup Khadka [email protected]
Expand Down
3 changes: 2 additions & 1 deletion lib/ovsdb-idl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1600,7 +1600,8 @@ ovsdb_idl_send_monitor_request__(struct ovsdb_idl *idl,
json_object_put(monitor_request, "where", where);
table->cond_changed = false;
}
json_object_put(monitor_requests, tc->name, monitor_request);
json_object_put(monitor_requests, tc->name,
json_array_create_1(monitor_request));
}
}
free_schema(schema);
Expand Down
5 changes: 3 additions & 2 deletions python/ovs/db/idl.py
Original file line number Diff line number Diff line change
Expand Up @@ -425,10 +425,11 @@ def __send_monitor_request(self):
(table.name in self.readonly) and
(column not in self.readonly[table.name])):
columns.append(column)
monitor_requests[table.name] = {"columns": columns}
monitor_request = {"columns": columns}
if method == "monitor_cond" and table.condition != [True]:
monitor_requests[table.name]["where"] = table.condition
monitor_request["where"] = table.condition
table.cond_change = False
monitor_requests[table.name] = [monitor_request]

msg = ovs.jsonrpc.Message.create_request(
method, [self._db.name, str(self.uuid), monitor_requests])
Expand Down

0 comments on commit 62bba60

Please sign in to comment.