From fcc8774005ceb60117cb238ad0852ac705e5cd9c Mon Sep 17 00:00:00 2001 From: Christopher Aubut Date: Wed, 13 Jul 2022 15:53:08 +0000 Subject: 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 Signed-off-by: Christopher Aubut Signed-off-by: Ilya Maximets --- python/ovs/db/idl.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/python/ovs/db/idl.py b/python/ovs/db/idl.py index 7ecaeee6d..859e4bb2a 100644 --- a/python/ovs/db/idl.py +++ b/python/ovs/db/idl.py @@ -1031,7 +1031,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 __getattr__(self, column_name): assert self._changes is not None -- cgit v1.2.1