diff options
| author | Jenkins <jenkins@review.openstack.org> | 2013-04-10 22:32:02 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2013-04-10 22:32:02 +0000 |
| commit | 7abb96db7410f0e46be3e470cb282d385a8964f3 (patch) | |
| tree | 2fda24cd54832b81330f286743a747968deb01fe /nova/db | |
| parent | 32456dc736b834eab1d534eecca5edeef5086d6d (diff) | |
| parent | ba9cd2a545a0c198990f649b6a2985a22102930f (diff) | |
Merge "Change DB API instance functions for selective metadata fetching"
Diffstat (limited to 'nova/db')
| -rw-r--r-- | nova/db/api.py | 4 | ||||
| -rw-r--r-- | nova/db/sqlalchemy/api.py | 5 |
2 files changed, 5 insertions, 4 deletions
diff --git a/nova/db/api.py b/nova/db/api.py index 19a5e1f5f..c1d28e33a 100644 --- a/nova/db/api.py +++ b/nova/db/api.py @@ -624,9 +624,9 @@ def instance_get_active_by_window_joined(context, begin, end=None, project_id, host) -def instance_get_all_by_host(context, host): +def instance_get_all_by_host(context, host, columns_to_join=None): """Get all instances belonging to a host.""" - return IMPL.instance_get_all_by_host(context, host) + return IMPL.instance_get_all_by_host(context, host, columns_to_join) def instance_get_all_by_host_and_node(context, host, node): diff --git a/nova/db/sqlalchemy/api.py b/nova/db/sqlalchemy/api.py index 035779e41..ab7646c41 100644 --- a/nova/db/sqlalchemy/api.py +++ b/nova/db/sqlalchemy/api.py @@ -1842,9 +1842,10 @@ def _instance_get_all_query(context, project_only=False, joins=None): @require_admin_context -def instance_get_all_by_host(context, host): +def instance_get_all_by_host(context, host, columns_to_join=None): return _instances_fill_metadata(context, - _instance_get_all_query(context).filter_by(host=host).all()) + _instance_get_all_query(context).filter_by(host=host).all(), + manual_joins=columns_to_join) @require_admin_context |
