2
0
mirror of https://github.com/openvswitch/ovs synced 2025-10-19 14:37:21 +00:00
Files
openvswitch/python
Isaku Yamahata 3b4c362f40 python/ovs/db/idl: getattr(Row) raises TypeError, not AttributeError.
In some cases getattr(Row instance, attrname) doesn't raise AttributeError,
but TypeError

> File "python/ovs/db/idl.py", line 554, in __getattr__
>     datum = self._data[column_name]
> TypeError: 'NoneType' object has no attribute '__getitem__'

So getattr(Row instance, attrname, default value) doesn't work.
This occurs when row._changes doesn't include attrname and row._data is None.
So teach Row.__getattr__ _data=None case.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-09-27 09:11:49 -07:00
..