From 52fa71421e63aeda441edb30da280a9b6dcecfe5 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 19 Jan 2024 11:54:08 +0000 Subject: [PATCH 01/25] Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild --- WALinuxAgent.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/WALinuxAgent.spec b/WALinuxAgent.spec index 9d9878a..144b8b7 100644 --- a/WALinuxAgent.spec +++ b/WALinuxAgent.spec @@ -3,7 +3,7 @@ Name: WALinuxAgent Version: 2.9.1.1 -Release: 1%{?dist} +Release: 2%{?dist} Summary: The Microsoft Azure Linux Agent License: Apache-2.0 @@ -121,6 +121,9 @@ install -m0755 -D -t %{buildroot}%{_prefix}/lib/dracut/modules.d/%{dracut_modnam %endif %changelog +* Fri Jan 19 2024 Fedora Release Engineering - 2.9.1.1-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + * Wed Oct 18 2023 Vitaly Kuznetsov - 2.9.1.1-1 - Update to 2.9.1.1 (#2232763) From 34e2e3bc6f34a15a2d017de6bc6aac7fc78a46ca Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Mon, 22 Jan 2024 22:30:15 +0000 Subject: [PATCH 02/25] Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild --- WALinuxAgent.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/WALinuxAgent.spec b/WALinuxAgent.spec index 144b8b7..9109f65 100644 --- a/WALinuxAgent.spec +++ b/WALinuxAgent.spec @@ -3,7 +3,7 @@ Name: WALinuxAgent Version: 2.9.1.1 -Release: 2%{?dist} +Release: 3%{?dist} Summary: The Microsoft Azure Linux Agent License: Apache-2.0 @@ -121,6 +121,9 @@ install -m0755 -D -t %{buildroot}%{_prefix}/lib/dracut/modules.d/%{dracut_modnam %endif %changelog +* Mon Jan 22 2024 Fedora Release Engineering - 2.9.1.1-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + * Fri Jan 19 2024 Fedora Release Engineering - 2.9.1.1-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild From b0181d89c7a5f6e3d70ae2c3d58f32cfbbb78218 Mon Sep 17 00:00:00 2001 From: Vitaly Kuznetsov Date: Thu, 4 Apr 2024 15:06:23 +0200 Subject: [PATCH 03/25] Update to 2.10.0.8 (#2271975) Signed-off-by: Vitaly Kuznetsov --- .gitignore | 1 + WALinuxAgent.spec | 7 +++++-- sources | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 155c25f..0eb4fb7 100644 --- a/.gitignore +++ b/.gitignore @@ -23,3 +23,4 @@ /v2.8.0.11.tar.gz /v2.9.0.4.tar.gz /v2.9.1.1.tar.gz +/v2.10.0.8.tar.gz diff --git a/WALinuxAgent.spec b/WALinuxAgent.spec index 9109f65..453f973 100644 --- a/WALinuxAgent.spec +++ b/WALinuxAgent.spec @@ -2,8 +2,8 @@ %global dracut_modname 97walinuxagent Name: WALinuxAgent -Version: 2.9.1.1 -Release: 3%{?dist} +Version: 2.10.0.8 +Release: 1%{?dist} Summary: The Microsoft Azure Linux Agent License: Apache-2.0 @@ -121,6 +121,9 @@ install -m0755 -D -t %{buildroot}%{_prefix}/lib/dracut/modules.d/%{dracut_modnam %endif %changelog +* Thu Apr 04 2024 Vitaly Kuznetsov - 2.10.0.8-1 +- Update to 2.10.0.8 (#2271975) + * Mon Jan 22 2024 Fedora Release Engineering - 2.9.1.1-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild diff --git a/sources b/sources index 5cd38e5..dbfefa5 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (v2.9.1.1.tar.gz) = 3f44aecc16ac545db4b550586f168dbbdef34289aad6775973517bf645e5a1d486864c01e974f03a71b3e946c14e1ca140673a75c1cd602aac28725eaa68e83d +SHA512 (v2.10.0.8.tar.gz) = aa2f8d0eb2e69eb5f29bebaf78190ffbb723727da5018c5a7acc31cd2c926eb29d4ef6641024e9fd965d6eae2ed88472cfca7ec4cf0583c2f2d6a542adaea6bc From 9df946ad946209ba4c0d0b5c271a69efc23e3bec Mon Sep 17 00:00:00 2001 From: Jeremy Cline Date: Wed, 8 May 2024 12:30:37 -0400 Subject: [PATCH 04/25] Add the udev dependencies to the dracut module This fixes the symlinks created by the Azure storage rules, which depend on readlink and cut being present. Before this change the Fedora Cloud image would produce a symlink at /dev/disk/azure -> /dev/sda instead of /dev/disk/azure being a directory of symlinks to the device and any partitions it contains. --- WALinuxAgent.spec | 5 ++++- module-setup.sh | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/WALinuxAgent.spec b/WALinuxAgent.spec index 453f973..486f128 100644 --- a/WALinuxAgent.spec +++ b/WALinuxAgent.spec @@ -3,7 +3,7 @@ Name: WALinuxAgent Version: 2.10.0.8 -Release: 1%{?dist} +Release: 2%{?dist} Summary: The Microsoft Azure Linux Agent License: Apache-2.0 @@ -121,6 +121,9 @@ install -m0755 -D -t %{buildroot}%{_prefix}/lib/dracut/modules.d/%{dracut_modnam %endif %changelog +* Wed May 08 2024 Jeremy Cline - 2.10.0.8-2 +- Add the udev dependencies to the dracut module + * Thu Apr 04 2024 Vitaly Kuznetsov - 2.10.0.8-1 - Update to 2.10.0.8 (#2271975) diff --git a/module-setup.sh b/module-setup.sh index 00d0eb7..9d29893 100644 --- a/module-setup.sh +++ b/module-setup.sh @@ -12,5 +12,6 @@ depends() { # called by dracut install() { + inst_multiple chmod cut readlink inst_rules 66-azure-storage.rules 99-azure-product-uuid.rules } From 74c8dfa9d46925d110b9cf4194a255e268e7969b Mon Sep 17 00:00:00 2001 From: Jeremy Cline Date: Wed, 8 May 2024 12:30:37 -0400 Subject: [PATCH 05/25] Add the udev dependencies to the dracut module This fixes the symlinks created by the Azure storage rules, which depend on readlink and cut being present. Before this change the Fedora Cloud image would produce a symlink at /dev/disk/azure -> /dev/sda instead of /dev/disk/azure being a directory of symlinks to the device and any partitions it contains. [Vitaly Kuznetsov] Update the change for F39 branch. --- WALinuxAgent.spec | 5 ++++- module-setup.sh | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/WALinuxAgent.spec b/WALinuxAgent.spec index 9d9878a..e2c6a1a 100644 --- a/WALinuxAgent.spec +++ b/WALinuxAgent.spec @@ -3,7 +3,7 @@ Name: WALinuxAgent Version: 2.9.1.1 -Release: 1%{?dist} +Release: 2%{?dist} Summary: The Microsoft Azure Linux Agent License: Apache-2.0 @@ -121,6 +121,9 @@ install -m0755 -D -t %{buildroot}%{_prefix}/lib/dracut/modules.d/%{dracut_modnam %endif %changelog +* Wed May 08 2024 Jeremy Cline - 2.9.1.1-2 +- Add the udev dependencies to the dracut module + * Wed Oct 18 2023 Vitaly Kuznetsov - 2.9.1.1-1 - Update to 2.9.1.1 (#2232763) diff --git a/module-setup.sh b/module-setup.sh index 00d0eb7..9d29893 100644 --- a/module-setup.sh +++ b/module-setup.sh @@ -12,5 +12,6 @@ depends() { # called by dracut install() { + inst_multiple chmod cut readlink inst_rules 66-azure-storage.rules 99-azure-product-uuid.rules } From 14a71aa725032fe861791cce142a1518ad2be894 Mon Sep 17 00:00:00 2001 From: Python Maint Date: Fri, 7 Jun 2024 11:10:43 +0200 Subject: [PATCH 06/25] Rebuilt for Python 3.13 --- WALinuxAgent.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/WALinuxAgent.spec b/WALinuxAgent.spec index 486f128..d9fb026 100644 --- a/WALinuxAgent.spec +++ b/WALinuxAgent.spec @@ -3,7 +3,7 @@ Name: WALinuxAgent Version: 2.10.0.8 -Release: 2%{?dist} +Release: 3%{?dist} Summary: The Microsoft Azure Linux Agent License: Apache-2.0 @@ -121,6 +121,9 @@ install -m0755 -D -t %{buildroot}%{_prefix}/lib/dracut/modules.d/%{dracut_modnam %endif %changelog +* Fri Jun 07 2024 Python Maint - 2.10.0.8-3 +- Rebuilt for Python 3.13 + * Wed May 08 2024 Jeremy Cline - 2.10.0.8-2 - Add the udev dependencies to the dracut module From db5f38ee469a29f4e097c12caacab14e5e5e693a Mon Sep 17 00:00:00 2001 From: Jeremy Cline Date: Wed, 12 Jun 2024 17:48:13 -0400 Subject: [PATCH 07/25] Update to v2.11.1.4 and fix Python 3.13 build --- .gitignore | 1 + ...instead-of-crypt-on-Python-3.13-3070.patch | 258 ++++++++++++++++++ ...acycrypt-for-crypt-r-for-Python-3.13.patch | 73 +++++ WALinuxAgent.spec | 18 +- sources | 2 +- 5 files changed, 349 insertions(+), 3 deletions(-) create mode 100644 0001-Use-legacycrypt-instead-of-crypt-on-Python-3.13-3070.patch create mode 100644 0002-Swap-out-legacycrypt-for-crypt-r-for-Python-3.13.patch diff --git a/.gitignore b/.gitignore index 0eb4fb7..8efa138 100644 --- a/.gitignore +++ b/.gitignore @@ -24,3 +24,4 @@ /v2.9.0.4.tar.gz /v2.9.1.1.tar.gz /v2.10.0.8.tar.gz +/v2.11.1.4.tar.gz diff --git a/0001-Use-legacycrypt-instead-of-crypt-on-Python-3.13-3070.patch b/0001-Use-legacycrypt-instead-of-crypt-on-Python-3.13-3070.patch new file mode 100644 index 0000000..435a881 --- /dev/null +++ b/0001-Use-legacycrypt-instead-of-crypt-on-Python-3.13-3070.patch @@ -0,0 +1,258 @@ +From 12adcb0b1181054f58e4fe172f7bfb795881cdb4 Mon Sep 17 00:00:00 2001 +From: Norberto Arrieta +Date: Tue, 27 Feb 2024 14:58:44 -0800 +Subject: [PATCH 1/2] Use legacycrypt instead of crypt on Python >= 3.13 + (#3070) + +* Use legacycrypt instead of crypt on Python >= 3.13 + +* remove ModuleNotFound + +--------- + +Co-authored-by: narrieta +Signed-off-by: Jeremy Cline +--- + azurelinuxagent/common/osutil/default.py | 27 ++++++++++++++++--- + azurelinuxagent/common/osutil/freebsd.py | 2 +- + azurelinuxagent/common/osutil/gaia.py | 3 +-- + azurelinuxagent/common/utils/textutil.py | 13 --------- + requirements.txt | 3 ++- + setup.py | 17 +++++++----- + tests/common/osutil/test_default.py | 9 +++++++ + .../{utils => osutil}/test_passwords.txt | 0 + tests/common/utils/test_text_util.py | 10 ------- + 9 files changed, 47 insertions(+), 37 deletions(-) + rename tests/common/{utils => osutil}/test_passwords.txt (100%) + +diff --git a/azurelinuxagent/common/osutil/default.py b/azurelinuxagent/common/osutil/default.py +index f763d5f5..1486167c 100644 +--- a/azurelinuxagent/common/osutil/default.py ++++ b/azurelinuxagent/common/osutil/default.py +@@ -16,6 +16,7 @@ + # Requires Python 2.6+ and Openssl 1.0+ + # + ++import array + import base64 + import datetime + import errno +@@ -26,15 +27,26 @@ import multiprocessing + import os + import platform + import pwd ++import random + import re + import shutil + import socket ++import string + import struct + import sys + import time + from pwd import getpwall + +-import array ++from azurelinuxagent.common.exception import OSUtilError ++# 'crypt' was removed in Python 3.13; use legacycrypt instead ++if sys.version_info[0] == 3 and sys.version_info[1] >= 13 or sys.version_info[0] > 3: ++ try: ++ from legacycrypt import crypt ++ except ImportError: ++ def crypt(password, salt): ++ raise OSUtilError("Please install the legacycrypt Python module to use this feature.") ++else: ++ from crypt import crypt # pylint: disable=deprecated-module + + from azurelinuxagent.common import conf + from azurelinuxagent.common import logger +@@ -42,7 +54,6 @@ from azurelinuxagent.common.utils import fileutil + from azurelinuxagent.common.utils import shellutil + from azurelinuxagent.common.utils import textutil + +-from azurelinuxagent.common.exception import OSUtilError + from azurelinuxagent.common.future import ustr, array_to_bytes + from azurelinuxagent.common.utils.cryptutil import CryptUtil + from azurelinuxagent.common.utils.flexible_version import FlexibleVersion +@@ -433,11 +444,21 @@ class DefaultOSUtil(object): + if self.is_sys_user(username): + raise OSUtilError(("User {0} is a system user, " + "will not set password.").format(username)) +- passwd_hash = textutil.gen_password_hash(password, crypt_id, salt_len) ++ passwd_hash = DefaultOSUtil.gen_password_hash(password, crypt_id, salt_len) + + self._run_command_raising_OSUtilError(["usermod", "-p", passwd_hash, username], + err_msg="Failed to set password for {0}".format(username)) + ++ @staticmethod ++ def gen_password_hash(password, crypt_id, salt_len): ++ collection = string.ascii_letters + string.digits ++ salt = ''.join(random.choice(collection) for _ in range(salt_len)) ++ salt = "${0}${1}".format(crypt_id, salt) ++ if sys.version_info[0] == 2: ++ # if python 2.*, encode to type 'str' to prevent Unicode Encode Error from crypt.crypt ++ password = password.encode('utf-8') ++ return crypt(password, salt) ++ + def get_users(self): + return getpwall() + +diff --git a/azurelinuxagent/common/osutil/freebsd.py b/azurelinuxagent/common/osutil/freebsd.py +index f8ee6db8..cff46709 100644 +--- a/azurelinuxagent/common/osutil/freebsd.py ++++ b/azurelinuxagent/common/osutil/freebsd.py +@@ -77,7 +77,7 @@ class FreeBSDOSUtil(DefaultOSUtil): + if self.is_sys_user(username): + raise OSUtilError(("User {0} is a system user, " + "will not set password.").format(username)) +- passwd_hash = textutil.gen_password_hash(password, crypt_id, salt_len) ++ passwd_hash = DefaultOSUtil.gen_password_hash(password, crypt_id, salt_len) + self._run_command_raising_OSUtilError(['pw', 'usermod', username, '-H', '0'], cmd_input=passwd_hash, + err_msg="Failed to set password for {0}".format(username)) + +diff --git a/azurelinuxagent/common/osutil/gaia.py b/azurelinuxagent/common/osutil/gaia.py +index 849d5d1f..3f9f746b 100644 +--- a/azurelinuxagent/common/osutil/gaia.py ++++ b/azurelinuxagent/common/osutil/gaia.py +@@ -29,7 +29,6 @@ from azurelinuxagent.common.osutil.default import DefaultOSUtil + from azurelinuxagent.common.utils.cryptutil import CryptUtil + import azurelinuxagent.common.utils.fileutil as fileutil + import azurelinuxagent.common.utils.shellutil as shellutil +-import azurelinuxagent.common.utils.textutil as textutil + + + class GaiaOSUtil(DefaultOSUtil): +@@ -64,7 +63,7 @@ class GaiaOSUtil(DefaultOSUtil): + + def chpasswd(self, username, password, crypt_id=6, salt_len=10): + logger.info('chpasswd') +- passwd_hash = textutil.gen_password_hash(password, crypt_id, salt_len) ++ passwd_hash = DefaultOSUtil.gen_password_hash(password, crypt_id, salt_len) + ret, out = self._run_clish( + 'set user admin password-hash ' + passwd_hash) + if ret != 0: +diff --git a/azurelinuxagent/common/utils/textutil.py b/azurelinuxagent/common/utils/textutil.py +index 1ff7a7e9..4a0f9a75 100644 +--- a/azurelinuxagent/common/utils/textutil.py ++++ b/azurelinuxagent/common/utils/textutil.py +@@ -17,11 +17,8 @@ + # Requires Python 2.6+ and Openssl 1.0+ + + import base64 +-import crypt + import hashlib +-import random + import re +-import string + import struct + import sys + import traceback +@@ -287,16 +284,6 @@ def remove_bom(c): + return c + + +-def gen_password_hash(password, crypt_id, salt_len): +- collection = string.ascii_letters + string.digits +- salt = ''.join(random.choice(collection) for _ in range(salt_len)) +- salt = "${0}${1}".format(crypt_id, salt) +- if sys.version_info[0] == 2: +- # if python 2.*, encode to type 'str' to prevent Unicode Encode Error from crypt.crypt +- password = password.encode('utf-8') +- return crypt.crypt(password, salt) +- +- + def get_bytes_from_pem(pem_str): + base64_bytes = "" + for line in pem_str.split('\n'): +diff --git a/requirements.txt b/requirements.txt +index b0b7c874..ab6958a7 100644 +--- a/requirements.txt ++++ b/requirements.txt +@@ -1,2 +1,3 @@ + distro; python_version >= '3.8' +-pyasn1 +\ No newline at end of file ++pyasn1 ++legacycrypt; python_version >= '3.13' +diff --git a/setup.py b/setup.py +index 6b54d09e..2d51fae8 100755 +--- a/setup.py ++++ b/setup.py +@@ -314,13 +314,16 @@ class install(_install): # pylint: disable=C0103 + + + # Note to packagers and users from source. +-# In version 3.5 of Python distribution information handling in the platform +-# module was deprecated. Depending on the Linux distribution the +-# implementation may be broken prior to Python 3.7 wher the functionality +-# will be removed from Python 3 +-requires = [] # pylint: disable=invalid-name +-if sys.version_info[0] >= 3 and sys.version_info[1] >= 7: +- requires = ['distro'] # pylint: disable=invalid-name ++# * In version 3.5 of Python distribution information handling in the platform ++# module was deprecated. Depending on the Linux distribution the ++# implementation may be broken prior to Python 3.8 where the functionality ++# will be removed from Python 3. ++# * In version 3.13 of Python, the crypt module was removed and legacycrypt is ++# required instead. ++requires = [ ++ "distro;python_version>='3.8'", ++ "legacycrypt;python_version>='3.13'", ++] + + modules = [] # pylint: disable=invalid-name + +diff --git a/tests/common/osutil/test_default.py b/tests/common/osutil/test_default.py +index afe27ae5..8325bbd0 100644 +--- a/tests/common/osutil/test_default.py ++++ b/tests/common/osutil/test_default.py +@@ -1111,6 +1111,15 @@ class TestGetPublishedHostname(AgentTestCase): + self.assertEqual(expected, actual, "get_hostname_record returned an incorrect hostname") + self.assertEqual(expected, self.__get_published_hostname_contents(), "get_hostname_record returned an incorrect hostname") + ++ def test_get_password_hash(self): ++ with open(os.path.join(os.path.dirname(os.path.realpath(__file__)), 'test_passwords.txt'), 'rb') as in_file: ++ for data in in_file: ++ # Remove bom on bytes data before it is converted into string. ++ data = textutil.remove_bom(data) ++ data = ustr(data, encoding='utf-8') ++ password_hash = osutil.DefaultOSUtil.gen_password_hash(data, 6, 10) ++ self.assertNotEqual(None, password_hash) ++ + + if __name__ == '__main__': + unittest.main() +diff --git a/tests/common/utils/test_passwords.txt b/tests/common/osutil/test_passwords.txt +similarity index 100% +rename from tests/common/utils/test_passwords.txt +rename to tests/common/osutil/test_passwords.txt +diff --git a/tests/common/utils/test_text_util.py b/tests/common/utils/test_text_util.py +index 5029cfb9..b382aa28 100644 +--- a/tests/common/utils/test_text_util.py ++++ b/tests/common/utils/test_text_util.py +@@ -16,7 +16,6 @@ + # + + import hashlib +-import os + import unittest + from distutils.version import LooseVersion as Version # pylint: disable=no-name-in-module,import-error + +@@ -26,15 +25,6 @@ from tests.lib.tools import AgentTestCase + + + class TestTextUtil(AgentTestCase): +- def test_get_password_hash(self): +- with open(os.path.join(os.path.dirname(os.path.realpath(__file__)), 'test_passwords.txt'), 'rb') as in_file: +- for data in in_file: +- # Remove bom on bytes data before it is converted into string. +- data = textutil.remove_bom(data) +- data = ustr(data, encoding='utf-8') +- password_hash = textutil.gen_password_hash(data, 6, 10) +- self.assertNotEqual(None, password_hash) +- + def test_replace_non_ascii(self): + data = ustr(b'\xef\xbb\xbfhehe', encoding='utf-8') + self.assertEqual('hehe', textutil.replace_non_ascii(data)) +-- +2.45.2 + diff --git a/0002-Swap-out-legacycrypt-for-crypt-r-for-Python-3.13.patch b/0002-Swap-out-legacycrypt-for-crypt-r-for-Python-3.13.patch new file mode 100644 index 0000000..dcc5c58 --- /dev/null +++ b/0002-Swap-out-legacycrypt-for-crypt-r-for-Python-3.13.patch @@ -0,0 +1,73 @@ +From faacd2d59fd34007fa4d678a2a89645d16fdaa7d Mon Sep 17 00:00:00 2001 +From: Jeremy Cline +Date: Wed, 12 Jun 2024 15:01:49 -0400 +Subject: [PATCH 2/2] Swap out legacycrypt for crypt-r for Python 3.13+ + +PR #3070 pulled in legacycrypt to replace the removed crypt module. +legacycrypt hasn't been updated since it was initially pulled out of +Python's stdlib in 2019 (Python 3.7). crypt-r pulls in the module as it +was in Python 3.12. While there's been no major developments since 3.7, +it's more likely to be kept updated for any breakages in future Python +releases. + +It's also already packaged for Fedora and means one less package for me +to maintain so that would be nice. + +Signed-off-by: Jeremy Cline +--- + azurelinuxagent/common/osutil/default.py | 6 +++--- + requirements.txt | 2 +- + setup.py | 4 ++-- + 3 files changed, 6 insertions(+), 6 deletions(-) + +diff --git a/azurelinuxagent/common/osutil/default.py b/azurelinuxagent/common/osutil/default.py +index 1486167c..2f339800 100644 +--- a/azurelinuxagent/common/osutil/default.py ++++ b/azurelinuxagent/common/osutil/default.py +@@ -38,13 +38,13 @@ import time + from pwd import getpwall + + from azurelinuxagent.common.exception import OSUtilError +-# 'crypt' was removed in Python 3.13; use legacycrypt instead ++# 'crypt' was removed in Python 3.13; use crypt-r instead + if sys.version_info[0] == 3 and sys.version_info[1] >= 13 or sys.version_info[0] > 3: + try: +- from legacycrypt import crypt ++ from crypt_r import crypt + except ImportError: + def crypt(password, salt): +- raise OSUtilError("Please install the legacycrypt Python module to use this feature.") ++ raise OSUtilError("Please install the crypt-r Python module to use this feature.") + else: + from crypt import crypt # pylint: disable=deprecated-module + +diff --git a/requirements.txt b/requirements.txt +index ab6958a7..fcb64396 100644 +--- a/requirements.txt ++++ b/requirements.txt +@@ -1,3 +1,3 @@ + distro; python_version >= '3.8' + pyasn1 +-legacycrypt; python_version >= '3.13' ++crypt-r; python_version >= '3.13' +diff --git a/setup.py b/setup.py +index 2d51fae8..26610ca8 100755 +--- a/setup.py ++++ b/setup.py +@@ -318,11 +318,11 @@ class install(_install): # pylint: disable=C0103 + # module was deprecated. Depending on the Linux distribution the + # implementation may be broken prior to Python 3.8 where the functionality + # will be removed from Python 3. +-# * In version 3.13 of Python, the crypt module was removed and legacycrypt is ++# * In version 3.13 of Python, the crypt module was removed and crypt-r is + # required instead. + requires = [ + "distro;python_version>='3.8'", +- "legacycrypt;python_version>='3.13'", ++ "crypt-r;python_version>='3.13'", + ] + + modules = [] # pylint: disable=invalid-name +-- +2.45.2 + diff --git a/WALinuxAgent.spec b/WALinuxAgent.spec index d9fb026..277ae36 100644 --- a/WALinuxAgent.spec +++ b/WALinuxAgent.spec @@ -2,8 +2,8 @@ %global dracut_modname 97walinuxagent Name: WALinuxAgent -Version: 2.10.0.8 -Release: 3%{?dist} +Version: 2.11.1.4 +Release: 1%{?dist} Summary: The Microsoft Azure Linux Agent License: Apache-2.0 @@ -12,12 +12,19 @@ Source0: https://github.com/Azure/%{name}/archive/v%{version}.tar.gz Source1: module-setup.sh Patch1: 0001-waagent.service-set-ConditionVirtualization-microsof.patch +# These two patches are from PR 3070 (merged) and PR 3141 (proposed) and +# are needed to build with Python 3.13 since it removed the crypt module. +# If PR 3141 is not merged it should be dropped in the future for whatever +# upstream decides to go with. +Patch2: 0001-Use-legacycrypt-instead-of-crypt-on-Python-3.13-3070.patch +Patch3: 0002-Swap-out-legacycrypt-for-crypt-r-for-Python-3.13.patch BuildArch: noarch BuildRequires: python3-devel BuildRequires: python3-setuptools BuildRequires: python3-distro +BuildRequires: python3-crypt-r Requires: %name-udev = %version-%release %if 0%{?fedora} Requires: ntfsprogs @@ -27,6 +34,7 @@ Requires: openssh-server Requires: openssl Requires: parted Requires: python3-pyasn1 +Requires: python3-crypt-r Requires: iptables BuildRequires: systemd @@ -59,6 +67,8 @@ Udev rules specific to Microsoft Azure Virtual Machines. %prep %setup -q %patch 1 -p1 +%patch 2 -p1 +%patch 3 -p1 %build %py3_build @@ -121,6 +131,10 @@ install -m0755 -D -t %{buildroot}%{_prefix}/lib/dracut/modules.d/%{dracut_modnam %endif %changelog +* Wed Jun 12 2024 Jeremy Cline - 2.11.1.4-1 +- Bump to upstream release v2.11.1.4 +- Fix build for Python 3.13 + * Fri Jun 07 2024 Python Maint - 2.10.0.8-3 - Rebuilt for Python 3.13 diff --git a/sources b/sources index dbfefa5..11fe930 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (v2.10.0.8.tar.gz) = aa2f8d0eb2e69eb5f29bebaf78190ffbb723727da5018c5a7acc31cd2c926eb29d4ef6641024e9fd965d6eae2ed88472cfca7ec4cf0583c2f2d6a542adaea6bc +SHA512 (v2.11.1.4.tar.gz) = e67ecd801541bd869bc01a023ee3b06a6ee879b5780b34c5fa320d080276ebe8400c66a8550b58d0ca4a1116bd923b00ce2da60d09c574f30c50f446b5a6ac2f From 9aa999030f7122f2ffad20ebbc7934a0ff749efc Mon Sep 17 00:00:00 2001 From: Jeremy Cline Date: Fri, 14 Jun 2024 11:21:53 -0400 Subject: [PATCH 08/25] Switch to autorelease and autochangelog [skip changelog] --- WALinuxAgent.spec | 205 +--------------------------------------------- changelog | 202 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 204 insertions(+), 203 deletions(-) create mode 100644 changelog diff --git a/WALinuxAgent.spec b/WALinuxAgent.spec index 277ae36..481c949 100644 --- a/WALinuxAgent.spec +++ b/WALinuxAgent.spec @@ -3,7 +3,7 @@ Name: WALinuxAgent Version: 2.11.1.4 -Release: 1%{?dist} +Release: %autorelease Summary: The Microsoft Azure Linux Agent License: Apache-2.0 @@ -131,205 +131,4 @@ install -m0755 -D -t %{buildroot}%{_prefix}/lib/dracut/modules.d/%{dracut_modnam %endif %changelog -* Wed Jun 12 2024 Jeremy Cline - 2.11.1.4-1 -- Bump to upstream release v2.11.1.4 -- Fix build for Python 3.13 - -* Fri Jun 07 2024 Python Maint - 2.10.0.8-3 -- Rebuilt for Python 3.13 - -* Wed May 08 2024 Jeremy Cline - 2.10.0.8-2 -- Add the udev dependencies to the dracut module - -* Thu Apr 04 2024 Vitaly Kuznetsov - 2.10.0.8-1 -- Update to 2.10.0.8 (#2271975) - -* Mon Jan 22 2024 Fedora Release Engineering - 2.9.1.1-3 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild - -* Fri Jan 19 2024 Fedora Release Engineering - 2.9.1.1-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild - -* Wed Oct 18 2023 Vitaly Kuznetsov - 2.9.1.1-1 -- Update to 2.9.1.1 (#2232763) - -* Wed Jul 19 2023 Fedora Release Engineering - 2.9.0.4-4 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild - -* Tue Jun 13 2023 Python Maint - 2.9.0.4-3 -- Rebuilt for Python 3.12 - -* Tue May 30 2023 Vitaly Kuznetsov - 2.9.0.4-2 -- Switch to SPDX identifiers for the license field - -* Mon Mar 13 2023 Vitaly Kuznetsov - 2.9.0.4-1 -- Update to 2.9.0.4 (#2177333) - -* Fri Jan 20 2023 Dusty Mabe - 2.8.0.11-3 -- Move module-setup.sh into git - -* Wed Jan 18 2023 Fedora Release Engineering - 2.8.0.11-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild - -* Mon Oct 31 2022 Vitaly Kuznetsov - 2.8.0.11-1 -- Update to 2.8.0.11 (#2128547) - -* Tue Oct 18 2022 Chris Patterson - 2.7.3.0-2 -- Add ConditionVirtualization=|microsoft triggering condition - -* Wed Aug 03 2022 Vitaly Kuznetsov - 2.7.3.0-1 -- Update to 2.7.3.0 (#2110155) - -* Wed Jul 20 2022 Fedora Release Engineering - 2.7.1.0-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild - -* Thu Jun 30 2022 Vitaly Kuznetsov - 2.7.1.0-1 -- Update to 2.7.1.0 (#2097244) - -* Mon Jun 13 2022 Python Maint - 2.7.0.6-2 -- Rebuilt for Python 3.11 - -* Fri Apr 22 2022 Vitaly Kuznetsov - 2.7.0.6-1 -- Update to 2.7.0.6 (#2040980) - -* Wed Jan 19 2022 Fedora Release Engineering - 2.5.0.2-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild - -* Mon Jan 03 2022 Vitaly Kuznetsov - 2.5.0.2-1 -- Update to 2.5.0.2 (#2008699) - -* Wed Jul 21 2021 Fedora Release Engineering - 2.3.1.1-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild - -* Mon Jul 19 2021 Vitaly Kuznetsov - 2.3.1.1-1 -- Update to 2.3.1.1 (#1982512) -- Require iptables for setting up persistent firewall rules - -* Tue Jun 15 2021 Vitaly Kuznetsov - 2.3.0.2-1 -- Update to 2.3.0.2 (#1971116) - -* Fri Jun 04 2021 Python Maint - 2.2.54.2-2 -- Rebuilt for Python 3.10 - -* Fri May 21 2021 Vitaly Kuznetsov - 2.2.54.2-1 -- Update to 2.2.54.2 (#1916966) - -* Tue Mar 02 2021 Zbigniew Jędrzejewski-Szmek - 2.2.52-6 -- Rebuilt for updated systemd-rpm-macros - See https://pagure.io/fesco/issue/2583. - -* Fri Feb 19 2021 Vitaly Kuznetsov - 2.2.52-5 -- Require ntfsprogs on Fedora only - -* Tue Jan 26 2021 Vitaly Kuznetsov - 2.2.52-4 -- Fix distro resolution for RedHat - -* Mon Jan 25 2021 Fedora Release Engineering - 2.2.52-3 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild - -* Fri Jan 15 2021 Vitaly Kuznetsov - 2.2.52-2 -- Add udev rules to initramfs (#1909287) - -* Wed Dec 09 2020 Vitaly Kuznetsov - 2.2.52-1 -- Update to 2.2.52 (#1849923) -- Add not yet upstream patches supporting Python3.9 changes - -* Mon Jul 27 2020 Fedora Release Engineering - 2.2.48.1-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild - -* Tue Jun 09 2020 Vitaly Kuznetsov - 2.2.48.1-1 -- Update to 2.2.48.1 (#1641605) -- Split udev rules to a separate subpackage (#1748432) - -* Tue May 26 2020 Miro Hrončok - 2.2.46-2 -- Rebuilt for Python 3.9 - -* Wed Apr 15 2020 Vitaly Kuznetsov - 2.2.46-1 -- Update to 2.2.46 - -* Tue Jan 28 2020 Fedora Release Engineering - 2.2.40-7 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild - -* Thu Oct 03 2019 Miro Hrončok - 2.2.40-6 -- Rebuilt for Python 3.8.0rc1 (#1748018) - -* Wed Aug 21 2019 Miro Hrončok - 2.2.40-5 -- Rebuilt for Python 3.8 - -* Wed Aug 21 2019 Vitaly Kuznetsov - 2.2.40-4 -- Disable Python2 dependent 'legacy' subpackage (#1741029) - -* Mon Aug 19 2019 Miro Hrončok - 2.2.40-3 -- Rebuilt for Python 3.8 - -* Wed Jul 24 2019 Fedora Release Engineering - 2.2.40-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild - -* Mon Jun 03 2019 Vitaly Kuznetsov - 2.2.40-1 -- Update to 2.2.40 -- Fix FTBFS in the preparation for Python3.8 (#1705219) - -* Thu Mar 14 2019 Vitaly Kuznetsov - 2.2.38-1 -- Update to 2.2.38 (CVE-2019-0804) - -* Thu Mar 14 2019 Vitaly Kuznetsov - 2.2.37-1 -- Update to 2.2.37 - -* Thu Jan 31 2019 Fedora Release Engineering - 2.2.32-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild - -* Thu Sep 20 2018 Vitaly Kuznetsov - 2.2.32-1 -- Update to 2.2.32.2 - -* Thu Jul 12 2018 Fedora Release Engineering - 2.2.25-4 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild - -* Tue Jun 19 2018 Miro Hrončok - 2.2.25-3 -- Rebuilt for Python 3.7 - -* Wed Apr 25 2018 Vitaly Kuznetsov - 2.2.25-2 -- Move net-tools dependency to WALinuxAgent-legacy (#1106781) - -* Mon Apr 16 2018 Vitaly Kuznetsov - 2.2.25-1 -- Update to 2.2.25 -- Switch to Python3 -- Legacy subpackage with waagent2.0 supporting old extensions - -* Wed Feb 28 2018 Iryna Shcherbina - 2.0.18-5 -- Update Python 2 dependency declarations to new packaging standards - (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3) - -* Wed Feb 07 2018 Fedora Release Engineering - 2.0.18-4 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild - -* Wed Jul 26 2017 Fedora Release Engineering - 2.0.18-3 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild - -* Fri Feb 10 2017 Fedora Release Engineering - 2.0.18-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild - -* Sat Apr 02 2016 Scott K Logan - 2.0.18-1 -- Update to 2.0.18 - -* Wed Feb 03 2016 Fedora Release Engineering - 2.0.14-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild - -* Thu Jul 02 2015 Scott K Logan - 2.0.14-1 -- Update to 2.0.14 - -* Tue Jun 16 2015 Fedora Release Engineering - 2.0.13-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild - -* Mon Jun 01 2015 Scott K Logan - 2.0.13-1 -- Update to 2.0.13 - -* Thu Apr 02 2015 Scott K Logan - 2.0.12-1 -- Update to 2.0.12-Oracle - -* Sat Jan 10 2015 Scott K Logan - 2.0.11-2 -- Use systemd for rhel7 -- Own logrotate.d -- Fix python2-devel dep - -* Sat Dec 20 2014 Scott K Logan - 2.0.11-1 -- Initial package +%autochangelog diff --git a/changelog b/changelog new file mode 100644 index 0000000..dd33a5c --- /dev/null +++ b/changelog @@ -0,0 +1,202 @@ +* Wed Jun 12 2024 Jeremy Cline - 2.11.1.4-1 +- Bump to upstream release v2.11.1.4 +- Fix build for Python 3.13 + +* Fri Jun 07 2024 Python Maint - 2.10.0.8-3 +- Rebuilt for Python 3.13 + +* Wed May 08 2024 Jeremy Cline - 2.10.0.8-2 +- Add the udev dependencies to the dracut module + +* Thu Apr 04 2024 Vitaly Kuznetsov - 2.10.0.8-1 +- Update to 2.10.0.8 (#2271975) + +* Mon Jan 22 2024 Fedora Release Engineering - 2.9.1.1-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Fri Jan 19 2024 Fedora Release Engineering - 2.9.1.1-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Wed Oct 18 2023 Vitaly Kuznetsov - 2.9.1.1-1 +- Update to 2.9.1.1 (#2232763) + +* Wed Jul 19 2023 Fedora Release Engineering - 2.9.0.4-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild + +* Tue Jun 13 2023 Python Maint - 2.9.0.4-3 +- Rebuilt for Python 3.12 + +* Tue May 30 2023 Vitaly Kuznetsov - 2.9.0.4-2 +- Switch to SPDX identifiers for the license field + +* Mon Mar 13 2023 Vitaly Kuznetsov - 2.9.0.4-1 +- Update to 2.9.0.4 (#2177333) + +* Fri Jan 20 2023 Dusty Mabe - 2.8.0.11-3 +- Move module-setup.sh into git + +* Wed Jan 18 2023 Fedora Release Engineering - 2.8.0.11-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild + +* Mon Oct 31 2022 Vitaly Kuznetsov - 2.8.0.11-1 +- Update to 2.8.0.11 (#2128547) + +* Tue Oct 18 2022 Chris Patterson - 2.7.3.0-2 +- Add ConditionVirtualization=|microsoft triggering condition + +* Wed Aug 03 2022 Vitaly Kuznetsov - 2.7.3.0-1 +- Update to 2.7.3.0 (#2110155) + +* Wed Jul 20 2022 Fedora Release Engineering - 2.7.1.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild + +* Thu Jun 30 2022 Vitaly Kuznetsov - 2.7.1.0-1 +- Update to 2.7.1.0 (#2097244) + +* Mon Jun 13 2022 Python Maint - 2.7.0.6-2 +- Rebuilt for Python 3.11 + +* Fri Apr 22 2022 Vitaly Kuznetsov - 2.7.0.6-1 +- Update to 2.7.0.6 (#2040980) + +* Wed Jan 19 2022 Fedora Release Engineering - 2.5.0.2-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild + +* Mon Jan 03 2022 Vitaly Kuznetsov - 2.5.0.2-1 +- Update to 2.5.0.2 (#2008699) + +* Wed Jul 21 2021 Fedora Release Engineering - 2.3.1.1-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild + +* Mon Jul 19 2021 Vitaly Kuznetsov - 2.3.1.1-1 +- Update to 2.3.1.1 (#1982512) +- Require iptables for setting up persistent firewall rules + +* Tue Jun 15 2021 Vitaly Kuznetsov - 2.3.0.2-1 +- Update to 2.3.0.2 (#1971116) + +* Fri Jun 04 2021 Python Maint - 2.2.54.2-2 +- Rebuilt for Python 3.10 + +* Fri May 21 2021 Vitaly Kuznetsov - 2.2.54.2-1 +- Update to 2.2.54.2 (#1916966) + +* Tue Mar 02 2021 Zbigniew Jędrzejewski-Szmek - 2.2.52-6 +- Rebuilt for updated systemd-rpm-macros + See https://pagure.io/fesco/issue/2583. + +* Fri Feb 19 2021 Vitaly Kuznetsov - 2.2.52-5 +- Require ntfsprogs on Fedora only + +* Tue Jan 26 2021 Vitaly Kuznetsov - 2.2.52-4 +- Fix distro resolution for RedHat + +* Mon Jan 25 2021 Fedora Release Engineering - 2.2.52-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild + +* Fri Jan 15 2021 Vitaly Kuznetsov - 2.2.52-2 +- Add udev rules to initramfs (#1909287) + +* Wed Dec 09 2020 Vitaly Kuznetsov - 2.2.52-1 +- Update to 2.2.52 (#1849923) +- Add not yet upstream patches supporting Python3.9 changes + +* Mon Jul 27 2020 Fedora Release Engineering - 2.2.48.1-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Tue Jun 09 2020 Vitaly Kuznetsov - 2.2.48.1-1 +- Update to 2.2.48.1 (#1641605) +- Split udev rules to a separate subpackage (#1748432) + +* Tue May 26 2020 Miro Hrončok - 2.2.46-2 +- Rebuilt for Python 3.9 + +* Wed Apr 15 2020 Vitaly Kuznetsov - 2.2.46-1 +- Update to 2.2.46 + +* Tue Jan 28 2020 Fedora Release Engineering - 2.2.40-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild + +* Thu Oct 03 2019 Miro Hrončok - 2.2.40-6 +- Rebuilt for Python 3.8.0rc1 (#1748018) + +* Wed Aug 21 2019 Miro Hrončok - 2.2.40-5 +- Rebuilt for Python 3.8 + +* Wed Aug 21 2019 Vitaly Kuznetsov - 2.2.40-4 +- Disable Python2 dependent 'legacy' subpackage (#1741029) + +* Mon Aug 19 2019 Miro Hrončok - 2.2.40-3 +- Rebuilt for Python 3.8 + +* Wed Jul 24 2019 Fedora Release Engineering - 2.2.40-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + +* Mon Jun 03 2019 Vitaly Kuznetsov - 2.2.40-1 +- Update to 2.2.40 +- Fix FTBFS in the preparation for Python3.8 (#1705219) + +* Thu Mar 14 2019 Vitaly Kuznetsov - 2.2.38-1 +- Update to 2.2.38 (CVE-2019-0804) + +* Thu Mar 14 2019 Vitaly Kuznetsov - 2.2.37-1 +- Update to 2.2.37 + +* Thu Jan 31 2019 Fedora Release Engineering - 2.2.32-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + +* Thu Sep 20 2018 Vitaly Kuznetsov - 2.2.32-1 +- Update to 2.2.32.2 + +* Thu Jul 12 2018 Fedora Release Engineering - 2.2.25-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + +* Tue Jun 19 2018 Miro Hrončok - 2.2.25-3 +- Rebuilt for Python 3.7 + +* Wed Apr 25 2018 Vitaly Kuznetsov - 2.2.25-2 +- Move net-tools dependency to WALinuxAgent-legacy (#1106781) + +* Mon Apr 16 2018 Vitaly Kuznetsov - 2.2.25-1 +- Update to 2.2.25 +- Switch to Python3 +- Legacy subpackage with waagent2.0 supporting old extensions + +* Wed Feb 28 2018 Iryna Shcherbina - 2.0.18-5 +- Update Python 2 dependency declarations to new packaging standards + (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3) + +* Wed Feb 07 2018 Fedora Release Engineering - 2.0.18-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + +* Wed Jul 26 2017 Fedora Release Engineering - 2.0.18-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + +* Fri Feb 10 2017 Fedora Release Engineering - 2.0.18-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild + +* Sat Apr 02 2016 Scott K Logan - 2.0.18-1 +- Update to 2.0.18 + +* Wed Feb 03 2016 Fedora Release Engineering - 2.0.14-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild + +* Thu Jul 02 2015 Scott K Logan - 2.0.14-1 +- Update to 2.0.14 + +* Tue Jun 16 2015 Fedora Release Engineering - 2.0.13-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild + +* Mon Jun 01 2015 Scott K Logan - 2.0.13-1 +- Update to 2.0.13 + +* Thu Apr 02 2015 Scott K Logan - 2.0.12-1 +- Update to 2.0.12-Oracle + +* Sat Jan 10 2015 Scott K Logan - 2.0.11-2 +- Use systemd for rhel7 +- Own logrotate.d +- Fix python2-devel dep + +* Sat Dec 20 2014 Scott K Logan - 2.0.11-1 +- Initial package From 1302d6c7f443caa1c14032dc4bc02c861e9d3fe4 Mon Sep 17 00:00:00 2001 From: Jeremy Cline Date: Thu, 13 Jun 2024 15:02:50 -0400 Subject: [PATCH 09/25] Drop both legacycrypt-related patches In the short-term we can manually require crypt-r which exposes a "crypt" module, making both backported patches unnecessary. If upstream decides to stick with legacycrypt we'll have to do some additional packaging, but we can cross that bridge when we come to it (probably next release). --- ...instead-of-crypt-on-Python-3.13-3070.patch | 258 ------------------ ...acycrypt-for-crypt-r-for-Python-3.13.patch | 73 ----- WALinuxAgent.spec | 6 - 3 files changed, 337 deletions(-) delete mode 100644 0001-Use-legacycrypt-instead-of-crypt-on-Python-3.13-3070.patch delete mode 100644 0002-Swap-out-legacycrypt-for-crypt-r-for-Python-3.13.patch diff --git a/0001-Use-legacycrypt-instead-of-crypt-on-Python-3.13-3070.patch b/0001-Use-legacycrypt-instead-of-crypt-on-Python-3.13-3070.patch deleted file mode 100644 index 435a881..0000000 --- a/0001-Use-legacycrypt-instead-of-crypt-on-Python-3.13-3070.patch +++ /dev/null @@ -1,258 +0,0 @@ -From 12adcb0b1181054f58e4fe172f7bfb795881cdb4 Mon Sep 17 00:00:00 2001 -From: Norberto Arrieta -Date: Tue, 27 Feb 2024 14:58:44 -0800 -Subject: [PATCH 1/2] Use legacycrypt instead of crypt on Python >= 3.13 - (#3070) - -* Use legacycrypt instead of crypt on Python >= 3.13 - -* remove ModuleNotFound - ---------- - -Co-authored-by: narrieta -Signed-off-by: Jeremy Cline ---- - azurelinuxagent/common/osutil/default.py | 27 ++++++++++++++++--- - azurelinuxagent/common/osutil/freebsd.py | 2 +- - azurelinuxagent/common/osutil/gaia.py | 3 +-- - azurelinuxagent/common/utils/textutil.py | 13 --------- - requirements.txt | 3 ++- - setup.py | 17 +++++++----- - tests/common/osutil/test_default.py | 9 +++++++ - .../{utils => osutil}/test_passwords.txt | 0 - tests/common/utils/test_text_util.py | 10 ------- - 9 files changed, 47 insertions(+), 37 deletions(-) - rename tests/common/{utils => osutil}/test_passwords.txt (100%) - -diff --git a/azurelinuxagent/common/osutil/default.py b/azurelinuxagent/common/osutil/default.py -index f763d5f5..1486167c 100644 ---- a/azurelinuxagent/common/osutil/default.py -+++ b/azurelinuxagent/common/osutil/default.py -@@ -16,6 +16,7 @@ - # Requires Python 2.6+ and Openssl 1.0+ - # - -+import array - import base64 - import datetime - import errno -@@ -26,15 +27,26 @@ import multiprocessing - import os - import platform - import pwd -+import random - import re - import shutil - import socket -+import string - import struct - import sys - import time - from pwd import getpwall - --import array -+from azurelinuxagent.common.exception import OSUtilError -+# 'crypt' was removed in Python 3.13; use legacycrypt instead -+if sys.version_info[0] == 3 and sys.version_info[1] >= 13 or sys.version_info[0] > 3: -+ try: -+ from legacycrypt import crypt -+ except ImportError: -+ def crypt(password, salt): -+ raise OSUtilError("Please install the legacycrypt Python module to use this feature.") -+else: -+ from crypt import crypt # pylint: disable=deprecated-module - - from azurelinuxagent.common import conf - from azurelinuxagent.common import logger -@@ -42,7 +54,6 @@ from azurelinuxagent.common.utils import fileutil - from azurelinuxagent.common.utils import shellutil - from azurelinuxagent.common.utils import textutil - --from azurelinuxagent.common.exception import OSUtilError - from azurelinuxagent.common.future import ustr, array_to_bytes - from azurelinuxagent.common.utils.cryptutil import CryptUtil - from azurelinuxagent.common.utils.flexible_version import FlexibleVersion -@@ -433,11 +444,21 @@ class DefaultOSUtil(object): - if self.is_sys_user(username): - raise OSUtilError(("User {0} is a system user, " - "will not set password.").format(username)) -- passwd_hash = textutil.gen_password_hash(password, crypt_id, salt_len) -+ passwd_hash = DefaultOSUtil.gen_password_hash(password, crypt_id, salt_len) - - self._run_command_raising_OSUtilError(["usermod", "-p", passwd_hash, username], - err_msg="Failed to set password for {0}".format(username)) - -+ @staticmethod -+ def gen_password_hash(password, crypt_id, salt_len): -+ collection = string.ascii_letters + string.digits -+ salt = ''.join(random.choice(collection) for _ in range(salt_len)) -+ salt = "${0}${1}".format(crypt_id, salt) -+ if sys.version_info[0] == 2: -+ # if python 2.*, encode to type 'str' to prevent Unicode Encode Error from crypt.crypt -+ password = password.encode('utf-8') -+ return crypt(password, salt) -+ - def get_users(self): - return getpwall() - -diff --git a/azurelinuxagent/common/osutil/freebsd.py b/azurelinuxagent/common/osutil/freebsd.py -index f8ee6db8..cff46709 100644 ---- a/azurelinuxagent/common/osutil/freebsd.py -+++ b/azurelinuxagent/common/osutil/freebsd.py -@@ -77,7 +77,7 @@ class FreeBSDOSUtil(DefaultOSUtil): - if self.is_sys_user(username): - raise OSUtilError(("User {0} is a system user, " - "will not set password.").format(username)) -- passwd_hash = textutil.gen_password_hash(password, crypt_id, salt_len) -+ passwd_hash = DefaultOSUtil.gen_password_hash(password, crypt_id, salt_len) - self._run_command_raising_OSUtilError(['pw', 'usermod', username, '-H', '0'], cmd_input=passwd_hash, - err_msg="Failed to set password for {0}".format(username)) - -diff --git a/azurelinuxagent/common/osutil/gaia.py b/azurelinuxagent/common/osutil/gaia.py -index 849d5d1f..3f9f746b 100644 ---- a/azurelinuxagent/common/osutil/gaia.py -+++ b/azurelinuxagent/common/osutil/gaia.py -@@ -29,7 +29,6 @@ from azurelinuxagent.common.osutil.default import DefaultOSUtil - from azurelinuxagent.common.utils.cryptutil import CryptUtil - import azurelinuxagent.common.utils.fileutil as fileutil - import azurelinuxagent.common.utils.shellutil as shellutil --import azurelinuxagent.common.utils.textutil as textutil - - - class GaiaOSUtil(DefaultOSUtil): -@@ -64,7 +63,7 @@ class GaiaOSUtil(DefaultOSUtil): - - def chpasswd(self, username, password, crypt_id=6, salt_len=10): - logger.info('chpasswd') -- passwd_hash = textutil.gen_password_hash(password, crypt_id, salt_len) -+ passwd_hash = DefaultOSUtil.gen_password_hash(password, crypt_id, salt_len) - ret, out = self._run_clish( - 'set user admin password-hash ' + passwd_hash) - if ret != 0: -diff --git a/azurelinuxagent/common/utils/textutil.py b/azurelinuxagent/common/utils/textutil.py -index 1ff7a7e9..4a0f9a75 100644 ---- a/azurelinuxagent/common/utils/textutil.py -+++ b/azurelinuxagent/common/utils/textutil.py -@@ -17,11 +17,8 @@ - # Requires Python 2.6+ and Openssl 1.0+ - - import base64 --import crypt - import hashlib --import random - import re --import string - import struct - import sys - import traceback -@@ -287,16 +284,6 @@ def remove_bom(c): - return c - - --def gen_password_hash(password, crypt_id, salt_len): -- collection = string.ascii_letters + string.digits -- salt = ''.join(random.choice(collection) for _ in range(salt_len)) -- salt = "${0}${1}".format(crypt_id, salt) -- if sys.version_info[0] == 2: -- # if python 2.*, encode to type 'str' to prevent Unicode Encode Error from crypt.crypt -- password = password.encode('utf-8') -- return crypt.crypt(password, salt) -- -- - def get_bytes_from_pem(pem_str): - base64_bytes = "" - for line in pem_str.split('\n'): -diff --git a/requirements.txt b/requirements.txt -index b0b7c874..ab6958a7 100644 ---- a/requirements.txt -+++ b/requirements.txt -@@ -1,2 +1,3 @@ - distro; python_version >= '3.8' --pyasn1 -\ No newline at end of file -+pyasn1 -+legacycrypt; python_version >= '3.13' -diff --git a/setup.py b/setup.py -index 6b54d09e..2d51fae8 100755 ---- a/setup.py -+++ b/setup.py -@@ -314,13 +314,16 @@ class install(_install): # pylint: disable=C0103 - - - # Note to packagers and users from source. --# In version 3.5 of Python distribution information handling in the platform --# module was deprecated. Depending on the Linux distribution the --# implementation may be broken prior to Python 3.7 wher the functionality --# will be removed from Python 3 --requires = [] # pylint: disable=invalid-name --if sys.version_info[0] >= 3 and sys.version_info[1] >= 7: -- requires = ['distro'] # pylint: disable=invalid-name -+# * In version 3.5 of Python distribution information handling in the platform -+# module was deprecated. Depending on the Linux distribution the -+# implementation may be broken prior to Python 3.8 where the functionality -+# will be removed from Python 3. -+# * In version 3.13 of Python, the crypt module was removed and legacycrypt is -+# required instead. -+requires = [ -+ "distro;python_version>='3.8'", -+ "legacycrypt;python_version>='3.13'", -+] - - modules = [] # pylint: disable=invalid-name - -diff --git a/tests/common/osutil/test_default.py b/tests/common/osutil/test_default.py -index afe27ae5..8325bbd0 100644 ---- a/tests/common/osutil/test_default.py -+++ b/tests/common/osutil/test_default.py -@@ -1111,6 +1111,15 @@ class TestGetPublishedHostname(AgentTestCase): - self.assertEqual(expected, actual, "get_hostname_record returned an incorrect hostname") - self.assertEqual(expected, self.__get_published_hostname_contents(), "get_hostname_record returned an incorrect hostname") - -+ def test_get_password_hash(self): -+ with open(os.path.join(os.path.dirname(os.path.realpath(__file__)), 'test_passwords.txt'), 'rb') as in_file: -+ for data in in_file: -+ # Remove bom on bytes data before it is converted into string. -+ data = textutil.remove_bom(data) -+ data = ustr(data, encoding='utf-8') -+ password_hash = osutil.DefaultOSUtil.gen_password_hash(data, 6, 10) -+ self.assertNotEqual(None, password_hash) -+ - - if __name__ == '__main__': - unittest.main() -diff --git a/tests/common/utils/test_passwords.txt b/tests/common/osutil/test_passwords.txt -similarity index 100% -rename from tests/common/utils/test_passwords.txt -rename to tests/common/osutil/test_passwords.txt -diff --git a/tests/common/utils/test_text_util.py b/tests/common/utils/test_text_util.py -index 5029cfb9..b382aa28 100644 ---- a/tests/common/utils/test_text_util.py -+++ b/tests/common/utils/test_text_util.py -@@ -16,7 +16,6 @@ - # - - import hashlib --import os - import unittest - from distutils.version import LooseVersion as Version # pylint: disable=no-name-in-module,import-error - -@@ -26,15 +25,6 @@ from tests.lib.tools import AgentTestCase - - - class TestTextUtil(AgentTestCase): -- def test_get_password_hash(self): -- with open(os.path.join(os.path.dirname(os.path.realpath(__file__)), 'test_passwords.txt'), 'rb') as in_file: -- for data in in_file: -- # Remove bom on bytes data before it is converted into string. -- data = textutil.remove_bom(data) -- data = ustr(data, encoding='utf-8') -- password_hash = textutil.gen_password_hash(data, 6, 10) -- self.assertNotEqual(None, password_hash) -- - def test_replace_non_ascii(self): - data = ustr(b'\xef\xbb\xbfhehe', encoding='utf-8') - self.assertEqual('hehe', textutil.replace_non_ascii(data)) --- -2.45.2 - diff --git a/0002-Swap-out-legacycrypt-for-crypt-r-for-Python-3.13.patch b/0002-Swap-out-legacycrypt-for-crypt-r-for-Python-3.13.patch deleted file mode 100644 index dcc5c58..0000000 --- a/0002-Swap-out-legacycrypt-for-crypt-r-for-Python-3.13.patch +++ /dev/null @@ -1,73 +0,0 @@ -From faacd2d59fd34007fa4d678a2a89645d16fdaa7d Mon Sep 17 00:00:00 2001 -From: Jeremy Cline -Date: Wed, 12 Jun 2024 15:01:49 -0400 -Subject: [PATCH 2/2] Swap out legacycrypt for crypt-r for Python 3.13+ - -PR #3070 pulled in legacycrypt to replace the removed crypt module. -legacycrypt hasn't been updated since it was initially pulled out of -Python's stdlib in 2019 (Python 3.7). crypt-r pulls in the module as it -was in Python 3.12. While there's been no major developments since 3.7, -it's more likely to be kept updated for any breakages in future Python -releases. - -It's also already packaged for Fedora and means one less package for me -to maintain so that would be nice. - -Signed-off-by: Jeremy Cline ---- - azurelinuxagent/common/osutil/default.py | 6 +++--- - requirements.txt | 2 +- - setup.py | 4 ++-- - 3 files changed, 6 insertions(+), 6 deletions(-) - -diff --git a/azurelinuxagent/common/osutil/default.py b/azurelinuxagent/common/osutil/default.py -index 1486167c..2f339800 100644 ---- a/azurelinuxagent/common/osutil/default.py -+++ b/azurelinuxagent/common/osutil/default.py -@@ -38,13 +38,13 @@ import time - from pwd import getpwall - - from azurelinuxagent.common.exception import OSUtilError --# 'crypt' was removed in Python 3.13; use legacycrypt instead -+# 'crypt' was removed in Python 3.13; use crypt-r instead - if sys.version_info[0] == 3 and sys.version_info[1] >= 13 or sys.version_info[0] > 3: - try: -- from legacycrypt import crypt -+ from crypt_r import crypt - except ImportError: - def crypt(password, salt): -- raise OSUtilError("Please install the legacycrypt Python module to use this feature.") -+ raise OSUtilError("Please install the crypt-r Python module to use this feature.") - else: - from crypt import crypt # pylint: disable=deprecated-module - -diff --git a/requirements.txt b/requirements.txt -index ab6958a7..fcb64396 100644 ---- a/requirements.txt -+++ b/requirements.txt -@@ -1,3 +1,3 @@ - distro; python_version >= '3.8' - pyasn1 --legacycrypt; python_version >= '3.13' -+crypt-r; python_version >= '3.13' -diff --git a/setup.py b/setup.py -index 2d51fae8..26610ca8 100755 ---- a/setup.py -+++ b/setup.py -@@ -318,11 +318,11 @@ class install(_install): # pylint: disable=C0103 - # module was deprecated. Depending on the Linux distribution the - # implementation may be broken prior to Python 3.8 where the functionality - # will be removed from Python 3. --# * In version 3.13 of Python, the crypt module was removed and legacycrypt is -+# * In version 3.13 of Python, the crypt module was removed and crypt-r is - # required instead. - requires = [ - "distro;python_version>='3.8'", -- "legacycrypt;python_version>='3.13'", -+ "crypt-r;python_version>='3.13'", - ] - - modules = [] # pylint: disable=invalid-name --- -2.45.2 - diff --git a/WALinuxAgent.spec b/WALinuxAgent.spec index 481c949..ec3b4c1 100644 --- a/WALinuxAgent.spec +++ b/WALinuxAgent.spec @@ -12,12 +12,6 @@ Source0: https://github.com/Azure/%{name}/archive/v%{version}.tar.gz Source1: module-setup.sh Patch1: 0001-waagent.service-set-ConditionVirtualization-microsof.patch -# These two patches are from PR 3070 (merged) and PR 3141 (proposed) and -# are needed to build with Python 3.13 since it removed the crypt module. -# If PR 3141 is not merged it should be dropped in the future for whatever -# upstream decides to go with. -Patch2: 0001-Use-legacycrypt-instead-of-crypt-on-Python-3.13-3070.patch -Patch3: 0002-Swap-out-legacycrypt-for-crypt-r-for-Python-3.13.patch BuildArch: noarch From b059b62abe167b5fa2f2adef4a993b9927d3ac39 Mon Sep 17 00:00:00 2001 From: Jeremy Cline Date: Thu, 13 Jun 2024 15:27:47 -0400 Subject: [PATCH 10/25] Switch to autosetup This handles automatically applying patches. [skip changelog] --- WALinuxAgent.spec | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/WALinuxAgent.spec b/WALinuxAgent.spec index ec3b4c1..f0f34dc 100644 --- a/WALinuxAgent.spec +++ b/WALinuxAgent.spec @@ -59,10 +59,9 @@ Summary: Udev rules for Microsoft Azure Udev rules specific to Microsoft Azure Virtual Machines. %prep -%setup -q -%patch 1 -p1 -%patch 2 -p1 -%patch 3 -p1 +%autosetup -n %{name}-%{version} -p1 + + %build %py3_build From 8ec7e0352b9ebc48b60ce4f935b77b03f2a0f686 Mon Sep 17 00:00:00 2001 From: Jeremy Cline Date: Thu, 13 Jun 2024 16:38:30 -0400 Subject: [PATCH 11/25] Switch to pyproject-rpm-macros This also stops depending on upstream's complicated setup.py to install service and configuration files. Instead, this is done explicitly. This isn't really more complicated, however, since previously we had to move all the installed files around to the correct directory. [skip changelog] --- WALinuxAgent.spec | 47 ++++++++++++++++++++++++++++++++--------------- 1 file changed, 32 insertions(+), 15 deletions(-) diff --git a/WALinuxAgent.spec b/WALinuxAgent.spec index f0f34dc..8f62ed3 100644 --- a/WALinuxAgent.spec +++ b/WALinuxAgent.spec @@ -15,10 +15,12 @@ Patch1: 0001-waagent.service-set-ConditionVirtualization-microsof.patch BuildArch: noarch -BuildRequires: python3-devel +BuildRequires: pyproject-rpm-macros + BuildRequires: python3-setuptools BuildRequires: python3-distro BuildRequires: python3-crypt-r + Requires: %name-udev = %version-%release %if 0%{?fedora} Requires: ntfsprogs @@ -27,7 +29,8 @@ Requires: openssh Requires: openssh-server Requires: openssl Requires: parted -Requires: python3-pyasn1 +# We need to manually require this for now since upstream +# still uses crypt (removed in Python 3.13) Requires: python3-crypt-r Requires: iptables @@ -62,23 +65,42 @@ Udev rules specific to Microsoft Azure Virtual Machines. %autosetup -n %{name}-%{version} -p1 +%generate_buildrequires +%pyproject_buildrequires + %build -%py3_build +%pyproject_wheel + %install -%{__python3} setup.py install -O1 --skip-build --root %{buildroot} --lnx-distro redhat +%pyproject_install +%pyproject_save_files azurelinuxagent + +# Prune files the setup.py installs, but that we don't want. +# +# While the setup.py does try to install configuration files, +# it doesn't place them where we need them so we install them +# explicitly later. +rm -rf %{buildroot}/%{python3_sitelib}/{usr,etc} +rm -rf %{buildroot}/%{python3_sitelib}/tests +rm -rf %{buildroot}/%{python3_sitelib}/__main__.py +rm -rf %{buildroot}/%{python3_sitelib}/__pycache__/__main__*.py* mkdir -p -m 0700 %{buildroot}%{_sharedstatedir}/waagent mkdir -p %{buildroot}%{_localstatedir}/log touch %{buildroot}%{_localstatedir}/log/waagent.log -mkdir -p %{buildroot}%{_udevrulesdir} -mv %{buildroot}%{_sysconfdir}/udev/rules.d/*.rules %{buildroot}%{_udevrulesdir}/ +# Install configuration and systemd files for the agent +install -m0644 -D --target-directory=%{buildroot}%{_sysconfdir}/ config/waagent.conf +install -m0644 -D --target-directory=%{buildroot}%{_unitdir}/ init/*.slice +install -m0755 -D bin/waagent %{buildroot}%{_sbindir}/waagent +install -m0644 -D init/redhat/waagent.service %{buildroot}%{_unitdir}/ +install -m0644 -D config/waagent.logrotate %{buildroot}%{_sysconfdir}/logrotate.d/%{name} -rm -rf %{buildroot}/%{python3_sitelib}/tests -rm -rf %{buildroot}/%{python3_sitelib}/__main__.py -rm -rf %{buildroot}/%{python3_sitelib}/__pycache__/__main__*.py* +# Install -udev related files +install -m0644 -D --target-directory=%{buildroot}%{_udevrulesdir}/ config/*.rules +install -m0755 -D --target-directory=%{buildroot}%{_prefix}/lib/dracut/modules.d/%{dracut_modname}/ %{SOURCE1} sed -i 's,#!/usr/bin/env python,#!/usr/bin/python3,' %{buildroot}%{_sbindir}/waagent %if 0%{?with_legacy} @@ -88,9 +110,6 @@ rm -f %{buildroot}%{_sbindir}/waagent2.0 %endif sed -i 's,/usr/bin/python ,/usr/bin/python3 ,' %{buildroot}%{_unitdir}/waagent.service -mv %{buildroot}%{_sysconfdir}/logrotate.d/waagent.logrotate %{buildroot}%{_sysconfdir}/logrotate.d/%{name} - -install -m0755 -D -t %{buildroot}%{_prefix}/lib/dracut/modules.d/%{dracut_modname}/ %{SOURCE1} %post %systemd_post waagent.service @@ -101,7 +120,7 @@ install -m0755 -D -t %{buildroot}%{_prefix}/lib/dracut/modules.d/%{dracut_modnam %postun %systemd_postun_with_restart waagent.service -%files +%files -f %{pyproject_files} %doc LICENSE.txt NOTICE README.md %ghost %{_localstatedir}/log/waagent.log %dir %attr(0700, root, root) %{_sharedstatedir}/waagent @@ -111,8 +130,6 @@ install -m0755 -D -t %{buildroot}%{_prefix}/lib/dracut/modules.d/%{dracut_modnam %{_unitdir}/waagent.service %{_unitdir}/azure.slice %{_unitdir}/azure-vmextensions.slice -%{python3_sitelib}/azurelinuxagent -%{python3_sitelib}/*.egg-info %files udev %{_udevrulesdir}/*.rules From 35ee2516efe5a9887960e30d4a7cc12d5a751514 Mon Sep 17 00:00:00 2001 From: Jeremy Cline Date: Thu, 13 Jun 2024 16:50:17 -0400 Subject: [PATCH 12/25] Drop the legacy package definition While Python 2 is still in use for RHEL7, I think we can safely drop it from the Rawhide specfile. [skip changelog] --- WALinuxAgent.spec | 25 ++----------------------- 1 file changed, 2 insertions(+), 23 deletions(-) diff --git a/WALinuxAgent.spec b/WALinuxAgent.spec index 8f62ed3..6417da5 100644 --- a/WALinuxAgent.spec +++ b/WALinuxAgent.spec @@ -1,4 +1,3 @@ -%global with_legacy 0 %global dracut_modname 97walinuxagent Name: WALinuxAgent @@ -16,7 +15,6 @@ Patch1: 0001-waagent.service-set-ConditionVirtualization-microsof.patch BuildArch: noarch BuildRequires: pyproject-rpm-macros - BuildRequires: python3-setuptools BuildRequires: python3-distro BuildRequires: python3-crypt-r @@ -44,17 +42,6 @@ The Microsoft Azure Linux Agent supports the provisioning and running of Linux VMs in the Microsoft Azure cloud. This package should be installed on Linux disk images that are built to run in the Microsoft Azure environment. -%if 0%{?with_legacy} -%package legacy -Summary: The Microsoft Azure Linux Agent (legacy) -Requires: %name = %version-%release -Requires: python2 -Requires: net-tools - -%description legacy -The Microsoft Azure Linux Agent supporting old version of extensions. -%endif - %package udev Summary: Udev rules for Microsoft Azure @@ -86,6 +73,7 @@ rm -rf %{buildroot}/%{python3_sitelib}/{usr,etc} rm -rf %{buildroot}/%{python3_sitelib}/tests rm -rf %{buildroot}/%{python3_sitelib}/__main__.py rm -rf %{buildroot}/%{python3_sitelib}/__pycache__/__main__*.py* +rm -f %{buildroot}%{_sbindir}/waagent2.0 mkdir -p -m 0700 %{buildroot}%{_sharedstatedir}/waagent mkdir -p %{buildroot}%{_localstatedir}/log @@ -103,11 +91,6 @@ install -m0644 -D --target-directory=%{buildroot}%{_udevrulesdir}/ config/*.rule install -m0755 -D --target-directory=%{buildroot}%{_prefix}/lib/dracut/modules.d/%{dracut_modname}/ %{SOURCE1} sed -i 's,#!/usr/bin/env python,#!/usr/bin/python3,' %{buildroot}%{_sbindir}/waagent -%if 0%{?with_legacy} -sed -i 's,#!/usr/bin/env python,#!/usr/bin/python2,' %{buildroot}%{_sbindir}/waagent2.0 -%else -rm -f %{buildroot}%{_sbindir}/waagent2.0 -%endif sed -i 's,/usr/bin/python ,/usr/bin/python3 ,' %{buildroot}%{_unitdir}/waagent.service @@ -125,8 +108,8 @@ sed -i 's,/usr/bin/python ,/usr/bin/python3 ,' %{buildroot}%{_unitdir}/waagent.s %ghost %{_localstatedir}/log/waagent.log %dir %attr(0700, root, root) %{_sharedstatedir}/waagent %config(noreplace) %{_sysconfdir}/logrotate.d/%{name} -%{_sbindir}/waagent %config(noreplace) %{_sysconfdir}/waagent.conf +%{_sbindir}/waagent %{_unitdir}/waagent.service %{_unitdir}/azure.slice %{_unitdir}/azure-vmextensions.slice @@ -135,10 +118,6 @@ sed -i 's,/usr/bin/python ,/usr/bin/python3 ,' %{buildroot}%{_unitdir}/waagent.s %{_udevrulesdir}/*.rules %{_prefix}/lib/dracut/modules.d/%{dracut_modname}/*.sh -%if 0%{?with_legacy} -%files legacy -%{_sbindir}/waagent2.0 -%endif %changelog %autochangelog From 660db33db56f4d1e8ebc7489d2c750fd7c22bcce Mon Sep 17 00:00:00 2001 From: Jeremy Cline Date: Fri, 14 Jun 2024 11:17:56 -0400 Subject: [PATCH 13/25] Add missing logrotate dependency The agent logs to /var/log/ and installs a logrotate config, but doesn't depend on the package. --- WALinuxAgent.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/WALinuxAgent.spec b/WALinuxAgent.spec index 6417da5..a6e8aca 100644 --- a/WALinuxAgent.spec +++ b/WALinuxAgent.spec @@ -31,6 +31,7 @@ Requires: parted # still uses crypt (removed in Python 3.13) Requires: python3-crypt-r Requires: iptables +Requires: logrotate BuildRequires: systemd Requires(post): systemd From c553f93c3a43b0d5f039e75d6ad28b38afd9754a Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Wed, 17 Jul 2024 16:26:20 +0000 Subject: [PATCH 14/25] Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild From 86fd51f6375bff377884f3b2a41607b9fc2a0884 Mon Sep 17 00:00:00 2001 From: Vitaly Kuznetsov Date: Mon, 21 Oct 2024 17:36:28 +0200 Subject: [PATCH 15/25] Update to v2.11.1.12 Signed-off-by: Vitaly Kuznetsov --- .gitignore | 1 + WALinuxAgent.spec | 2 +- sources | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 8efa138..fc2e64e 100644 --- a/.gitignore +++ b/.gitignore @@ -25,3 +25,4 @@ /v2.9.1.1.tar.gz /v2.10.0.8.tar.gz /v2.11.1.4.tar.gz +/v2.11.1.12.tar.gz diff --git a/WALinuxAgent.spec b/WALinuxAgent.spec index a6e8aca..b144983 100644 --- a/WALinuxAgent.spec +++ b/WALinuxAgent.spec @@ -1,7 +1,7 @@ %global dracut_modname 97walinuxagent Name: WALinuxAgent -Version: 2.11.1.4 +Version: 2.11.1.12 Release: %autorelease Summary: The Microsoft Azure Linux Agent diff --git a/sources b/sources index 11fe930..572b6d4 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (v2.11.1.4.tar.gz) = e67ecd801541bd869bc01a023ee3b06a6ee879b5780b34c5fa320d080276ebe8400c66a8550b58d0ca4a1116bd923b00ce2da60d09c574f30c50f446b5a6ac2f +SHA512 (v2.11.1.12.tar.gz) = 5979b1553b2cba1e8b7673ad2f29ccf91fb24ecc74034304caf78de735eb38b2955b9aaf092bdbedae611f6f19fdfc07ceabb0df7832b5be1570a58d1fe8d3cd From 8f18b5595d8233262d0d0b5b7f1aef936d2d2d2d Mon Sep 17 00:00:00 2001 From: Vitaly Kuznetsov Date: Tue, 26 Nov 2024 15:23:09 +0100 Subject: [PATCH 16/25] Update to v2.12.0.4 Note: legacycrypt is not in Fedora, add a patch to keep working with 'crypt_r' instead. Signed-off-by: Vitaly Kuznetsov --- .gitignore | 2 + 0001-Fedora-do-not-require-legacycrypt.patch | 67 ++++++++++++++++++++ WALinuxAgent.spec | 3 +- sources | 2 +- 4 files changed, 72 insertions(+), 2 deletions(-) create mode 100644 0001-Fedora-do-not-require-legacycrypt.patch diff --git a/.gitignore b/.gitignore index fc2e64e..266efa3 100644 --- a/.gitignore +++ b/.gitignore @@ -26,3 +26,5 @@ /v2.10.0.8.tar.gz /v2.11.1.4.tar.gz /v2.11.1.12.tar.gz +/v2.12.0.2.tar.gz +/v2.12.0.4.tar.gz diff --git a/0001-Fedora-do-not-require-legacycrypt.patch b/0001-Fedora-do-not-require-legacycrypt.patch new file mode 100644 index 0000000..41caab1 --- /dev/null +++ b/0001-Fedora-do-not-require-legacycrypt.patch @@ -0,0 +1,67 @@ +From 376c6651f3f7c863c1aa5ac5e9536e974e6ab17c Mon Sep 17 00:00:00 2001 +From: Vitaly Kuznetsov +Date: Wed, 27 Nov 2024 14:53:15 +0100 +Subject: [PATCH] Fedora: do not require legacycrypt +Content-Type: text/plain + +'legacycrypt' is not yet present in Fedora, however, there's 'crypt_r' +stub emulating 'crypt'. + +Signed-off-by: Vitaly Kuznetsov +--- + azurelinuxagent/common/osutil/default.py | 10 +--------- + requirements.txt | 1 - + setup.py | 5 ++--- + 3 files changed, 3 insertions(+), 13 deletions(-) + +diff --git a/azurelinuxagent/common/osutil/default.py b/azurelinuxagent/common/osutil/default.py +index 0a0fd0e1cdd7..3a1c647a8363 100644 +--- a/azurelinuxagent/common/osutil/default.py ++++ b/azurelinuxagent/common/osutil/default.py +@@ -38,15 +38,7 @@ import time + from pwd import getpwall + + from azurelinuxagent.common.exception import OSUtilError +-# 'crypt' was removed in Python 3.13; use legacycrypt instead +-if sys.version_info[0] == 3 and sys.version_info[1] >= 13 or sys.version_info[0] > 3: +- try: +- from legacycrypt import crypt +- except ImportError: +- def crypt(password, salt): +- raise OSUtilError("Please install the legacycrypt Python module to use this feature.") +-else: +- from crypt import crypt # pylint: disable=deprecated-module ++from crypt import crypt # pylint: disable=deprecated-module + + from azurelinuxagent.common import conf + from azurelinuxagent.common import logger +diff --git a/requirements.txt b/requirements.txt +index ab6958a732ce..ee3b024d8fdc 100644 +--- a/requirements.txt ++++ b/requirements.txt +@@ -1,3 +1,2 @@ + distro; python_version >= '3.8' + pyasn1 +-legacycrypt; python_version >= '3.13' +diff --git a/setup.py b/setup.py +index e83f598934c6..ea4c488b2897 100755 +--- a/setup.py ++++ b/setup.py +@@ -319,12 +319,11 @@ class install(_install): # pylint: disable=C0103 + # implementation may be broken prior to Python 3.8 where the functionality + # will be removed from Python 3. + # * In version 3.13 of Python, the crypt module was removed and legacycrypt is +-# required instead. ++# required instead. Fedora doesn't provide legacycrypt but has 'crypt_r' stub ++# instead. + requires = [] + if sys.version_info[0] >= 3 and sys.version_info[1] >= 8: + requires.append('distro') +-if sys.version_info[0] >= 3 and sys.version_info[1] >= 13: +- requires.append('legacycrypt') + + modules = [] # pylint: disable=invalid-name + +-- +2.47.0 + diff --git a/WALinuxAgent.spec b/WALinuxAgent.spec index b144983..b3c602f 100644 --- a/WALinuxAgent.spec +++ b/WALinuxAgent.spec @@ -1,7 +1,7 @@ %global dracut_modname 97walinuxagent Name: WALinuxAgent -Version: 2.11.1.12 +Version: 2.12.0.4 Release: %autorelease Summary: The Microsoft Azure Linux Agent @@ -11,6 +11,7 @@ Source0: https://github.com/Azure/%{name}/archive/v%{version}.tar.gz Source1: module-setup.sh Patch1: 0001-waagent.service-set-ConditionVirtualization-microsof.patch +Patch2: 0001-Fedora-do-not-require-legacycrypt.patch BuildArch: noarch diff --git a/sources b/sources index 572b6d4..b420d66 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (v2.11.1.12.tar.gz) = 5979b1553b2cba1e8b7673ad2f29ccf91fb24ecc74034304caf78de735eb38b2955b9aaf092bdbedae611f6f19fdfc07ceabb0df7832b5be1570a58d1fe8d3cd +SHA512 (v2.12.0.4.tar.gz) = 483c187afd30c8d356b54af7a01544297ea6c8f196234332a9ecac23c9192d0432fcc31f5a3ff31b763d36faabec4f77262d44d5d729f8f2256695f208319571 From 6e0394d06e6acfecc65992858bf6d02162362644 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 16 Jan 2025 10:23:35 +0000 Subject: [PATCH 17/25] Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild From 705517316832cc4e6cda63ab306b821261c3ea93 Mon Sep 17 00:00:00 2001 From: Vitaly Kuznetsov Date: Mon, 5 May 2025 16:13:48 +0200 Subject: [PATCH 18/25] Update to v2.13.1.1 (#2363841) Signed-off-by: Vitaly Kuznetsov --- .gitignore | 1 + WALinuxAgent.spec | 2 +- sources | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 266efa3..f36f11d 100644 --- a/.gitignore +++ b/.gitignore @@ -28,3 +28,4 @@ /v2.11.1.12.tar.gz /v2.12.0.2.tar.gz /v2.12.0.4.tar.gz +/v2.13.1.1.tar.gz diff --git a/WALinuxAgent.spec b/WALinuxAgent.spec index b3c602f..3f562fd 100644 --- a/WALinuxAgent.spec +++ b/WALinuxAgent.spec @@ -1,7 +1,7 @@ %global dracut_modname 97walinuxagent Name: WALinuxAgent -Version: 2.12.0.4 +Version: 2.13.1.1 Release: %autorelease Summary: The Microsoft Azure Linux Agent diff --git a/sources b/sources index b420d66..7194baa 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (v2.12.0.4.tar.gz) = 483c187afd30c8d356b54af7a01544297ea6c8f196234332a9ecac23c9192d0432fcc31f5a3ff31b763d36faabec4f77262d44d5d729f8f2256695f208319571 +SHA512 (v2.13.1.1.tar.gz) = 3cb65495955c746bf112e794cbeb11f47ace72e4272c3cd16eb8d478c0b3b0323890b52c592b68775efafb8c6f267b3614e66f09d6a6dee066b603297676cd38 From 6664e733d843479d0a0c7dcc8a31e139bf3fe9b9 Mon Sep 17 00:00:00 2001 From: Python Maint Date: Mon, 2 Jun 2025 23:21:05 +0200 Subject: [PATCH 19/25] Rebuilt for Python 3.14 From a3c68d79b431fc4a1ead34793545cc1d185c0997 Mon Sep 17 00:00:00 2001 From: Jeremy Cline Date: Mon, 21 Jul 2025 12:04:17 -0400 Subject: [PATCH 20/25] Turn off ResourceDisk.Format in the default config WALinuxAgent can optionally format resource disks. However, other tools can also handle this. Fedora Cloud ships with cloud-init, and enables the disk_setup[0] module, which handles formatting the disks. For any cases where users don't want this done via cloud-init, the azure-vm-utils package will provide a small shell script and systemd unit to handle it[1]. [0] https://docs.cloud-init.io/en/latest/reference/yaml_examples/disk_setup.html [1] https://github.com/Azure/azure-vm-utils/pull/84 Signed-off-by: Jeremy Cline --- WALinuxAgent.spec | 3 +++ 1 file changed, 3 insertions(+) diff --git a/WALinuxAgent.spec b/WALinuxAgent.spec index 3f562fd..63f7946 100644 --- a/WALinuxAgent.spec +++ b/WALinuxAgent.spec @@ -94,6 +94,9 @@ install -m0755 -D --target-directory=%{buildroot}%{_prefix}/lib/dracut/modules.d sed -i 's,#!/usr/bin/env python,#!/usr/bin/python3,' %{buildroot}%{_sbindir}/waagent sed -i 's,/usr/bin/python ,/usr/bin/python3 ,' %{buildroot}%{_unitdir}/waagent.service +# Other commonly-used tools can handle formatting resource disks (cloud-init, azure-vm-utils) so +# by default, let's have WALinuxAgent not do that. +sed -i 's,ResourceDisk.Format=y,ResourceDisk.Format=n,' %{buildroot}%{_sysconfdir}/waagent.conf %post From 2d46c9102420b1ca59f443aa4d02372502d9195f Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Wed, 23 Jul 2025 16:39:58 +0000 Subject: [PATCH 21/25] Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild From 4314e3d0b327bd92018eaa6ae4e9bfa1553728c2 Mon Sep 17 00:00:00 2001 From: Python Maint Date: Fri, 15 Aug 2025 15:22:43 +0200 Subject: [PATCH 22/25] Rebuilt for Python 3.14.0rc2 bytecode From 1104f83c4642b1b25faf4290de98502a6c9f3021 Mon Sep 17 00:00:00 2001 From: Python Maint Date: Fri, 19 Sep 2025 15:03:06 +0200 Subject: [PATCH 23/25] Rebuilt for Python 3.14.0rc3 bytecode From 1c8843aa5e7a2763a113c772e542db1a1cdddd5a Mon Sep 17 00:00:00 2001 From: Vitaly Kuznetsov Date: Mon, 22 Sep 2025 11:08:47 +0200 Subject: [PATCH 24/25] Update to v2.14.0.1 Signed-off-by: Vitaly Kuznetsov --- .gitignore | 1 + 0001-Fedora-do-not-require-legacycrypt.patch | 67 -------------------- WALinuxAgent.spec | 3 +- sources | 2 +- 4 files changed, 3 insertions(+), 70 deletions(-) delete mode 100644 0001-Fedora-do-not-require-legacycrypt.patch diff --git a/.gitignore b/.gitignore index f36f11d..16e49a8 100644 --- a/.gitignore +++ b/.gitignore @@ -29,3 +29,4 @@ /v2.12.0.2.tar.gz /v2.12.0.4.tar.gz /v2.13.1.1.tar.gz +/v2.14.0.1.tar.gz diff --git a/0001-Fedora-do-not-require-legacycrypt.patch b/0001-Fedora-do-not-require-legacycrypt.patch deleted file mode 100644 index 41caab1..0000000 --- a/0001-Fedora-do-not-require-legacycrypt.patch +++ /dev/null @@ -1,67 +0,0 @@ -From 376c6651f3f7c863c1aa5ac5e9536e974e6ab17c Mon Sep 17 00:00:00 2001 -From: Vitaly Kuznetsov -Date: Wed, 27 Nov 2024 14:53:15 +0100 -Subject: [PATCH] Fedora: do not require legacycrypt -Content-Type: text/plain - -'legacycrypt' is not yet present in Fedora, however, there's 'crypt_r' -stub emulating 'crypt'. - -Signed-off-by: Vitaly Kuznetsov ---- - azurelinuxagent/common/osutil/default.py | 10 +--------- - requirements.txt | 1 - - setup.py | 5 ++--- - 3 files changed, 3 insertions(+), 13 deletions(-) - -diff --git a/azurelinuxagent/common/osutil/default.py b/azurelinuxagent/common/osutil/default.py -index 0a0fd0e1cdd7..3a1c647a8363 100644 ---- a/azurelinuxagent/common/osutil/default.py -+++ b/azurelinuxagent/common/osutil/default.py -@@ -38,15 +38,7 @@ import time - from pwd import getpwall - - from azurelinuxagent.common.exception import OSUtilError --# 'crypt' was removed in Python 3.13; use legacycrypt instead --if sys.version_info[0] == 3 and sys.version_info[1] >= 13 or sys.version_info[0] > 3: -- try: -- from legacycrypt import crypt -- except ImportError: -- def crypt(password, salt): -- raise OSUtilError("Please install the legacycrypt Python module to use this feature.") --else: -- from crypt import crypt # pylint: disable=deprecated-module -+from crypt import crypt # pylint: disable=deprecated-module - - from azurelinuxagent.common import conf - from azurelinuxagent.common import logger -diff --git a/requirements.txt b/requirements.txt -index ab6958a732ce..ee3b024d8fdc 100644 ---- a/requirements.txt -+++ b/requirements.txt -@@ -1,3 +1,2 @@ - distro; python_version >= '3.8' - pyasn1 --legacycrypt; python_version >= '3.13' -diff --git a/setup.py b/setup.py -index e83f598934c6..ea4c488b2897 100755 ---- a/setup.py -+++ b/setup.py -@@ -319,12 +319,11 @@ class install(_install): # pylint: disable=C0103 - # implementation may be broken prior to Python 3.8 where the functionality - # will be removed from Python 3. - # * In version 3.13 of Python, the crypt module was removed and legacycrypt is --# required instead. -+# required instead. Fedora doesn't provide legacycrypt but has 'crypt_r' stub -+# instead. - requires = [] - if sys.version_info[0] >= 3 and sys.version_info[1] >= 8: - requires.append('distro') --if sys.version_info[0] >= 3 and sys.version_info[1] >= 13: -- requires.append('legacycrypt') - - modules = [] # pylint: disable=invalid-name - --- -2.47.0 - diff --git a/WALinuxAgent.spec b/WALinuxAgent.spec index 63f7946..eda48cf 100644 --- a/WALinuxAgent.spec +++ b/WALinuxAgent.spec @@ -1,7 +1,7 @@ %global dracut_modname 97walinuxagent Name: WALinuxAgent -Version: 2.13.1.1 +Version: 2.14.0.1 Release: %autorelease Summary: The Microsoft Azure Linux Agent @@ -11,7 +11,6 @@ Source0: https://github.com/Azure/%{name}/archive/v%{version}.tar.gz Source1: module-setup.sh Patch1: 0001-waagent.service-set-ConditionVirtualization-microsof.patch -Patch2: 0001-Fedora-do-not-require-legacycrypt.patch BuildArch: noarch diff --git a/sources b/sources index 7194baa..662611f 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (v2.13.1.1.tar.gz) = 3cb65495955c746bf112e794cbeb11f47ace72e4272c3cd16eb8d478c0b3b0323890b52c592b68775efafb8c6f267b3614e66f09d6a6dee066b603297676cd38 +SHA512 (v2.14.0.1.tar.gz) = b09c0dc7145f7f6b347c603ddcd5a5b26522b2cd1d37303dcdcb44c41ee710a61e2aab3df0bb5854304de8ed5c7d934c7a6924c9e5c7005e081f66e7d1658db8 From 2116361af6a18ba636d8cc3dee54fe4d9a37fe3f Mon Sep 17 00:00:00 2001 From: Vitaly Kuznetsov Date: Wed, 26 Nov 2025 10:21:13 +0100 Subject: [PATCH 25/25] Update to v2.15.0.1 Signed-off-by: Vitaly Kuznetsov --- .gitignore | 1 + WALinuxAgent.spec | 2 +- sources | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 16e49a8..30509ac 100644 --- a/.gitignore +++ b/.gitignore @@ -30,3 +30,4 @@ /v2.12.0.4.tar.gz /v2.13.1.1.tar.gz /v2.14.0.1.tar.gz +/v2.15.0.1.tar.gz diff --git a/WALinuxAgent.spec b/WALinuxAgent.spec index eda48cf..5eea00e 100644 --- a/WALinuxAgent.spec +++ b/WALinuxAgent.spec @@ -1,7 +1,7 @@ %global dracut_modname 97walinuxagent Name: WALinuxAgent -Version: 2.14.0.1 +Version: 2.15.0.1 Release: %autorelease Summary: The Microsoft Azure Linux Agent diff --git a/sources b/sources index 662611f..35a2aed 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (v2.14.0.1.tar.gz) = b09c0dc7145f7f6b347c603ddcd5a5b26522b2cd1d37303dcdcb44c41ee710a61e2aab3df0bb5854304de8ed5c7d934c7a6924c9e5c7005e081f66e7d1658db8 +SHA512 (v2.15.0.1.tar.gz) = dc9398bd5a100f43f7921e0503ef288d632f0e494f2cc9a149e181634ef68da96bb743dda8378b93bbc538f82d43bf59571b7049918dbe2770495001ae80ab79