diff options
-rw-r--r-- | community/salt/APKBUILD | 6 | ||||
-rw-r--r-- | community/salt/fix-grains-dist-detection.patch | 51 |
2 files changed, 55 insertions, 2 deletions
diff --git a/community/salt/APKBUILD b/community/salt/APKBUILD index a60cff0c4e..4d5a33395a 100644 --- a/community/salt/APKBUILD +++ b/community/salt/APKBUILD @@ -3,7 +3,7 @@ # Maintainer: Kevin Daudt <kdaudt@alpinelinux.org> pkgname=salt pkgver=2019.2.2 -pkgrel=2 +pkgrel=3 pkgdesc="A parallel remote execution system" url="https://github.com/saltstack/salt" arch="noarch !s390x" @@ -28,6 +28,7 @@ source="https://pypi.io/packages/source/s/salt/salt-$pkgver.tar.gz salt-minion.initd salt-syndic.confd salt-syndic.initd + fix-grains-dist-detection.patch " options="!check" # depends on pytestsalt @@ -154,4 +155,5 @@ cfbbeb8023a383e7c42d84e3346edfd068c9ec7650c4ddc3caa38534da325a67497e1f06ca02cc1f 0051e13351cef8db81dc075a194bb384723f07d5591b5b4d3f3adf4180afaf7beced470ab79ceca9d1ec0dae62dbd72084eb76af009fc78411a011050a94a2ed salt-minion.confd 31521a7bf9455a805652ebb2c2a258148d654169caed500dbf1fe0c26baf26b330217117fe84a13706ded75a9eedadc0bbd671ede0957ed4d60d1e766fea6b39 salt-minion.initd bafc6ea10cdafd0aef868feb35aecbe4ae6a7dff0ae42862bded85715ad763eb89e1ed27437866a7e5f2b9f7064e3c2a3fb59814487744ba4227238d95cf3818 salt-syndic.confd -d71133e834685304e0167554035ebbc861252f972bbe981cc71e45b70f15d94a28a02a369463c9a641372919689f96b62a0408b14f824ad986d536e52b1e5ec0 salt-syndic.initd" +d71133e834685304e0167554035ebbc861252f972bbe981cc71e45b70f15d94a28a02a369463c9a641372919689f96b62a0408b14f824ad986d536e52b1e5ec0 salt-syndic.initd +377fea82f4ad62804a89cae556e74ac04e8fc401364f5ae570cbea00d21417d6e00fcc0aca52c9f8c158e067f0588f54915fb8ea8a970bacf26df653c2779110 fix-grains-dist-detection.patch" diff --git a/community/salt/fix-grains-dist-detection.patch b/community/salt/fix-grains-dist-detection.patch new file mode 100644 index 0000000000..07f9664f4a --- /dev/null +++ b/community/salt/fix-grains-dist-detection.patch @@ -0,0 +1,51 @@ +python 3.8 removed linux_distribution support completely and leaves that +functionality to third-party modules, which is provided by 'distro'. + +Just completely remove the backwards compatibility and completely rely on that +module. + +diff --git a/salt/grains/core.py b/salt/grains/core.py +index 04c1ae9..9280975 100644 +--- a/salt/grains/core.py ++++ b/salt/grains/core.py +@@ -24,6 +24,7 @@ from errno import EACCES, EPERM + import datetime + import warnings + import time ++from distro import linux_distribution + + # pylint: disable=import-error + try: +@@ -35,23 +36,6 @@ except ImportError: + __proxyenabled__ = ['*'] + __FQDN__ = None + +-# Extend the default list of supported distros. This will be used for the +-# /etc/DISTRO-release checking that is part of linux_distribution() +-from platform import _supported_dists +-_supported_dists += ('arch', 'mageia', 'meego', 'vmware', 'bluewhite64', +- 'slamd64', 'ovs', 'system', 'mint', 'oracle', 'void') +- +-# linux_distribution deprecated in py3.7 +-try: +- from platform import linux_distribution as _deprecated_linux_distribution +- +- def linux_distribution(**kwargs): +- with warnings.catch_warnings(): +- warnings.simplefilter("ignore") +- return _deprecated_linux_distribution(**kwargs) +-except ImportError: +- from distro import linux_distribution +- + # Import salt libs + import salt.exceptions + import salt.log +@@ -1920,7 +1904,7 @@ def os_data(): + ) + (osname, osrelease, oscodename) = \ + [x.strip('"').strip("'") for x in +- linux_distribution(supported_dists=_supported_dists)] ++ linux_distribution()] + # Try to assign these three names based on the lsb info, they tend to + # be more accurate than what python gets from /etc/DISTRO-release. + # It's worth noting that Ubuntu has patched their Python distribution |