Some callers of instance_get_all_by_host are passing
in columns_to_join=[], like the _sync_scheduler_instance_info
periodic task in the compute manager, to avoid unnecessary
joins with other tables.
The problem was columns_to_join wasn't being passed through
to _instance_get_all_query which builds the actual query
method, and defaults to join on info_cache and security_groups.
This fixes the problem by passing through columns_to_join and
provides tests to show it working both with and without the joins.
Change-Id: I69f2ddca8fb0935e03b0f426891d01360940a85a
Closes-Bug: #1680616
(cherry picked from commit d52bcc616f2d1c0df7bad8a6f5a00adc7ad1fb27)
Reviewed: https:/ /review. openstack. org/511682 /git.openstack. org/cgit/ openstack/ nova/commit/ ?id=e2c2b1d586f 4e24f0e4f3fc760 c687e03c501ec7
Committed: https:/
Submitter: Zuul
Branch: stable/ocata
commit e2c2b1d586f4e24 f0e4f3fc760c687 e03c501ec7
Author: Matt Riedemann <email address hidden>
Date: Thu Apr 6 17:59:34 2017 -0400
Fix joins in instance_ get_all_ by_host
Some callers of instance_ get_all_ by_host are passing _instance_ info
in columns_to_join=[], like the _sync_scheduler
periodic task in the compute manager, to avoid unnecessary
joins with other tables.
The problem was columns_to_join wasn't being passed through get_all_ query which builds the actual query
to _instance_
method, and defaults to join on info_cache and security_groups.
This fixes the problem by passing through columns_to_join and
provides tests to show it working both with and without the joins.
Change-Id: I69f2ddca8fb093 5e03b0f426891d0 1360940a85a df7bad8a6f5a00a dc7ad1fb27)
Closes-Bug: #1680616
(cherry picked from commit d52bcc616f2d1c0