Rubygem-smart_proxy_salt : Support for Python 3

Problem:
Salt is deprecating Python 2.7 in less than 6 months. They are offering a version running on Python 3.
Installing salt-master with the Python 3 however breaks foreman-node

Expected outcome:
Calling foreman-node work

Foreman and Proxy versions:
foreman-proxy: 1.22.0-1.el7
salt-master: 2019.2.0-1.el7
rubygem-smart_proxy_salt: 2.1.9-1.el7
Foreman and Proxy plugin versions:

Other relevant data:

The following error is printed in the log.

[ERROR   ][5036] Command '['/usr/bin/foreman-node', 'pminion1.example.com']' failed with return code: 1
[ERROR   ][5036] stdout: Could not get grains: No grains received from Salt master
[ERROR   ][5036] retcode: 1
[ERROR   ][5036] Command '/usr/bin/foreman-node pminion1.example.com' failed with return code: 1
[ERROR   ][5036] output: Could not get grains: No grains received from Salt master
[CRITICAL][5036] YAML data from /usr/bin/foreman-node failed to parse

foreman-node calls /usr/share/gems/gems/smart_proxy_salt-2.1.9/bin/foreman-node which itself call python by piping a script. Calling that script outputs this error:

Traceback (most recent call last):
  File "t.py", line 6, in <module>
    import salt.config
ImportError: No module named salt.config

Reverting back to the Python 2.7 installation, the setup work anew.

Not the maintainer, but the source is at:

I’m sure patches are appreciated :slight_smile:

python3 support was merged some days ago:
https://github.com/theforeman/smart_proxy_salt/commit/ec09a6b897c11c4cff9d1f58b1a9bd2d7e9c9e9b