Skip to content

Commit c6d069f

Browse files
authored
add patch for cloud-init pkg install error (#8422)
Co-authored-by: minghe <rmhsawyer>
1 parent 110c93f commit c6d069f

2 files changed

Lines changed: 30 additions & 1 deletion

File tree

SPECS/cloud-init/cloud-init.spec

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Summary: Cloud instance init scripts
22
Name: cloud-init
33
Version: 23.4.1
4-
Release: 3%{?dist}
4+
Release: 4%{?dist}
55
License: GPLv3
66
Vendor: Microsoft Corporation
77
Distribution: Mariner
@@ -11,6 +11,7 @@ Source0: https://launchpad.net/cloud-init/trunk/%{version}/+download/%{na
1111
Source1: 10-azure-kvp.cfg
1212
Patch0: Retain-exit-code-in-cloud-init-status-for-recoverabl.patch
1313
Patch1: ci-Pin-pytest-8.0.0.patch
14+
Patch2: exec_cmd_error_handling.patch
1415
%define cl_services cloud-config.service cloud-config.target cloud-final.service cloud-init.service cloud-init.target cloud-init-local.service
1516
BuildRequires: automake
1617
BuildRequires: dbus
@@ -146,6 +147,9 @@ make check %{?_smp_mflags}
146147
%config(noreplace) %{_sysconfdir}/cloud/cloud.cfg.d/10-azure-kvp.cfg
147148

148149
%changelog
150+
* Wed Mar 13 2024 Minghe Ren <mingheren@microsoft.com> - 23.4.1-4
151+
- Add patch to resolve error handling approach when executing command
152+
149153
* Fri Feb 09 2024 Chris Co <chrco@microsoft.com> - 23.4.1-3
150154
- Add patch to pin pytest to <8.0.0 so cloud-init tests run correctly
151155

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
diff -ruN a/cloudinit/distros/photon.py b/cloudinit/distros/photon.py
2+
--- a/cloudinit/distros/photon.py 2023-12-14 09:17:35.000000000 -0800
3+
+++ b/cloudinit/distros/photon.py 2024-03-20 14:34:15.375591963 -0700
4+
@@ -45,7 +45,6 @@
5+
LOG.warning(
6+
"Running %s resulted in stderr output: %s", cmd, err
7+
)
8+
- return True, out, err
9+
return False, out, err
10+
except subp.ProcessExecutionError:
11+
util.logexc(LOG, "Command %s failed", cmd)
12+
diff -ruN a/tests/unittests/distros/test_photon.py b/tests/unittests/distros/test_photon.py
13+
--- a/tests/unittests/distros/test_photon.py 2023-12-14 09:17:35.000000000 -0800
14+
+++ b/tests/unittests/distros/test_photon.py 2024-03-20 14:57:38.141906589 -0700
15+
@@ -42,11 +42,6 @@
16+
ret = self.distro._read_hostname(hostfile)
17+
self.assertEqual(ret, hostname)
18+
19+
- self.logs.truncate(0)
20+
- m_subp.return_value = (None, "bla")
21+
- self.distro._write_hostname(hostname, None)
22+
- self.assertIn("Error while setting hostname", self.logs.getvalue())
23+
-
24+
@mock.patch("cloudinit.net.generate_fallback_config")
25+
def test_fallback_netcfg(self, m_fallback_cfg):

0 commit comments

Comments
 (0)