commit 0aecc86987794e3cb433723afbec744a11e1e720
Author: Chris Friesen <email address hidden>
Date: Tue Mar 25 08:29:58 2014 -0600
Add missing test for None in sqlalchemy query filter
In sqlalchemy a comparison against a non-null value will not match
null values, so the existing code at the end of
db.sqlalchemy.api.instance_get_all_by_filters() will not return
instances where vm_state is NULL.
This would be fine if the vm_state could never be null, but it
is declared as "nullable" in the Instance object. In many cases
"vm_state" will in fact have a value, but not all--in
get_test_instance() in test/utils.py the value of "vm_state" is not
specified. There may be other similar cases.
Accordingly, this commit updates the test to explicitly check for None.
Without this fix the unit tests for bug 1292963 will fail because
the test instances have a vm_state of None.
Reviewed: https:/ /review. openstack. org/82869 /git.openstack. org/cgit/ openstack/ nova/commit/ ?id=0aecc869877 94e3cb433723afb ec744a11e1e720
Committed: https:/
Submitter: Jenkins
Branch: master
commit 0aecc86987794e3 cb433723afbec74 4a11e1e720
Author: Chris Friesen <email address hidden>
Date: Tue Mar 25 08:29:58 2014 -0600
Add missing test for None in sqlalchemy query filter
In sqlalchemy a comparison against a non-null value will not match sqlalchemy. api.instance_ get_all_ by_filters( ) will not return
null values, so the existing code at the end of
db.
instances where vm_state is NULL.
This would be fine if the vm_state could never be null, but it test_instance( ) in test/utils.py the value of "vm_state" is not
is declared as "nullable" in the Instance object. In many cases
"vm_state" will in fact have a value, but not all--in
get_
specified. There may be other similar cases.
Accordingly, this commit updates the test to explicitly check for None.
Without this fix the unit tests for bug 1292963 will fail because
the test instances have a vm_state of None.
Closes-Bug: 1294756 fd0e76abadefd0f e06d32c3227
Related-Bug: 1292963
Change-Id: I271cff22dec160