Add patch to replace platform.dist() [RH:1695953]

This commit is contained in:
Björn Esser 2019-04-23 20:39:21 +02:00
parent 8bc2e5eb74
commit 414e6c4d01
No known key found for this signature in database
GPG Key ID: F52E98007594C21D
2 changed files with 28 additions and 1 deletions

View File

@ -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'

View File

@ -1,6 +1,6 @@
Name: cloud-init Name: cloud-init
Version: 17.1 Version: 17.1
Release: 9%{?dist} Release: 10%{?dist}
Summary: Cloud instance init scripts Summary: Cloud instance init scripts
License: ASL 2.0 or GPLv3 License: ASL 2.0 or GPLv3
URL: http://launchpad.net/cloud-init 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. # opennebula: exclude EPOCHREALTIME as known bash env variable with a delta.
Patch5: cloud-init-17.1-exclude_EPOCHREALTIME.patch 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 BuildArch: noarch
BuildRequires: pkgconfig(systemd) BuildRequires: pkgconfig(systemd)
@ -158,6 +161,9 @@ nosetests-%{python3_version} tests/unittests/
%changelog %changelog
* Tue Apr 23 2019 Björn Esser <besser82@fedoraproject.org> - 17.1-10
- Add patch to replace platform.dist() [RH:1695953]
* Tue Apr 23 2019 Björn Esser <besser82@fedoraproject.org> - 17.1-9 * Tue Apr 23 2019 Björn Esser <besser82@fedoraproject.org> - 17.1-9
- Fix %%systemd_postun macro [RH:1695953] - Fix %%systemd_postun macro [RH:1695953]
- Add patch to fix failing test for EPOCHREALTIME bash env [RH:1695953] - Add patch to fix failing test for EPOCHREALTIME bash env [RH:1695953]