fence-agents/0002-fence_compute-Keep-compatibility-with-python-novacli.patch
Kristoffer Gronlund 9cf0a96d50 - Update to version 4.0.23:
* A lot of changes in fence_compute (OpenStack compute instance)
  * Obtain status of nodes from Cisco UCS correctly
  * New fence agent for AMT using openwsman
  * Python3 support
  * Fence agent for PVE can be used by non-root users
  * Parallel building and testing of fence agents
  * Fix occasional failures of APC fence agent
- Updated fence_compute patch set:
  - Add 0001-fence_compute-Create-nova-client-with-API-2.11.patch
  - Add 0002-fence_compute-Keep-compatibility-with-python-novacli.patch
  - Add 0003-fence_compute-Only-list-nova-compute-services-when-g.patch
  - Add 0004-fence_compute-Don-t-list-hypervisors-but-nova-comput.patch
  - Add 0005-fence_compute-Do-not-override-domain-if-it-is-alread.patch
  - Add 0006-fence_compute-Fix-use-of-undefined-variable.patch
  - Add 0007-fence_compute-Fix-fix_domain-to-not-return-too-early.patch
  - Add 0008-fence_compute-Fix-fix_plug_name-when-looking-if-plug.patch
  - Add 0009-fence_compute-Fix-disabling-force_down-on-node-when-.patch
  - Remove 0001-fence_compute-Add-insecure-command-line-argument.patch
  - Remove 0002-fence_compute-Add-region-name-command-line-argument.patch
  - Remove 0003-fence_compute-Create-nova-client-with-API-2.11.patch
  - Remove 0004-fence_compute-Fix-disabling-force_down-on-node-when-.patch
  - Remove 0005-fence_compute-Evacuate-instances-on-all-tenants.patch
  - Remove 0006-fence_compute-On-list-don-t-list-hypervisors-but-nov.patch
  - Remove 0007-fence_compute-Only-list-nova-compute-services-when-g.patch
  - Remove 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=52
2016-06-30 10:01:27 +00:00

47 lines
1.3 KiB
Diff

From 29425375744cc04d85a1e25a839de47593913c87 Mon Sep 17 00:00:00 2001
From: Vincent Untz <vuntz@suse.com>
Date: Wed, 23 Mar 2016 11:03:24 +0100
Subject: [PATCH 2/9] fence_compute: Keep compatibility with python-novaclient
<= 2.26.0
---
fence/agents/compute/fence_compute.py | 15 ++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)
diff --git a/fence/agents/compute/fence_compute.py b/fence/agents/compute/fence_compute.py
index a4f62dc..265a347 100644
--- a/fence/agents/compute/fence_compute.py
+++ b/fence/agents/compute/fence_compute.py
@@ -324,7 +324,12 @@ def main():
run_delay(options)
try:
- from novaclient import client as nova_client
+ from distutils.version import LooseVersion
+ except ImportError:
+ fail_usage("distutils not found or not accessible")
+
+ try:
+ import novaclient
except ImportError:
fail_usage("nova not found or not accessible")
@@ -347,8 +352,12 @@ def main():
elif options["--action"] in ["monitor", "status"]:
sys.exit(0)
- # The first argument is the Nova client version
- nova = nova_client.Client('2.11',
+ if LooseVersion(novaclient.__version__) <= LooseVersion('2.26.0') :
+ api_version = '2'
+ else:
+ api_version = '2.11'
+
+ nova = novaclient.client.Client(api_version,
options["--username"],
options["--password"],
options["--tenant-name"],
--
2.8.3