diff --git a/SOURCES/ci-fix-rh_subscription-add-string-type-to-org-5453.patch b/SOURCES/ci-fix-rh_subscription-add-string-type-to-org-5453.patch new file mode 100644 index 0000000..e327f13 --- /dev/null +++ b/SOURCES/ci-fix-rh_subscription-add-string-type-to-org-5453.patch @@ -0,0 +1,131 @@ +From 9066bea7bebf583f81f841ae7f8c99728df4982f Mon Sep 17 00:00:00 2001 +From: Alberto Contreras +Date: Mon, 1 Jul 2024 21:04:21 +0200 +Subject: [PATCH] fix(rh_subscription): add string type to org (#5453) + +RH-Author: xiachen +RH-MergeRequest: 158: fix(rh_subscription): add string type to org (#5453) +RH-Jira: RHEL-81163 +RH-Acked-by: Emanuele Giuseppe Esposito +RH-Acked-by: Jon Maloy +RH-Acked-by: Ani Sinha +RH-Commit: [1/1] 0210968f6630cc3a10d8f4f16f274280f00fabb0 + +Per [1], org's correct type is string. Added as new type and deprecated +integer. + +References: +[1] https://github.com/candlepin/subscription-manager/blob/b6fad11e7783ae414fe88fdecee57d8db5c8e292/man/subscription-manager.8#L589 + +Fixes GH-5382 + +One conflict fixed: doc/module-docs/cc_rh_subscription/example2.yaml +is absent in 23.4 since it was added as a part of +f9352b9467626d ("chore(doc): migrate cc modules i through r to templates (#5313)") +later. + +Co-authored-by: pneigel-ca +(cherry picked from commit 681b7de1a598bc5ab1b7d9868dcf2f32fd45aba3) +Signed-off-by: Amy Chen +--- + cloudinit/config/cc_rh_subscription.py | 4 ++-- + .../config/schemas/schema-cloud-config-v1.json | 14 ++++++++++++-- + .../unittests/config/test_cc_rh_subscription.py | 16 +++++++++++++++- + tools/.github-cla-signers | 1 + + 4 files changed, 30 insertions(+), 5 deletions(-) + +diff --git a/cloudinit/config/cc_rh_subscription.py b/cloudinit/config/cc_rh_subscription.py +index 83fa4f61..b2588915 100644 +--- a/cloudinit/config/cc_rh_subscription.py ++++ b/cloudinit/config/cc_rh_subscription.py +@@ -47,14 +47,14 @@ meta: MetaSchema = { + """\ + rh_subscription: + activation-key: foobar +- org: 12345 ++ org: "ABC" + """ + ), + dedent( + """\ + rh_subscription: + activation-key: foobar +- org: 12345 ++ org: "ABC" + auto-attach: true + service-level: self-support + add-pool: +diff --git a/cloudinit/config/schemas/schema-cloud-config-v1.json b/cloudinit/config/schemas/schema-cloud-config-v1.json +index c5f46f37..6e4fcca9 100644 +--- a/cloudinit/config/schemas/schema-cloud-config-v1.json ++++ b/cloudinit/config/schemas/schema-cloud-config-v1.json +@@ -2451,8 +2451,18 @@ + "description": "The activation key to use. Must be used with ``org``. Should not be used with ``username`` or ``password``" + }, + "org": { +- "type": "integer", +- "description": "The organization number to use. Must be used with ``activation-key``. Should not be used with ``username`` or ``password``" ++ "description": "The organization to use. Must be used with ``activation-key``. Should not be used with ``username`` or ``password``", ++ "oneOf": [ ++ { ++ "type": "string" ++ }, ++ { ++ "type": "integer", ++ "deprecated": true, ++ "deprecated_version": "24.2", ++ "deprecated_description": "Use of type integer for this value is deprecated. Use a string instead." ++ } ++ ] + }, + "auto-attach": { + "type": "boolean", +diff --git a/tests/unittests/config/test_cc_rh_subscription.py b/tests/unittests/config/test_cc_rh_subscription.py +index 955b092b..d811d16a 100644 +--- a/tests/unittests/config/test_cc_rh_subscription.py ++++ b/tests/unittests/config/test_cc_rh_subscription.py +@@ -184,7 +184,7 @@ class TestBadInput(CiTestCase): + "rh_subscription": { + "activation-key": "abcdef1234", + "fookey": "bar", +- "org": "123", ++ "org": "ABC", + } + } + +@@ -330,6 +330,20 @@ class TestRhSubscriptionSchema: + {"rh_subscription": {"disable-repo": "name"}}, + "'name' is not of type 'array'", + ), ++ ( ++ { ++ "rh_subscription": { ++ "activation-key": "foobar", ++ "org": "ABC", ++ } ++ }, ++ None, ++ ), ++ ( ++ {"rh_subscription": {"activation-key": "foobar", "org": 314}}, ++ "Deprecated in version 24.2. Use of type integer for this" ++ " value is deprecated. Use a string instead.", ++ ), + ], + ) + @skipUnlessJsonSchema() +diff --git a/tools/.github-cla-signers b/tools/.github-cla-signers +index 8b119025..fc95f611 100644 +--- a/tools/.github-cla-signers ++++ b/tools/.github-cla-signers +@@ -125,6 +125,7 @@ Oursin + outscale-mdr + phsm + phunyguy ++pneigel-ca + qubidt + r00ta + RedKrieg +-- +2.48.1 + diff --git a/SPECS/cloud-init.spec b/SPECS/cloud-init.spec index 5c1a763..ab9621f 100644 --- a/SPECS/cloud-init.spec +++ b/SPECS/cloud-init.spec @@ -1,86 +1,88 @@ -Name: cloud-init -Version: 23.4 -Release: 19%{?dist}.5.alma.1 -Summary: Cloud instance init scripts -License: ASL 2.0 or GPLv3 -URL: http://launchpad.net/cloud-init -Source0: https://github.com/canonical/cloud-init/archive/refs/tags/%{version}.tar.gz -Source1: cloud-init-tmpfiles.conf +Name: cloud-init +Version: 23.4 +Release: 19%{?dist}.6.alma.1 +Summary: Cloud instance init scripts +License: ASL 2.0 or GPLv3 +URL: http://launchpad.net/cloud-init +Source0: https://github.com/canonical/cloud-init/archive/refs/tags/%{version}.tar.gz +Source1: cloud-init-tmpfiles.conf # Source-git patches -Patch1: 0001-Add-initial-redhat-changes.patch -Patch2: 0002-Do-not-write-NM_CONTROLLED-no-in-generated-interface.patch -Patch3: 0003-Setting-autoconnect-priority-setting-for-network-scr.patch -Patch4: 0004-net-network_manager-do-not-set-may-fail-to-False-for.patch -Patch5: 0005-net-allow-dhcp6-configuration-from-generate_fallback.patch -Patch6: 0006-net-nm-check-for-presence-of-ifcfg-files-when-nm-con.patch -Patch7: 0007-test-jsonschema-Pin-jsonschema-version-4781.patch -Patch8: 0008-fix-clean-stop-warning-when-running-clean-command-47.patch +Patch1: 0001-Add-initial-redhat-changes.patch +Patch2: 0002-Do-not-write-NM_CONTROLLED-no-in-generated-interface.patch +Patch3: 0003-Setting-autoconnect-priority-setting-for-network-scr.patch +Patch4: 0004-net-network_manager-do-not-set-may-fail-to-False-for.patch +Patch5: 0005-net-allow-dhcp6-configuration-from-generate_fallback.patch +Patch6: 0006-net-nm-check-for-presence-of-ifcfg-files-when-nm-con.patch +Patch7: 0007-test-jsonschema-Pin-jsonschema-version-4781.patch +Patch8: 0008-fix-clean-stop-warning-when-running-clean-command-47.patch # For RHEL-22255 - [Azure][RHEL-9] cloud-init-23.4 cannot read "- Azure" datasource_list format -Patch9: ci-Revert-Use-grep-for-faster-parsing-of-cloud-config-i.patch -Patch10: ci-Pin-pythes-8.0.0.patch +Patch9: ci-Revert-Use-grep-for-faster-parsing-of-cloud-config-i.patch +Patch10: ci-Pin-pythes-8.0.0.patch # For RHEL-21324 - [rhel-9] The schema WARNING info for network-config.json is not suitable in cloud-init-23.4 -Patch11: ci-fix-Add-types-to-network-v1-schema-4841.patch +Patch11: ci-fix-Add-types-to-network-v1-schema-4841.patch # For RHEL-28549 - [RHEL 9.4] cloud-init 23.4 returns 2 on recoverable errors instead of 0 -Patch12: ci-Retain-exit-code-in-cloud-init-status-for-recoverabl.patch +Patch12: ci-Retain-exit-code-in-cloud-init-status-for-recoverabl.patch # For RHEL-20964 - [rhel-9]cloud-init fails to configure DNS/search domains for network-config v1 -Patch13: ci-fix-Correct-v2-NetworkManager-route-rendering-4637.patch +Patch13: ci-fix-Correct-v2-NetworkManager-route-rendering-4637.patch # For RHEL-20964 - [rhel-9]cloud-init fails to configure DNS/search domains for network-config v1 -Patch14: ci-feat-apply-global-DNS-to-interfaces-in-network-manag.patch +Patch14: ci-feat-apply-global-DNS-to-interfaces-in-network-manag.patch # For RHEL-29709 - Suggest to backport patch ff40d1a to undeprecate 'network' in schema route definition -Patch15: ci-fix-Undeprecate-network-in-schema-route-definition-5.patch +Patch15: ci-fix-Undeprecate-network-in-schema-route-definition-5.patch # For RHEL-32846 - [cloud-init][ESXi]VMware datasource resets on every boot causing it to lose network configuration [rhel-9] -Patch16: ci-fix-Fall-back-to-cached-local-ds-if-no-valid-ds-foun.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 +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 +Patch18: ci-fix-cloudstack-Use-parsed-lease-file-for-virtual-rou.patch # For RHEL-17961 - [RHEL-9] cloud-init fails to configure DNS search domains -Patch19: ci-feat-sysconfig-Add-DNS-from-interface-config-to-reso.patch +Patch19: ci-feat-sysconfig-Add-DNS-from-interface-config-to-reso.patch # For RHEL-44337 - [rhel-9] fix `SUDO` configuration schema for users and groups -Patch20: ci-fix-jsonschema-Add-missing-sudo-definition-5418.patch +Patch20: ci-fix-jsonschema-Add-missing-sudo-definition-5418.patch # For RHEL-44337 - [rhel-9] fix `SUDO` configuration schema for users and groups -Patch21: ci-doc-update-examples-to-reflect-alternative-ways-to-p.patch +Patch21: ci-doc-update-examples-to-reflect-alternative-ways-to-p.patch # For RHEL-44598 - fix pylint error and support python 3.12 -Patch22: ci-fix-dhcp-Guard-against-FileNotFoundError-and-NameErr.patch +Patch22: ci-fix-dhcp-Guard-against-FileNotFoundError-and-NameErr.patch # For RHEL-44598 - fix pylint error and support python 3.12 -Patch23: ci-fix-Address-TIOBE-abstract-interpretation-issues-486.patch +Patch23: ci-fix-Address-TIOBE-abstract-interpretation-issues-486.patch # For RHEL-44598 - fix pylint error and support python 3.12 -Patch24: ci-Update-pylint-version-to-support-python-3.12-5338.patch +Patch24: ci-Update-pylint-version-to-support-python-3.12-5338.patch # For RHEL-45262 - Deprecate the users ssh-authorized-keys property and permit deprecated hyphenated keys under users key -Patch25: ci-Deprecate-the-users-ssh-authorized-keys-property-516.patch +Patch25: ci-Deprecate-the-users-ssh-authorized-keys-property-516.patch # For RHEL-45262 - Deprecate the users ssh-authorized-keys property and permit deprecated hyphenated keys under users key -Patch26: ci-docs-Add-deprecated-system_info-to-schema-5168.patch +Patch26: ci-docs-Add-deprecated-system_info-to-schema-5168.patch # For RHEL-45262 - Deprecate the users ssh-authorized-keys property and permit deprecated hyphenated keys under users key -Patch27: ci-fix-schema-permit-deprecated-hyphenated-keys-under-u.patch +Patch27: ci-fix-schema-permit-deprecated-hyphenated-keys-under-u.patch # For RHEL-44916 - [RFE] Support metalink in yum repository config -Patch28: ci-Support-metalink-in-yum-repository-config-5444.patch +Patch28: ci-Support-metalink-in-yum-repository-config-5444.patch # For RHEL-46194 - [RHEL-9] It leaves the ipv6 networking config as blank in NM keyfile when config dhcp ipv6 with customization spec -Patch29: ci-fix-vmware-Set-IPv6-to-dhcp-when-there-is-no-IPv6-ad.patch +Patch29: ci-fix-vmware-Set-IPv6-to-dhcp-when-there-is-no-IPv6-ad.patch # For RHEL-46873 - Suggest to update schema to support metalink -Patch30: ci-fix-add-schema-rules-for-baseurl-and-metalink-in-yum.patch +Patch30: ci-fix-add-schema-rules-for-baseurl-and-metalink-in-yum.patch # For RHEL-49736 - [Cloud-init] [RHEL-9] Password reset feature broken with CloudstackDataSource -Patch31: ci-fix-Clean-cache-if-no-datasource-fallback-5499.patch +Patch31: ci-fix-Clean-cache-if-no-datasource-fallback-5499.patch # For RHEL-49674 - Support setting mirrorlist in yum repository config -Patch32: ci-Support-setting-mirrorlist-in-yum-repository-config-.patch +Patch32: ci-Support-setting-mirrorlist-in-yum-repository-config-.patch # For RHEL-54373 - [RHEL9]Revert "fix(vmware): Set IPv6 to dhcp when there is no IPv6 addr (#5471)" -Patch33: ci-Revert-fix-vmware-Set-IPv6-to-dhcp-when-there-is-no-.patch +Patch33: ci-Revert-fix-vmware-Set-IPv6-to-dhcp-when-there-is-no-.patch # For RHEL-54686 - [RHEL-9.5] cloud-init schema validation fails. -Patch34: ci-fix-Add-subnet-ipv4-ipv6-to-network-schema-5191.patch +Patch34: ci-fix-Add-subnet-ipv4-ipv6-to-network-schema-5191.patch # For RHEL-65018 - Configuring metric for default gateway is not working [rhel-9.5.z] -Patch35: ci-Fix-metric-setting-for-ifcfg-network-connections-for.patch +Patch35: ci-Fix-metric-setting-for-ifcfg-network-connections-for.patch # For RHEL-65018 - Configuring metric for default gateway is not working [rhel-9.5.z] -Patch36: ci-fix-python3.13-Fix-import-error-for-passlib-on-Pytho.patch +Patch36: ci-fix-python3.13-Fix-import-error-for-passlib-on-Pytho.patch # For RHEL-65021 - NoCloud - network_config bridges incorrectly configured [rhel-9.5.z] -Patch37: ci-fix-Render-bridges-correctly-for-v2-on-sysconfig-wit.patch +Patch37: ci-fix-Render-bridges-correctly-for-v2-on-sysconfig-wit.patch # For RHEL-65021 - NoCloud - network_config bridges incorrectly configured [rhel-9.5.z] -Patch38: ci-fix-Render-v2-bridges-correctly-on-network-manager-w.patch +Patch38: ci-fix-Render-v2-bridges-correctly-on-network-manager-w.patch # For RHEL-65778 - [RHEL-9] Prevent NM from handling DNS when network interfaces have DNS config [rhel-9.5.z] -Patch39: ci-Prevent-NM-from-handling-DNS-when-network-interfaces.patch +Patch39: ci-Prevent-NM-from-handling-DNS-when-network-interfaces.patch # For RHEL-68409 - cloud-init fails to configure DNS and search domain [rhel-9.5.z] -Patch40: ci-refactor-Ensure-internal-DNS-state-same-for-v1-and-v.patch +Patch40: ci-refactor-Ensure-internal-DNS-state-same-for-v1-and-v.patch # For RHEL-79774 - [RHEL 9] Backport support for smbios datasource definition [rhel-9.5.z] -Patch41: ci-fix-nocloud-smbios-datasource-definition.patch +Patch41: ci-fix-nocloud-smbios-datasource-definition.patch +# For RHEL-81163 - Cloud-init fails to subscribe system if activation key 'org' is not an integer [rhel-9.5.z] +Patch42: ci-fix-rh_subscription-add-string-type-to-org-5453.patch # AlmaLinux Patch Patch3100: 0031-Improvements-for-AlmaLinux-OS-and-CloudLinux-OS.patch @@ -93,46 +95,46 @@ BuildRequires: python3-setuptools BuildRequires: systemd # For tests -BuildRequires: iproute -BuildRequires: python3-configobj +BuildRequires: iproute +BuildRequires: python3-configobj # https://bugzilla.redhat.com/show_bug.cgi?id=1695953 -BuildRequires: python3-distro -BuildRequires: python3-jinja2 -BuildRequires: python3-jsonpatch -BuildRequires: python3-oauthlib -BuildRequires: python3-prettytable -BuildRequires: python3-pyserial -BuildRequires: python3-PyYAML -BuildRequires: python3-requests -BuildRequires: python3-six +BuildRequires: python3-distro +BuildRequires: python3-jinja2 +BuildRequires: python3-jsonpatch +BuildRequires: python3-oauthlib +BuildRequires: python3-prettytable +BuildRequires: python3-pyserial +BuildRequires: python3-PyYAML +BuildRequires: python3-requests +BuildRequires: python3-six # dnf is needed to make cc_ntp unit tests work # https://bugs.launchpad.net/cloud-init/+bug/1721573 -BuildRequires: /usr/bin/dnf +BuildRequires: /usr/bin/dnf -Requires: e2fsprogs -Requires: iproute -Requires: libselinux-python3 -Requires: policycoreutils-python3 -Requires: procps -Requires: python3-configobj +Requires: e2fsprogs +Requires: iproute +Requires: libselinux-python3 +Requires: policycoreutils-python3 +Requires: procps +Requires: python3-configobj # https://bugzilla.redhat.com/show_bug.cgi?id=1695953 -Requires: python3-distro -Requires: python3-jinja2 -Requires: python3-jsonpatch -Requires: python3-oauthlib -Requires: python3-prettytable -Requires: python3-pyserial -Requires: python3-PyYAML -Requires: python3-requests -Requires: python3-six -Requires: shadow-utils -Requires: util-linux -Requires: xfsprogs -Requires: dhcp-client +Requires: python3-distro +Requires: python3-jinja2 +Requires: python3-jsonpatch +Requires: python3-oauthlib +Requires: python3-prettytable +Requires: python3-pyserial +Requires: python3-PyYAML +Requires: python3-requests +Requires: python3-six +Requires: shadow-utils +Requires: util-linux +Requires: xfsprogs +Requires: dhcp-client # https://bugzilla.redhat.com/show_bug.cgi?id=2032524 -Requires: gdisk -Requires: openssl -Requires: python3-netifaces +Requires: gdisk +Requires: openssl +Requires: python3-netifaces %{?systemd_requires} @@ -298,9 +300,14 @@ fi %config(noreplace) %{_sysconfdir}/rsyslog.d/21-cloudinit.conf %changelog -* Tue Mar 25 2025 Elkhan Mammadli - 23.4-19.5.alma.1 +* Thu May 08 2025 Elkhan Mammadli - 23.4-19.6.alma.1 - 0031-Improvements-for-AlmaLinux-OS-and-CloudLinux-OS.patch +* Tue Apr 01 2025 Jon Maloy - 23.4-19.el9_5.6 +- ci-fix-rh_subscription-add-string-type-to-org-5453.patch [RHEL-81163] +- Resolves: RHEL-81163 + (Cloud-init fails to subscribe system if activation key 'org' is not an integer [rhel-9.5.z]) + * Mon Feb 24 2025 Jon Maloy - 23.4-19.el9_5.5 - ci-fix-nocloud-smbios-datasource-definition.patch [RHEL-79774] - Resolves: RHEL-79774 @@ -822,7 +829,7 @@ fi * Thu Apr 13 2017 Charalampos Stratakis 0.7.9-4 - Import to RHEL 7 -Resolves: rhbz#1427280 +Resolves: rhbz#1427280 * Tue Mar 07 2017 Lars Kellogg-Stedman 0.7.9-3 - fixes for network config generation