Merge ~racb/ubuntu/+source/fence-agents:azure-api-fix into ubuntu/+source/fence-agents:ubuntu/devel

Proposed by Robie Basak
Status: Merged
Merged at revision: 9875c5e7c010f396fc0327b5f2731680b8838e93
Proposed branch: ~racb/ubuntu/+source/fence-agents:azure-api-fix
Merge into: ubuntu/+source/fence-agents:ubuntu/devel
Diff against target: 84 lines (+62/-0)
3 files modified
debian/changelog (+8/-0)
debian/patches/fence_azure_arm-fix-get-virtual-machines-call (+53/-0)
debian/patches/series (+1/-0)
Reviewer Review Type Date Requested Status
Robie Basak Approve
Canonical Server Reporter Pending
Review via email: mp+464436@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Robie Basak (racb) wrote :

Test build at ppa:racb/experimental

I'm still testing this. Feel free to review or ask me to hold if you think appropriate, but since it's trivial I will self-accept as soon as I'm done testing.

Revision history for this message
Robie Basak (racb) wrote :

Self-approving as the fix is trivial, and uploaded.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/debian/changelog b/debian/changelog
2index 5765348..a0f9397 100644
3--- a/debian/changelog
4+++ b/debian/changelog
5@@ -1,3 +1,11 @@
6+fence-agents (4.12.1-2~exp1ubuntu4) noble; urgency=medium
7+
8+ * d/p/fence_azure_arm-fix-get-virtual-machines-call: fix get virtual machines
9+ call to match API changes in python3-azure. This fixes the otherwise
10+ completely broken Azure fence agent.
11+
12+ -- Robie Basak <robie.basak@ubuntu.com> Tue, 16 Apr 2024 13:38:28 +0000
13+
14 fence-agents (4.12.1-2~exp1ubuntu3) noble; urgency=high
15
16 * No change rebuild for 64-bit time_t and frame pointers.
17diff --git a/debian/patches/fence_azure_arm-fix-get-virtual-machines-call b/debian/patches/fence_azure_arm-fix-get-virtual-machines-call
18new file mode 100644
19index 0000000..b7f2188
20--- /dev/null
21+++ b/debian/patches/fence_azure_arm-fix-get-virtual-machines-call
22@@ -0,0 +1,53 @@
23+From 3f3655e8370067fd4a133592a75778778c8e6eef Mon Sep 17 00:00:00 2001
24+From: Javier Cano Cano <jcanocan@redhat.com>
25+Date: Wed, 11 Oct 2023 15:12:14 +0200
26+Subject: [PATCH] fence_azure_arm: fix get virtual machines call
27+
28+The function virtual_machines.get() has changed it's signature from:
29+
30+```
31+def get(
32+ self,
33+ resource_group_name,
34+ expand=None,
35+ **kwargs
36+):
37+```
38+to:
39+
40+```
41+def get(
42+ self,
43+ resource_group_name: str,
44+ machine_name: str,
45+ expand: Optional[Union[str, _models.InstanceViewTypes]] = None,
46+ **kwargs: Any
47+ ) -> _models.Machine:
48+```
49+
50+Therefore, the number of positional arguments has been reduced to two:
51+`resource_group_name` and `machine_name`, while the `expand`
52+parameter has swift from a *positional argument* to a *keyword-only
53+argument*.
54+
55+Signed-off-by: Javier Cano Cano <jcanocan@redhat.com>
56+
57+Origin: upstream, https://github.com/ClusterLabs/fence-agents/commit/3f3655e8370067fd4a133592a75778778c8e6eef
58+Last-Update: 2024-04-16
59+---
60+ agents/azure_arm/fence_azure_arm.py | 2 +-
61+ 1 file changed, 1 insertion(+), 1 deletion(-)
62+
63+diff --git a/agents/azure_arm/fence_azure_arm.py b/agents/azure_arm/fence_azure_arm.py
64+index e3b7c85c7..515aae294 100755
65+--- a/agents/azure_arm/fence_azure_arm.py
66++++ b/agents/azure_arm/fence_azure_arm.py
67+@@ -72,7 +72,7 @@ def get_power_status(clients, options):
68+
69+ powerState = "unknown"
70+ try:
71+- vmStatus = compute_client.virtual_machines.get(rgName, vmName, "instanceView")
72++ vmStatus = compute_client.virtual_machines.get(rgName, vmName, expand="instanceView")
73+ except Exception as e:
74+ fail_usage("Failed: %s" % e)
75+
76diff --git a/debian/patches/series b/debian/patches/series
77index dc1af89..72195c8 100644
78--- a/debian/patches/series
79+++ b/debian/patches/series
80@@ -4,3 +4,4 @@ systemd-syslog-target
81 logging-warn-deprecated
82 fence-virt-key
83 fence-vmware-helper
84+fence_azure_arm-fix-get-virtual-machines-call

Subscribers

People subscribed via source and target branches