fence-agents/0004-fence_compute-Fix-disabling-force_down-on-node-when-.patch
Kristoffer Gronlund 88cb20e9f5 - Update to version 4.0.22+git.1455008135.15c5e92:
+ fence_cisco_ucs: Obtain status of device from different endpoint
  + fence_cisco_ucs: Add --missing-as-off
- Patches for fence_compute (fate#320346)
  - fence_compute: Add --insecure command line argument
  - fence_compute: Add --region-name command line argument
  - fence_compute: Create nova client with API 2.11
  - fence_compute: Fix disabling force_down on node when action is on
  - fence_compute: Evacuate instances on all tenants
  - fence_compute: On list, don't list hypervisors but nova-compute services
  - fence_compute: Only list nova-compute services when getting status
  - fence_compute: Deprecate the domain option
- Add 0001-fence_compute-Add-insecure-command-line-argument.patch
- Add 0002-fence_compute-Add-region-name-command-line-argument.patch
- Add 0003-fence_compute-Create-nova-client-with-API-2.11.patch
- Add 0004-fence_compute-Fix-disabling-force_down-on-node-when-.patch
- Add 0005-fence_compute-Evacuate-instances-on-all-tenants.patch
- Add 0006-fence_compute-On-list-don-t-list-hypervisors-but-nov.patch
- Add 0007-fence_compute-Only-list-nova-compute-services-when-g.patch
- Add 0008-fence_compute-Deprecate-the-domain-option.patch

OBS-URL: https://build.opensuse.org/package/show/network:ha-clustering:Factory/fence-agents?expand=0&rev=49
2016-02-22 09:28:31 +00:00

62 lines
2.5 KiB
Diff

From 6cbbe5d9e81ddeee91d06660f27a4a51117aa0ed Mon Sep 17 00:00:00 2001
From: Vincent Untz <vuntz@suse.com>
Date: Wed, 3 Feb 2016 13:45:52 +0100
Subject: [PATCH 4/8] fence_compute: Fix disabling force_down on node when
action is on
When the action is on, the goal is to disable force_down for the
nova-compute service on the node.
However, we were only doing that if the nova-compute service was up;
which is impossible if it's forced to be down... So just always disable
force_down, and then, if it's up, do more things.
---
fence/agents/compute/fence_compute.py | 28 ++++++++++++++--------------
1 file changed, 14 insertions(+), 14 deletions(-)
diff --git a/fence/agents/compute/fence_compute.py b/fence/agents/compute/fence_compute.py
index b443a3c..feb86c0 100644
--- a/fence/agents/compute/fence_compute.py
+++ b/fence/agents/compute/fence_compute.py
@@ -148,23 +148,23 @@ def set_power_status(_, options):
return
if options["--action"] == "on":
+ try:
+ # Forcing the host back up
+ nova.services.force_down(
+ options["--plug"], "nova-compute", force_down=False)
+ except Exception as e:
+ # In theory, if foce_down=False fails, that's for the exact
+ # same possible reasons that below with force_down=True
+ # eg. either an incompatible version or an old client.
+ # Since it's about forcing back to a default value, there is
+ # no real worries to just consider it's still okay even if the
+ # command failed
+ logging.info("Exception from attempt to force "
+ "host back up via nova API: "
+ "%s: %s" % (e.__class__.__name__, e))
if get_power_status(_, options) == "on":
# Forcing the service back up in case it was disabled
nova.services.enable(options["--plug"], 'nova-compute')
- try:
- # Forcing the host back up
- nova.services.force_down(
- options["--plug"], "nova-compute", force_down=False)
- except Exception as e:
- # In theory, if foce_down=False fails, that's for the exact
- # same possible reasons that below with force_down=True
- # eg. either an incompatible version or an old client.
- # Since it's about forcing back to a default value, there is
- # no real worries to just consider it's still okay even if the
- # command failed
- logging.info("Exception from attempt to force "
- "host back up via nova API: "
- "%s: %s" % (e.__class__.__name__, e))
else:
# Pretend we're 'on' so that the fencing library doesn't loop forever waiting for the node to boot
override_status = "on"
--
2.6.2