aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--python/ovs/db/idl.py2
-rw-r--r--tests/ovsdb-idl.at10
-rw-r--r--tests/test-ovsdb.py11
3 files changed, 22 insertions, 1 deletions
diff --git a/python/ovs/db/idl.py b/python/ovs/db/idl.py
index 5330cea6..3a8dec28 100644
--- a/python/ovs/db/idl.py
+++ b/python/ovs/db/idl.py
@@ -758,6 +758,8 @@ class Transaction(object):
row = self._txn_rows.get(uuid, None)
if row and row._data is None:
return ["named-uuid", _uuid_name_from_uuid(uuid)]
+ else:
+ return [self._substitute_uuids(elem) for elem in json]
return json
def __disassemble(self):
diff --git a/tests/ovsdb-idl.at b/tests/ovsdb-idl.at
index 48e74899..68fe8689 100644
--- a/tests/ovsdb-idl.at
+++ b/tests/ovsdb-idl.at
@@ -429,3 +429,13 @@ OVSDB_CHECK_IDL([external-linking idl, consistent ops],
002: i=1 k=1 ka=[] l2=0 uuid=<1>
003: done
]])
+
+OVSDB_CHECK_IDL_PY([external-linking idl, insert ops],
+ [],
+ [['linktest']],
+ [[000: empty
+001: commit, status=success
+002: i=1 k=1 ka=[1] l2= uuid=<0>
+002: i=2 k=1 ka=[1 2] l2= uuid=<1>
+003: done
+]])
diff --git a/tests/test-ovsdb.py b/tests/test-ovsdb.py
index 1350ccde..170476de 100644
--- a/tests/test-ovsdb.py
+++ b/tests/test-ovsdb.py
@@ -180,7 +180,7 @@ def print_idl(idl, step):
for row in l2.itervalues():
s = ["%03d: i=%s l1=" % (step, row.i)]
if row.l1:
- s.append(str(row.l1.i))
+ s.append(str(row.l1[0].i))
s.append(" uuid=%s" % row.uuid)
print(''.join(s))
n += 1
@@ -312,6 +312,15 @@ def idl_set(idl, commands, step):
sys.stdout.flush()
txn.abort()
return
+ elif name == "linktest":
+ l1_0 = txn.insert(idl.tables["link1"])
+ l1_0.i = 1
+ l1_0.k = [l1_0]
+ l1_0.ka = [l1_0]
+ l1_1 = txn.insert(idl.tables["link1"])
+ l1_1.i = 2
+ l1_1.k = [l1_0]
+ l1_1.ka = [l1_0, l1_1]
else:
sys.stderr.write("unknown command %s\n" % name)
sys.exit(1)