From 414e6c4d015c536c835c2d52c76bb282551c3f69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Esser?= Date: Tue, 23 Apr 2019 20:39:21 +0200 Subject: [PATCH] Add patch to replace platform.dist() [RH:1695953] --- ...d-init-17.1-deprecated_platform_dist.patch | 21 +++++++++++++++++++ cloud-init.spec | 8 ++++++- 2 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 cloud-init-17.1-deprecated_platform_dist.patch diff --git a/cloud-init-17.1-deprecated_platform_dist.patch b/cloud-init-17.1-deprecated_platform_dist.patch new file mode 100644 index 0000000..494e107 --- /dev/null +++ b/cloud-init-17.1-deprecated_platform_dist.patch @@ -0,0 +1,21 @@ +Index: cloud-init-17.1/cloudinit/util.py +=================================================================== +--- cloud-init-17.1.orig/cloudinit/util.py ++++ cloud-init-17.1/cloudinit/util.py +@@ -11,6 +11,7 @@ + import contextlib + import copy as obj_copy + import ctypes ++import distro + import email + import glob + import grp +@@ -586,7 +587,7 @@ def system_info(): + 'release': platform.release(), + 'python': platform.python_version(), + 'uname': platform.uname(), +- 'dist': platform.dist(), # pylint: disable=W1505 ++ 'dist': distro.linux_distribution(full_distribution_name=False), + } + system = info['system'].lower() + var = 'unknown' diff --git a/cloud-init.spec b/cloud-init.spec index 881297e..c4089e3 100644 --- a/cloud-init.spec +++ b/cloud-init.spec @@ -1,6 +1,6 @@ Name: cloud-init Version: 17.1 -Release: 9%{?dist} +Release: 10%{?dist} Summary: Cloud instance init scripts License: ASL 2.0 or GPLv3 URL: http://launchpad.net/cloud-init @@ -26,6 +26,9 @@ Patch4: cloud-init-17.1-fix-local-ipv4-only.patch # opennebula: exclude EPOCHREALTIME as known bash env variable with a delta. Patch5: cloud-init-17.1-exclude_EPOCHREALTIME.patch +# platform.dist has been removed in Pyton 3.8. +Patch6: cloud-init-17.1-deprecated_platform_dist.patch + BuildArch: noarch BuildRequires: pkgconfig(systemd) @@ -158,6 +161,9 @@ nosetests-%{python3_version} tests/unittests/ %changelog +* Tue Apr 23 2019 Björn Esser - 17.1-10 +- Add patch to replace platform.dist() [RH:1695953] + * Tue Apr 23 2019 Björn Esser - 17.1-9 - Fix %%systemd_postun macro [RH:1695953] - Add patch to fix failing test for EPOCHREALTIME bash env [RH:1695953]