summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorChristopher Aubut <christopher@aubut.me>2022-07-13 15:53:08 +0000
committerIlya Maximets <i.maximets@ovn.org>2022-09-19 18:33:48 +0200
commita39ee99edc26a3bf2fec8f6081f140567af54129 (patch)
treeff58fc77c622e0c20fe687f6e7b3c2a37e5c9aa5 /python
parent586adfd047cbbbf5fae329180adbce1f4f4eb1db (diff)
downloadopenvswitch-a39ee99edc26a3bf2fec8f6081f140567af54129.tar.gz
python: idl: Fix idl.Row.__str__ method.
Fixes idl.Row's __str__ method to only print if the column exists on the object. The Row object passed to the 'updates' argument of Idl.notify only contains a subset of columns. Printing that argument causes an AttributeError. Fixes: 6a1c98461b46 ("Add a __str__ method to idl.Row") Submitted-at: https://github.com/openvswitch/ovs/pull/392 Acked-by: Terry Wilson <twilson@redhat.com> Signed-off-by: Christopher Aubut <christopher@aubut.me> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
Diffstat (limited to 'python')
-rw-r--r--python/ovs/db/idl.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/python/ovs/db/idl.py b/python/ovs/db/idl.py
index 8f13d1f55..8e31e02d7 100644
--- a/python/ovs/db/idl.py
+++ b/python/ovs/db/idl.py
@@ -1295,7 +1295,8 @@ class Row(object):
return "{table}({data})".format(
table=self._table.name,
data=", ".join("{col}={val}".format(col=c, val=getattr(self, c))
- for c in sorted(self._table.columns)))
+ for c in sorted(self._table.columns)
+ if hasattr(self, c)))
def _uuid_to_row(self, atom, base):
if base.ref_table: