* Mon Jun 17 2024 Miroslav Rezanina <mrezanin@redhat.com> - 23.4-12

- ci-fix-cloudstack-Use-parsed-lease-file-for-virtual-rou.patch [RHEL-40217]
- Resolves: RHEL-40217
  ([Cloud-init] CloudstackDataSource cannot work with NetworkManager)
This commit is contained in:
Miroslav Rezanina 2024-06-17 06:14:17 -04:00
parent 47e39e15e7
commit 3affac864f
2 changed files with 66 additions and 1 deletions

View File

@ -0,0 +1,58 @@
From fcaff2e02a07af587d8366f61df1685435e32288 Mon Sep 17 00:00:00 2001
From: Brett Holman <brett.holman@canonical.com>
Date: Wed, 3 Jan 2024 09:11:40 -0700
Subject: [PATCH] fix(cloudstack): Use parsed lease file for virtual router in
cloudstack
RH-Author: Ani Sinha <anisinha@redhat.com>
RH-MergeRequest: 85: fix(cloudstack): Use parsed lease file for virtual router in cloudstack
RH-Jira: RHEL-40217
RH-Acked-by: Cathy Avery <cavery@redhat.com>
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
RH-Commit: [1/1] 9d1353620ee2c773170e424479bb2664116554f4 (anisinha/cloud-init)
Fixes 5942f4023e2581a
(cherry picked from commit cb36bf38b823f811a3e938ccffc03d7d13190095)
Signed-off-by: Ani Sinha <anisinha@redhat.com>
---
cloudinit/sources/DataSourceCloudStack.py | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/cloudinit/sources/DataSourceCloudStack.py b/cloudinit/sources/DataSourceCloudStack.py
index fd2482a3..f752765d 100644
--- a/cloudinit/sources/DataSourceCloudStack.py
+++ b/cloudinit/sources/DataSourceCloudStack.py
@@ -229,18 +229,18 @@ def get_vr_address():
)
return latest_address
- # Try dhcp lease files next...
+ # Try dhcp lease files next
lease_file = dhcp.IscDhclient.get_latest_lease()
- if not lease_file:
- LOG.debug("No lease file found, using default gateway")
- return get_default_gateway()
-
- lease_file = dhcp.IscDhclient.parse_dhcp_server_from_lease_file(lease_file)
- if not latest_address:
- # No virtual router found, fallback on default gateway
- LOG.debug("No DHCP found, using default gateway")
- return get_default_gateway()
- return latest_address
+ if lease_file:
+ latest_address = dhcp.IscDhclient.parse_dhcp_server_from_lease_file(
+ lease_file
+ )
+ if latest_address:
+ return latest_address
+
+ # No virtual router found, fallback to default gateway
+ LOG.debug("No DHCP found, using default gateway")
+ return get_default_gateway()
# Used to match classes to dependencies
--
2.39.3

View File

@ -1,6 +1,6 @@
Name: cloud-init
Version: 23.4
Release: 11%{?dist}
Release: 12%{?dist}
Summary: Cloud instance init scripts
License: ASL 2.0 or GPLv3
URL: http://launchpad.net/cloud-init
@ -33,6 +33,8 @@ Patch15: ci-fix-Undeprecate-network-in-schema-route-definition-5.patch
Patch16: ci-fix-Fall-back-to-cached-local-ds-if-no-valid-ds-foun.patch
# For RHEL-36255 - [rhel-9.5] DataSourceNoCloudNet not configurable via config files
Patch17: ci-fix-Always-use-single-datasource-if-specified-5098.patch
# For RHEL-40217 - [Cloud-init] CloudstackDataSource cannot work with NetworkManager
Patch18: ci-fix-cloudstack-Use-parsed-lease-file-for-virtual-rou.patch
BuildArch: noarch
@ -247,6 +249,11 @@ fi
%config(noreplace) %{_sysconfdir}/rsyslog.d/21-cloudinit.conf
%changelog
* Mon Jun 17 2024 Miroslav Rezanina <mrezanin@redhat.com> - 23.4-12
- ci-fix-cloudstack-Use-parsed-lease-file-for-virtual-rou.patch [RHEL-40217]
- Resolves: RHEL-40217
([Cloud-init] CloudstackDataSource cannot work with NetworkManager)
* Thu May 16 2024 Miroslav Rezanina <mrezanin@redhat.com> - 23.4-11
- ci-fix-Always-use-single-datasource-if-specified-5098.patch [RHEL-36255]
- Resolves: RHEL-36255