Salt-bootstrap: Option -y -x python3 does not install using python3

Created on 10 Aug 2017  路  15Comments  路  Source: saltstack/salt-bootstrap

Description of Issue/Question

Expected:
bash bootstrap-salt.sh -y -x python3 -M git develop

installs salt with python3 support

Currently:
It will still install using python2.7's pip and the /usr/bin/salt* files will have #!/usr/bin/python instead of python3

Setup

(Please provide relevant configs (Be sure to remove sensitive info).)

Steps to Reproduce Issue

(Include debug logs if possible, bootstrap-salt.sh -D.)

Execute mentioned command and watch for "byte-compiling /usr/lib/python2.7/**..."

Versions and Systems

(salt --versions-report, bootstrap-salt.sh -v, system type and version,
cloud/VM provider as appropriate.)
Ubuntu 16.04, latest salt-bootstrap

Feature Fixed Pending Verification

Most helpful comment

@ketzacoatl I have started working on this today, but ran into some bugs. The approach I am using right now is to start with the stable PY3 packages that are now available at repo.saltstack.com.

I plan to continue working on this tomorrow.

The effort to support multiple distros will probably be a decent effort. I'm starting with Ubuntu 16.04 right now.

All 15 comments

When running with set -x I can see PY_EXE being set to python3[.5] so I am not sure where things go wrong here.

+ _INSTALL_PY=0
+ getopts :hvnDc:g:Gyx:wk:s:MSNXCPFUKIA:i:Lp:dH:ZbflV:J:j:rR:aq opt
+ case "${opt}" in
+ _INSTALL_PY=1
+ getopts :hvnDc:g:Gyx:wk:s:MSNXCPFUKIA:i:Lp:dH:ZbflV:J:j:rR:aq opt
+ case "${opt}" in
+ _PY_EXE=python3.5
+ getopts :hvnDc:g:Gyx:wk:s:MSNXCPFUKIA:i:Lp:dH:ZbflV:J:j:rR:aq opt
+ case "${opt}" in
+ _INSTALL_MASTER=1
+ getopts :hvnDc:g:Gyx:wk:s:MSNXCPFUKIA:i:Lp:dH:ZbflV:J:j:rR:aq opt
+ shift 4

Well there's a bunch of issues I see here, all parts of script should use ${PY_EXE} and there is 'python' hardcoded in some parts...

Needs a fix here
https://github.com/saltstack/salt-bootstrap/blob/develop/bootstrap-salt.sh#L2173
https://github.com/saltstack/salt-bootstrap/blob/develop/bootstrap-salt.sh#L2771

I changed these these and still can't get it to work with python3 it crashes with no module named yaml...

Ok and the final fix should be here https://github.com/saltstack/salt-bootstrap/blob/develop/bootstrap-salt.sh#L2685 I hardcoded every python-XXX pkg to python3-XXX.
Now it's working.

Is anyone interested in making salt-bootstrap support python3?

Hi @ninja- Thanks for filing this. Yes, we do want salt-bootstrap to support Python 3 and this is on my radar. The focus up until now has been to get salt itself working on Python 3, then get to bootstrap.

The -x option, as you've discovered, has not been tested with Python 3. That option was recently added to allow us to install Python 2.7 on CentOS 6, since it comes with Python 2.6 by default. It hasn't been used officially in any other context (yet). Using -x to install Salt using Python 3 but would be the way to go with getting this support implemented. For now, this will only work with git installations, as packages at repo.saltstack.com are not yet available for Python 3 installs.

Any help you'd like to supply on this front is greatly appreciated! And of course, thank you for your detective work here. :)

I'll mark this as a feature request for now.

Oh, also note that PR #1124 is related to this, but has not been merged yet.

Thanks. I'll be using a patched script for now, I am kind of stuck to python3 because most of my formulas require it. (iteritems() vs items() for example...)

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.

still relevant stale-bot

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

@ninja- do you have a fork somewhere with the updates to use python 3?

@rallytime do you have any comments/feedback on the proper way to implement support for python 3?

@ketzacoatl I have started working on this today, but ran into some bugs. The approach I am using right now is to start with the stable PY3 packages that are now available at repo.saltstack.com.

I plan to continue working on this tomorrow.

The effort to support multiple distros will probably be a decent effort. I'm starting with Ubuntu 16.04 right now.

I've added support for Ubuntu 16.04 in #1238. I plan on adding support for CentOS 7 sometime soon as well, but that's a good place to start.

CentOS 7 support added for CentOS 7 in #1242.

And Debian 9 support was added just now in #1243

I think this is a really good start for this issue and I won't have time to add anymore beyond this for quite some time.

I think we should close this feature request since there are now multiple examples of how to add Py3 support to the bootstrap script.

If there are other distributions that need Python3 support, individual tickets can be opened for those.

In addition, now that there are some examples of how to get this working, community members can add some as well.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

speedlight picture speedlight  路  9Comments

yitzhakbg picture yitzhakbg  路  7Comments

chrisnew picture chrisnew  路  8Comments

brianholland99 picture brianholland99  路  14Comments

birengoodco picture birengoodco  路  17Comments