* Mon Mar 10 2025 Jon Maloy <jmaloy@redhat.com> - 23.4-7.el8.9

- ci-fix-rh_subscription-add-string-type-to-org-5453.patch [RHEL-81169]
- ci-fix-python3.13-Fix-import-error-for-passlib-on-Pytho.patch [RHEL-81169]
- Resolves: RHEL-81169
  (Cloud-init fails to subscribe system if activation key 'org' is not an integer [rhel-8.10.z])
This commit is contained in:
Jon Maloy 2025-03-10 13:55:22 -04:00
parent 87aa295075
commit cfb605dd83
3 changed files with 176 additions and 1 deletions

View File

@ -0,0 +1,35 @@
From 6fc0b92ef5dac36e9def584ba90c1ed813f21752 Mon Sep 17 00:00:00 2001
From: Brett Holman <brett.holman@canonical.com>
Date: Tue, 5 Dec 2023 16:40:03 -0700
Subject: [PATCH 2/2] fix(python3.13): Fix import error for passlib on Python
3.13 (#4669)
RH-Author: Ani Sinha <anisinha@redhat.com>
RH-MergeRequest: 155: fix(rh_subscription): add string type to org (#5453)
RH-Jira: RHEL-81169
RH-Acked-by: xiachen <xiachen@redhat.com>
RH-Acked-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
RH-Commit: [2/2] 1742cf86b1a123053c5ced03d764b5deb76f93c8
(cherry picked from commit 09b70436b3a0aae1fe24fdde6e8cdd7ee98d9c15)
Signed-off-by: Ani Sinha <anisinha@redhat.com>
---
cloudinit/sources/DataSourceAzure.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/cloudinit/sources/DataSourceAzure.py b/cloudinit/sources/DataSourceAzure.py
index 11c14e20..4c5780f7 100644
--- a/cloudinit/sources/DataSourceAzure.py
+++ b/cloudinit/sources/DataSourceAzure.py
@@ -58,7 +58,7 @@ try:
)
except (ImportError, AttributeError):
try:
- import passlib
+ import passlib.hash
blowfish_hash = passlib.hash.sha512_crypt.hash
except ImportError:
--
2.48.1

View File

@ -0,0 +1,130 @@
From a31707413ea4b6d425c130e2872f7416b73de766 Mon Sep 17 00:00:00 2001
From: Alberto Contreras <alberto.contreras@canonical.com>
Date: Mon, 1 Jul 2024 21:04:21 +0200
Subject: [PATCH 1/2] fix(rh_subscription): add string type to org (#5453)
RH-Author: Ani Sinha <anisinha@redhat.com>
RH-MergeRequest: 155: fix(rh_subscription): add string type to org (#5453)
RH-Jira: RHEL-81169
RH-Acked-by: xiachen <xiachen@redhat.com>
RH-Acked-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
RH-Commit: [1/2] 48d486eebf66e3f32854223bd7db6bf3c6a5d512
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 <patrick.neigel@gmail.com>
(cherry picked from commit 681b7de1a598bc5ab1b7d9868dcf2f32fd45aba3)
Signed-off-by: Ani Sinha <anisinha@redhat.com>
---
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 a553c52c..282d746b 100644
--- a/cloudinit/config/schemas/schema-cloud-config-v1.json
+++ b/cloudinit/config/schemas/schema-cloud-config-v1.json
@@ -2372,8 +2372,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 f4da0989..49f3b130 100644
--- a/tools/.github-cla-signers
+++ b/tools/.github-cla-signers
@@ -124,6 +124,7 @@ Oursin
outscale-mdr
phsm
phunyguy
+pneigel-ca
qubidt
r00ta
RedKrieg
--
2.48.1

View File

@ -6,7 +6,7 @@
Name: cloud-init
Version: 23.4
Release: 7%{?dist}.8
Release: 7%{?dist}.9
Summary: Cloud instance init scripts
Group: System Environment/Base
@ -57,6 +57,10 @@ Patch30: ci-feat-sysconfig-Add-DNS-from-interface-config-to-reso.patch
Patch31: ci-fix-Clean-cache-if-no-datasource-fallback-5499.patch
# For RHEL-54155 - [RHEL 8.10] cloud-init schema validation fails.
Patch32: ci-fix-Add-subnet-ipv4-ipv6-to-network-schema-5191.patch
# For RHEL-81169 - Cloud-init fails to subscribe system if activation key 'org' is not an integer [rhel-8.10.z]
Patch33: ci-fix-rh_subscription-add-string-type-to-org-5453.patch
# For RHEL-81169 - Cloud-init fails to subscribe system if activation key 'org' is not an integer [rhel-8.10.z]
Patch34: ci-fix-python3.13-Fix-import-error-for-passlib-on-Pytho.patch
BuildArch: noarch
@ -272,6 +276,12 @@ fi
%config(noreplace) %{_sysconfdir}/rsyslog.d/21-cloudinit.conf
%changelog
* Mon Mar 10 2025 Jon Maloy <jmaloy@redhat.com> - 23.4-7.el8.9
- ci-fix-rh_subscription-add-string-type-to-org-5453.patch [RHEL-81169]
- ci-fix-python3.13-Fix-import-error-for-passlib-on-Pytho.patch [RHEL-81169]
- Resolves: RHEL-81169
(Cloud-init fails to subscribe system if activation key 'org' is not an integer [rhel-8.10.z])
* Tue Aug 20 2024 Jon Maloy <jmaloy@redhat.com> - 23.4-7.el8_10.8
- ci-fix-Add-subnet-ipv4-ipv6-to-network-schema-5191.patch [RHEL-54155]
- Resolves: RHEL-54155