2
0
mirror of https://github.com/openvswitch/ovs synced 2025-10-25 15:07:05 +00:00

Handle refTable values with setkey()

For columns like QoS.queues where we have a map containing refTable
values, assigning w/ __setattr__ e.g. qos.queues={1: $queue_row}
works, but using using qos.setkey('queues', 1, $queue_row) results
in an Exception. The opdat argument can essentially just be the
JSON representation of the map column instead of trying to build
it.

Signed-off-by: Terry Wilson <twilson@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
This commit is contained in:
Terry Wilson
2020-03-20 15:22:38 +00:00
committed by Ben Pfaff
parent 047b920ea6
commit 9435b0b8e6
4 changed files with 51 additions and 3 deletions

View File

@@ -1567,10 +1567,9 @@ class Transaction(object):
for col, val in row._mutations['_inserts'].items():
column = row._table.columns[col]
if column.type.is_map():
opdat = ["map"]
datum = data.Datum.from_python(column.type, val,
_row_to_uuid)
opdat.append(datum.as_list())
opdat = self._substitute_uuids(datum.to_json())
else:
opdat = ["set"]
inner_opdat = []