- Update to version 4.0.25+git.1509350522.8d6f8530 (bsc#1065966):
* Use Python 3 for all scripts * compute: Fix unfencing and ensure fencing occurs in partial up/down states * compute: Split out evacation functionality * compute: Handle differences in Nova API argument passing * fence_zvm: fix "uintptr_t" undeclared * fence_ifmib: fix README typo(s) - Add patch: * 0001-Use-Python-3-for-all-scripts-bsc-1065966.patch - Remove merged patches: * 0001-fence_compute-Only-list-nova-compute-services-when-g.patch * 0002-fence_compute-Don-t-list-hypervisors-but-nova-comput.patch * 0003-fence_compute-Do-not-override-domain-if-it-is-alread.patch * 0004-fence_compute-Fix-handling-of-domain-None.patch * 0005-fence_compute-Fix-fix_domain-to-not-return-too-early.patch * 0006-fence_compute-Fix-fix_plug_name-when-looking-if-plug.patch * 0007-fence_compute-Remove-duplicate-check-for-binary-name.patch * 0009-fence_compute-Fix-disabling-force_down-on-node-when-.patch OBS-URL: https://build.opensuse.org/package/show/network:ha-clustering:Factory/fence-agents?expand=0&rev=72
This commit is contained in:
parent
e7f138833c
commit
7a71d868fd
222
0001-Use-Python-3-for-all-scripts-bsc-1065966.patch
Normal file
222
0001-Use-Python-3-for-all-scripts-bsc-1065966.patch
Normal file
@ -0,0 +1,222 @@
|
||||
From 67d60e07804f59512bd673fdb5bc020c02c48bcc Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Kristoffer=20Gr=C3=B6nlund?= <krig@koru.se>
|
||||
Date: Wed, 1 Nov 2017 10:28:22 +0100
|
||||
Subject: [PATCH] Use Python 3 for all scripts (bsc#1065966)
|
||||
|
||||
---
|
||||
fence/agents/autodetect/autodetect.py | 2 +-
|
||||
fence/agents/autodetect/autodetect_test.py | 2 +-
|
||||
fence/agents/autodetect/fence_apc.py | 2 +-
|
||||
fence/agents/autodetect/fence_bladecenter.py | 2 +-
|
||||
fence/agents/autodetect/fence_brocade.py | 2 +-
|
||||
fence/agents/autodetect/fence_ilo_moonshot.py | 2 +-
|
||||
fence/agents/autodetect/fence_lpar.py | 2 +-
|
||||
fence/agents/autodetect/fencing.py | 2 +-
|
||||
fence/agents/lib/tests/test_fencing.py | 2 +-
|
||||
fence/agents/powerman/fence_powerman.py | 2 +-
|
||||
tests/fence_testing_test.py | 2 +-
|
||||
tests/test-apc2.py | 4 ++--
|
||||
tests/test-apc5.py | 4 ++--
|
||||
tests/test-drac4.py | 4 ++--
|
||||
tests/test-multi-apc2.py | 4 ++--
|
||||
tests/test.py | 4 ++--
|
||||
16 files changed, 21 insertions(+), 21 deletions(-)
|
||||
|
||||
diff --git a/fence/agents/autodetect/autodetect.py b/fence/agents/autodetect/autodetect.py
|
||||
index 24d9a731..366e5212 100755
|
||||
--- a/fence/agents/autodetect/autodetect.py
|
||||
+++ b/fence/agents/autodetect/autodetect.py
|
||||
@@ -1,4 +1,4 @@
|
||||
-#!/usr/bin/python
|
||||
+#!/usr/bin/python3
|
||||
|
||||
import pexpect
|
||||
import re
|
||||
diff --git a/fence/agents/autodetect/autodetect_test.py b/fence/agents/autodetect/autodetect_test.py
|
||||
index a18aaed0..462c469d 100755
|
||||
--- a/fence/agents/autodetect/autodetect_test.py
|
||||
+++ b/fence/agents/autodetect/autodetect_test.py
|
||||
@@ -1,4 +1,4 @@
|
||||
-#!/usr/bin/python
|
||||
+#!/usr/bin/python3
|
||||
|
||||
import unittest
|
||||
import autodetect as detect
|
||||
diff --git a/fence/agents/autodetect/fence_apc.py b/fence/agents/autodetect/fence_apc.py
|
||||
index c6dd106e..935f18e8 100644
|
||||
--- a/fence/agents/autodetect/fence_apc.py
|
||||
+++ b/fence/agents/autodetect/fence_apc.py
|
||||
@@ -1,4 +1,4 @@
|
||||
-#!/usr/bin/python -tt
|
||||
+#!/usr/bin/python3 -tt
|
||||
|
||||
#####
|
||||
##
|
||||
diff --git a/fence/agents/autodetect/fence_bladecenter.py b/fence/agents/autodetect/fence_bladecenter.py
|
||||
index d72c07f1..dbcdb0d8 100644
|
||||
--- a/fence/agents/autodetect/fence_bladecenter.py
|
||||
+++ b/fence/agents/autodetect/fence_bladecenter.py
|
||||
@@ -1,4 +1,4 @@
|
||||
-#!/usr/bin/python -tt
|
||||
+#!/usr/bin/python3 -tt
|
||||
|
||||
#####
|
||||
##
|
||||
diff --git a/fence/agents/autodetect/fence_brocade.py b/fence/agents/autodetect/fence_brocade.py
|
||||
index 5257bccb..f1df7a23 100644
|
||||
--- a/fence/agents/autodetect/fence_brocade.py
|
||||
+++ b/fence/agents/autodetect/fence_brocade.py
|
||||
@@ -1,4 +1,4 @@
|
||||
-#!/usr/bin/python -tt
|
||||
+#!/usr/bin/python3 -tt
|
||||
|
||||
import sys, re
|
||||
import atexit
|
||||
diff --git a/fence/agents/autodetect/fence_ilo_moonshot.py b/fence/agents/autodetect/fence_ilo_moonshot.py
|
||||
index e161ac65..a7e827bb 100644
|
||||
--- a/fence/agents/autodetect/fence_ilo_moonshot.py
|
||||
+++ b/fence/agents/autodetect/fence_ilo_moonshot.py
|
||||
@@ -1,4 +1,4 @@
|
||||
-#!/usr/bin/python -tt
|
||||
+#!/usr/bin/python3 -tt
|
||||
|
||||
import sys
|
||||
import atexit
|
||||
diff --git a/fence/agents/autodetect/fence_lpar.py b/fence/agents/autodetect/fence_lpar.py
|
||||
index 6676e1c6..59cc2213 100644
|
||||
--- a/fence/agents/autodetect/fence_lpar.py
|
||||
+++ b/fence/agents/autodetect/fence_lpar.py
|
||||
@@ -1,4 +1,4 @@
|
||||
-#!/usr/bin/python -tt
|
||||
+#!/usr/bin/python3 -tt
|
||||
|
||||
#####
|
||||
##
|
||||
diff --git a/fence/agents/autodetect/fencing.py b/fence/agents/autodetect/fencing.py
|
||||
index ea21ace1..5d891eee 100644
|
||||
--- a/fence/agents/autodetect/fencing.py
|
||||
+++ b/fence/agents/autodetect/fencing.py
|
||||
@@ -1,4 +1,4 @@
|
||||
-#!/usr/bin/python -tt
|
||||
+#!/usr/bin/python3 -tt
|
||||
|
||||
import sys, getopt, time, os, uuid, pycurl, stat
|
||||
import pexpect, re, syslog
|
||||
diff --git a/fence/agents/lib/tests/test_fencing.py b/fence/agents/lib/tests/test_fencing.py
|
||||
index 6ee93858..389e9746 100644
|
||||
--- a/fence/agents/lib/tests/test_fencing.py
|
||||
+++ b/fence/agents/lib/tests/test_fencing.py
|
||||
@@ -1,4 +1,4 @@
|
||||
-#!/usr/bin/python
|
||||
+#!/usr/bin/python3
|
||||
|
||||
import unittest
|
||||
import sys
|
||||
diff --git a/fence/agents/powerman/fence_powerman.py b/fence/agents/powerman/fence_powerman.py
|
||||
index 962fdb8f..7aeeaf12 100755
|
||||
--- a/fence/agents/powerman/fence_powerman.py
|
||||
+++ b/fence/agents/powerman/fence_powerman.py
|
||||
@@ -1,4 +1,4 @@
|
||||
-#!/usr/bin/env python
|
||||
+#!@PYTHON@ -tt
|
||||
import os
|
||||
import time
|
||||
from datetime import datetime
|
||||
diff --git a/tests/fence_testing_test.py b/tests/fence_testing_test.py
|
||||
index 36b2a5e0..9da9d0cf 100755
|
||||
--- a/tests/fence_testing_test.py
|
||||
+++ b/tests/fence_testing_test.py
|
||||
@@ -1,4 +1,4 @@
|
||||
-#!/usr/bin/python
|
||||
+#!/usr/bin/python3
|
||||
|
||||
import unittest
|
||||
import fence_testing
|
||||
diff --git a/tests/test-apc2.py b/tests/test-apc2.py
|
||||
index bb5aefd8..bc120dcb 100755
|
||||
--- a/tests/test-apc2.py
|
||||
+++ b/tests/test-apc2.py
|
||||
@@ -1,4 +1,4 @@
|
||||
-#!/usr/bin/python
|
||||
+#!/usr/bin/python3
|
||||
|
||||
from fence_testing import test_action
|
||||
|
||||
@@ -14,4 +14,4 @@ def main():
|
||||
test_action(DEVICE, ACT_LIST, "getopt")
|
||||
|
||||
if __name__ == "__main__":
|
||||
- main()
|
||||
\ No newline at end of file
|
||||
+ main()
|
||||
diff --git a/tests/test-apc5.py b/tests/test-apc5.py
|
||||
index 6cea3b1c..8c24ecf5 100755
|
||||
--- a/tests/test-apc5.py
|
||||
+++ b/tests/test-apc5.py
|
||||
@@ -1,4 +1,4 @@
|
||||
-#!/usr/bin/python
|
||||
+#!/usr/bin/python3
|
||||
|
||||
from fence_testing import test_action
|
||||
|
||||
@@ -14,4 +14,4 @@ def main():
|
||||
test_action(DEVICE, ACT_LIST, "getopt")
|
||||
|
||||
if __name__ == "__main__":
|
||||
- main()
|
||||
\ No newline at end of file
|
||||
+ main()
|
||||
diff --git a/tests/test-drac4.py b/tests/test-drac4.py
|
||||
index 75c24c51..d4b14cb2 100755
|
||||
--- a/tests/test-drac4.py
|
||||
+++ b/tests/test-drac4.py
|
||||
@@ -1,4 +1,4 @@
|
||||
-#!/usr/bin/python
|
||||
+#!/usr/bin/python3
|
||||
|
||||
from fence_testing import test_action
|
||||
|
||||
@@ -12,4 +12,4 @@ def main():
|
||||
test_action(DRAC4, ACT_ONOFF, "stdin")
|
||||
|
||||
if __name__ == "__main__":
|
||||
- main()
|
||||
\ No newline at end of file
|
||||
+ main()
|
||||
diff --git a/tests/test-multi-apc2.py b/tests/test-multi-apc2.py
|
||||
index 7ab9754d..1c03912e 100755
|
||||
--- a/tests/test-multi-apc2.py
|
||||
+++ b/tests/test-multi-apc2.py
|
||||
@@ -1,4 +1,4 @@
|
||||
-#!/usr/bin/python
|
||||
+#!/usr/bin/python3
|
||||
|
||||
from fence_testing import test_action
|
||||
|
||||
@@ -14,4 +14,4 @@ def main():
|
||||
test_action(DEVICE, ACT_LIST, "getopt")
|
||||
|
||||
if __name__ == "__main__":
|
||||
- main()
|
||||
\ No newline at end of file
|
||||
+ main()
|
||||
diff --git a/tests/test.py b/tests/test.py
|
||||
index 8e82ed98..4204fae5 100755
|
||||
--- a/tests/test.py
|
||||
+++ b/tests/test.py
|
||||
@@ -1,4 +1,4 @@
|
||||
-#!/usr/bin/python
|
||||
+#!/usr/bin/python3
|
||||
|
||||
from fence_testing import test_action
|
||||
|
||||
@@ -18,4 +18,4 @@ def main():
|
||||
test_action(DUMMYDEF, ACT_ONOFF, "getopt")
|
||||
|
||||
if __name__ == "__main__":
|
||||
- main()
|
||||
\ No newline at end of file
|
||||
+ main()
|
||||
--
|
||||
2.14.2
|
||||
|
@ -1,27 +0,0 @@
|
||||
From b6558964430c579b8a881807f43ec61fd38cd31b Mon Sep 17 00:00:00 2001
|
||||
From: Vincent Untz <vuntz@suse.com>
|
||||
Date: Thu, 4 Feb 2016 10:02:49 +0100
|
||||
Subject: [PATCH 1/9] fence_compute: Only list nova-compute services when
|
||||
getting status
|
||||
|
||||
We don't care about other services.
|
||||
---
|
||||
fence/agents/compute/fence_compute.py | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/fence/agents/compute/fence_compute.py b/fence/agents/compute/fence_compute.py
|
||||
index 1845cc4..6237f5e 100644
|
||||
--- a/fence/agents/compute/fence_compute.py
|
||||
+++ b/fence/agents/compute/fence_compute.py
|
||||
@@ -34,7 +34,7 @@ def get_power_status(_, options):
|
||||
|
||||
if nova:
|
||||
try:
|
||||
- services = nova.services.list(host=options["--plug"])
|
||||
+ 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":
|
||||
--
|
||||
2.10.1
|
||||
|
@ -1,84 +0,0 @@
|
||||
From 77a6ad6383ae1ffd26f771e394263e0d2fc4df5e Mon Sep 17 00:00:00 2001
|
||||
From: Vincent Untz <vuntz@suse.com>
|
||||
Date: Thu, 4 Feb 2016 09:59:43 +0100
|
||||
Subject: [PATCH 2/9] fence_compute: Don't list hypervisors but nova-compute
|
||||
services
|
||||
|
||||
Everything we do (evacuate, force_down) is on nova-compute services, so
|
||||
there's no reason to list hypervisors; just directly look for
|
||||
nova-compute services.
|
||||
|
||||
This matters as hypervisors are always FQDN, while nova service hosts
|
||||
can be short hostnames.
|
||||
---
|
||||
fence/agents/compute/fence_compute.py | 22 +++++++++++-----------
|
||||
1 file changed, 11 insertions(+), 11 deletions(-)
|
||||
|
||||
diff --git a/fence/agents/compute/fence_compute.py b/fence/agents/compute/fence_compute.py
|
||||
index 6237f5e..e38c7bb 100644
|
||||
--- a/fence/agents/compute/fence_compute.py
|
||||
+++ b/fence/agents/compute/fence_compute.py
|
||||
@@ -218,23 +218,23 @@ def fix_domain(options):
|
||||
if nova:
|
||||
# Find it in nova
|
||||
|
||||
- hypervisors = nova.hypervisors.list()
|
||||
- for hypervisor in hypervisors:
|
||||
- shorthost = hypervisor.hypervisor_hostname.split('.')[0]
|
||||
+ services = nova.services.list(binary="nova-compute")
|
||||
+ for service in services:
|
||||
+ shorthost = service.host.split('.')[0]
|
||||
|
||||
- if shorthost == hypervisor.hypervisor_hostname:
|
||||
+ if shorthost == service.host:
|
||||
# Nova is not using FQDN
|
||||
calculated = ""
|
||||
else:
|
||||
# Compute nodes are named as FQDN, strip off the hostname
|
||||
- calculated = hypervisor.hypervisor_hostname.replace(shorthost+".", "")
|
||||
+ calculated = service.host.replace(shorthost+".", "")
|
||||
|
||||
domains[calculated] = shorthost
|
||||
|
||||
if calculated == last_domain:
|
||||
# Avoid complaining for each compute node with the same name
|
||||
# One hopes they don't appear interleaved as A.com B.com A.com B.com
|
||||
- logging.debug("Calculated the same domain from: %s" % hypervisor.hypervisor_hostname)
|
||||
+ logging.debug("Calculated the same domain from: %s" % service.host)
|
||||
|
||||
elif "--domain" in options and options["--domain"] == calculated:
|
||||
# Supplied domain name is valid
|
||||
@@ -243,7 +243,7 @@ def fix_domain(options):
|
||||
elif "--domain" in options:
|
||||
# Warn in case nova isn't available at some point
|
||||
logging.warning("Supplied domain '%s' does not match the one calculated from: %s"
|
||||
- % (options["--domain"], hypervisor.hypervisor_hostname))
|
||||
+ % (options["--domain"], service.host))
|
||||
|
||||
last_domain = calculated
|
||||
|
||||
@@ -256,7 +256,7 @@ def fix_domain(options):
|
||||
|
||||
elif len(domains) == 1:
|
||||
logging.error("Overriding supplied domain '%s' does not match the one calculated from: %s"
|
||||
- % (options["--domain"], hypervisor.hypervisor_hostname))
|
||||
+ % (options["--domain"], service.host))
|
||||
options["--domain"] = last_domain
|
||||
return options["--domain"]
|
||||
|
||||
@@ -298,9 +298,9 @@ def get_plugs_list(_, options):
|
||||
result = {}
|
||||
|
||||
if nova:
|
||||
- hypervisors = nova.hypervisors.list()
|
||||
- for hypervisor in hypervisors:
|
||||
- longhost = hypervisor.hypervisor_hostname
|
||||
+ services = nova.services.list(binary="nova-compute")
|
||||
+ for service in services:
|
||||
+ longhost = service.host
|
||||
shorthost = longhost.split('.')[0]
|
||||
result[longhost] = ("", None)
|
||||
result[shorthost] = ("", None)
|
||||
--
|
||||
2.10.1
|
||||
|
@ -1,28 +0,0 @@
|
||||
From 6e6bb16ef33121603b6c7b958a7c96ddc8424877 Mon Sep 17 00:00:00 2001
|
||||
From: Vincent Untz <vuntz@suse.com>
|
||||
Date: Wed, 29 Jun 2016 09:42:56 +0200
|
||||
Subject: [PATCH 3/9] fence_compute: Do not override domain if it is already
|
||||
correct
|
||||
|
||||
---
|
||||
fence/agents/compute/fence_compute.py | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/fence/agents/compute/fence_compute.py b/fence/agents/compute/fence_compute.py
|
||||
index e38c7bb..470fd07 100644
|
||||
--- a/fence/agents/compute/fence_compute.py
|
||||
+++ b/fence/agents/compute/fence_compute.py
|
||||
@@ -254,8 +254,8 @@ def fix_domain(options):
|
||||
options["--domain"] = last_domain
|
||||
return options["--domain"]
|
||||
|
||||
- elif len(domains) == 1:
|
||||
- logging.error("Overriding supplied domain '%s' does not match the one calculated from: %s"
|
||||
+ elif len(domains) == 1 and options["--domain"] != last_domain:
|
||||
+ logging.error("Overriding supplied domain '%s' as it does not match the one calculated from: %s"
|
||||
% (options["--domain"], service.host))
|
||||
options["--domain"] = last_domain
|
||||
return options["--domain"]
|
||||
--
|
||||
2.10.1
|
||||
|
@ -1,58 +0,0 @@
|
||||
From 952c40fb84b182c3600f781ed6fe6373012424ef Mon Sep 17 00:00:00 2001
|
||||
From: Vincent Untz <vuntz@suse.com>
|
||||
Date: Wed, 29 Jun 2016 09:43:57 +0200
|
||||
Subject: [PATCH 4/9] fence_compute: Fix handling of domain == None
|
||||
|
||||
---
|
||||
fence/agents/compute/fence_compute.py | 13 ++++++-------
|
||||
1 file changed, 6 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/fence/agents/compute/fence_compute.py b/fence/agents/compute/fence_compute.py
|
||||
index 470fd07..3c19f02 100644
|
||||
--- a/fence/agents/compute/fence_compute.py
|
||||
+++ b/fence/agents/compute/fence_compute.py
|
||||
@@ -252,20 +252,18 @@ def fix_domain(options):
|
||||
|
||||
elif len(domains) == 1 and "--domain" not in options:
|
||||
options["--domain"] = last_domain
|
||||
- return options["--domain"]
|
||||
|
||||
elif len(domains) == 1 and options["--domain"] != last_domain:
|
||||
logging.error("Overriding supplied domain '%s' as it does not match the one calculated from: %s"
|
||||
% (options["--domain"], service.host))
|
||||
options["--domain"] = last_domain
|
||||
- return options["--domain"]
|
||||
|
||||
elif len(domains) > 1:
|
||||
logging.error("The supplied domain '%s' did not match any used inside nova: %s"
|
||||
% (options["--domain"], repr(domains)))
|
||||
sys.exit(1)
|
||||
|
||||
- return None
|
||||
+ return last_domain
|
||||
|
||||
def fix_plug_name(options):
|
||||
if options["--action"] == "list":
|
||||
@@ -275,14 +273,15 @@ def fix_plug_name(options):
|
||||
return
|
||||
|
||||
calculated = fix_domain(options)
|
||||
- short_plug = options["--plug"].split('.')[0]
|
||||
- logging.debug("Checking target '%s' against calculated domain '%s'"% (options["--plug"], options["--domain"]))
|
||||
|
||||
- if "--domain" not in options:
|
||||
+ if calculated is None or "--domain" not in options:
|
||||
# Nothing supplied and nova not available... what to do... nothing
|
||||
return
|
||||
|
||||
- elif options["--domain"] == "":
|
||||
+ short_plug = options["--plug"].split('.')[0]
|
||||
+ logging.debug("Checking target '%s' against calculated domain '%s'"% (options["--plug"], calculated))
|
||||
+
|
||||
+ if options["--domain"] == "":
|
||||
# Ensure any domain is stripped off since nova isn't using FQDN
|
||||
options["--plug"] = short_plug
|
||||
|
||||
--
|
||||
2.10.1
|
||||
|
@ -1,58 +0,0 @@
|
||||
From 02a40aed59e4d6bb48ccd28e7558d18b0d03e7c0 Mon Sep 17 00:00:00 2001
|
||||
From: Vincent Untz <vuntz@suse.com>
|
||||
Date: Wed, 29 Jun 2016 09:50:12 +0200
|
||||
Subject: [PATCH 5/9] fence_compute: Fix fix_domain to not return too early
|
||||
|
||||
We were returning from the loop, while we want the rest of the code to
|
||||
still execute (in case there are multiple domains in nova).
|
||||
|
||||
Also simplify the code...
|
||||
---
|
||||
fence/agents/compute/fence_compute.py | 14 +++++---------
|
||||
1 file changed, 5 insertions(+), 9 deletions(-)
|
||||
|
||||
diff --git a/fence/agents/compute/fence_compute.py b/fence/agents/compute/fence_compute.py
|
||||
index 3c19f02..d39c053 100644
|
||||
--- a/fence/agents/compute/fence_compute.py
|
||||
+++ b/fence/agents/compute/fence_compute.py
|
||||
@@ -229,24 +229,20 @@ def fix_domain(options):
|
||||
# Compute nodes are named as FQDN, strip off the hostname
|
||||
calculated = service.host.replace(shorthost+".", "")
|
||||
|
||||
- domains[calculated] = shorthost
|
||||
-
|
||||
if calculated == last_domain:
|
||||
# Avoid complaining for each compute node with the same name
|
||||
# One hopes they don't appear interleaved as A.com B.com A.com B.com
|
||||
logging.debug("Calculated the same domain from: %s" % service.host)
|
||||
+ continue
|
||||
|
||||
- elif "--domain" in options and options["--domain"] == calculated:
|
||||
- # Supplied domain name is valid
|
||||
- return
|
||||
+ domains[calculated] = service.host
|
||||
+ last_domain = calculated
|
||||
|
||||
- elif "--domain" in options:
|
||||
+ if "--domain" in options and options["--domain"] != calculated:
|
||||
# Warn in case nova isn't available at some point
|
||||
logging.warning("Supplied domain '%s' does not match the one calculated from: %s"
|
||||
% (options["--domain"], service.host))
|
||||
|
||||
- last_domain = calculated
|
||||
-
|
||||
if len(domains) == 0 and "--domain" not in options:
|
||||
logging.error("Could not calculate the domain names used by compute nodes in nova")
|
||||
|
||||
@@ -255,7 +251,7 @@ def fix_domain(options):
|
||||
|
||||
elif len(domains) == 1 and options["--domain"] != last_domain:
|
||||
logging.error("Overriding supplied domain '%s' as it does not match the one calculated from: %s"
|
||||
- % (options["--domain"], service.host))
|
||||
+ % (options["--domain"], domains[last_domain]))
|
||||
options["--domain"] = last_domain
|
||||
|
||||
elif len(domains) > 1:
|
||||
--
|
||||
2.10.1
|
||||
|
@ -1,30 +0,0 @@
|
||||
From 0525e0cfb9299c4d3f93fea8e3da785406b6c5d7 Mon Sep 17 00:00:00 2001
|
||||
From: Vincent Untz <vuntz@suse.com>
|
||||
Date: Wed, 29 Jun 2016 09:51:37 +0200
|
||||
Subject: [PATCH 6/9] fence_compute: Fix fix_plug_name when looking if plug has
|
||||
domain
|
||||
|
||||
We shouldn't check if the plug name contains the domain, but if it ends
|
||||
with the domain.
|
||||
---
|
||||
fence/agents/compute/fence_compute.py | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/fence/agents/compute/fence_compute.py b/fence/agents/compute/fence_compute.py
|
||||
index d39c053..0cdf685 100644
|
||||
--- a/fence/agents/compute/fence_compute.py
|
||||
+++ b/fence/agents/compute/fence_compute.py
|
||||
@@ -281,8 +281,8 @@ def fix_plug_name(options):
|
||||
# Ensure any domain is stripped off since nova isn't using FQDN
|
||||
options["--plug"] = short_plug
|
||||
|
||||
- elif options["--domain"] in options["--plug"]:
|
||||
- # Plug already contains the domain, don't re-add
|
||||
+ elif options["--plug"].endswith(options["--domain"]):
|
||||
+ # Plug already uses the domain, don't re-add
|
||||
return
|
||||
|
||||
else:
|
||||
--
|
||||
2.10.1
|
||||
|
@ -1,39 +0,0 @@
|
||||
From 06c939730ccfcdef24370b09066a718e85f9dddc Mon Sep 17 00:00:00 2001
|
||||
From: Vincent Untz <vuntz@suse.com>
|
||||
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
|
||||
|
@ -1,62 +0,0 @@
|
||||
From 6d2776559a5bb11b83e9703bed2aeec681207b78 Mon Sep 17 00:00:00 2001
|
||||
From: Vincent Untz <vuntz@suse.com>
|
||||
Date: Wed, 3 Feb 2016 13:45:52 +0100
|
||||
Subject: [PATCH 9/9] 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 | 30 +++++++++++++++---------------
|
||||
1 file changed, 15 insertions(+), 15 deletions(-)
|
||||
|
||||
diff --git a/fence/agents/compute/fence_compute.py b/fence/agents/compute/fence_compute.py
|
||||
index cb7dfe3..00a49cb 100644
|
||||
--- a/fence/agents/compute/fence_compute.py
|
||||
+++ b/fence/agents/compute/fence_compute.py
|
||||
@@ -159,23 +159,23 @@ def set_power_status(_, options):
|
||||
return
|
||||
|
||||
if options["--action"] == "on":
|
||||
- if get_power_status(_, options) != "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 force_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 force_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.10.1
|
||||
|
@ -1,4 +1,4 @@
|
||||
<servicedata>
|
||||
<service name="tar_scm">
|
||||
<param name="url">git://github.com/ClusterLabs/fence-agents.git</param>
|
||||
<param name="changesrevision">7bae40a0eb02ae4abb8a3d470397b94e08f0b88b</param></service></servicedata>
|
||||
<param name="changesrevision">f243cfc5d8fcae96bcbe7ee7fd64bbca120dfe18</param></service></servicedata>
|
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:bb8659cdaa9ac3a84d01842725c94a51359127080bb35a5e447e8d3de9110250
|
||||
size 214276
|
3
fence-agents-4.0.25+git.1509350522.8d6f8530.tar.xz
Normal file
3
fence-agents-4.0.25+git.1509350522.8d6f8530.tar.xz
Normal file
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:36b0cb8ad3f809c09cfb09e67b0f473ded145b4657fe22533bcdca317e42e52d
|
||||
size 216712
|
@ -1,3 +1,27 @@
|
||||
-------------------------------------------------------------------
|
||||
Wed Nov 01 08:59:33 UTC 2017 - kgronlund@suse.com
|
||||
|
||||
- Update to version 4.0.25+git.1509350522.8d6f8530 (bsc#1065966):
|
||||
* Use Python 3 for all scripts
|
||||
* compute: Fix unfencing and ensure fencing occurs in partial up/down states
|
||||
* compute: Split out evacation functionality
|
||||
* compute: Handle differences in Nova API argument passing
|
||||
* fence_zvm: fix "uintptr_t" undeclared
|
||||
* fence_ifmib: fix README typo(s)
|
||||
|
||||
- Add patch:
|
||||
* 0001-Use-Python-3-for-all-scripts-bsc-1065966.patch
|
||||
|
||||
- Remove merged patches:
|
||||
* 0001-fence_compute-Only-list-nova-compute-services-when-g.patch
|
||||
* 0002-fence_compute-Don-t-list-hypervisors-but-nova-comput.patch
|
||||
* 0003-fence_compute-Do-not-override-domain-if-it-is-alread.patch
|
||||
* 0004-fence_compute-Fix-handling-of-domain-None.patch
|
||||
* 0005-fence_compute-Fix-fix_domain-to-not-return-too-early.patch
|
||||
* 0006-fence_compute-Fix-fix_plug_name-when-looking-if-plug.patch
|
||||
* 0007-fence_compute-Remove-duplicate-check-for-binary-name.patch
|
||||
* 0009-fence_compute-Fix-disabling-force_down-on-node-when-.patch
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Sat Sep 9 16:53:49 UTC 2017 - kgronlund@suse.com
|
||||
|
||||
|
@ -23,26 +23,11 @@ Name: fence-agents
|
||||
Summary: Fence Agents for High Availability
|
||||
License: GPL-2.0 and LGPL-2.1
|
||||
Group: Productivity/Clustering/HA
|
||||
Version: 4.0.25+git.1501671877.7bae40a0
|
||||
Version: 4.0.25+git.1509350522.8d6f8530
|
||||
Release: 0
|
||||
Url: https://github.com/ClusterLabs/fence-agents
|
||||
Source0: %{name}-%{version}.tar.xz
|
||||
# PATCH-FIX-UPSTREAM: fence_compute: Only list nova-compute services when getting status
|
||||
Patch1: 0001-fence_compute-Only-list-nova-compute-services-when-g.patch
|
||||
# PATCH-FIX-UPSTREAM: fence_compute: On list, don't list hypervisors but nova-compute services
|
||||
Patch2: 0002-fence_compute-Don-t-list-hypervisors-but-nova-comput.patch
|
||||
# PATCH-FIX-UPSTREAM: fence_compute: Do not override domain if it is already correct
|
||||
Patch3: 0003-fence_compute-Do-not-override-domain-if-it-is-alread.patch
|
||||
# PATCH-FIX-UPSTREAM: fence_compute: Fix handling of domain == None
|
||||
Patch4: 0004-fence_compute-Fix-handling-of-domain-None.patch
|
||||
# PATCH-FIX-UPSTREAM: fence_compute: Fix fix_domain to not return too early
|
||||
Patch5: 0005-fence_compute-Fix-fix_domain-to-not-return-too-early.patch
|
||||
# PATCH-FIX-UPSTREAM: fence_compute: Fix fix_plug_name when looking if plug has domain
|
||||
Patch6: 0006-fence_compute-Fix-fix_plug_name-when-looking-if-plug.patch
|
||||
# PATCH-FIX-UPSTREAM: fence_compute: Remove duplicate check for binary name
|
||||
Patch7: 0007-fence_compute-Remove-duplicate-check-for-binary-name.patch
|
||||
# PATCH-FIX-UPSTREAM: fence_compute: Fix disabling force_down on node when action is on
|
||||
Patch9: 0009-fence_compute-Fix-disabling-force_down-on-node-when-.patch
|
||||
Patch1: 0001-Use-Python-3-for-all-scripts-bsc-1065966.patch
|
||||
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
BuildRequires: autoconf
|
||||
@ -110,18 +95,11 @@ development.
|
||||
%prep
|
||||
%setup -q -n %{name}-%{version}
|
||||
%patch1 -p1
|
||||
%patch2 -p1
|
||||
%patch3 -p1
|
||||
%patch4 -p1
|
||||
%patch5 -p1
|
||||
%patch6 -p1
|
||||
%patch7 -p1
|
||||
%patch9 -p1
|
||||
|
||||
%build
|
||||
CFLAGS="${CFLAGS} ${RPM_OPT_FLAGS}"
|
||||
export CFLAGS
|
||||
PYTHON="%{_bindir}/env python3"
|
||||
PYTHON="%{_bindir}/python3"
|
||||
export PYTHON
|
||||
./autogen.sh
|
||||
%{configure} --with-agents='%{agent_list}'
|
||||
|
Loading…
Reference in New Issue
Block a user