File 0001-fence_azure_arm-fix-get-virtual-machines-call.patch of Package fence-agents.34594
--- a/agents/azure_arm/fence_azure_arm.py-orig 2024-07-04 12:34:38.266079588 +0200
+++ b/agents/azure_arm/fence_azure_arm.py 2024-07-04 12:38:01.867756816 +0200
@@ -1,5 +1,18 @@
-#!@PYTHON@ -tt
+#!/bin/sh
+# Next line is bilingual: it starts a comment in Python, and is a no-op in shell
+""":"
+
+# Find a suitable python interpreter. Look for python3.11 first and fallback to python otherwise
+for cmd in python3.11 python3 python ; do
+ command -v > /dev/null $cmd && exec $cmd $0 "$@"
+done
+
+echo "python not found" >2
+
+exit 1
+
+":"""
import sys, re, pexpect
import logging
import atexit
@@ -74,7 +87,10 @@
try:
vmStatus = compute_client.virtual_machines.get(rgName, vmName, "instanceView")
except Exception as e:
- fail_usage("Failed: %s" % e)
+ try:
+ vmStatus = compute_client.virtual_machines.get(rgName, vmName, expand="instanceView")
+ except Exception as e:
+ fail_usage("Failed: %s" % e)
for status in vmStatus.instance_view.statuses:
if status.code.startswith("PowerState"):