[ovs-git] Open vSwitch: python/ovs/db/idl: getattr(Row) raises TypeError, not AttributeError. (master)

dev at openvswitch.org dev at openvswitch.org
Thu Sep 27 16:13:04 UTC 2012


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Open vSwitch".

The branch, master has been updated
       via  3b4c362f4078549d9a3bf18a2393e12e4b3ff9f7 (commit)
      from  f89b7ce502441c9b71ac469846049ecacabcd888 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 3b4c362f4078549d9a3bf18a2393e12e4b3ff9f7
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=3b4c362f4078549d9a3bf18a2393e12e4b3ff9f7
Author: Isaku Yamahata <yamahata at valinux.co.jp>
		
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 at valinux.co.jp>
Signed-off-by: Ben Pfaff <blp at nicira.com>


-----------------------------------------------------------------------

Summary of changes:
 python/ovs/db/idl.py |    3 +++
 tests/ovsdb-idl.at   |    9 +++++++++
 tests/test-ovsdb.py  |    8 ++++++++
 3 files changed, 20 insertions(+), 0 deletions(-)


hooks/post-receive
-- 
Open vSwitch



More information about the git mailing list