From e23865c4d5b8777b7aba1e7179ac011cc7ccaa8f Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Dec 21 2020 08:09:09 +0000 Subject: import WALinuxAgent-2.2.49.2-2.el8 --- diff --git a/SOURCES/wla-Fixed-faulty-check-for-run_command-2093.patch b/SOURCES/wla-Fixed-faulty-check-for-run_command-2093.patch new file mode 100644 index 0000000..8084d38 --- /dev/null +++ b/SOURCES/wla-Fixed-faulty-check-for-run_command-2093.patch @@ -0,0 +1,63 @@ +From 51ff3dc6705217f52e4b4810fa9b6eac406ca84e Mon Sep 17 00:00:00 2001 +From: Vitaly Kuznetsov +Date: Thu, 17 Dec 2020 06:50:11 +0100 +Subject: [PATCH] Fixed faulty check for run_command (#2093) + +RH-Author: Vitaly Kuznetsov +Message-id: <20201209101549.2667108-1-vkuznets@redhat.com> +Patchwork-id: 100366 +O-Subject: [RHEL8 WALinuxAgent PATCH] Fixed faulty check for run_command (#2093) +Bugzilla: 1903074 +RH-Acked-by: Cathy Avery +RH-Acked-by: Mohammed Gamal + +Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1903074 +Brew: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=33563215 +Tested: by QE +Branch: rhel840/master-2.2.49 + +commit b1799aef33f1213ef8828d5ba1838582026d5030 +Author: Laveesh Rohra +Date: Tue Dec 1 16:13:03 2020 -0800 + + Fixed faulty check for run_command (#2093) + +Signed-off-by: Vitaly Kuznetsov +Signed-off-by: Miroslav Rezanina +--- + azurelinuxagent/common/osutil/redhat.py | 5 ++++- + azurelinuxagent/common/osutil/suse.py | 2 +- + 2 files changed, 5 insertions(+), 2 deletions(-) + +diff --git a/azurelinuxagent/common/osutil/redhat.py b/azurelinuxagent/common/osutil/redhat.py +index 8974ecc..1b3ae0e 100644 +--- a/azurelinuxagent/common/osutil/redhat.py ++++ b/azurelinuxagent/common/osutil/redhat.py +@@ -106,7 +106,10 @@ class RedhatOSUtil(Redhat6xOSUtil): + to hostname. + """ + hostnamectl_cmd = ['hostnamectl', 'set-hostname', hostname, '--static'] +- if self._run_command_without_raising(hostnamectl_cmd, log_error=False) != 0: ++ ++ try: ++ shellutil.run_command(hostnamectl_cmd, log_error=False) ++ except shellutil.CommandError: + logger.warn("[{0}] failed, attempting fallback".format(' '.join(hostnamectl_cmd))) + DefaultOSUtil.set_hostname(self, hostname) + +diff --git a/azurelinuxagent/common/osutil/suse.py b/azurelinuxagent/common/osutil/suse.py +index 2192c67..0b5fc8d 100644 +--- a/azurelinuxagent/common/osutil/suse.py ++++ b/azurelinuxagent/common/osutil/suse.py +@@ -80,7 +80,7 @@ class SUSEOSUtil(SUSE11OSUtil): + self._run_command_without_raising(["systemctl", "start", "{}.service".format(self.dhclient_name)], + log_error=False) + +- def start_network(self) : ++ def start_network(self): + self._run_command_without_raising(["systemctl", "start", "network.service"], log_error=False) + + def restart_ssh_service(self): +-- +2.18.4 + diff --git a/SPECS/WALinuxAgent.spec b/SPECS/WALinuxAgent.spec index 04f9925..9cedeb8 100644 --- a/SPECS/WALinuxAgent.spec +++ b/SPECS/WALinuxAgent.spec @@ -1,7 +1,7 @@ Summary: Microsoft Azure Linux Agent Name: WALinuxAgent Version: 2.2.49.2 -Release: 1%{?dist} +Release: 2%{?dist} License: ASL 2.0 Group: Development/Libraries @@ -11,6 +11,8 @@ Source0: WALinuxAgent-2.2.49.2.tar.gz BuildArch: noarch Patch0001: 0001-Add-inital-redhat-build-support.patch Patch0002: 0002-Fix-handling-of-gen2-disks-with-udev-rules-1954.patch +# For bz#1903074 - [Azure][WALA] Miss report "hostnamectl set-hostname --static] failed, attempting fallback" +Patch3: wla-Fixed-faulty-check-for-run_command-2093.patch # rhel requirements BuildRequires: python3-devel @@ -38,6 +40,7 @@ images that are built to run in the Azure environment. %patch0001 -p1 %patch0002 -p1 +%patch3 -p1 %build %py3_build @@ -70,6 +73,11 @@ rm -rf $RPM_BUILD_ROOT /etc/udev/rules.d/99-azure-product-uuid.rules %changelog +* Thu Dec 17 2020 Miroslav Rezanina - 2.2.49.2-2.el8 +- wla-Fixed-faulty-check-for-run_command-2093.patch [bz#1903074] +- Resolves: bz#1903074 + ([Azure][WALA] Miss report "hostnamectl set-hostname --static] failed, attempting fallback") + * Wed Nov 18 2020 Miroslav Rezanina - 2.2.49.2-1.el8 - Rebase to 2.2.49.2 [bz#1896907] - Resolves: bz#1896907