The argument to insert() should be a uuid.UUID object. If it isn't
then a Row is created with a string uuid attribute and that row is
added to table.rows with a string key instead of a UUID key.
Fixes: 55b9507e6824 ("ovsdb-idl: Add the support to specify the uuid for row
insert.")
Signed-off-by: Terry Wilson <[email protected]>
---
python/ovs/db/idl.py | 2 +-
tests/test-ovsdb.py | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/python/ovs/db/idl.py b/python/ovs/db/idl.py
index a80da84e7..0e201366b 100644
--- a/python/ovs/db/idl.py
+++ b/python/ovs/db/idl.py
@@ -1854,7 +1854,7 @@ class Transaction(object):
if row._data is None:
op["op"] = "insert"
if row._persist_uuid:
- op["uuid"] = row.uuid
+ op["uuid"] = str(row.uuid)
else:
op["uuid-name"] = _uuid_name_from_uuid(row.uuid)
diff --git a/tests/test-ovsdb.py b/tests/test-ovsdb.py
index 48f8ee2d7..6307aa2bd 100644
--- a/tests/test-ovsdb.py
+++ b/tests/test-ovsdb.py
@@ -434,7 +434,7 @@ def idl_set(idl, commands, step):
sys.stderr.write('"set" command requires 2 argument\n')
sys.exit(1)
- s = txn.insert(idl.tables["simple"], new_uuid=args[0],
+ s = txn.insert(idl.tables["simple"], new_uuid=uuid.UUID(args[0]),
persist_uuid=True)
s.i = int(args[1])
elif name == "delete":
--
2.34.3
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev