summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVishvananda Ishaya <vishvananda@yahoo.com>2010-09-03 00:53:41 -0700
committerVishvananda Ishaya <vishvananda@yahoo.com>2010-09-03 00:53:41 -0700
commit22aa51638dc221e78de60f7e2ddb10eb0ddf4db3 (patch)
tree9ec3aa9f6099f31498a1eb412b2221b18916d56e
parentbc1271761a5677280a8fc67edcb7b60419812e99 (diff)
downloadnova-22aa51638dc221e78de60f7e2ddb10eb0ddf4db3.tar.gz
nova-22aa51638dc221e78de60f7e2ddb10eb0ddf4db3.tar.xz
nova-22aa51638dc221e78de60f7e2ddb10eb0ddf4db3.zip
removed extra file and updated sql note
-rwxr-xr-xbin/nova-listinstances38
-rw-r--r--nova/db/sqlalchemy/api.py1
2 files changed, 1 insertions, 38 deletions
diff --git a/bin/nova-listinstances b/bin/nova-listinstances
deleted file mode 100755
index 386283d2f..000000000
--- a/bin/nova-listinstances
+++ /dev/null
@@ -1,38 +0,0 @@
-#!/usr/bin/env python
-# vim: tabstop=4 shiftwidth=4 softtabstop=4
-
-# Copyright (c) 2010 Openstack, LLC.
-#
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License. You may obtain
-# a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations
-# under the License.
-
-#
-# Duplicates the functionality of euca-describe-instances, but doesn't require
-# going through the API. Does a direct query to the datastore. This is
-# mostly a test program written for the scheduler
-#
-
-"""
-List instances by doing a direct query to the datastore
-"""
-
-from nova.compute import model
-
-data_needed = ['image_id', 'memory_kb', 'local_gb', 'node_name', 'vcpus']
-
-instances = model.InstanceDirectory().all
-
-for instance in instances:
- print 'Instance: %s' % instance['instance_id']
- for x in data_needed:
- print ' %s: %s' % (x, instance[x])
-
diff --git a/nova/db/sqlalchemy/api.py b/nova/db/sqlalchemy/api.py
index 4ae55eaf4..4fa85b74b 100644
--- a/nova/db/sqlalchemy/api.py
+++ b/nova/db/sqlalchemy/api.py
@@ -69,6 +69,7 @@ def service_get_all_compute_sorted(context):
# FROM services LEFT OUTER JOIN
# (SELECT host, count(*) AS instance_count
# FROM instances GROUP BY host) AS inst_count
+ # ON services.host == inst_count.host
topic = 'compute'
label = 'instance_count'
subq = session.query(models.Instance.host,