python: Fix writing to non-"alert" column for newly inserted row.
authorSumit Garg <sumit@extremenetworks.com>
Thu, 25 Jun 2015 15:51:42 +0000 (08:51 -0700)
committerBen Pfaff <blp@nicira.com>
Thu, 25 Jun 2015 15:54:29 +0000 (08:54 -0700)
commite2695ccb9c8d16cfc41925ef9c780b79ba1cd25d
treeb4299ac546f418b080f09af5f8bc67cc51bece09
parent17e6ef35a02a8933b05225cd7a9482c21ae2fc84
python: Fix writing to non-"alert" column for newly inserted row.

When 'alert' was turned off on a column, the code was erroring out when
value for that column was being set in a newly inserted row. This is
because the row._data was None at this time.

It seems that new rows are not initialized to defaults and that's why the
NULL error happens.  IMO a newly inserted row should automatically get
intialized to default values.  This new behavior can be implemented as a
separate improvement sometime in the future.

For now, I don't see an issue with adding the additional check. This new
check can continue as-is even after the new behavior is implemented.

Signed-off-by: Sumit Garg <sumit@extremenetworks.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
python/ovs/db/idl.py