From 06c939730ccfcdef24370b09066a718e85f9dddc Mon Sep 17 00:00:00 2001 From: Vincent Untz Date: Tue, 18 Oct 2016 16:35:52 +0200 Subject: [PATCH 7/9] fence_compute: Remove duplicate check for binary name We already do the filtering on the server side. --- fence/agents/compute/fence_compute.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/fence/agents/compute/fence_compute.py b/fence/agents/compute/fence_compute.py index 0cdf685..cb7dfe3 100644 --- a/fence/agents/compute/fence_compute.py +++ b/fence/agents/compute/fence_compute.py @@ -37,14 +37,13 @@ def get_power_status(_, options): services = nova.services.list(host=options["--plug"], binary="nova-compute") for service in services: logging.debug("Status of %s is %s" % (service.binary, service.state)) - if service.binary == "nova-compute": - if service.state == "up": - status = "on" - elif service.state == "down": - status = "off" - else: - logging.debug("Unknown status detected from nova: " + service.state) - break + if service.state == "up": + status = "on" + elif service.state == "down": + status = "off" + else: + logging.debug("Unknown status detected from nova: " + service.state) + break except requests.exception.ConnectionError as err: logging.warning("Nova connection failed: " + str(err)) return status -- 2.10.1