Dirk's Tech Findings

Saltstack: salt-ssh fails on host with Python 3.8

Publication date: 2020-01-20

Issue: salt-ssh fails on host with Python 3.8 with an "ImportError"

salt-ssh fails on host with Python 3.8: "ImportError: cannot import name '_supported_dists' from 'platform'"

Solution: x

Edit file on host given in error message (similar to "/var/tmp/.container1002_5bb81f_salt/pyall/salt/grains/core.py"):

    -# 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(supported_dists=_supported_dists)]
    +             linux_distribution()]

Also install the distro package:

pip3 install distro

Back to topic list...