-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migration to Python3 #2839
Migration to Python3 #2839
Commits on Nov 27, 2020
-
salt: In downgrade orchestrate use
metalk8s.cmp_sorted
With Python3 we can no longer use `cmp` in `sort` and `sorted` function so use our salt module `metalk8s.cmp_sorted` in Downgrade orchestrate if we are running with Python3, so that it works well with Python2 and Pyton3 Refs: #2203
Configuration menu - View commit details
-
Copy full SHA for 7655d6f - Browse repository at this point
Copy the full SHA 7655d6fView commit details -
tests,docs: Use
salt-ssh --raw-shell
command before expansionsIn the past a `salt-ssh` command was needed prior to start the expansions to accept the ssh key but it's not longer needed so remove it. Instead do a simple `salt-ssh --raw-shell` command to check that salt-ssh work properly
Configuration menu - View commit details
-
Copy full SHA for 6577d2c - Browse repository at this point
Copy the full SHA 6577d2cView commit details -
salt: Add a
states
to execute a function on a minion with raw sshRight now `salt.function` salt state module do not handle `roster` for ssh and `raw_shell`, create a custom salt state module to run a `saltutil.cmd` with all kwargs input so that we support `roster` and `raw_shell` Sees: saltstack/salt#58662
Configuration menu - View commit details
-
Copy full SHA for 5e4174d - Browse repository at this point
Copy the full SHA 5e4174dView commit details -
build,salt,script: Migrate to Salt Python3
Change salt-master image to use Python3 salt-master package and also install Python3 dependencies, embed Python3 salt-minion version instead of Python2. In order to install Python3 salt-minion we need: - to install python3 - to install python36-rpm as by default version comparaison for package installation is wrong - to install python3 on nodes for being able to use `salt-ssh` Sees: saltstack/salt#58039 Sees: saltstack/salt#57972 Fixes: #2203
Configuration menu - View commit details
-
Copy full SHA for b53d936 - Browse repository at this point
Copy the full SHA b53d936View commit details -
salt/unit-test: Migrate to Python 3
- removes `salttesting` dependency - migrates away from deprecated `TestCase` methods - migrates `Mock` objects call args checks
Configuration menu - View commit details
-
Copy full SHA for a7b51ea - Browse repository at this point
Copy the full SHA a7b51eaView commit details -
salt: Prevent invalid escape sequence warnings
We need to pass `\;` to the `isoinfo` binary for reading file contents from an ISO archive, but this escape sequence is not valid in Python, and Python 3 warns about it. We could have escaped the backslash, but instead rely on the raw string notation for Python 3 (`r'my \escaped sequence'`).
Configuration menu - View commit details
-
Copy full SHA for e735947 - Browse repository at this point
Copy the full SHA e735947View commit details -
Configuration menu - View commit details
-
Copy full SHA for cf5df11 - Browse repository at this point
Copy the full SHA cf5df11View commit details -
salt: Add a
migrate_salt
state for Upgrade/DowngradeSince we migrate from Python2 to Python3 a "classic" salt states cannot handle it properly as the Python version change during the state execution. Add a dedicated orchestrate that handle the migration from Salt Python2 to Salt Python3 and also the migration from Salt Python3 to Salt Python2, call this new orchestrate during Upgrade and Downgrade if needed Refs: #2203
Configuration menu - View commit details
-
Copy full SHA for 561d0cb - Browse repository at this point
Copy the full SHA 561d0cbView commit details -
salt: Use
loop.previtem
in Upgrade and Downgrade orchestrateSince we migrate to Salt Python3 we have Jinja 2.11 so we can use `loop.previtem` instead of ugly hack using a jinja variable. NOTE: This hack is still needed in downgrade orchestrate when we downgrade to `2.6.x` as we are running with Salt master metalk8s-2.6.x that use Salt Python2 and Jinja 2.7 Refs: #2203
Configuration menu - View commit details
-
Copy full SHA for 280d3e5 - Browse repository at this point
Copy the full SHA 280d3e5View commit details -
salt: Do not call etcd state if Salt upgrade/downgrade failed
In `deploy_node` orchestrate, before this commit, during upgrade and downgrade the `Install etcd node` state is called even if the Salt upgrade/downgrade failed. This commit just add a require on this etcd state
Configuration menu - View commit details
-
Copy full SHA for 334a7f5 - Browse repository at this point
Copy the full SHA 334a7f5View commit details -
salt: Remove non-breaking space characters from Solutions
Solutions YAML files contains some non-breaking space characters inside some Jinja formula `{{ }}` that make Salt Python3 rendering fail. NOTE: Those non-breaking space characters did not break Jinja2.7 used by Salt in Python2 that's why we didn't see any issue because of this before
Configuration menu - View commit details
-
Copy full SHA for 10d08d8 - Browse repository at this point
Copy the full SHA 10d08d8View commit details -
changelog: Add entry for Python3 migration
Add an entry in changelog file about Salt migration to Python3 and bump to Salt version 3002.2 Refs: #2203
Configuration menu - View commit details
-
Copy full SHA for ea22895 - Browse repository at this point
Copy the full SHA ea22895View commit details -
Configuration menu - View commit details
-
Copy full SHA for 0d1cb84 - Browse repository at this point
Copy the full SHA 0d1cb84View commit details