diff --git a/SOURCES/bz1957762-fence_azure_arm-fix-MSI-support.patch b/SOURCES/bz1957762-fence_azure_arm-fix-MSI-support.patch new file mode 100644 index 0000000..5e33400 --- /dev/null +++ b/SOURCES/bz1957762-fence_azure_arm-fix-MSI-support.patch @@ -0,0 +1,75 @@ +From 2c9ee29d1e28dbdd5e305156ae70451e31d976c0 Mon Sep 17 00:00:00 2001 +From: Oyvind Albrigtsen +Date: Thu, 4 Jun 2020 14:43:15 +0200 +Subject: [PATCH 1/2] fence_azure_arm: log metadata when debugging + +--- + lib/azure_fence.py.py | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/lib/azure_fence.py.py b/lib/azure_fence.py.py +index 7bb43adc..4e44ca9d 100644 +--- a/lib/azure_fence.py.py ++++ b/lib/azure_fence.py.py +@@ -41,6 +41,7 @@ def get_from_metadata(parameter): + import requests + try: + r = requests.get('http://169.254.169.254/metadata/instance?api-version=2017-08-01', headers = {"Metadata":"true"}) ++ logging.debug("metadata: " + str(r.json())) + return str(r.json()["compute"][parameter]) + except: + logging.warning("Not able to use metadata service. Am I running in Azure?") + +From e3e3199cbf35855c6ab512ac06d7249df94eb3e7 Mon Sep 17 00:00:00 2001 +From: Oyvind Albrigtsen +Date: Thu, 4 Jun 2020 14:43:52 +0200 +Subject: [PATCH 2/2] fence_azure_arm: fixes to make MSI support work + +--- + agents/azure_arm/fence_azure_arm.py | 3 ++- + tests/data/metadata/fence_azure_arm.xml | 4 ++-- + 2 files changed, 4 insertions(+), 3 deletions(-) + +diff --git a/agents/azure_arm/fence_azure_arm.py b/agents/azure_arm/fence_azure_arm.py +index be0d4034..6b1a3770 100755 +--- a/agents/azure_arm/fence_azure_arm.py ++++ b/agents/azure_arm/fence_azure_arm.py +@@ -184,7 +184,7 @@ def main(): + compute_client = None + network_client = None + +- device_opt = ["login", "passwd", "port", "resourceGroup", "tenantId", "subscriptionId", "network-fencing", "msi", "cloud"] ++ device_opt = ["login", "no_login", "no_password", "passwd", "port", "resourceGroup", "tenantId", "subscriptionId", "network-fencing", "msi", "cloud"] + + atexit.register(atexit_handler) + +@@ -222,6 +222,7 @@ def main(): + + try: + config = azure_fence.get_azure_config(options) ++ options["--resourceGroup"] = config.RGName + compute_client = azure_fence.get_azure_compute_client(config) + if "--network-fencing" in options: + network_client = azure_fence.get_azure_network_client(config) +diff --git a/tests/data/metadata/fence_azure_arm.xml b/tests/data/metadata/fence_azure_arm.xml +index 97ecfdba..7ea672af 100644 +--- a/tests/data/metadata/fence_azure_arm.xml ++++ b/tests/data/metadata/fence_azure_arm.xml +@@ -23,7 +23,7 @@ When using network fencing the reboot-action will cause a quick-return once the + + Fencing action + +- ++ + + + Application ID +@@ -58,7 +58,7 @@ When using network fencing the reboot-action will cause a quick-return once the + + Physical plug number on device, UUID or identification of machine + +- ++ + + + Application ID diff --git a/SPECS/fence-agents.spec b/SPECS/fence-agents.spec index 6c63cdb..12bc8da 100644 --- a/SPECS/fence-agents.spec +++ b/SPECS/fence-agents.spec @@ -67,7 +67,7 @@ Name: fence-agents Summary: Fence Agents for Red Hat Cluster Version: 4.2.1 -Release: 41%{?alphatag:.%{alphatag}}%{?dist}.3 +Release: 41%{?alphatag:.%{alphatag}}%{?dist}.4 License: GPLv2+ and LGPLv2+ Group: System Environment/Base URL: https://github.com/ClusterLabs/fence-agents @@ -138,6 +138,7 @@ Patch63: bz1832289-fence_aws-improve-catch-connectionerror.patch Patch64: bz1860545-fence_lpar-fix-long-user-host-issue.patch Patch65: bz1862024-fence_evacuate-support-private-flavors.patch Patch66: bz1905735-fence_aws-add-imdsv2-support.patch +Patch67: bz1957762-fence_azure_arm-fix-MSI-support.patch # bundle patches Patch1000: bz1568753-4-fence_gce-bundled-libs.patch Patch1001: bz1568753-5-%{oauth2client}-docs-build-fix.patch @@ -237,6 +238,7 @@ BuildRequires: python-six >= 1.6.1 %patch64 -p1 %patch65 -p1 %patch66 -p1 +%patch67 -p1 # prevent compilation of something that won't get used anyway sed -i.orig 's|FENCE_ZVM=1|FENCE_ZVM=0|' configure.ac @@ -1188,6 +1190,10 @@ The fence-agents-zvm package contains a fence agent for z/VM hypervisors %endif %changelog +* Wed May 12 2021 Oyvind Albrigtsen - 4.2.1-41.4 +- fence_azure_arm: fix MSI support + Resolves: rhbz#1957762 + * Mon Jan 4 2021 Oyvind Albrigtsen - 4.2.1-41.3 - fence_aws: add support for IMDSv2 Resolves: rhbz#1905735