diff options
Diffstat (limited to 'nova/db')
| -rw-r--r-- | nova/db/sqlalchemy/api.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/nova/db/sqlalchemy/api.py b/nova/db/sqlalchemy/api.py index 0946d0b19..2e390a2ff 100644 --- a/nova/db/sqlalchemy/api.py +++ b/nova/db/sqlalchemy/api.py @@ -331,7 +331,8 @@ def service_destroy(context, service_id): service_ref = service_get(context, service_id, session=session) service_ref.delete(session=session) - if service_ref.topic == 'compute' and service_ref.compute_node: + if (service_ref.topic == FLAGS.compute_topic and + service_ref.compute_node): for c in service_ref.compute_node: c.delete(session=session) @@ -387,7 +388,7 @@ def service_get_all_compute_by_host(context, host): result = model_query(context, models.Service, read_deleted="no").\ options(joinedload('compute_node')).\ filter_by(host=host).\ - filter_by(topic="compute").\ + filter_by(topic=FLAGS.compute_topic).\ all() if not result: @@ -420,7 +421,7 @@ def service_get_all_compute_sorted(context): # (SELECT host, SUM(instances.vcpus) AS instance_cores # FROM instances GROUP BY host) AS inst_cores # ON services.host = inst_cores.host - topic = 'compute' + topic = FLAGS.compute_topic label = 'instance_cores' subq = model_query(context, models.Instance.host, func.sum(models.Instance.vcpus).label(label), @@ -438,7 +439,7 @@ def service_get_all_compute_sorted(context): def service_get_all_volume_sorted(context): session = get_session() with session.begin(): - topic = 'volume' + topic = FLAGS.volume_topic label = 'volume_gigabytes' subq = model_query(context, models.Volume.host, func.sum(models.Volume.size).label(label), |
