Closed noelmcloughlin closed 3 years ago
I managed to get centos CI working.
Just a note, this might be a breaking change for existing systems. If anyone is still running salt on the system default python 2.7, it would break.
Maybe wrap the logic in a something like this:
{%- if salt["grains.get"]("pythonversion")[0] == 2 %}
foo
{%- else %}
bar
{%- endif %}
Maybe wrap the logic in a something like this:
Done.
{%- if 'pythonversion' in grains and grains.pythonversion[0]|int == 3 %}
pythonpkg: python36-PyMySQL # python36-mysql works too
{%- else %}
pythonpkg: MySQL-python
{%- endif %}
Thanks @ixs appreciated.
:tada: This PR is included in version 0.56.2 :tada:
The release is available on GitHub release
Your semantic-release bot :package::rocket:
PR progress checklist (to be filled in by reviewers)
What type of PR is this?
Primary type
[build]
Changes related to the build system[chore]
Changes to the build process or auxiliary tools and libraries such as documentation generation[ci]
Changes to the continuous integration configuration[feat]
A new feature[fix]
A bug fix[perf]
A code change that improves performance[refactor]
A code change that neither fixes a bug nor adds a feature[revert]
A change used to revert a previous commit[style]
Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc.)Secondary type
[docs]
Documentation changes[test]
Adding missing or correcting existing testsDoes this PR introduce a
BREAKING CHANGE
?No.
Related issues and/or pull requests
https://github.com/saltstack/salt/issues/54702 https://github.com/saltstack-formulas/mysql-formula/pull/248 https://github.com/saltstack-formulas/mysql-formula/pull/252
Describe the changes you're proposing
Problem: On Centos7 the
MySQL-python
package provides python2.7 support for MySQL. However, if salt is installed using python3 (salt-bootstrap -x python3) the salt MySQL state requires python3.6 support. The result is that this formula fails on CentOS7.A solution This PR checks python version grain to choose the correct package to install on CentOS7.
The solution is not ideal but I see no other solution for CentOS7.
Pillar / config required to test the proposed changes
Debug log showing how the proposed changes work
BEFORE
VERSIONS
Try python3-pyMySQL https://github.com/saltstack-formulas/mysql-formula/pull/252
Try python36-mysql
Try python36-PyMySQL