]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commit
Modify VO so that obj.get always defaults to None
authorRyan McNair <rdmcnair@us.ibm.com>
Wed, 16 Dec 2015 04:10:37 +0000 (04:10 +0000)
committerRyan McNair <rdmcnair@us.ibm.com>
Wed, 16 Dec 2015 04:32:38 +0000 (04:32 +0000)
commit90cf88d5c9f722f7a679a6c50744384b11e82362
treef2298409669825232af885868a8678da33b9e08e
parentb353731d5cd53fd9bd175a14fb030905c4546668
Modify VO so that obj.get always defaults to None

Currently, CinderObjectDictCompat.get will default to None if a field
is not in the object, however if a field is present in the object
but the value is not yet set we get an error instead of None. To be
consistent with dict.get() we should default to None if the field
is not present or not set.

Change-Id: Id87efeaaeb2fb44960d8d0df9aa854dd156bff45
cinder/objects/base.py
cinder/tests/unit/objects/test_base.py