From 52237c461395d48309b3f1092647bf9266be7741 Mon Sep 17 00:00:00 2001 From: Christian Kellner Date: Tue, 26 May 2020 19:05:40 +0200 Subject: [PATCH] Patch added to allow new files source format Add a patch to allow org.osbuild.files source in the new format but without actually containing the secrets key. Taken from merged PR: https://github.com/osbuild/osbuild/pull/416 --- osbuild.spec | 10 ++++++- sources-fix-break-when-secrets-is-None.patch | 28 ++++++++++++++++++++ 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 sources-fix-break-when-secrets-is-None.patch diff --git a/osbuild.spec b/osbuild.spec index ad7aa03..a6fbc47 100644 --- a/osbuild.spec +++ b/osbuild.spec @@ -8,12 +8,14 @@ Version: 15 %global pkgdir %{_prefix}/lib/%{pypi_name} Name: %{pypi_name} -Release: 2%{?dist} +Release: 3%{?dist} License: ASL 2.0 URL: %{forgeurl} Source0: %{forgesource} +# PR416 (merged): https://github.com/osbuild/osbuild/pull/416 +Patch0: sources-fix-break-when-secrets-is-None.patch BuildArch: noarch Summary: A build system for OS images @@ -65,6 +67,7 @@ to build OSTree based images. %prep %forgesetup +%patch0 -p1 %build %py3_build @@ -130,6 +133,11 @@ exit 0 %{pkgdir}/stages/org.osbuild.rpm-ostree %changelog +* Tue May 26 2020 Christian Kellner - 15-3 +- Add a patch to allow org.osbuild.files source in the new format + but without actually containing the secrets key. + Taken from merged PR: https://github.com/osbuild/osbuild/pull/416 + * Tue May 26 2020 Miro HronĨok - 15-2 - Rebuilt for Python 3.9 diff --git a/sources-fix-break-when-secrets-is-None.patch b/sources-fix-break-when-secrets-is-None.patch new file mode 100644 index 0000000..a206080 --- /dev/null +++ b/sources-fix-break-when-secrets-is-None.patch @@ -0,0 +1,28 @@ +From 9cbedc049671bf2a2eb50caa2759d91acbf7c7f5 Mon Sep 17 00:00:00 2001 +From: Jacob Kozol +Date: Fri, 22 May 2020 19:11:46 +0200 +Subject: [PATCH] sources: fix break when secrets is None + +When the urls' secrets field is not set, an error is thrown when trying +to get the name of the secrets. The secrets now have a default value of +{} when they are checked for the name. +--- + sources/org.osbuild.files | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/sources/org.osbuild.files b/sources/org.osbuild.files +index 0444d59..34d5334 100755 +--- a/sources/org.osbuild.files ++++ b/sources/org.osbuild.files +@@ -110,7 +110,7 @@ def main(options, checksums, cache, output): + try: + if isinstance(urls[checksum], dict): + # check if url needs rhsm secrets +- if urls[checksum].get("secrets").get("name") == "org.osbuild.rhsm": ++ if urls[checksum].get("secrets", {}).get("name") == "org.osbuild.rhsm": + # rhsm secrets only need to be retrieved once and can then be reused + if rhsm_secrets is None: + try: +-- +2.26.2 +