Salt: Unable to run salt-ssh command against python 2.6 target

Created on 25 Oct 2019  Â·  15Comments  Â·  Source: saltstack/salt

`[server-123]# salt --versions-report
Salt Version:
Salt: 2018.3.2

Dependency Versions:
cffi: 1.11.5
cherrypy: Not Installed
dateutil: 2.7.3
docker-py: Not Installed
gitdb: Not Installed
gitpython: Not Installed
ioflo: Not Installed
Jinja2: 2.10
libgit2: Not Installed
libnacl: Not Installed
M2Crypto: Not Installed
Mako: Not Installed
msgpack-pure: Not Installed
msgpack-python: 0.5.6
mysql-python: Not Installed
pycparser: 2.19
pycrypto: 2.6.1
pycryptodome: Not Installed
pygit2: Not Installed
Python: 2.7.13 (default, Oct 9 2018, 14:04:55)
python-gnupg: Not Installed
PyYAML: 3.13
PyZMQ: 17.0.0
RAET: Not Installed
smmap: Not Installed
timelib: Not Installed
Tornado: 4.5.3
ZMQ: 4.1.6

System Versions:
dist: centos 6.10 Final
locale: UTF-8
machine: x86_64
release: 4.4.180-1.el6.elrepo.x86_64
system: Linux
version: CentOS 6.10 Final

[server-123]# salt-ssh '1350' state.sls salt.install_salt-minion -i
1350:
----------
_error:
Failed to return clean data
retcode:
0
stderr:
Traceback (most recent call last):
File "/var/tmp/.root_183985_salt/salt-call", line 15, in
salt_call()
File "/var/tmp/.root_183985_salt/py2/salt/scripts.py", line 395, in salt_call
import salt.cli.call
File "/var/tmp/.root_183985_salt/py2/salt/cli/call.py", line 5, in
import salt.utils.parsers
File "/var/tmp/.root_183985_salt/py2/salt/utils/parsers.py", line 27, in
import salt.config as config
File "/var/tmp/.root_183985_salt/py2/salt/config/__init__.py", line 24, in
import salt.utils.data
File "/var/tmp/.root_183985_salt/py2/salt/utils/data.py", line 18, in
import salt.utils.stringutils
File "/var/tmp/.root_183985_salt/py2/salt/utils/stringutils.py", line 214
trans_args = ({ord(x): None for x in text_characters},)
^
SyntaxError: invalid syntax
stdout:
[root@DB4-34 salt]# `

The 1356 server python version is:

python -V
Python 2.6.6

Confirmed Documentation Magnesium Salt-SSH

Most helpful comment

As noted already, the problem here, that salt needs python 2.7 or greater for Python 2, is clearly covered by documentation in an appropriate place: https://docs.saltstack.com/en/master/topics/installation/index.html#dependencies

Although, arguably, the documentation for salt-ssh:

Python is required on the remote system (unless using the -r option to send raw ssh commands)

... could be updated to be clear that the python requirement is the same as for salt itself.

All 15 comments

Hi, can you provide a bit more context with this issue? I see you're running
salt-ssh '1350' state.sls salt.install_salt-minion -i correct?

Also, is there any way you could upgrade python from 2.6.6 to 2.7.13+? ord() is a buildin function in python2.6 however I don't see a syntactical error with that line. where it fails.

hi,Thank you for your answer,
I just want to install python2.7.13 with salt-ssh, but now test, ping is not available.
What information can I provide?

image

@glkappe, yeah. SaltStack has a minimum required Python version of 2.7 according to https://docs.saltstack.com/en/2018.3/topics/installation/index.html.

In this situation, you'll likely need to use something other than salt in order to upgrade your version of Python.. If salt-cloud somehow works, you "might" be able to use that if you have smb and pwsh remoting...

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

If this issue is closed prematurely, please leave a comment and we will gladly reopen the issue.

This should be explicitly closed as a "wontfix" due to it being a non-supported python version and covered by documentation.

Thank you for updating this issue. It is no longer marked as stale.

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

If this issue is closed prematurely, please leave a comment and we will gladly reopen the issue.

Thank you for updating this issue. It is no longer marked as stale.

Thank you for updating this issue. It is no longer marked as stale.

Thank you for updating this issue. It is no longer marked as stale.

@saltstack/docs-working-group

As noted already, the problem here, that salt needs python 2.7 or greater for Python 2, is clearly covered by documentation in an appropriate place: https://docs.saltstack.com/en/master/topics/installation/index.html#dependencies

Although, arguably, the documentation for salt-ssh:

Python is required on the remote system (unless using the -r option to send raw ssh commands)

... could be updated to be clear that the python requirement is the same as for salt itself.

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

If this issue is closed prematurely, please leave a comment and we will gladly reopen the issue.

This should be explicitly closed as a "wontfix" due to it being a non-supported python version and covered by documentation.

So how is this called automation? I need to use salt-ssh to install python 2.7 for a python 2.6 server. Now, you say, if the target server is python 2.6, he will not run.So I should manually upgrade the python version before using salt or salt-ssh to manage them.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

roflmao picture roflmao  Â·  58Comments

sumeetisp picture sumeetisp  Â·  54Comments

Deshke picture Deshke  Â·  60Comments

kevich picture kevich  Â·  66Comments

Zogg picture Zogg  Â·  80Comments