aboutsummaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorIsaku Yamahata <yamahata@valinux.co.jp>2012-09-13 13:41:04 +0900
committerBen Pfaff <blp@nicira.com>2012-09-12 22:22:18 -0700
commit225b582a8c218eec242921b0eed291cf6ec19b76 (patch)
tree281b32f0dbb83d5d2513092b120fce6912a88a7d /python
parent158edc8d32355d736fb843c18e624e3d402a7a16 (diff)
python/ovs/db/idl.py: Transaction._substitute doesn't handle list/tuple
Since Transaction._substitute doesn't substitute elements of list/tuple, setting list references results in transaction error. Teach it such case. Example: {"op": "update", "row":{"bridges":["set",[["uuid", "1f42bc19-307f-42e7-a9c0-c12178bd8b51"], ["uuid", "f97e0c76-7146-489d-9bed-29bc704f65fe"]]]}, "table": "Open_vSwitch", "where":[["_uuid", "==", ["uuid", "20c2a046-ae7e-4453-a576-11034db24985"]]]} In the above case, uuid in "row" aren't replaced by "named-uuid" because the function doesn't look into elements of lists. When list/tuple is found, look into elements recursively. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Ben Pfaff <blp@nicira.com>
Diffstat (limited to 'python')
-rw-r--r--python/ovs/db/idl.py2
1 files changed, 2 insertions, 0 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):