summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2013-02-12 13:32:29 +0000
committerGerrit Code Review <review@openstack.org>2013-02-12 13:32:29 +0000
commit31f08a3869f3f88fa0cc3af48b920bda0394f4c5 (patch)
tree501d342fa43fe110ace5e09661db27788b47c9fc
parentb1073d92e9587ef51bc0a25db46a90a1820c6743 (diff)
parent9e208ae6e3cfe3b1dfea56f36d73c413b1952acd (diff)
downloadnova-31f08a3869f3f88fa0cc3af48b920bda0394f4c5.tar.gz
nova-31f08a3869f3f88fa0cc3af48b920bda0394f4c5.tar.xz
nova-31f08a3869f3f88fa0cc3af48b920bda0394f4c5.zip
Merge "Use ServiceGroup API to show node liveness"
-rwxr-xr-xbin/nova-manage5
1 files changed, 3 insertions, 2 deletions
diff --git a/bin/nova-manage b/bin/nova-manage
index c793fed16..6e8aa8a9c 100755
--- a/bin/nova-manage
+++ b/bin/nova-manage
@@ -87,6 +87,7 @@ from nova.openstack.common import rpc
from nova.openstack.common import timeutils
from nova import quota
from nova.scheduler import rpcapi as scheduler_rpcapi
+from nova import servicegroup
from nova import utils
from nova import version
@@ -624,6 +625,7 @@ class ServiceCommands(object):
"""
Show a list of all running services. Filter by host & service name.
"""
+ servicegroup_api = servicegroup.API()
ctxt = context.get_admin_context()
now = timeutils.utcnow()
services = db.service_get_all(ctxt)
@@ -641,8 +643,7 @@ class ServiceCommands(object):
_('State'),
_('Updated_At'))
for svc in services:
- delta = now - (svc['updated_at'] or svc['created_at'])
- alive = abs(utils.total_seconds(delta)) <= CONF.service_down_time
+ alive = servicegroup_api.service_is_up(svc)
art = (alive and ":-)") or "XXX"
active = 'enabled'
if svc['disabled']: