summaryrefslogtreecommitdiff
blob: 1c543a085b101fd405a54626b80cf6ae62453c38 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
From 5259ba8ef6e5949815641edc563deab67ba68582 Mon Sep 17 00:00:00 2001
From: Mathias Fussenegger <f.mathias@zignar.net>
Date: Fri, 22 Nov 2019 17:05:27 +0100
Subject: [PATCH] Remove _supported_dists import for python-3.8 support

`_supported_dists` has been removed from platform in Python 3.8:

    https://github.com/python/cpython/commit/8b94b41ab7b12f745dea744e8940631318816935#diff-47c8e5750258a08a6dd9de3e9c3774acL267-L271

This instead inlines all the values that have been there.

Without this change running `salt-ssh` with Python 3.8 run into an
import error.
---
 salt/grains/core.py | 31 +++++++++++++++++++++++++++----
 1 file changed, 27 insertions(+), 4 deletions(-)

diff --git a/salt/grains/core.py b/salt/grains/core.py
index 04c1ae91b5f5..77694abe84f9 100644
--- a/salt/grains/core.py
+++ b/salt/grains/core.py
@@ -35,11 +35,34 @@
 __proxyenabled__ = ['*']
 __FQDN__ = None
 
-# Extend the default list of supported distros. This will be used for 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')
+_supported_dists = (
+    'SuSE',
+    'UnitedLinux',
+    'arch',
+    'bluewhite64',
+    'centos',
+    'debian',
+    'fedora',
+    'gentoo',
+    'mageia',
+    'mandrake',
+    'mandriva',
+    'meego',
+    'mint',
+    'oracle',
+    'ovs',
+    'redhat',
+    'rocks',
+    'slackware',
+    'slamd64',
+    'system',
+    'turbolinux',
+    'vmware',
+    'void',
+    'yellowdog',
+)
 
 # linux_distribution deprecated in py3.7
 try: