2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-31 06:15:47 +00:00

ovsdb: Fix mutation of newly inserted rows from Python IDL.

This patch fixes the scenario, where the mutate operation on a row
is sent in the same transaction as row insert operation. It was
obvserved that this mutate operation was not getting committed
to the OVSDB.

To get around the above problem the "where" condition in an
mutate operation is modified to use the named-uuid to identify
a row created in the current transaction.

Signed-off-by: Amitabha Biswas <abiswas@us.ibm.com>
Suggested-by: Richard Theis <rtheis@us.ibm.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
This commit is contained in:
Amitabha Biswas
2016-08-23 22:12:30 -07:00
committed by Ben Pfaff
parent 58026109d5
commit b3220c677a
4 changed files with 25 additions and 5 deletions

View File

@@ -1271,7 +1271,13 @@ class Transaction(object):
addop = False
op = {"table": row._table.name}
op["op"] = "mutate"
op["where"] = _where_uuid_equals(row.uuid)
if row._data is None:
# New row
op["where"] = self._substitute_uuids(
_where_uuid_equals(row.uuid))
else:
# Existing row
op["where"] = _where_uuid_equals(row.uuid)
op["mutations"] = []
if '_removes' in row._mutations.keys():
for col, dat in six.iteritems(row._mutations['_removes']):