Merge "Fix uses of service_get_all_compute_by_host"

This commit is contained in:
Jenkins 2013-01-14 19:54:21 +00:00 committed by Gerrit Code Review
commit 635d250f16
2 changed files with 8 additions and 5 deletions

View File

@ -151,9 +151,12 @@ def service_get_all_by_host(context, host):
return IMPL.service_get_all_by_host(context, host)
def service_get_all_compute_by_host(context, host):
"""Get all compute services for a given host."""
return IMPL.service_get_all_compute_by_host(context, host)
def service_get_by_compute_host(context, host):
"""Get the service entry for a given compute host.
Returns the service entry joined with the compute_node entry.
"""
return IMPL.service_get_by_compute_host(context, host)
def service_get_all_compute_sorted(context):

View File

@ -370,12 +370,12 @@ def service_get_all_by_host(context, host):
@require_admin_context
def service_get_all_compute_by_host(context, host):
def service_get_by_compute_host(context, host):
result = model_query(context, models.Service, read_deleted="no").\
options(joinedload('compute_node')).\
filter_by(host=host).\
filter_by(topic=CONF.compute_topic).\
all()
first()
if not result:
raise exception.ComputeHostNotFound(host=host)