From dbbd869b8c3b645ff150f2dca45a16edc4e9c04e Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Tue, 27 Jun 2023 08:05:57 +0100 Subject: [PATCH 01/13] Revert "Don't hardcode the python version on `pkg/debian/salt-cloud.postinst`" This reverts commit ae14412da3abd215f10b8212001ab47807dded39. --- pkg/debian/salt-cloud.postinst | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pkg/debian/salt-cloud.postinst b/pkg/debian/salt-cloud.postinst index a92551161da0..12a955b93492 100644 --- a/pkg/debian/salt-cloud.postinst +++ b/pkg/debian/salt-cloud.postinst @@ -1,6 +1,5 @@ case "$1" in configure) - PY_VER=$(/opt/saltstack/salt/bin/python3 -c "import sys; sys.stdout.write('{}.{}'.format(*sys.version_info)); sys.stdout.flush;") - chown -R salt:salt /etc/salt/cloud.deploy.d /opt/saltstack/salt/lib/python${PY_VER}/site-packages/salt/cloud/deploy + chown -R salt:salt /etc/salt/cloud.deploy.d /opt/saltstack/salt/lib/python3.10/site-packages/salt/cloud/deploy ;; esac From 1799f6e94e38488bcafac59368c4cf6a4924f0f2 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Tue, 27 Jun 2023 08:05:57 +0100 Subject: [PATCH 02/13] Revert "Don't hardcode the python version in the test." This reverts commit c6e2bd18e9ba531514252359d0d2496305710eee. --- pkg/tests/integration/test_salt_user.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/pkg/tests/integration/test_salt_user.py b/pkg/tests/integration/test_salt_user.py index 74ec8bb00937..d1c8d504fa00 100644 --- a/pkg/tests/integration/test_salt_user.py +++ b/pkg/tests/integration/test_salt_user.py @@ -1,6 +1,5 @@ import pathlib import subprocess -import sys import psutil import pytest @@ -62,9 +61,7 @@ def test_salt_cloud_dirs(install_salt): Test the correct user is running the Salt Master """ paths = [ - "/opt/saltstack/salt/lib/python{}.{}/site-packages/salt/cloud/deploy".format( - *sys.version_info - ), + "/opt/saltstack/salt/lib/python3.10/site-packages/salt/cloud/deploy", "/etc/salt/cloud.deploy.d", ] for name in paths: From 8ff65f0cc58e89e9e82d8b7325a1e2c7078d8e2a Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Tue, 27 Jun 2023 08:05:57 +0100 Subject: [PATCH 03/13] Revert "Added changelog entry and updated release notes" This reverts commit a1861c7871e80e01d8e5b6db08d306c70029c386. --- changelog/64457.added.md | 1 - changelog/64457.changed.md | 7 ------- doc/topics/releases/templates/3007.0.md.template | 3 --- 3 files changed, 11 deletions(-) delete mode 100644 changelog/64457.added.md delete mode 100644 changelog/64457.changed.md diff --git a/changelog/64457.added.md b/changelog/64457.added.md deleted file mode 100644 index b868b65eb7f5..000000000000 --- a/changelog/64457.added.md +++ /dev/null @@ -1 +0,0 @@ -Switched Salt's onedir Python version to 3.11 diff --git a/changelog/64457.changed.md b/changelog/64457.changed.md deleted file mode 100644 index 3360eb9c0ccc..000000000000 --- a/changelog/64457.changed.md +++ /dev/null @@ -1,7 +0,0 @@ -Addressed Python 3.11 deprecations: - -* Switch to `FullArgSpec` since Py 3.11 no longer has `ArgSpec`, deprecated since Py 3.0 -* Stopped using the deprecated `cgi` module. -* Stopped using the deprecated `pipes` module -* Backport `locale.getdefaultlocale()` into Salt. It's getting removed in Py 3.13 -* Stopped using the deprecated `imp` module diff --git a/doc/topics/releases/templates/3007.0.md.template b/doc/topics/releases/templates/3007.0.md.template index 1230db548a1f..66899b0f1553 100644 --- a/doc/topics/releases/templates/3007.0.md.template +++ b/doc/topics/releases/templates/3007.0.md.template @@ -6,9 +6,6 @@ Add release specific details below --> -## Python 3.11 -Salt's onedir packages now use Python 3.11 - ## Python 3.7 Support Dropped Support for python 3.7 has been dropped since it reached end-of-line in 27 Jun 2023. From 37e7eb12eac7386c6001603f703bc4c1b518210a Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Tue, 27 Jun 2023 08:05:57 +0100 Subject: [PATCH 04/13] Revert "Generate 3.11 requirements for the package tests" This reverts commit d2f1990135d87040cf399fb21f6c5f8296d032c8. --- .pre-commit-config.yaml | 26 --- .../static/ci/py3.11/pkgtests-windows.txt | 164 ------------------ requirements/static/ci/py3.11/pkgtests.txt | 159 ----------------- 3 files changed, 349 deletions(-) delete mode 100644 requirements/static/ci/py3.11/pkgtests-windows.txt delete mode 100644 requirements/static/ci/py3.11/pkgtests.txt diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 20737c86ee23..3c1d9b7e388f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1124,32 +1124,6 @@ repos: - --include=requirements/zeromq.txt - requirements/static/ci/pkgtests-windows.in - - id: pip-tools-compile - alias: compile-ci-pkg-3.11-requirements - name: PKG tests CI Py3.11 Requirements - files: ^requirements/((base|zeromq|pytest)\.txt|static/(pkg/linux\.in|ci/((pkgtests|common)\.in|py3\.11/pkgtests\.in)))$ - pass_filenames: false - args: - - -v - - --py-version=3.11 - - --platform=linux - - --include=requirements/base.txt - - --include=requirements/zeromq.txt - - requirements/static/ci/pkgtests.in - - - id: pip-tools-compile - alias: compile-ci-windows-pkg-3.11-requirements - name: PKG tests Windows CI Py3.11 Requirements - files: ^requirements/((base|zeromq|pytest)\.txt|static/(pkg/linux\.in|ci/((pkgtests-windows|common)\.in|py3\.11/pkgtests-windows\.in)))$ - pass_filenames: false - args: - - -v - - --py-version=3.11 - - --platform=windows - - --include=requirements/base.txt - - --include=requirements/zeromq.txt - - requirements/static/ci/pkgtests-windows.in - # <---- PKG ci requirements----------------------------------------------------------------------------------------- diff --git a/requirements/static/ci/py3.11/pkgtests-windows.txt b/requirements/static/ci/py3.11/pkgtests-windows.txt deleted file mode 100644 index 73ec2a9dea14..000000000000 --- a/requirements/static/ci/py3.11/pkgtests-windows.txt +++ /dev/null @@ -1,164 +0,0 @@ -# -# This file is autogenerated by pip-compile -# To update, run: -# -# pip-compile --output-file=requirements/static/ci/py3.11/pkgtests-windows.txt requirements/base.txt requirements/static/ci/pkgtests-windows.in requirements/zeromq.txt -# -attrs==23.1.0 - # via - # pytest-salt-factories - # pytest-shell-utilities - # pytest-skip-markers - # pytest-system-statistics -autocommand==2.2.2 - # via jaraco.text -certifi==2023.5.7 - # via requests -cffi==1.15.1 - # via - # clr-loader - # cryptography -charset-normalizer==2.1.1 - # via requests -cheroot==10.0.0 - # via cherrypy -cherrypy==18.8.0 - # via -r requirements/static/ci/pkgtests-windows.in -clr-loader==0.2.5 - # via pythonnet -colorama==0.4.6 - # via pytest -contextvars==2.4 - # via -r requirements/base.txt -cryptography==40.0.2 - # via -r requirements/crypto.txt -distlib==0.3.6 - # via virtualenv -distro==1.8.0 - # via - # -r requirements/base.txt - # pytest-skip-markers -filelock==3.9.0 - # via virtualenv -idna==3.4 - # via requests -immutables==0.15 - # via contextvars -inflect==6.0.2 - # via jaraco.text -iniconfig==2.0.0 - # via pytest -jaraco.collections==4.1.0 - # via cherrypy -jaraco.context==4.3.0 - # via jaraco.text -jaraco.functools==3.7.0 - # via - # cheroot - # jaraco.text - # tempora -jaraco.text==3.11.1 - # via jaraco.collections -jinja2==3.1.2 - # via -r requirements/base.txt -jmespath==1.0.1 - # via -r requirements/base.txt -looseversion==1.2.0 - # via -r requirements/base.txt -markupsafe==2.1.2 - # via - # -r requirements/base.txt - # jinja2 -more-itertools==9.1.0 - # via - # cheroot - # cherrypy - # jaraco.functools - # jaraco.text -msgpack==1.0.5 - # via - # -r requirements/base.txt - # pytest-salt-factories -packaging==23.1 - # via - # -r requirements/base.txt - # pytest -platformdirs==2.6.2 - # via virtualenv -pluggy==1.0.0 - # via pytest -portend==3.1.0 - # via cherrypy -psutil==5.9.5 - # via - # -r requirements/base.txt - # pytest-salt-factories - # pytest-shell-utilities - # pytest-system-statistics -pycparser==2.21 - # via cffi -pycryptodomex==3.9.8 - # via -r requirements/crypto.txt -pydantic==1.10.4 - # via inflect -pytest-helpers-namespace==2021.12.29 - # via - # pytest-salt-factories - # pytest-shell-utilities -pytest-salt-factories==1.0.0rc17 - # via -r requirements/static/ci/pkgtests-windows.in -pytest-shell-utilities==1.7.0 - # via pytest-salt-factories -pytest-skip-markers==1.4.0 - # via - # pytest-salt-factories - # pytest-shell-utilities - # pytest-system-statistics -pytest-system-statistics==1.0.2 - # via pytest-salt-factories -pytest-tempdir==2019.10.12 - # via pytest-salt-factories -pytest==7.3.1 - # via - # pytest-helpers-namespace - # pytest-salt-factories - # pytest-shell-utilities - # pytest-skip-markers - # pytest-system-statistics - # pytest-tempdir -pythonnet==3.0.1 - # via -r requirements/static/ci/pkgtests-windows.in -pytz==2023.3 - # via tempora -pywin32==306 - # via - # pytest-skip-markers - # wmi -pyyaml==6.0 - # via -r requirements/base.txt -pyzmq==25.1.0 - # via - # -r requirements/zeromq.txt - # pytest-salt-factories -requests==2.31.0 - # via -r requirements/base.txt -tempora==5.2.2 - # via portend -tornado==6.3.2 ; python_version >= "3.8" - # via -r requirements/base.txt -typing-extensions==4.6.2 - # via - # pydantic - # pytest-shell-utilities - # pytest-system-statistics -urllib3==1.26.14 - # via requests -virtualenv==20.18.0 - # via pytest-salt-factories -wmi==1.5.1 ; sys_platform == "win32" - # via -r requirements/static/ci/pkgtests-windows.in -zc.lockfile==2.0 - # via cherrypy - -# The following packages are considered to be unsafe in a requirements file: -# setuptools diff --git a/requirements/static/ci/py3.11/pkgtests.txt b/requirements/static/ci/py3.11/pkgtests.txt deleted file mode 100644 index 7ca882892bce..000000000000 --- a/requirements/static/ci/py3.11/pkgtests.txt +++ /dev/null @@ -1,159 +0,0 @@ -# -# This file is autogenerated by pip-compile -# To update, run: -# -# pip-compile --output-file=requirements/static/ci/py3.11/pkgtests.txt requirements/base.txt requirements/static/ci/pkgtests.in requirements/zeromq.txt -# -attrs==23.1.0 - # via - # pytest-salt-factories - # pytest-shell-utilities - # pytest-skip-markers - # pytest-system-statistics -autocommand==2.2.2 - # via jaraco.text -certifi==2023.5.7 - # via requests -cffi==1.15.1 - # via cryptography -charset-normalizer==2.1.1 - # via requests -cheroot==10.0.0 - # via cherrypy -cherrypy==18.8.0 - # via -r requirements/static/ci/pkgtests.in -contextvars==2.4 - # via -r requirements/base.txt -cryptography==40.0.2 - # via -r requirements/crypto.txt -distlib==0.3.6 - # via virtualenv -distro==1.8.0 - # via - # -r requirements/base.txt - # pytest-skip-markers -docker==6.1.2 - # via -r requirements/static/ci/pkgtests.in -filelock==3.9.0 - # via virtualenv -idna==3.4 - # via requests -immutables==0.15 - # via contextvars -inflect==6.0.2 - # via jaraco.text -iniconfig==2.0.0 - # via pytest -jaraco.collections==4.1.0 - # via cherrypy -jaraco.context==4.3.0 - # via jaraco.text -jaraco.functools==3.7.0 - # via - # cheroot - # jaraco.text - # tempora -jaraco.text==3.11.1 - # via jaraco.collections -jinja2==3.1.2 - # via -r requirements/base.txt -jmespath==1.0.1 - # via -r requirements/base.txt -looseversion==1.2.0 - # via -r requirements/base.txt -markupsafe==2.1.2 - # via - # -r requirements/base.txt - # jinja2 -more-itertools==9.1.0 - # via - # cheroot - # cherrypy - # jaraco.functools - # jaraco.text -msgpack==1.0.5 - # via - # -r requirements/base.txt - # pytest-salt-factories -packaging==23.1 - # via - # -r requirements/base.txt - # docker - # pytest -platformdirs==2.6.2 - # via virtualenv -pluggy==1.0.0 - # via pytest -portend==3.1.0 - # via cherrypy -psutil==5.9.5 - # via - # -r requirements/base.txt - # pytest-salt-factories - # pytest-shell-utilities - # pytest-system-statistics -pycparser==2.21 - # via cffi -pycryptodomex==3.9.8 - # via -r requirements/crypto.txt -pydantic==1.10.4 - # via inflect -pytest-helpers-namespace==2021.12.29 - # via - # pytest-salt-factories - # pytest-shell-utilities -pytest-salt-factories==1.0.0rc17 - # via -r requirements/static/ci/pkgtests.in -pytest-shell-utilities==1.7.0 - # via pytest-salt-factories -pytest-skip-markers==1.4.0 - # via - # pytest-salt-factories - # pytest-shell-utilities - # pytest-system-statistics -pytest-system-statistics==1.0.2 - # via pytest-salt-factories -pytest-tempdir==2019.10.12 - # via pytest-salt-factories -pytest==7.3.1 - # via - # pytest-helpers-namespace - # pytest-salt-factories - # pytest-shell-utilities - # pytest-skip-markers - # pytest-system-statistics - # pytest-tempdir -pytz==2023.3 - # via tempora -pyyaml==6.0 - # via -r requirements/base.txt -pyzmq==25.1.0 - # via - # -r requirements/zeromq.txt - # pytest-salt-factories -requests==2.31.0 - # via - # -r requirements/base.txt - # docker -tempora==5.2.2 - # via portend -tornado==6.3.2 ; python_version >= "3.8" - # via -r requirements/base.txt -typing-extensions==4.6.2 - # via - # pydantic - # pytest-shell-utilities - # pytest-system-statistics -urllib3==1.26.14 - # via - # docker - # requests -virtualenv==20.17.1 - # via pytest-salt-factories -websocket-client==1.5.1 - # via docker -zc.lockfile==2.0 - # via cherrypy - -# The following packages are considered to be unsafe in a requirements file: -# setuptools From 982601863adf4c13a05974c04c96a4f331ae1b5a Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Tue, 27 Jun 2023 08:05:57 +0100 Subject: [PATCH 05/13] Revert "Use proper keys since Python's base64 in Py3.11 is more picky" This reverts commit 14282d69f68b3f99acb0b80ce8c59df84b33bdde. --- tests/integration/states/test_ssh_auth.py | 50 +++++++---------------- 1 file changed, 15 insertions(+), 35 deletions(-) diff --git a/tests/integration/states/test_ssh_auth.py b/tests/integration/states/test_ssh_auth.py index 46ffc9b41155..660c3f62d6a2 100644 --- a/tests/integration/states/test_ssh_auth.py +++ b/tests/integration/states/test_ssh_auth.py @@ -24,20 +24,6 @@ def test_issue_7409_no_linebreaks_between_keys(self, username): user_ssh_dir = os.path.join(userdetails["home"], ".ssh") authorized_keys_file = os.path.join(user_ssh_dir, "authorized_keys") - key1 = ( - # Explicit no ending line break - "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQC3dd5ACsvJhnIOrn6bSOkX5" - "KyVDpTYsVAaJj3AmEo6Fr5cHXJFJoJS+Ld8K5vCscPzuXashdYUdrhL1E5Liz" - "bza+zneQ5AkJ7sn2NXymD6Bbra+infO4NgnQXbGMp/NyY65jbQGqJeQ081iEV" - f"YbDP2zXp6fmrqqmFCaakZfGRbVw== root" - ) - key2 = ( - "AAAAB3NzaC1yc2EAAAADAQABAAAAgQC7h77HyBPCUDONCs5bI/PrrPwyYJegl0" - "f9YWLaBofVYOUl/uSv1ux8zjIoLVs4kguY1ihtIoK2kho4YsjNtIaAd6twdua9" - "oqCg2g/54cIK/8WbIjwnb3LFRgyTG5DFuj+7526EdJycAZvhSzIZYui3RUj4Vp" - "eMoF7mcB6TIK2/2w==" - ) - ret = self.run_state( "file.managed", name=authorized_keys_file, @@ -45,22 +31,23 @@ def test_issue_7409_no_linebreaks_between_keys(self, username): makedirs=True, contents_newline=False, # Explicit no ending line break - contents=key1, + contents="ssh-rsa AAAAB3NzaC1kc3MAAACBAL0sQ9fJ5bYTEyY== root", ) ret = self.run_state( "ssh_auth.present", - name=key2, + name="AAAAB3NzaC1kcQ9J5bYTEyZ==", enc="ssh-rsa", user=username, comment=username, ) self.assertSaltTrueReturn(ret) - self.assertSaltStateChangesEqual(ret, {key2: "New"}) + self.assertSaltStateChangesEqual(ret, {"AAAAB3NzaC1kcQ9J5bYTEyZ==": "New"}) with salt.utils.files.fopen(authorized_keys_file, "r") as fhr: self.assertEqual( fhr.read(), - f"{key1}\nssh-rsa {key2} {username}\n", + "ssh-rsa AAAAB3NzaC1kc3MAAACBAL0sQ9fJ5bYTEyY== root\n" + "ssh-rsa AAAAB3NzaC1kcQ9J5bYTEyZ== {}\n".format(username), ) @pytest.mark.destructive_test @@ -73,48 +60,39 @@ def test_issue_10198_keyfile_from_another_env(self, username=None): authorized_keys_file = os.path.join(user_ssh_dir, "authorized_keys") key_fname = "issue_10198.id_rsa.pub" - key_contents = ( - "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQC3dd5ACsvJhnIOrn6bSOkX5" - "KyVDpTYsVAaJj3AmEo6Fr5cHXJFJoJS+Ld8K5vCscPzuXashdYUdrhL1E5Liz" - "bza+zneQ5AkJ7sn2NXymD6Bbra+infO4NgnQXbGMp/NyY65jbQGqJeQ081iEV" - f"YbDP2zXp6fmrqqmFCaakZfGRbVw== {username}\n" - ) # Create the keyfile that we expect to get back on the state call with salt.utils.files.fopen( os.path.join(RUNTIME_VARS.TMP_PRODENV_STATE_TREE, key_fname), "w" ) as kfh: - kfh.write(key_contents) + kfh.write("ssh-rsa AAAAB3NzaC1kcQ9J5bYTEyZ== {}\n".format(username)) # Create a bogus key file on base environment with salt.utils.files.fopen( os.path.join(RUNTIME_VARS.TMP_STATE_TREE, key_fname), "w" ) as kfh: - kfh.write( - "ssh-rsa A!AAB3NzaC1yc2EAAAADAQABAAAAgQC3dd5ACsvJhnIOrn6bSOkX5" - "KyVDpTYsVAaJj3AmEo6Fr5cHXJFJoJS+Ld8K5vCscPzuXashdYUdrhL1E5Liz" - "bza+zneQ5AkJ7sn2NXymD6Bbra+infO4NgnQXbGMp/NyY65jbQGqJeQ081iEV" - f"YbDP2zXp6fmrqqmFCaakZfGRbVw== {username}\n" - ) + kfh.write("ssh-rsa BAAAB3NzaC1kcQ9J5bYTEyZ== {}\n".format(username)) ret = self.run_state( "ssh_auth.present", name="Setup Keys", - source=f"salt://{key_fname}?saltenv=prod", + source="salt://{}?saltenv=prod".format(key_fname), enc="ssh-rsa", user=username, comment=username, ) self.assertSaltTrueReturn(ret) with salt.utils.files.fopen(authorized_keys_file, "r") as fhr: - self.assertEqual(fhr.read(), key_contents) + self.assertEqual( + fhr.read(), "ssh-rsa AAAAB3NzaC1kcQ9J5bYTEyZ== {}\n".format(username) + ) os.unlink(authorized_keys_file) ret = self.run_state( "ssh_auth.present", name="Setup Keys", - source=f"salt://{key_fname}", + source="salt://{}".format(key_fname), enc="ssh-rsa", user=username, comment=username, @@ -122,4 +100,6 @@ def test_issue_10198_keyfile_from_another_env(self, username=None): ) self.assertSaltTrueReturn(ret) with salt.utils.files.fopen(authorized_keys_file, "r") as fhr: - self.assertEqual(fhr.read(), key_contents) + self.assertEqual( + fhr.read(), "ssh-rsa AAAAB3NzaC1kcQ9J5bYTEyZ== {}\n".format(username) + ) From 5feeabd19884a2882e323bd7a9dad62a1c9700fd Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Tue, 27 Jun 2023 08:05:57 +0100 Subject: [PATCH 06/13] Revert "Switch onedir to Py3.11" This reverts commit ff42133e8148f355a2ef25caec2cae01984b12ff. --- .github/workflows/ci.yml | 98 ++++++++-------- .github/workflows/nightly.yml | 98 ++++++++-------- .github/workflows/release.yml | 64 +++++------ .github/workflows/scheduled.yml | 98 ++++++++-------- .github/workflows/staging.yml | 162 +++++++++++++-------------- cicd/shared-gh-workflows-context.yml | 2 +- 6 files changed, 261 insertions(+), 261 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7859aa907ef6..4464cae1e299 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -470,7 +470,7 @@ jobs: self-hosted-runners: ${{ fromJSON(needs.prepare-workflow.outputs.runners)['self-hosted'] }} github-hosted-runners: ${{ fromJSON(needs.prepare-workflow.outputs.runners)['github-hosted'] }} relenv-version: "0.12.3" - python-version: "3.11.3" + python-version: "3.10.11" build-salt-onedir: name: Build Salt Onedir @@ -486,7 +486,7 @@ jobs: self-hosted-runners: ${{ fromJSON(needs.prepare-workflow.outputs.runners)['self-hosted'] }} github-hosted-runners: ${{ fromJSON(needs.prepare-workflow.outputs.runners)['github-hosted'] }} relenv-version: "0.12.3" - python-version: "3.11.3" + python-version: "3.10.11" build-rpm-pkgs: name: Build RPM Packages @@ -498,7 +498,7 @@ jobs: with: salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" relenv-version: "0.12.3" - python-version: "3.11.3" + python-version: "3.10.11" build-deb-pkgs: name: Build DEB Packages @@ -510,7 +510,7 @@ jobs: with: salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" relenv-version: "0.12.3" - python-version: "3.11.3" + python-version: "3.10.11" build-windows-pkgs: name: Build Windows Packages @@ -522,7 +522,7 @@ jobs: with: salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" relenv-version: "0.12.3" - python-version: "3.11.3" + python-version: "3.10.11" build-macos-pkgs: name: Build macOS Packages @@ -534,7 +534,7 @@ jobs: with: salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" relenv-version: "0.12.3" - python-version: "3.11.3" + python-version: "3.10.11" amazonlinux-2-pkg-tests: name: Amazon Linux 2 Package Tests @@ -549,7 +549,7 @@ jobs: arch: x86_64 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" pkg-type: rpm - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: ${{ github.event_name == 'pull_request' }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} @@ -566,7 +566,7 @@ jobs: arch: x86_64 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" pkg-type: rpm - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: ${{ github.event_name == 'pull_request' }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} @@ -583,7 +583,7 @@ jobs: arch: x86_64 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" pkg-type: rpm - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: ${{ github.event_name == 'pull_request' }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} @@ -600,7 +600,7 @@ jobs: arch: x86_64 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" pkg-type: rpm - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: ${{ github.event_name == 'pull_request' }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} @@ -617,7 +617,7 @@ jobs: arch: x86_64 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" pkg-type: deb - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: ${{ github.event_name == 'pull_request' }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} @@ -634,7 +634,7 @@ jobs: arch: x86_64 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" pkg-type: deb - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: ${{ github.event_name == 'pull_request' }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} @@ -651,7 +651,7 @@ jobs: arch: aarch64 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" pkg-type: deb - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: ${{ github.event_name == 'pull_request' }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} @@ -668,7 +668,7 @@ jobs: arch: x86_64 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" pkg-type: rpm - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: ${{ github.event_name == 'pull_request' }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} @@ -685,7 +685,7 @@ jobs: arch: x86_64 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" pkg-type: rpm - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: ${{ github.event_name == 'pull_request' }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} @@ -702,7 +702,7 @@ jobs: arch: x86_64 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" pkg-type: deb - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: ${{ github.event_name == 'pull_request' }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} @@ -719,7 +719,7 @@ jobs: arch: aarch64 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" pkg-type: deb - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: ${{ github.event_name == 'pull_request' }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} @@ -736,7 +736,7 @@ jobs: arch: x86_64 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" pkg-type: deb - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: ${{ github.event_name == 'pull_request' }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} @@ -753,7 +753,7 @@ jobs: arch: aarch64 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" pkg-type: deb - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: ${{ github.event_name == 'pull_request' }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} @@ -770,7 +770,7 @@ jobs: arch: x86_64 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" pkg-type: macos - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: ${{ github.event_name == 'pull_request' }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} @@ -787,7 +787,7 @@ jobs: arch: amd64 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" pkg-type: NSIS - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: ${{ github.event_name == 'pull_request' }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} @@ -804,7 +804,7 @@ jobs: arch: amd64 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" pkg-type: MSI - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: ${{ github.event_name == 'pull_request' }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} @@ -821,7 +821,7 @@ jobs: arch: amd64 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" pkg-type: NSIS - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: ${{ github.event_name == 'pull_request' }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} @@ -838,7 +838,7 @@ jobs: arch: amd64 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" pkg-type: MSI - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: ${{ github.event_name == 'pull_request' }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} @@ -855,7 +855,7 @@ jobs: arch: amd64 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" pkg-type: NSIS - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: ${{ github.event_name == 'pull_request' }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} @@ -872,7 +872,7 @@ jobs: arch: amd64 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" pkg-type: MSI - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: ${{ github.event_name == 'pull_request' }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} @@ -890,7 +890,7 @@ jobs: arch: amd64 testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 pull-labels: ${{ needs.prepare-workflow.outputs.pull-labels }} skip-code-coverage: ${{ github.event_name == 'pull_request' }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} @@ -909,7 +909,7 @@ jobs: arch: amd64 testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 pull-labels: ${{ needs.prepare-workflow.outputs.pull-labels }} skip-code-coverage: ${{ github.event_name == 'pull_request' }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} @@ -928,7 +928,7 @@ jobs: arch: amd64 testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 pull-labels: ${{ needs.prepare-workflow.outputs.pull-labels }} skip-code-coverage: ${{ github.event_name == 'pull_request' }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} @@ -947,7 +947,7 @@ jobs: arch: x86_64 testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 pull-labels: ${{ needs.prepare-workflow.outputs.pull-labels }} skip-code-coverage: ${{ github.event_name == 'pull_request' }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} @@ -966,7 +966,7 @@ jobs: arch: x86_64 testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 pull-labels: ${{ needs.prepare-workflow.outputs.pull-labels }} skip-code-coverage: ${{ github.event_name == 'pull_request' }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} @@ -985,7 +985,7 @@ jobs: arch: x86_64 testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 pull-labels: ${{ needs.prepare-workflow.outputs.pull-labels }} skip-code-coverage: ${{ github.event_name == 'pull_request' }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} @@ -1004,7 +1004,7 @@ jobs: arch: x86_64 testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 pull-labels: ${{ needs.prepare-workflow.outputs.pull-labels }} skip-code-coverage: ${{ github.event_name == 'pull_request' }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} @@ -1023,7 +1023,7 @@ jobs: arch: x86_64 testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 pull-labels: ${{ needs.prepare-workflow.outputs.pull-labels }} skip-code-coverage: ${{ github.event_name == 'pull_request' }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} @@ -1042,7 +1042,7 @@ jobs: arch: x86_64 testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 pull-labels: ${{ needs.prepare-workflow.outputs.pull-labels }} skip-code-coverage: ${{ github.event_name == 'pull_request' }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} @@ -1061,7 +1061,7 @@ jobs: arch: x86_64 testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 pull-labels: ${{ needs.prepare-workflow.outputs.pull-labels }} skip-code-coverage: ${{ github.event_name == 'pull_request' }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} @@ -1080,7 +1080,7 @@ jobs: arch: x86_64 testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 pull-labels: ${{ needs.prepare-workflow.outputs.pull-labels }} skip-code-coverage: ${{ github.event_name == 'pull_request' }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} @@ -1099,7 +1099,7 @@ jobs: arch: x86_64 testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 pull-labels: ${{ needs.prepare-workflow.outputs.pull-labels }} skip-code-coverage: ${{ github.event_name == 'pull_request' }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} @@ -1118,7 +1118,7 @@ jobs: arch: x86_64 testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 pull-labels: ${{ needs.prepare-workflow.outputs.pull-labels }} skip-code-coverage: ${{ github.event_name == 'pull_request' }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} @@ -1137,7 +1137,7 @@ jobs: arch: aarch64 testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 pull-labels: ${{ needs.prepare-workflow.outputs.pull-labels }} skip-code-coverage: ${{ github.event_name == 'pull_request' }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} @@ -1156,7 +1156,7 @@ jobs: arch: x86_64 testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 pull-labels: ${{ needs.prepare-workflow.outputs.pull-labels }} skip-code-coverage: ${{ github.event_name == 'pull_request' }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} @@ -1175,7 +1175,7 @@ jobs: arch: x86_64 testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 pull-labels: ${{ needs.prepare-workflow.outputs.pull-labels }} skip-code-coverage: ${{ github.event_name == 'pull_request' }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} @@ -1194,7 +1194,7 @@ jobs: arch: x86_64 testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 pull-labels: ${{ needs.prepare-workflow.outputs.pull-labels }} skip-code-coverage: ${{ github.event_name == 'pull_request' }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} @@ -1213,7 +1213,7 @@ jobs: arch: x86_64 testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 pull-labels: ${{ needs.prepare-workflow.outputs.pull-labels }} skip-code-coverage: ${{ github.event_name == 'pull_request' }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} @@ -1232,7 +1232,7 @@ jobs: arch: x86_64 testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 pull-labels: ${{ needs.prepare-workflow.outputs.pull-labels }} skip-code-coverage: ${{ github.event_name == 'pull_request' }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} @@ -1251,7 +1251,7 @@ jobs: arch: x86_64 testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 pull-labels: ${{ needs.prepare-workflow.outputs.pull-labels }} skip-code-coverage: ${{ github.event_name == 'pull_request' }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} @@ -1270,7 +1270,7 @@ jobs: arch: aarch64 testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 pull-labels: ${{ needs.prepare-workflow.outputs.pull-labels }} skip-code-coverage: ${{ github.event_name == 'pull_request' }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} @@ -1289,7 +1289,7 @@ jobs: arch: x86_64 testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 pull-labels: ${{ needs.prepare-workflow.outputs.pull-labels }} skip-code-coverage: ${{ github.event_name == 'pull_request' }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} @@ -1308,7 +1308,7 @@ jobs: arch: aarch64 testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 pull-labels: ${{ needs.prepare-workflow.outputs.pull-labels }} skip-code-coverage: ${{ github.event_name == 'pull_request' }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index cec3544f8727..282e18e579af 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -523,7 +523,7 @@ jobs: self-hosted-runners: ${{ fromJSON(needs.prepare-workflow.outputs.runners)['self-hosted'] }} github-hosted-runners: ${{ fromJSON(needs.prepare-workflow.outputs.runners)['github-hosted'] }} relenv-version: "0.12.3" - python-version: "3.11.3" + python-version: "3.10.11" build-salt-onedir: name: Build Salt Onedir @@ -539,7 +539,7 @@ jobs: self-hosted-runners: ${{ fromJSON(needs.prepare-workflow.outputs.runners)['self-hosted'] }} github-hosted-runners: ${{ fromJSON(needs.prepare-workflow.outputs.runners)['github-hosted'] }} relenv-version: "0.12.3" - python-version: "3.11.3" + python-version: "3.10.11" build-rpm-pkgs: name: Build RPM Packages @@ -551,7 +551,7 @@ jobs: with: salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" relenv-version: "0.12.3" - python-version: "3.11.3" + python-version: "3.10.11" build-deb-pkgs: name: Build DEB Packages @@ -563,7 +563,7 @@ jobs: with: salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" relenv-version: "0.12.3" - python-version: "3.11.3" + python-version: "3.10.11" build-windows-pkgs: name: Build Windows Packages @@ -575,7 +575,7 @@ jobs: with: salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" relenv-version: "0.12.3" - python-version: "3.11.3" + python-version: "3.10.11" environment: nightly sign-packages: false secrets: inherit @@ -590,7 +590,7 @@ jobs: with: salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" relenv-version: "0.12.3" - python-version: "3.11.3" + python-version: "3.10.11" environment: nightly sign-packages: true secrets: inherit @@ -608,7 +608,7 @@ jobs: arch: x86_64 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" pkg-type: rpm - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: false skip-junit-reports: false @@ -625,7 +625,7 @@ jobs: arch: x86_64 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" pkg-type: rpm - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: false skip-junit-reports: false @@ -642,7 +642,7 @@ jobs: arch: x86_64 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" pkg-type: rpm - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: false skip-junit-reports: false @@ -659,7 +659,7 @@ jobs: arch: x86_64 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" pkg-type: rpm - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: false skip-junit-reports: false @@ -676,7 +676,7 @@ jobs: arch: x86_64 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" pkg-type: deb - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: false skip-junit-reports: false @@ -693,7 +693,7 @@ jobs: arch: x86_64 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" pkg-type: deb - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: false skip-junit-reports: false @@ -710,7 +710,7 @@ jobs: arch: aarch64 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" pkg-type: deb - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: false skip-junit-reports: false @@ -727,7 +727,7 @@ jobs: arch: x86_64 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" pkg-type: rpm - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: false skip-junit-reports: false @@ -744,7 +744,7 @@ jobs: arch: x86_64 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" pkg-type: rpm - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: false skip-junit-reports: false @@ -761,7 +761,7 @@ jobs: arch: x86_64 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" pkg-type: deb - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: false skip-junit-reports: false @@ -778,7 +778,7 @@ jobs: arch: aarch64 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" pkg-type: deb - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: false skip-junit-reports: false @@ -795,7 +795,7 @@ jobs: arch: x86_64 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" pkg-type: deb - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: false skip-junit-reports: false @@ -812,7 +812,7 @@ jobs: arch: aarch64 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" pkg-type: deb - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: false skip-junit-reports: false @@ -829,7 +829,7 @@ jobs: arch: x86_64 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" pkg-type: macos - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: false skip-junit-reports: false @@ -846,7 +846,7 @@ jobs: arch: amd64 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" pkg-type: NSIS - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: false skip-junit-reports: false @@ -863,7 +863,7 @@ jobs: arch: amd64 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" pkg-type: MSI - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: false skip-junit-reports: false @@ -880,7 +880,7 @@ jobs: arch: amd64 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" pkg-type: NSIS - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: false skip-junit-reports: false @@ -897,7 +897,7 @@ jobs: arch: amd64 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" pkg-type: MSI - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: false skip-junit-reports: false @@ -914,7 +914,7 @@ jobs: arch: amd64 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" pkg-type: NSIS - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: false skip-junit-reports: false @@ -931,7 +931,7 @@ jobs: arch: amd64 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" pkg-type: MSI - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: false skip-junit-reports: false @@ -949,7 +949,7 @@ jobs: arch: amd64 testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 pull-labels: ${{ needs.prepare-workflow.outputs.pull-labels }} skip-code-coverage: false skip-junit-reports: false @@ -968,7 +968,7 @@ jobs: arch: amd64 testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 pull-labels: ${{ needs.prepare-workflow.outputs.pull-labels }} skip-code-coverage: false skip-junit-reports: false @@ -987,7 +987,7 @@ jobs: arch: amd64 testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 pull-labels: ${{ needs.prepare-workflow.outputs.pull-labels }} skip-code-coverage: false skip-junit-reports: false @@ -1006,7 +1006,7 @@ jobs: arch: x86_64 testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 pull-labels: ${{ needs.prepare-workflow.outputs.pull-labels }} skip-code-coverage: false skip-junit-reports: false @@ -1025,7 +1025,7 @@ jobs: arch: x86_64 testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 pull-labels: ${{ needs.prepare-workflow.outputs.pull-labels }} skip-code-coverage: false skip-junit-reports: false @@ -1044,7 +1044,7 @@ jobs: arch: x86_64 testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 pull-labels: ${{ needs.prepare-workflow.outputs.pull-labels }} skip-code-coverage: false skip-junit-reports: false @@ -1063,7 +1063,7 @@ jobs: arch: x86_64 testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 pull-labels: ${{ needs.prepare-workflow.outputs.pull-labels }} skip-code-coverage: false skip-junit-reports: false @@ -1082,7 +1082,7 @@ jobs: arch: x86_64 testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 pull-labels: ${{ needs.prepare-workflow.outputs.pull-labels }} skip-code-coverage: false skip-junit-reports: false @@ -1101,7 +1101,7 @@ jobs: arch: x86_64 testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 pull-labels: ${{ needs.prepare-workflow.outputs.pull-labels }} skip-code-coverage: false skip-junit-reports: false @@ -1120,7 +1120,7 @@ jobs: arch: x86_64 testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 pull-labels: ${{ needs.prepare-workflow.outputs.pull-labels }} skip-code-coverage: false skip-junit-reports: false @@ -1139,7 +1139,7 @@ jobs: arch: x86_64 testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 pull-labels: ${{ needs.prepare-workflow.outputs.pull-labels }} skip-code-coverage: false skip-junit-reports: false @@ -1158,7 +1158,7 @@ jobs: arch: x86_64 testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 pull-labels: ${{ needs.prepare-workflow.outputs.pull-labels }} skip-code-coverage: false skip-junit-reports: false @@ -1177,7 +1177,7 @@ jobs: arch: x86_64 testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 pull-labels: ${{ needs.prepare-workflow.outputs.pull-labels }} skip-code-coverage: false skip-junit-reports: false @@ -1196,7 +1196,7 @@ jobs: arch: aarch64 testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 pull-labels: ${{ needs.prepare-workflow.outputs.pull-labels }} skip-code-coverage: false skip-junit-reports: false @@ -1215,7 +1215,7 @@ jobs: arch: x86_64 testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 pull-labels: ${{ needs.prepare-workflow.outputs.pull-labels }} skip-code-coverage: false skip-junit-reports: false @@ -1234,7 +1234,7 @@ jobs: arch: x86_64 testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 pull-labels: ${{ needs.prepare-workflow.outputs.pull-labels }} skip-code-coverage: false skip-junit-reports: false @@ -1253,7 +1253,7 @@ jobs: arch: x86_64 testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 pull-labels: ${{ needs.prepare-workflow.outputs.pull-labels }} skip-code-coverage: false skip-junit-reports: false @@ -1272,7 +1272,7 @@ jobs: arch: x86_64 testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 pull-labels: ${{ needs.prepare-workflow.outputs.pull-labels }} skip-code-coverage: false skip-junit-reports: false @@ -1291,7 +1291,7 @@ jobs: arch: x86_64 testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 pull-labels: ${{ needs.prepare-workflow.outputs.pull-labels }} skip-code-coverage: false skip-junit-reports: false @@ -1310,7 +1310,7 @@ jobs: arch: x86_64 testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 pull-labels: ${{ needs.prepare-workflow.outputs.pull-labels }} skip-code-coverage: false skip-junit-reports: false @@ -1329,7 +1329,7 @@ jobs: arch: aarch64 testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 pull-labels: ${{ needs.prepare-workflow.outputs.pull-labels }} skip-code-coverage: false skip-junit-reports: false @@ -1348,7 +1348,7 @@ jobs: arch: x86_64 testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 pull-labels: ${{ needs.prepare-workflow.outputs.pull-labels }} skip-code-coverage: false skip-junit-reports: false @@ -1367,7 +1367,7 @@ jobs: arch: aarch64 testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 pull-labels: ${{ needs.prepare-workflow.outputs.pull-labels }} skip-code-coverage: false skip-junit-reports: false diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ded139e597f0..fa0a019a4967 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -232,7 +232,7 @@ jobs: distro-slug: almalinux-8 platform: linux arch: x86_64 - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" environment: release skip-code-coverage: true @@ -252,7 +252,7 @@ jobs: distro-slug: almalinux-8-arm64 platform: linux arch: aarch64 - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" environment: release skip-code-coverage: true @@ -272,7 +272,7 @@ jobs: distro-slug: almalinux-9 platform: linux arch: x86_64 - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" environment: release skip-code-coverage: true @@ -292,7 +292,7 @@ jobs: distro-slug: almalinux-9-arm64 platform: linux arch: aarch64 - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" environment: release skip-code-coverage: true @@ -312,7 +312,7 @@ jobs: distro-slug: amazonlinux-2 platform: linux arch: x86_64 - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" environment: release skip-code-coverage: true @@ -332,7 +332,7 @@ jobs: distro-slug: amazonlinux-2-arm64 platform: linux arch: aarch64 - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" environment: release skip-code-coverage: true @@ -352,7 +352,7 @@ jobs: distro-slug: centos-7 platform: linux arch: x86_64 - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" environment: release skip-code-coverage: true @@ -372,7 +372,7 @@ jobs: distro-slug: centos-7-arm64 platform: linux arch: aarch64 - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" environment: release skip-code-coverage: true @@ -392,7 +392,7 @@ jobs: distro-slug: centosstream-8 platform: linux arch: x86_64 - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" environment: release skip-code-coverage: true @@ -412,7 +412,7 @@ jobs: distro-slug: centosstream-8-arm64 platform: linux arch: aarch64 - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" environment: release skip-code-coverage: true @@ -432,7 +432,7 @@ jobs: distro-slug: centosstream-9 platform: linux arch: x86_64 - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" environment: release skip-code-coverage: true @@ -452,7 +452,7 @@ jobs: distro-slug: centosstream-9-arm64 platform: linux arch: aarch64 - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" environment: release skip-code-coverage: true @@ -472,7 +472,7 @@ jobs: distro-slug: debian-10 platform: linux arch: x86_64 - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" environment: release skip-code-coverage: true @@ -492,7 +492,7 @@ jobs: distro-slug: debian-11 platform: linux arch: x86_64 - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" environment: release skip-code-coverage: true @@ -512,7 +512,7 @@ jobs: distro-slug: debian-11-arm64 platform: linux arch: aarch64 - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" environment: release skip-code-coverage: true @@ -532,7 +532,7 @@ jobs: distro-slug: fedora-37 platform: linux arch: x86_64 - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" environment: release skip-code-coverage: true @@ -552,7 +552,7 @@ jobs: distro-slug: fedora-37-arm64 platform: linux arch: aarch64 - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" environment: release skip-code-coverage: true @@ -572,7 +572,7 @@ jobs: distro-slug: fedora-38 platform: linux arch: x86_64 - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" environment: release skip-code-coverage: true @@ -592,7 +592,7 @@ jobs: distro-slug: fedora-38-arm64 platform: linux arch: aarch64 - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" environment: release skip-code-coverage: true @@ -612,7 +612,7 @@ jobs: distro-slug: photonos-3 platform: linux arch: x86_64 - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" environment: release skip-code-coverage: true @@ -632,7 +632,7 @@ jobs: distro-slug: photonos-4 platform: linux arch: x86_64 - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" environment: release skip-code-coverage: true @@ -652,7 +652,7 @@ jobs: distro-slug: ubuntu-20.04 platform: linux arch: x86_64 - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" environment: release skip-code-coverage: true @@ -672,7 +672,7 @@ jobs: distro-slug: ubuntu-20.04-arm64 platform: linux arch: aarch64 - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" environment: release skip-code-coverage: true @@ -692,7 +692,7 @@ jobs: distro-slug: ubuntu-22.04 platform: linux arch: x86_64 - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" environment: release skip-code-coverage: true @@ -712,7 +712,7 @@ jobs: distro-slug: ubuntu-22.04-arm64 platform: linux arch: aarch64 - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" environment: release skip-code-coverage: true @@ -732,7 +732,7 @@ jobs: distro-slug: ubuntu-22.04 platform: linux arch: x86_64 - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" environment: release skip-code-coverage: true @@ -752,7 +752,7 @@ jobs: distro-slug: ubuntu-22.04-arm64 platform: linux arch: aarch64 - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" environment: release skip-code-coverage: true @@ -772,7 +772,7 @@ jobs: distro-slug: macos-12 platform: darwin arch: x86_64 - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" environment: release skip-code-coverage: true @@ -792,7 +792,7 @@ jobs: distro-slug: macos-12 platform: darwin arch: x86_64 - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" environment: release skip-code-coverage: true @@ -813,7 +813,7 @@ jobs: platform: windows arch: amd64 pkg-type: nsis - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" environment: release skip-code-coverage: true @@ -833,7 +833,7 @@ jobs: platform: windows arch: amd64 pkg-type: msi - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" environment: release skip-code-coverage: true @@ -853,7 +853,7 @@ jobs: platform: windows arch: amd64 pkg-type: onedir - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" environment: release skip-code-coverage: true diff --git a/.github/workflows/scheduled.yml b/.github/workflows/scheduled.yml index 40623b001591..abe9015dfd7d 100644 --- a/.github/workflows/scheduled.yml +++ b/.github/workflows/scheduled.yml @@ -513,7 +513,7 @@ jobs: self-hosted-runners: ${{ fromJSON(needs.prepare-workflow.outputs.runners)['self-hosted'] }} github-hosted-runners: ${{ fromJSON(needs.prepare-workflow.outputs.runners)['github-hosted'] }} relenv-version: "0.12.3" - python-version: "3.11.3" + python-version: "3.10.11" build-salt-onedir: name: Build Salt Onedir @@ -529,7 +529,7 @@ jobs: self-hosted-runners: ${{ fromJSON(needs.prepare-workflow.outputs.runners)['self-hosted'] }} github-hosted-runners: ${{ fromJSON(needs.prepare-workflow.outputs.runners)['github-hosted'] }} relenv-version: "0.12.3" - python-version: "3.11.3" + python-version: "3.10.11" build-rpm-pkgs: name: Build RPM Packages @@ -541,7 +541,7 @@ jobs: with: salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" relenv-version: "0.12.3" - python-version: "3.11.3" + python-version: "3.10.11" build-deb-pkgs: name: Build DEB Packages @@ -553,7 +553,7 @@ jobs: with: salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" relenv-version: "0.12.3" - python-version: "3.11.3" + python-version: "3.10.11" build-windows-pkgs: name: Build Windows Packages @@ -565,7 +565,7 @@ jobs: with: salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" relenv-version: "0.12.3" - python-version: "3.11.3" + python-version: "3.10.11" build-macos-pkgs: name: Build macOS Packages @@ -577,7 +577,7 @@ jobs: with: salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" relenv-version: "0.12.3" - python-version: "3.11.3" + python-version: "3.10.11" amazonlinux-2-pkg-tests: name: Amazon Linux 2 Package Tests @@ -592,7 +592,7 @@ jobs: arch: x86_64 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" pkg-type: rpm - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: false skip-junit-reports: false @@ -609,7 +609,7 @@ jobs: arch: x86_64 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" pkg-type: rpm - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: false skip-junit-reports: false @@ -626,7 +626,7 @@ jobs: arch: x86_64 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" pkg-type: rpm - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: false skip-junit-reports: false @@ -643,7 +643,7 @@ jobs: arch: x86_64 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" pkg-type: rpm - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: false skip-junit-reports: false @@ -660,7 +660,7 @@ jobs: arch: x86_64 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" pkg-type: deb - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: false skip-junit-reports: false @@ -677,7 +677,7 @@ jobs: arch: x86_64 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" pkg-type: deb - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: false skip-junit-reports: false @@ -694,7 +694,7 @@ jobs: arch: aarch64 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" pkg-type: deb - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: false skip-junit-reports: false @@ -711,7 +711,7 @@ jobs: arch: x86_64 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" pkg-type: rpm - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: false skip-junit-reports: false @@ -728,7 +728,7 @@ jobs: arch: x86_64 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" pkg-type: rpm - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: false skip-junit-reports: false @@ -745,7 +745,7 @@ jobs: arch: x86_64 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" pkg-type: deb - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: false skip-junit-reports: false @@ -762,7 +762,7 @@ jobs: arch: aarch64 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" pkg-type: deb - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: false skip-junit-reports: false @@ -779,7 +779,7 @@ jobs: arch: x86_64 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" pkg-type: deb - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: false skip-junit-reports: false @@ -796,7 +796,7 @@ jobs: arch: aarch64 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" pkg-type: deb - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: false skip-junit-reports: false @@ -813,7 +813,7 @@ jobs: arch: x86_64 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" pkg-type: macos - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: false skip-junit-reports: false @@ -830,7 +830,7 @@ jobs: arch: amd64 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" pkg-type: NSIS - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: false skip-junit-reports: false @@ -847,7 +847,7 @@ jobs: arch: amd64 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" pkg-type: MSI - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: false skip-junit-reports: false @@ -864,7 +864,7 @@ jobs: arch: amd64 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" pkg-type: NSIS - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: false skip-junit-reports: false @@ -881,7 +881,7 @@ jobs: arch: amd64 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" pkg-type: MSI - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: false skip-junit-reports: false @@ -898,7 +898,7 @@ jobs: arch: amd64 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" pkg-type: NSIS - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: false skip-junit-reports: false @@ -915,7 +915,7 @@ jobs: arch: amd64 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" pkg-type: MSI - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: false skip-junit-reports: false @@ -933,7 +933,7 @@ jobs: arch: amd64 testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 pull-labels: ${{ needs.prepare-workflow.outputs.pull-labels }} skip-code-coverage: false skip-junit-reports: false @@ -952,7 +952,7 @@ jobs: arch: amd64 testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 pull-labels: ${{ needs.prepare-workflow.outputs.pull-labels }} skip-code-coverage: false skip-junit-reports: false @@ -971,7 +971,7 @@ jobs: arch: amd64 testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 pull-labels: ${{ needs.prepare-workflow.outputs.pull-labels }} skip-code-coverage: false skip-junit-reports: false @@ -990,7 +990,7 @@ jobs: arch: x86_64 testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 pull-labels: ${{ needs.prepare-workflow.outputs.pull-labels }} skip-code-coverage: false skip-junit-reports: false @@ -1009,7 +1009,7 @@ jobs: arch: x86_64 testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 pull-labels: ${{ needs.prepare-workflow.outputs.pull-labels }} skip-code-coverage: false skip-junit-reports: false @@ -1028,7 +1028,7 @@ jobs: arch: x86_64 testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 pull-labels: ${{ needs.prepare-workflow.outputs.pull-labels }} skip-code-coverage: false skip-junit-reports: false @@ -1047,7 +1047,7 @@ jobs: arch: x86_64 testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 pull-labels: ${{ needs.prepare-workflow.outputs.pull-labels }} skip-code-coverage: false skip-junit-reports: false @@ -1066,7 +1066,7 @@ jobs: arch: x86_64 testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 pull-labels: ${{ needs.prepare-workflow.outputs.pull-labels }} skip-code-coverage: false skip-junit-reports: false @@ -1085,7 +1085,7 @@ jobs: arch: x86_64 testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 pull-labels: ${{ needs.prepare-workflow.outputs.pull-labels }} skip-code-coverage: false skip-junit-reports: false @@ -1104,7 +1104,7 @@ jobs: arch: x86_64 testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 pull-labels: ${{ needs.prepare-workflow.outputs.pull-labels }} skip-code-coverage: false skip-junit-reports: false @@ -1123,7 +1123,7 @@ jobs: arch: x86_64 testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 pull-labels: ${{ needs.prepare-workflow.outputs.pull-labels }} skip-code-coverage: false skip-junit-reports: false @@ -1142,7 +1142,7 @@ jobs: arch: x86_64 testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 pull-labels: ${{ needs.prepare-workflow.outputs.pull-labels }} skip-code-coverage: false skip-junit-reports: false @@ -1161,7 +1161,7 @@ jobs: arch: x86_64 testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 pull-labels: ${{ needs.prepare-workflow.outputs.pull-labels }} skip-code-coverage: false skip-junit-reports: false @@ -1180,7 +1180,7 @@ jobs: arch: aarch64 testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 pull-labels: ${{ needs.prepare-workflow.outputs.pull-labels }} skip-code-coverage: false skip-junit-reports: false @@ -1199,7 +1199,7 @@ jobs: arch: x86_64 testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 pull-labels: ${{ needs.prepare-workflow.outputs.pull-labels }} skip-code-coverage: false skip-junit-reports: false @@ -1218,7 +1218,7 @@ jobs: arch: x86_64 testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 pull-labels: ${{ needs.prepare-workflow.outputs.pull-labels }} skip-code-coverage: false skip-junit-reports: false @@ -1237,7 +1237,7 @@ jobs: arch: x86_64 testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 pull-labels: ${{ needs.prepare-workflow.outputs.pull-labels }} skip-code-coverage: false skip-junit-reports: false @@ -1256,7 +1256,7 @@ jobs: arch: x86_64 testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 pull-labels: ${{ needs.prepare-workflow.outputs.pull-labels }} skip-code-coverage: false skip-junit-reports: false @@ -1275,7 +1275,7 @@ jobs: arch: x86_64 testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 pull-labels: ${{ needs.prepare-workflow.outputs.pull-labels }} skip-code-coverage: false skip-junit-reports: false @@ -1294,7 +1294,7 @@ jobs: arch: x86_64 testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 pull-labels: ${{ needs.prepare-workflow.outputs.pull-labels }} skip-code-coverage: false skip-junit-reports: false @@ -1313,7 +1313,7 @@ jobs: arch: aarch64 testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 pull-labels: ${{ needs.prepare-workflow.outputs.pull-labels }} skip-code-coverage: false skip-junit-reports: false @@ -1332,7 +1332,7 @@ jobs: arch: x86_64 testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 pull-labels: ${{ needs.prepare-workflow.outputs.pull-labels }} skip-code-coverage: false skip-junit-reports: false @@ -1351,7 +1351,7 @@ jobs: arch: aarch64 testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 pull-labels: ${{ needs.prepare-workflow.outputs.pull-labels }} skip-code-coverage: false skip-junit-reports: false diff --git a/.github/workflows/staging.yml b/.github/workflows/staging.yml index a3144b1ac753..7cd4cccc5c81 100644 --- a/.github/workflows/staging.yml +++ b/.github/workflows/staging.yml @@ -513,7 +513,7 @@ jobs: self-hosted-runners: ${{ fromJSON(needs.prepare-workflow.outputs.runners)['self-hosted'] }} github-hosted-runners: ${{ fromJSON(needs.prepare-workflow.outputs.runners)['github-hosted'] }} relenv-version: "0.12.3" - python-version: "3.11.3" + python-version: "3.10.11" build-salt-onedir: name: Build Salt Onedir @@ -529,7 +529,7 @@ jobs: self-hosted-runners: ${{ fromJSON(needs.prepare-workflow.outputs.runners)['self-hosted'] }} github-hosted-runners: ${{ fromJSON(needs.prepare-workflow.outputs.runners)['github-hosted'] }} relenv-version: "0.12.3" - python-version: "3.11.3" + python-version: "3.10.11" build-rpm-pkgs: name: Build RPM Packages @@ -541,7 +541,7 @@ jobs: with: salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" relenv-version: "0.12.3" - python-version: "3.11.3" + python-version: "3.10.11" build-deb-pkgs: name: Build DEB Packages @@ -553,7 +553,7 @@ jobs: with: salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" relenv-version: "0.12.3" - python-version: "3.11.3" + python-version: "3.10.11" build-windows-pkgs: name: Build Windows Packages @@ -565,7 +565,7 @@ jobs: with: salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" relenv-version: "0.12.3" - python-version: "3.11.3" + python-version: "3.10.11" environment: staging sign-packages: ${{ inputs.sign-windows-packages }} secrets: inherit @@ -580,7 +580,7 @@ jobs: with: salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" relenv-version: "0.12.3" - python-version: "3.11.3" + python-version: "3.10.11" environment: staging sign-packages: true secrets: inherit @@ -598,7 +598,7 @@ jobs: arch: x86_64 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" pkg-type: rpm - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: true skip-junit-reports: true @@ -615,7 +615,7 @@ jobs: arch: x86_64 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" pkg-type: rpm - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: true skip-junit-reports: true @@ -632,7 +632,7 @@ jobs: arch: x86_64 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" pkg-type: rpm - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: true skip-junit-reports: true @@ -649,7 +649,7 @@ jobs: arch: x86_64 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" pkg-type: rpm - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: true skip-junit-reports: true @@ -666,7 +666,7 @@ jobs: arch: x86_64 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" pkg-type: deb - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: true skip-junit-reports: true @@ -683,7 +683,7 @@ jobs: arch: x86_64 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" pkg-type: deb - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: true skip-junit-reports: true @@ -700,7 +700,7 @@ jobs: arch: aarch64 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" pkg-type: deb - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: true skip-junit-reports: true @@ -717,7 +717,7 @@ jobs: arch: x86_64 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" pkg-type: rpm - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: true skip-junit-reports: true @@ -734,7 +734,7 @@ jobs: arch: x86_64 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" pkg-type: rpm - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: true skip-junit-reports: true @@ -751,7 +751,7 @@ jobs: arch: x86_64 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" pkg-type: deb - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: true skip-junit-reports: true @@ -768,7 +768,7 @@ jobs: arch: aarch64 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" pkg-type: deb - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: true skip-junit-reports: true @@ -785,7 +785,7 @@ jobs: arch: x86_64 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" pkg-type: deb - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: true skip-junit-reports: true @@ -802,7 +802,7 @@ jobs: arch: aarch64 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" pkg-type: deb - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: true skip-junit-reports: true @@ -819,7 +819,7 @@ jobs: arch: x86_64 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" pkg-type: macos - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: true skip-junit-reports: true @@ -836,7 +836,7 @@ jobs: arch: amd64 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" pkg-type: NSIS - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: true skip-junit-reports: true @@ -853,7 +853,7 @@ jobs: arch: amd64 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" pkg-type: MSI - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: true skip-junit-reports: true @@ -870,7 +870,7 @@ jobs: arch: amd64 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" pkg-type: NSIS - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: true skip-junit-reports: true @@ -887,7 +887,7 @@ jobs: arch: amd64 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" pkg-type: MSI - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: true skip-junit-reports: true @@ -904,7 +904,7 @@ jobs: arch: amd64 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" pkg-type: NSIS - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: true skip-junit-reports: true @@ -921,7 +921,7 @@ jobs: arch: amd64 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" pkg-type: MSI - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: true skip-junit-reports: true @@ -939,7 +939,7 @@ jobs: arch: amd64 testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 pull-labels: ${{ needs.prepare-workflow.outputs.pull-labels }} skip-code-coverage: true skip-junit-reports: true @@ -958,7 +958,7 @@ jobs: arch: amd64 testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 pull-labels: ${{ needs.prepare-workflow.outputs.pull-labels }} skip-code-coverage: true skip-junit-reports: true @@ -977,7 +977,7 @@ jobs: arch: amd64 testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 pull-labels: ${{ needs.prepare-workflow.outputs.pull-labels }} skip-code-coverage: true skip-junit-reports: true @@ -996,7 +996,7 @@ jobs: arch: x86_64 testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 pull-labels: ${{ needs.prepare-workflow.outputs.pull-labels }} skip-code-coverage: true skip-junit-reports: true @@ -1015,7 +1015,7 @@ jobs: arch: x86_64 testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 pull-labels: ${{ needs.prepare-workflow.outputs.pull-labels }} skip-code-coverage: true skip-junit-reports: true @@ -1034,7 +1034,7 @@ jobs: arch: x86_64 testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 pull-labels: ${{ needs.prepare-workflow.outputs.pull-labels }} skip-code-coverage: true skip-junit-reports: true @@ -1053,7 +1053,7 @@ jobs: arch: x86_64 testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 pull-labels: ${{ needs.prepare-workflow.outputs.pull-labels }} skip-code-coverage: true skip-junit-reports: true @@ -1072,7 +1072,7 @@ jobs: arch: x86_64 testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 pull-labels: ${{ needs.prepare-workflow.outputs.pull-labels }} skip-code-coverage: true skip-junit-reports: true @@ -1091,7 +1091,7 @@ jobs: arch: x86_64 testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 pull-labels: ${{ needs.prepare-workflow.outputs.pull-labels }} skip-code-coverage: true skip-junit-reports: true @@ -1110,7 +1110,7 @@ jobs: arch: x86_64 testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 pull-labels: ${{ needs.prepare-workflow.outputs.pull-labels }} skip-code-coverage: true skip-junit-reports: true @@ -1129,7 +1129,7 @@ jobs: arch: x86_64 testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 pull-labels: ${{ needs.prepare-workflow.outputs.pull-labels }} skip-code-coverage: true skip-junit-reports: true @@ -1148,7 +1148,7 @@ jobs: arch: x86_64 testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 pull-labels: ${{ needs.prepare-workflow.outputs.pull-labels }} skip-code-coverage: true skip-junit-reports: true @@ -1167,7 +1167,7 @@ jobs: arch: x86_64 testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 pull-labels: ${{ needs.prepare-workflow.outputs.pull-labels }} skip-code-coverage: true skip-junit-reports: true @@ -1186,7 +1186,7 @@ jobs: arch: aarch64 testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 pull-labels: ${{ needs.prepare-workflow.outputs.pull-labels }} skip-code-coverage: true skip-junit-reports: true @@ -1205,7 +1205,7 @@ jobs: arch: x86_64 testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 pull-labels: ${{ needs.prepare-workflow.outputs.pull-labels }} skip-code-coverage: true skip-junit-reports: true @@ -1224,7 +1224,7 @@ jobs: arch: x86_64 testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 pull-labels: ${{ needs.prepare-workflow.outputs.pull-labels }} skip-code-coverage: true skip-junit-reports: true @@ -1243,7 +1243,7 @@ jobs: arch: x86_64 testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 pull-labels: ${{ needs.prepare-workflow.outputs.pull-labels }} skip-code-coverage: true skip-junit-reports: true @@ -1262,7 +1262,7 @@ jobs: arch: x86_64 testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 pull-labels: ${{ needs.prepare-workflow.outputs.pull-labels }} skip-code-coverage: true skip-junit-reports: true @@ -1281,7 +1281,7 @@ jobs: arch: x86_64 testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 pull-labels: ${{ needs.prepare-workflow.outputs.pull-labels }} skip-code-coverage: true skip-junit-reports: true @@ -1300,7 +1300,7 @@ jobs: arch: x86_64 testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 pull-labels: ${{ needs.prepare-workflow.outputs.pull-labels }} skip-code-coverage: true skip-junit-reports: true @@ -1319,7 +1319,7 @@ jobs: arch: aarch64 testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 pull-labels: ${{ needs.prepare-workflow.outputs.pull-labels }} skip-code-coverage: true skip-junit-reports: true @@ -1338,7 +1338,7 @@ jobs: arch: x86_64 testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 pull-labels: ${{ needs.prepare-workflow.outputs.pull-labels }} skip-code-coverage: true skip-junit-reports: true @@ -1357,7 +1357,7 @@ jobs: arch: aarch64 testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 pull-labels: ${{ needs.prepare-workflow.outputs.pull-labels }} skip-code-coverage: true skip-junit-reports: true @@ -2120,7 +2120,7 @@ jobs: distro-slug: almalinux-8 platform: linux arch: x86_64 - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" environment: staging skip-code-coverage: true @@ -2139,7 +2139,7 @@ jobs: distro-slug: almalinux-8-arm64 platform: linux arch: aarch64 - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" environment: staging skip-code-coverage: true @@ -2158,7 +2158,7 @@ jobs: distro-slug: almalinux-9 platform: linux arch: x86_64 - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" environment: staging skip-code-coverage: true @@ -2177,7 +2177,7 @@ jobs: distro-slug: almalinux-9-arm64 platform: linux arch: aarch64 - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" environment: staging skip-code-coverage: true @@ -2196,7 +2196,7 @@ jobs: distro-slug: amazonlinux-2 platform: linux arch: x86_64 - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" environment: staging skip-code-coverage: true @@ -2215,7 +2215,7 @@ jobs: distro-slug: amazonlinux-2-arm64 platform: linux arch: aarch64 - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" environment: staging skip-code-coverage: true @@ -2234,7 +2234,7 @@ jobs: distro-slug: centos-7 platform: linux arch: x86_64 - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" environment: staging skip-code-coverage: true @@ -2253,7 +2253,7 @@ jobs: distro-slug: centos-7-arm64 platform: linux arch: aarch64 - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" environment: staging skip-code-coverage: true @@ -2272,7 +2272,7 @@ jobs: distro-slug: centosstream-8 platform: linux arch: x86_64 - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" environment: staging skip-code-coverage: true @@ -2291,7 +2291,7 @@ jobs: distro-slug: centosstream-8-arm64 platform: linux arch: aarch64 - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" environment: staging skip-code-coverage: true @@ -2310,7 +2310,7 @@ jobs: distro-slug: centosstream-9 platform: linux arch: x86_64 - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" environment: staging skip-code-coverage: true @@ -2329,7 +2329,7 @@ jobs: distro-slug: centosstream-9-arm64 platform: linux arch: aarch64 - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" environment: staging skip-code-coverage: true @@ -2348,7 +2348,7 @@ jobs: distro-slug: debian-10 platform: linux arch: x86_64 - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" environment: staging skip-code-coverage: true @@ -2367,7 +2367,7 @@ jobs: distro-slug: debian-11 platform: linux arch: x86_64 - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" environment: staging skip-code-coverage: true @@ -2386,7 +2386,7 @@ jobs: distro-slug: debian-11-arm64 platform: linux arch: aarch64 - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" environment: staging skip-code-coverage: true @@ -2405,7 +2405,7 @@ jobs: distro-slug: fedora-37 platform: linux arch: x86_64 - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" environment: staging skip-code-coverage: true @@ -2424,7 +2424,7 @@ jobs: distro-slug: fedora-37-arm64 platform: linux arch: aarch64 - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" environment: staging skip-code-coverage: true @@ -2443,7 +2443,7 @@ jobs: distro-slug: fedora-38 platform: linux arch: x86_64 - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" environment: staging skip-code-coverage: true @@ -2462,7 +2462,7 @@ jobs: distro-slug: fedora-38-arm64 platform: linux arch: aarch64 - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" environment: staging skip-code-coverage: true @@ -2481,7 +2481,7 @@ jobs: distro-slug: photonos-3 platform: linux arch: x86_64 - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" environment: staging skip-code-coverage: true @@ -2500,7 +2500,7 @@ jobs: distro-slug: photonos-4 platform: linux arch: x86_64 - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" environment: staging skip-code-coverage: true @@ -2519,7 +2519,7 @@ jobs: distro-slug: ubuntu-20.04 platform: linux arch: x86_64 - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" environment: staging skip-code-coverage: true @@ -2538,7 +2538,7 @@ jobs: distro-slug: ubuntu-20.04-arm64 platform: linux arch: aarch64 - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" environment: staging skip-code-coverage: true @@ -2557,7 +2557,7 @@ jobs: distro-slug: ubuntu-22.04 platform: linux arch: x86_64 - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" environment: staging skip-code-coverage: true @@ -2576,7 +2576,7 @@ jobs: distro-slug: ubuntu-22.04-arm64 platform: linux arch: aarch64 - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" environment: staging skip-code-coverage: true @@ -2595,7 +2595,7 @@ jobs: distro-slug: ubuntu-22.04 platform: linux arch: x86_64 - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" environment: staging skip-code-coverage: true @@ -2614,7 +2614,7 @@ jobs: distro-slug: ubuntu-22.04-arm64 platform: linux arch: aarch64 - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" environment: staging skip-code-coverage: true @@ -2633,7 +2633,7 @@ jobs: distro-slug: macos-12 platform: darwin arch: x86_64 - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" environment: staging skip-code-coverage: true @@ -2652,7 +2652,7 @@ jobs: distro-slug: macos-12 platform: darwin arch: x86_64 - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" environment: staging skip-code-coverage: true @@ -2672,7 +2672,7 @@ jobs: platform: windows arch: amd64 pkg-type: nsis - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" environment: staging skip-code-coverage: true @@ -2691,7 +2691,7 @@ jobs: platform: windows arch: amd64 pkg-type: msi - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" environment: staging skip-code-coverage: true @@ -2710,7 +2710,7 @@ jobs: platform: windows arch: amd64 pkg-type: onedir - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.11.3 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" environment: staging skip-code-coverage: true diff --git a/cicd/shared-gh-workflows-context.yml b/cicd/shared-gh-workflows-context.yml index a8a4c456da0e..2e07c02a506c 100644 --- a/cicd/shared-gh-workflows-context.yml +++ b/cicd/shared-gh-workflows-context.yml @@ -1,4 +1,4 @@ -python_version: "3.11.3" +python_version: "3.10.11" relenv_version: "0.12.3" release-branches: - "3006.x" From 3bf07fee490fa246701ef23f76dc935c7fe8109f Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Tue, 27 Jun 2023 08:05:57 +0100 Subject: [PATCH 07/13] Revert "Stop using the deprecated `imp` module" This reverts commit 8331264fdb08e9c042e57412444b7de359b9bae2. --- tests/unit/test_loader.py | 51 ++++++++++++++++++++--------------- tests/unit/utils/test_path.py | 11 ++++---- 2 files changed, 36 insertions(+), 26 deletions(-) diff --git a/tests/unit/test_loader.py b/tests/unit/test_loader.py index 067130620b3b..cf339033200b 100644 --- a/tests/unit/test_loader.py +++ b/tests/unit/test_loader.py @@ -8,6 +8,7 @@ import collections import compileall import copy +import imp import inspect import logging import os @@ -34,15 +35,15 @@ def remove_bytecode(module_path): paths = [module_path + "c"] - cache_tag = sys.implementation.cache_tag - modname, ext = os.path.splitext(module_path.split(os.sep)[-1]) - paths.append( - os.path.join( - os.path.dirname(module_path), - "__pycache__", - f"{modname}.{cache_tag}.pyc", + if hasattr(imp, "get_tag"): + modname, ext = os.path.splitext(module_path.split(os.sep)[-1]) + paths.append( + os.path.join( + os.path.dirname(module_path), + "__pycache__", + "{}.{}.pyc".format(modname, imp.get_tag()), + ) ) - ) for path in paths: if os.path.exists(path): os.unlink(path) @@ -83,7 +84,9 @@ def setUp(self): # Setup the module self.module_dir = tempfile.mkdtemp(dir=RUNTIME_VARS.TMP) self.addCleanup(shutil.rmtree, self.module_dir, ignore_errors=True) - self.module_file = os.path.join(self.module_dir, f"{self.module_name}.py") + self.module_file = os.path.join( + self.module_dir, "{}.py".format(self.module_name) + ) with salt.utils.files.fopen(self.module_file, "w") as fh: fh.write(salt.utils.stringutils.to_str(loader_template)) fh.flush() @@ -160,14 +163,16 @@ def setUpClass(cls): def setUp(self): # Setup the module self.module_dir = tempfile.mkdtemp(dir=RUNTIME_VARS.TMP) - self.module_file = os.path.join(self.module_dir, f"{self.module_name}.py") + self.module_file = os.path.join( + self.module_dir, "{}.py".format(self.module_name) + ) with salt.utils.files.fopen(self.module_file, "w") as fh: fh.write(salt.utils.stringutils.to_str(loader_template_module)) fh.flush() os.fsync(fh.fileno()) self.utils_dir = tempfile.mkdtemp(dir=RUNTIME_VARS.TMP) - self.utils_file = os.path.join(self.utils_dir, f"{self.utils_name}.py") + self.utils_file = os.path.join(self.utils_dir, "{}.py".format(self.utils_name)) with salt.utils.files.fopen(self.utils_file, "w") as fh: fh.write(salt.utils.stringutils.to_str(loader_template_utils)) fh.flush() @@ -511,7 +516,7 @@ def test_single_item_no_dot(self): Checks that a KeyError is raised when the function key does not contain a '.' """ key = "testing_no_dot" - expected = f"The key '{key}' should contain a '.'" + expected = "The key '{}' should contain a '.'".format(key) with self.assertRaises(KeyError) as err: inspect.isfunction(self.loader["testing_no_dot"]) @@ -614,7 +619,7 @@ def rm_module(self): @property def module_path(self): - return os.path.join(self.tmp_dir, f"{self.module_name}.py") + return os.path.join(self.tmp_dir, "{}.py".format(self.module_name)) @pytest.mark.slow_test def test_alias(self): @@ -625,15 +630,17 @@ def test_alias(self): self.assertNotIn(self.module_key, self.loader) self.update_module() - self.assertNotIn(f"{self.module_name}.test_alias", self.loader) + self.assertNotIn("{}.test_alias".format(self.module_name), self.loader) self.assertTrue( isinstance( - self.loader[f"{self.module_name}.working_alias"], + self.loader["{}.working_alias".format(self.module_name)], salt.loader.lazy.LoadedFunc, ) ) self.assertTrue( - inspect.isfunction(self.loader[f"{self.module_name}.working_alias"].func) + inspect.isfunction( + self.loader["{}.working_alias".format(self.module_name)].func + ) ) @pytest.mark.slow_test @@ -795,7 +802,7 @@ def update_module(self): @property def module_path(self): - return os.path.join(self.tmp_dir, f"{self.module_name}.py") + return os.path.join(self.tmp_dir, "{}.py".format(self.module_name)) @pytest.mark.slow_test def test_virtual_alias(self): @@ -1192,7 +1199,7 @@ def setUp(self): "__salt__": self.minion_mods, }, ) - self.assertIn(f"{self.module_name}.top", self.loader) + self.assertIn("{}.top".format(self.module_name), self.loader) def tearDown(self): del self.tmp_dir @@ -1234,7 +1241,7 @@ def update_lib(self, lib_name): @pytest.mark.slow_test def test_basic(self): - self.assertIn(f"{self.module_name}.top", self.loader) + self.assertIn("{}.top".format(self.module_name), self.loader) def _verify_libs(self): for lib in self.libs: @@ -1542,7 +1549,9 @@ def setUp(self): # Setup the module self.module_dir = tempfile.mkdtemp(dir=RUNTIME_VARS.TMP) self.addCleanup(shutil.rmtree, self.module_dir, ignore_errors=True) - self.module_file = os.path.join(self.module_dir, f"{self.module_name}.py") + self.module_file = os.path.join( + self.module_dir, "{}.py".format(self.module_name) + ) def tearDown(self): try: @@ -1576,7 +1585,7 @@ def _expected(self, optimize=0): return "lazyloadertest.cpython-{}{}{}.pyc".format( sys.version_info[0], sys.version_info[1], - "" if not optimize else f".opt-{optimize}", + "" if not optimize else ".opt-{}".format(optimize), ) def _write_module_file(self): diff --git a/tests/unit/utils/test_path.py b/tests/unit/utils/test_path.py index 47a108a2f4ee..bebb9ce284a7 100644 --- a/tests/unit/utils/test_path.py +++ b/tests/unit/utils/test_path.py @@ -4,7 +4,6 @@ import posixpath import sys import tempfile -import types import pytest @@ -41,14 +40,14 @@ class PathJoinTestCase(TestCase): def test_nix_paths(self): for idx, (parts, expected) in enumerate(self.NIX_PATHS): path = salt.utils.path.join(*parts) - assert f"{idx}: {path}" == f"{idx}: {expected}" + assert "{}: {}".format(idx, path) == "{}: {}".format(idx, expected) @pytest.mark.skip(reason="Skipped until properly mocked") @pytest.mark.skip_unless_on_windows def test_windows_paths(self): for idx, (parts, expected) in enumerate(self.WIN_PATHS): path = salt.utils.path.join(*parts) - assert f"{idx}: {path}" == f"{idx}: {expected}" + assert "{}: {}".format(idx, path) == "{}: {}".format(idx, expected) @pytest.mark.skip(reason="Skipped until properly mocked") @pytest.mark.skip_on_windows @@ -58,7 +57,7 @@ def test_windows_paths_patched_path_module(self): try: for idx, (parts, expected) in enumerate(self.WIN_PATHS): path = salt.utils.path.join(*parts) - assert f"{idx}: {path}" == f"{idx}: {expected}" + assert "{}: {}".format(idx, path) == "{}: {}".format(idx, expected) finally: self.__unpatch_path() @@ -80,12 +79,14 @@ def test_mixed_unicode_and_binary(self): assert actual == expected def __patch_path(self): + import imp + modules = list(self.BUILTIN_MODULES[:]) modules.pop(modules.index("posix")) modules.append("nt") code = """'''Salt unittest loaded NT module'''""" - module = types.ModuleType("nt") + module = imp.new_module("nt") exec(code, module.__dict__) sys.modules["nt"] = module From b6311b1b5716b58e0d593b8deaf48b2cb2da03c7 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Tue, 27 Jun 2023 08:05:57 +0100 Subject: [PATCH 08/13] Revert "Backport `locale.getdefaultlocale()` into Salt. It's getting removed in Py 3.13" This reverts commit ad706711d3340bd84a62be83f84b43f5adb296e9. --- salt/__init__.py | 43 ++--------------- salt/grains/core.py | 108 +++++++++++++++++++++++------------------- salt/utils/locales.py | 39 +-------------- 3 files changed, 65 insertions(+), 125 deletions(-) diff --git a/salt/__init__.py b/salt/__init__.py index 32a73d568e79..485b17553c18 100644 --- a/salt/__init__.py +++ b/salt/__init__.py @@ -39,44 +39,6 @@ ) -def __getdefaultlocale(envvars=("LC_ALL", "LC_CTYPE", "LANG", "LANGUAGE")): - """ - This function was backported from Py3.11 which started triggering a - deprecation warning about it's removal in 3.13. - """ - import locale - - try: - # check if it's supported by the _locale module - import _locale - - code, encoding = _locale._getdefaultlocale() - except (ImportError, AttributeError): - pass - else: - # make sure the code/encoding values are valid - if sys.platform == "win32" and code and code[:2] == "0x": - # map windows language identifier to language name - code = locale.windows_locale.get(int(code, 0)) - # ...add other platform-specific processing here, if - # necessary... - return code, encoding - - # fall back on POSIX behaviour - import os - - lookup = os.environ.get - for variable in envvars: - localename = lookup(variable, None) - if localename: - if variable == "LANGUAGE": - localename = localename.split(":")[0] - break - else: - localename = "C" - return locale._parse_localename(localename) - - def __define_global_system_encoding_variable__(): import sys @@ -95,14 +57,17 @@ def __define_global_system_encoding_variable__(): # If the system is properly configured this should return a valid # encoding. MS Windows has problems with this and reports the wrong # encoding + import locale try: - encoding = __getdefaultlocale()[-1] + encoding = locale.getdefaultlocale()[-1] except ValueError: # A bad locale setting was most likely found: # https://github.com/saltstack/salt/issues/26063 pass + # This is now garbage collectable + del locale if not encoding: # This is most likely ascii which is not the best but we were # unable to find a better encoding. If this fails, we fall all diff --git a/salt/grains/core.py b/salt/grains/core.py index afaa5389e397..710c57f28fbf 100644 --- a/salt/grains/core.py +++ b/salt/grains/core.py @@ -11,6 +11,7 @@ import datetime import hashlib +import locale import logging import os import platform @@ -32,7 +33,6 @@ import salt.utils.args import salt.utils.dns import salt.utils.files -import salt.utils.locales import salt.utils.network import salt.utils.path import salt.utils.pkg.rpm @@ -289,7 +289,7 @@ def _linux_gpu_data(): devs = [] try: - lspci_out = __salt__["cmd.run"](f"{lspci} -vmm") + lspci_out = __salt__["cmd.run"]("{} -vmm".format(lspci)) cur_dev = {} error = False @@ -363,7 +363,7 @@ def _netbsd_gpu_data(): for line in pcictl_out.splitlines(): for vendor in known_vendors: vendor_match = re.match( - rf"[0-9:]+ ({vendor}) (.+) \(VGA .+\)", line, re.IGNORECASE + r"[0-9:]+ ({}) (.+) \(VGA .+\)".format(vendor), line, re.IGNORECASE ) if vendor_match: gpus.append( @@ -425,18 +425,18 @@ def _bsd_cpudata(osdata): if sysctl: cmds.update( { - "num_cpus": f"{sysctl} -n hw.ncpu", - "cpuarch": f"{sysctl} -n hw.machine", - "cpu_model": f"{sysctl} -n hw.model", + "num_cpus": "{} -n hw.ncpu".format(sysctl), + "cpuarch": "{} -n hw.machine".format(sysctl), + "cpu_model": "{} -n hw.model".format(sysctl), } ) if arch and osdata["kernel"] == "OpenBSD": - cmds["cpuarch"] = f"{arch} -s" + cmds["cpuarch"] = "{} -s".format(arch) if osdata["kernel"] == "Darwin": - cmds["cpu_model"] = f"{sysctl} -n machdep.cpu.brand_string" - cmds["cpu_flags"] = f"{sysctl} -n machdep.cpu.features" + cmds["cpu_model"] = "{} -n machdep.cpu.brand_string".format(sysctl) + cmds["cpu_flags"] = "{} -n machdep.cpu.features".format(sysctl) grains = {k: __salt__["cmd.run"](v) for k, v in cmds.items()} @@ -521,7 +521,7 @@ def _aix_cpudata(): grains = {} cmd = salt.utils.path.which("prtconf") if cmd: - data = __salt__["cmd.run"](f"{cmd}") + os.linesep + data = __salt__["cmd.run"]("{}".format(cmd)) + os.linesep for dest, regstring in ( ("cpuarch", r"(?im)^\s*Processor\s+Type:\s+(\S+)"), ("cpu_flags", r"(?im)^\s*Processor\s+Version:\s+(\S+)"), @@ -567,9 +567,9 @@ def _osx_memdata(): sysctl = salt.utils.path.which("sysctl") if sysctl: - mem = __salt__["cmd.run"](f"{sysctl} -n hw.memsize") + mem = __salt__["cmd.run"]("{} -n hw.memsize".format(sysctl)) swap_total = ( - __salt__["cmd.run"](f"{sysctl} -n vm.swapusage") + __salt__["cmd.run"]("{} -n vm.swapusage".format(sysctl)) .split()[2] .replace(",", ".") ) @@ -594,20 +594,20 @@ def _bsd_memdata(osdata): sysctl = salt.utils.path.which("sysctl") if sysctl: - mem = __salt__["cmd.run"](f"{sysctl} -n hw.physmem") + mem = __salt__["cmd.run"]("{} -n hw.physmem".format(sysctl)) if osdata["kernel"] == "NetBSD" and mem.startswith("-"): - mem = __salt__["cmd.run"](f"{sysctl} -n hw.physmem64") + mem = __salt__["cmd.run"]("{} -n hw.physmem64".format(sysctl)) grains["mem_total"] = int(mem) // 1024 // 1024 if osdata["kernel"] in ["OpenBSD", "NetBSD"]: swapctl = salt.utils.path.which("swapctl") - swap_data = __salt__["cmd.run"](f"{swapctl} -sk") + swap_data = __salt__["cmd.run"]("{} -sk".format(swapctl)) if swap_data == "no swap devices configured": swap_total = 0 else: swap_total = swap_data.split(" ")[1] else: - swap_total = __salt__["cmd.run"](f"{sysctl} -n vm.swap_total") + swap_total = __salt__["cmd.run"]("{} -n vm.swap_total".format(sysctl)) grains["swap_total"] = int(swap_total) // 1024 // 1024 return grains @@ -625,7 +625,7 @@ def _sunos_memdata(): grains["mem_total"] = int(comps[2].strip()) swap_cmd = salt.utils.path.which("swap") - swap_data = __salt__["cmd.run"](f"{swap_cmd} -s").split() + swap_data = __salt__["cmd.run"]("{} -s".format(swap_cmd)).split() try: swap_avail = int(swap_data[-2][:-1]) swap_used = int(swap_data[-4][:-1]) @@ -653,7 +653,7 @@ def _aix_memdata(): swap_cmd = salt.utils.path.which("swap") if swap_cmd: - swap_data = __salt__["cmd.run"](f"{swap_cmd} -s").split() + swap_data = __salt__["cmd.run"]("{} -s".format(swap_cmd)).split() try: swap_total = (int(swap_data[-2]) + int(swap_data[-6])) * 4 except ValueError: @@ -706,7 +706,7 @@ def _aix_get_machine_id(): grains = {} cmd = salt.utils.path.which("lsattr") if cmd: - data = __salt__["cmd.run"](f"{cmd} -El sys0") + os.linesep + data = __salt__["cmd.run"]("{} -El sys0".format(cmd)) + os.linesep uuid_regexes = [re.compile(r"(?im)^\s*os_uuid\s+(\S+)\s+(.*)")] for regex in uuid_regexes: res = regex.search(data) @@ -1017,7 +1017,7 @@ def _virtual(osdata): subtype_cmd = "{} -c current get -H -o value {}-role".format( command, role ) - ret = __salt__["cmd.run"](f"{subtype_cmd}") + ret = __salt__["cmd.run"]("{}".format(subtype_cmd)) if ret == "true": roles.append(role) if roles: @@ -1163,14 +1163,14 @@ def _virtual(osdata): elif osdata["kernel"] == "FreeBSD": kenv = salt.utils.path.which("kenv") if kenv: - product = __salt__["cmd.run"](f"{kenv} smbios.system.product") - maker = __salt__["cmd.run"](f"{kenv} smbios.system.maker") + product = __salt__["cmd.run"]("{} smbios.system.product".format(kenv)) + maker = __salt__["cmd.run"]("{} smbios.system.maker".format(kenv)) if product.startswith("VMware"): grains["virtual"] = "VMware" if product.startswith("VirtualBox"): grains["virtual"] = "VirtualBox" if maker.startswith("Xen"): - grains["virtual_subtype"] = f"{maker} {product}" + grains["virtual_subtype"] = "{} {}".format(maker, product) grains["virtual"] = "xen" if maker.startswith("Microsoft") and product.startswith("Virtual"): grains["virtual"] = "VirtualPC" @@ -1181,9 +1181,9 @@ def _virtual(osdata): if maker.startswith("Amazon EC2"): grains["virtual"] = "Nitro" if sysctl: - hv_vendor = __salt__["cmd.run"](f"{sysctl} -n hw.hv_vendor") - model = __salt__["cmd.run"](f"{sysctl} -n hw.model") - jail = __salt__["cmd.run"](f"{sysctl} -n security.jail.jailed") + hv_vendor = __salt__["cmd.run"]("{} -n hw.hv_vendor".format(sysctl)) + model = __salt__["cmd.run"]("{} -n hw.model".format(sysctl)) + jail = __salt__["cmd.run"]("{} -n security.jail.jailed".format(sysctl)) if "bhyve" in hv_vendor: grains["virtual"] = "bhyve" elif "QEMU Virtual CPU" in model: @@ -1199,19 +1199,22 @@ def _virtual(osdata): elif osdata["kernel"] == "NetBSD": if sysctl: if "QEMU Virtual CPU" in __salt__["cmd.run"]( - f"{sysctl} -n machdep.cpu_brand" + "{} -n machdep.cpu_brand".format(sysctl) ): grains["virtual"] = "kvm" elif "invalid" not in __salt__["cmd.run"]( - f"{sysctl} -n machdep.xen.suspend" + "{} -n machdep.xen.suspend".format(sysctl) ): grains["virtual"] = "Xen PV DomU" elif "VMware" in __salt__["cmd.run"]( - f"{sysctl} -n machdep.dmi.system-vendor" + "{} -n machdep.dmi.system-vendor".format(sysctl) ): grains["virtual"] = "VMware" # NetBSD has Xen dom0 support - elif __salt__["cmd.run"](f"{sysctl} -n machdep.idle-mechanism") == "xen": + elif ( + __salt__["cmd.run"]("{} -n machdep.idle-mechanism".format(sysctl)) + == "xen" + ): if os.path.isfile("/var/run/xenconsoled.pid"): grains["virtual_subtype"] = "Xen Dom0" elif osdata["kernel"] == "SunOS": @@ -1219,7 +1222,7 @@ def _virtual(osdata): # check the zonename here as fallback zonename = salt.utils.path.which("zonename") if zonename: - zone = __salt__["cmd.run"](f"{zonename}") + zone = __salt__["cmd.run"]("{}".format(zonename)) if zone != "global": grains["virtual"] = "zone" @@ -1248,7 +1251,7 @@ def _virtual(osdata): r".*Product Name: ([^\r\n]*).*", output, flags=re.DOTALL ) if product: - grains["virtual_subtype"] = f"Amazon EC2 ({product[1]})" + grains["virtual_subtype"] = "Amazon EC2 ({})".format(product[1]) elif re.match(r".*Version: [^\r\n]+\.amazon.*", output, flags=re.DOTALL): grains["virtual_subtype"] = "Amazon EC2" @@ -1280,7 +1283,9 @@ def _virtual_hv(osdata): try: version = {} for fn in ("major", "minor", "extra"): - with salt.utils.files.fopen(f"/sys/hypervisor/version/{fn}", "r") as fhr: + with salt.utils.files.fopen( + "/sys/hypervisor/version/{}".format(fn), "r" + ) as fhr: version[fn] = salt.utils.stringutils.to_unicode(fhr.read().strip()) grains["virtual_hv_version"] = "{}.{}{}".format( version["major"], version["minor"], version["extra"] @@ -1436,7 +1441,7 @@ def _windows_os_release_grain(caption, product_type): # ie: R2 if re.match(r"^R\d+$", item): release = item - os_release = f"{version}Server{release}" + os_release = "{}Server{}".format(version, release) else: for item in caption.split(" "): # If it's a number, decimal number, Thin or Vista, then it's the @@ -1627,7 +1632,7 @@ def _read_dt_string(path): try: # /proc/device-tree should be used instead of /sys/firmware/devicetree/base # see https://github.com/torvalds/linux/blob/v5.13/Documentation/ABI/testing/sysfs-firmware-ofw#L14 - loc = f"/proc/device-tree/{path}" + loc = "/proc/device-tree/{}".format(path) if os.path.isfile(loc): with salt.utils.files.fopen(loc, mode="r") as f: return f.read().rstrip("\x00") # all strings are null-terminated @@ -1866,13 +1871,18 @@ def _linux_bin_exists(binary): """ for search_cmd in ("which", "type -ap"): try: - return __salt__["cmd.retcode"](f"{search_cmd} {binary}") == 0 + return __salt__["cmd.retcode"]("{} {}".format(search_cmd, binary)) == 0 except salt.exceptions.CommandExecutionError: pass try: return ( - len(__salt__["cmd.run_all"](f"whereis -b {binary}")["stdout"].split()) > 1 + len( + __salt__["cmd.run_all"]("whereis -b {}".format(binary))[ + "stdout" + ].split() + ) + > 1 ) except salt.exceptions.CommandExecutionError: return False @@ -1890,7 +1900,7 @@ def _parse_lsb_release(): pass else: # Adds lsb_distrib_{id,release,codename,description} - ret[f"lsb_{key.lower()}"] = value.rstrip() + ret["lsb_{}".format(key.lower())] = value.rstrip() except OSError as exc: log.trace("Failed to parse /etc/lsb-release: %s", exc) return ret @@ -2614,7 +2624,7 @@ def os_data(): osbuild = __salt__["cmd.run"]("sw_vers -buildVersion") grains["os"] = "MacOS" grains["os_family"] = "MacOS" - grains["osfullname"] = f"{osname} {osrelease}" + grains["osfullname"] = "{} {}".format(osname, osrelease) grains["osrelease"] = osrelease grains["osbuild"] = osbuild grains["init"] = "launchd" @@ -2688,7 +2698,7 @@ def locale_info(): ( grains["locale_info"]["defaultlanguage"], grains["locale_info"]["defaultencoding"], - ) = salt.utils.locales.getdefaultlocale() + ) = locale.getdefaultlocale() except Exception: # pylint: disable=broad-except # locale.getdefaultlocale can ValueError!! Catch anything else it # might do, per #2205 @@ -3155,7 +3165,7 @@ def _hw_data(osdata): "productname": "DeviceDesc", } for grain_name, cmd_key in hwdata.items(): - result = __salt__["cmd.run_all"](f"fw_printenv {cmd_key}") + result = __salt__["cmd.run_all"]("fw_printenv {}".format(cmd_key)) if result["retcode"] == 0: uboot_keyval = result["stdout"].split("=") grains[grain_name] = _clean_value(grain_name, uboot_keyval[1]) @@ -3175,7 +3185,7 @@ def _hw_data(osdata): "uuid": "smbios.system.uuid", } for key, val in fbsd_hwdata.items(): - value = __salt__["cmd.run"](f"{kenv} {val}") + value = __salt__["cmd.run"]("{} {}".format(kenv, val)) grains[key] = _clean_value(key, value) elif osdata["kernel"] == "OpenBSD": sysctl = salt.utils.path.which("sysctl") @@ -3187,7 +3197,7 @@ def _hw_data(osdata): "uuid": "hw.uuid", } for key, oid in hwdata.items(): - value = __salt__["cmd.run"](f"{sysctl} -n {oid}") + value = __salt__["cmd.run"]("{} -n {}".format(sysctl, oid)) if not value.endswith(" value is not available"): grains[key] = _clean_value(key, value) elif osdata["kernel"] == "NetBSD": @@ -3202,7 +3212,7 @@ def _hw_data(osdata): "uuid": "machdep.dmi.system-uuid", } for key, oid in nbsd_hwdata.items(): - result = __salt__["cmd.run_all"](f"{sysctl} -n {oid}") + result = __salt__["cmd.run_all"]("{} -n {}".format(sysctl, oid)) if result["retcode"] == 0: grains[key] = _clean_value(key, result["stdout"]) elif osdata["kernel"] == "Darwin": @@ -3210,7 +3220,7 @@ def _hw_data(osdata): sysctl = salt.utils.path.which("sysctl") hwdata = {"productname": "hw.model"} for key, oid in hwdata.items(): - value = __salt__["cmd.run"](f"{sysctl} -b {oid}") + value = __salt__["cmd.run"]("{} -b {}".format(sysctl, oid)) if not value.endswith(" is invalid"): grains[key] = _clean_value(key, value) elif osdata["kernel"] == "SunOS" and osdata["cpuarch"].startswith("sparc"): @@ -3224,7 +3234,7 @@ def _hw_data(osdata): ("/usr/sbin/virtinfo", "-a"), ): if salt.utils.path.which(cmd): # Also verifies that cmd is executable - data += __salt__["cmd.run"](f"{cmd} {args}") + data += __salt__["cmd.run"]("{} {}".format(cmd, args)) data += "\n" sn_regexes = [ @@ -3339,7 +3349,7 @@ def _hw_data(osdata): elif osdata["kernel"] == "AIX": cmd = salt.utils.path.which("prtconf") if cmd: - data = __salt__["cmd.run"](f"{cmd}") + os.linesep + data = __salt__["cmd.run"]("{}".format(cmd)) + os.linesep for dest, regstring in ( ("serialnumber", r"(?im)^\s*Machine\s+Serial\s+Number:\s+(\S+)"), ("systemfirmware", r"(?im)^\s*Firmware\s+Version:\s+(.*)"), @@ -3421,14 +3431,14 @@ def default_gateway(): for line in out.splitlines(): if line.startswith("default"): grains["ip_gw"] = True - grains[f"ip{ip_version}_gw"] = True + grains["ip{}_gw".format(ip_version)] = True try: via, gw_ip = line.split()[1:3] except ValueError: pass else: if via == "via": - grains[f"ip{ip_version}_gw"] = gw_ip + grains["ip{}_gw".format(ip_version)] = gw_ip break except Exception: # pylint: disable=broad-except continue diff --git a/salt/utils/locales.py b/salt/utils/locales.py index a380ddbe7a2c..8017958d5de2 100644 --- a/salt/utils/locales.py +++ b/salt/utils/locales.py @@ -1,7 +1,8 @@ """ the locale utils used by salt """ -import locale + + import sys from salt.utils.decorators import memoize as real_memoize @@ -82,39 +83,3 @@ def normalize_locale(loc): comps["codeset"] = comps["codeset"].lower().replace("-", "") comps["charmap"] = "" return join_locale(comps) - - -def getdefaultlocale(envvars=("LC_ALL", "LC_CTYPE", "LANG", "LANGUAGE")): - """ - This function was backported from Py3.11 which started triggering a - deprecation warning about it's removal in 3.13. - """ - try: - # check if it's supported by the _locale module - import _locale - - code, encoding = _locale._getdefaultlocale() - except (ImportError, AttributeError): - pass - else: - # make sure the code/encoding values are valid - if sys.platform == "win32" and code and code[:2] == "0x": - # map windows language identifier to language name - code = locale.windows_locale.get(int(code, 0)) - # ...add other platform-specific processing here, if - # necessary... - return code, encoding - - # fall back on POSIX behaviour - import os - - lookup = os.environ.get - for variable in envvars: - localename = lookup(variable, None) - if localename: - if variable == "LANGUAGE": - localename = localename.split(":")[0] - break - else: - localename = "C" - return locale._parse_localename(localename) From 6cd7339e81e0b8306d84a5b5b5ac247c720bdd99 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Tue, 27 Jun 2023 08:05:57 +0100 Subject: [PATCH 09/13] Revert "Add `__getstate__` to blacklisted methods, present in Py 3.11" This reverts commit 3f78a510c07ce82be792bf35f1f0b31af227905c. --- tests/unit/test_master.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/tests/unit/test_master.py b/tests/unit/test_master.py index 96fe2a545953..b454882f06c5 100644 --- a/tests/unit/test_master.py +++ b/tests/unit/test_master.py @@ -56,7 +56,6 @@ def test_aes_funcs_black(self): "__format__", "__ge__", "__getattribute__", - "__getstate__", "__gt__", "__hash__", "__init__", @@ -72,9 +71,9 @@ def test_aes_funcs_black(self): "__sizeof__", "__str__", "__subclasshook__", - "destroy", "get_method", "run_func", + "destroy", ] for name in dir(aes_funcs): if name in aes_funcs.expose_methods: @@ -109,7 +108,6 @@ def test_clear_funcs_black(self): "__format__", "__ge__", "__getattribute__", - "__getstate__", "__gt__", "__hash__", "__init__", @@ -130,9 +128,9 @@ def test_clear_funcs_black(self): "_prep_pub", "_send_pub", "_send_ssh_pub", - "connect", - "destroy", "get_method", + "destroy", + "connect", ] for name in dir(clear_funcs): if name in clear_funcs.expose_methods: From 772f90709d3d9aede628fa305f5d82c5ec57dbfa Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Tue, 27 Jun 2023 08:05:57 +0100 Subject: [PATCH 10/13] Revert "Stop using the deprecated `pipes` module" This reverts commit e814134020c89d91d593b9904526fb19aadb8a2d. --- salt/modules/container_resource.py | 74 +++++--- salt/modules/deb_postgres.py | 16 +- salt/modules/dockermod.py | 178 ++++++++++-------- salt/modules/lxc.py | 32 ++-- salt/modules/mac_keychain.py | 32 +++- salt/modules/macpackage.py | 45 +++-- salt/modules/openstack_config.py | 41 ++-- salt/modules/postgres.py | 116 ++++++------ salt/utils/cloud.py | 289 ++++++++++++++++------------- salt/utils/jinja.py | 25 +-- 10 files changed, 495 insertions(+), 353 deletions(-) diff --git a/salt/modules/container_resource.py b/salt/modules/container_resource.py index ceec72a7b203..a29cba2e468b 100644 --- a/salt/modules/container_resource.py +++ b/salt/modules/container_resource.py @@ -8,11 +8,13 @@ :mod:`docker ` execution modules. They provide for common logic to be re-used for common actions. """ + + import copy import functools import logging import os -import shlex +import pipes import time import traceback @@ -66,14 +68,14 @@ def _nsenter(pid): """ Return the nsenter command to attach to the named container """ - return f"nsenter --target {pid} --mount --uts --ipc --net --pid" + return "nsenter --target {} --mount --uts --ipc --net --pid".format(pid) def _get_md5(name, path, run_func): """ Get the MD5 checksum of a file from a container """ - output = run_func(name, f"md5sum {shlex.quote(path)}", ignore_retcode=True)[ + output = run_func(name, "md5sum {}".format(pipes.quote(path)), ignore_retcode=True)[ "stdout" ] try: @@ -100,10 +102,10 @@ def cache_file(source): if source.startswith("salt://"): cached_source = __salt__["cp.cache_file"](source) if not cached_source: - raise CommandExecutionError(f"Unable to cache {source}") + raise CommandExecutionError("Unable to cache {}".format(source)) return cached_source except AttributeError: - raise SaltInvocationError(f"Invalid source file {source}") + raise SaltInvocationError("Invalid source file {}".format(source)) return source @@ -162,47 +164,55 @@ def run( if exec_driver == "lxc-attach": full_cmd = "lxc-attach " if path: - full_cmd += f"-P {shlex.quote(path)} " + full_cmd += "-P {} ".format(pipes.quote(path)) if keep_env is not True: full_cmd += "--clear-env " if "PATH" not in to_keep: - full_cmd += f"--set-var {PATH} " + full_cmd += "--set-var {} ".format(PATH) # --clear-env results in a very restrictive PATH # (/bin:/usr/bin), use a good fallback. full_cmd += " ".join( [ - f"--set-var {x}={shlex.quote(os.environ[x])}" + "--set-var {}={}".format(x, pipes.quote(os.environ[x])) for x in to_keep if x in os.environ ] ) - full_cmd += f" -n {shlex.quote(name)} -- {cmd}" + full_cmd += " -n {} -- {}".format(pipes.quote(name), cmd) elif exec_driver == "nsenter": - pid = __salt__[f"{container_type}.pid"](name) - full_cmd = f"nsenter --target {pid} --mount --uts --ipc --net --pid -- " + pid = __salt__["{}.pid".format(container_type)](name) + full_cmd = "nsenter --target {} --mount --uts --ipc --net --pid -- ".format(pid) if keep_env is not True: full_cmd += "env -i " if "PATH" not in to_keep: - full_cmd += f"{PATH} " + full_cmd += "{} ".format(PATH) full_cmd += " ".join( - [f"{x}={shlex.quote(os.environ[x])}" for x in to_keep if x in os.environ] + [ + "{}={}".format(x, pipes.quote(os.environ[x])) + for x in to_keep + if x in os.environ + ] ) - full_cmd += f" {cmd}" + full_cmd += " {}".format(cmd) elif exec_driver == "docker-exec": # We're using docker exec on the CLI as opposed to via docker-py, since # the Docker API doesn't return stdout and stderr separately. full_cmd = "docker exec " if stdin: full_cmd += "-i " - full_cmd += f"{name} " + full_cmd += "{} ".format(name) if keep_env is not True: full_cmd += "env -i " if "PATH" not in to_keep: - full_cmd += f"{PATH} " + full_cmd += "{} ".format(PATH) full_cmd += " ".join( - [f"{x}={shlex.quote(os.environ[x])}" for x in to_keep if x in os.environ] + [ + "{}={}".format(x, pipes.quote(os.environ[x])) + for x in to_keep + if x in os.environ + ] ) - full_cmd += f" {cmd}" + full_cmd += " {}".format(cmd) if not use_vt: ret = __salt__[cmd_func]( @@ -289,13 +299,13 @@ def copy_to( salt myminion container_resource.copy_to mycontainer /local/file/path /container/file/path container_type=docker exec_driver=nsenter """ # Get the appropriate functions - state = __salt__[f"{container_type}.state"] + state = __salt__["{}.state".format(container_type)] def run_all(*args, **akwargs): akwargs = copy.deepcopy(akwargs) if container_type in ["lxc"] and "path" not in akwargs: akwargs["path"] = path - return __salt__[f"{container_type}.run_all"](*args, **akwargs) + return __salt__["{}.run_all".format(container_type)](*args, **akwargs) state_kwargs = {} cmd_kwargs = {"ignore_retcode": True} @@ -311,7 +321,7 @@ def _state(name): c_state = _state(name) if c_state != "running": - raise CommandExecutionError(f"Container '{name}' is not running") + raise CommandExecutionError("Container '{}' is not running".format(name)) local_file = cache_file(source) source_dir, source_name = os.path.split(local_file) @@ -320,14 +330,17 @@ def _state(name): if not os.path.isabs(local_file): raise SaltInvocationError("Source path must be absolute") elif not os.path.exists(local_file): - raise SaltInvocationError(f"Source file {local_file} does not exist") + raise SaltInvocationError("Source file {} does not exist".format(local_file)) elif not os.path.isfile(local_file): raise SaltInvocationError("Source must be a regular file") # Destination file sanity checks if not os.path.isabs(dest): raise SaltInvocationError("Destination path must be absolute") - if run_all(name, f"test -d {shlex.quote(dest)}", **cmd_kwargs)["retcode"] == 0: + if ( + run_all(name, "test -d {}".format(pipes.quote(dest)), **cmd_kwargs)["retcode"] + == 0 + ): # Destination is a directory, full path to dest file will include the # basename of the source file. dest = os.path.join(dest, source_name) @@ -337,12 +350,14 @@ def _state(name): # parent directory. dest_dir, dest_name = os.path.split(dest) if ( - run_all(name, f"test -d {shlex.quote(dest_dir)}", **cmd_kwargs)["retcode"] + run_all(name, "test -d {}".format(pipes.quote(dest_dir)), **cmd_kwargs)[ + "retcode" + ] != 0 ): if makedirs: result = run_all( - name, f"mkdir -p {shlex.quote(dest_dir)}", **cmd_kwargs + name, "mkdir -p {}".format(pipes.quote(dest_dir)), **cmd_kwargs ) if result["retcode"] != 0: error = ( @@ -360,7 +375,10 @@ def _state(name): ) if ( not overwrite - and run_all(name, f"test -e {shlex.quote(dest)}", **cmd_kwargs)["retcode"] == 0 + and run_all(name, "test -e {}".format(pipes.quote(dest)), **cmd_kwargs)[ + "retcode" + ] + == 0 ): raise CommandExecutionError( "Destination path {} already exists. Use overwrite=True to " @@ -383,14 +401,14 @@ def _state(name): if exec_driver == "lxc-attach": lxcattach = "lxc-attach" if path: - lxcattach += f" -P {shlex.quote(path)}" + lxcattach += " -P {}".format(pipes.quote(path)) copy_cmd = ( 'cat "{0}" | {4} --clear-env --set-var {1} -n {2} -- tee "{3}"'.format( local_file, PATH, name, dest, lxcattach ) ) elif exec_driver == "nsenter": - pid = __salt__[f"{container_type}.pid"](name) + pid = __salt__["{}.pid".format(container_type)](name) copy_cmd = 'cat "{}" | {} env -i {} tee "{}"'.format( local_file, _nsenter(pid), PATH, dest ) diff --git a/salt/modules/deb_postgres.py b/salt/modules/deb_postgres.py index d92859562d46..3ecd4a8ba492 100644 --- a/salt/modules/deb_postgres.py +++ b/salt/modules/deb_postgres.py @@ -2,8 +2,10 @@ Module to provide Postgres compatibility to salt for debian family specific tools. """ + + import logging -import shlex +import pipes import salt.utils.path @@ -74,7 +76,7 @@ def cluster_create( cmd += ["--data-checksums"] if wal_segsize: cmd += ["--wal-segsize", wal_segsize] - cmdstr = " ".join([shlex.quote(c) for c in cmd]) + cmdstr = " ".join([pipes.quote(c) for c in cmd]) ret = __salt__["cmd.run_all"](cmdstr, python_shell=False) if ret.get("retcode", 0) != 0: log.error("Error creating a Postgresql cluster %s/%s", version, name) @@ -95,7 +97,7 @@ def cluster_list(verbose=False): salt '*' postgres.cluster_list verbose=True """ cmd = [salt.utils.path.which("pg_lsclusters"), "--no-header"] - ret = __salt__["cmd.run_all"](" ".join([shlex.quote(c) for c in cmd])) + ret = __salt__["cmd.run_all"](" ".join([pipes.quote(c) for c in cmd])) if ret.get("retcode", 0) != 0: log.error("Error listing clusters") cluster_dict = _parse_pg_lscluster(ret["stdout"]) @@ -116,7 +118,7 @@ def cluster_exists(version, name="main"): salt '*' postgres.cluster_exists '9.3' 'main' """ - return f"{version}/{name}" in cluster_list() + return "{}/{}".format(version, name) in cluster_list() def cluster_remove(version, name="main", stop=False): @@ -139,13 +141,13 @@ def cluster_remove(version, name="main", stop=False): if stop: cmd += ["--stop"] cmd += [str(version), name] - cmdstr = " ".join([shlex.quote(c) for c in cmd]) + cmdstr = " ".join([pipes.quote(c) for c in cmd]) ret = __salt__["cmd.run_all"](cmdstr, python_shell=False) # FIXME - return Boolean ? if ret.get("retcode", 0) != 0: log.error("Error removing a Postgresql cluster %s/%s", version, name) else: - ret["changes"] = f"Successfully removed cluster {version}/{name}" + ret["changes"] = "Successfully removed cluster {}/{}".format(version, name) return ret @@ -156,7 +158,7 @@ def _parse_pg_lscluster(output): cluster_dict = {} for line in output.splitlines(): version, name, port, status, user, datadir, log = line.split() - cluster_dict[f"{version}/{name}"] = { + cluster_dict["{}/{}".format(version, name)] = { "port": int(port), "status": status, "user": user, diff --git a/salt/modules/dockermod.py b/salt/modules/dockermod.py index b58fd1b32bc4..3e35700788d5 100644 --- a/salt/modules/dockermod.py +++ b/salt/modules/dockermod.py @@ -204,8 +204,8 @@ import json import logging import os +import pipes import re -import shlex import shutil import string import subprocess @@ -252,6 +252,7 @@ HAS_NSENTER = bool(salt.utils.path.which("nsenter")) +# Set up logging log = logging.getLogger(__name__) # Don't shadow built-in's. @@ -391,7 +392,7 @@ def _get_client(timeout=NOTSET, **kwargs): ) except Exception as exc: # pylint: disable=broad-except raise CommandExecutionError( - f"Docker machine {docker_machine} failed: {exc}" + "Docker machine {} failed: {}".format(docker_machine, exc) ) try: # docker-py 2.0 renamed this client attribute @@ -491,7 +492,7 @@ def _change_state(name, action, expected, *args, **kwargs): return { "result": False, "state": {"old": expected, "new": expected}, - "comment": f"Container '{name}' already {expected}", + "comment": "Container '{}' already {}".format(name, expected), } _client_wrapper(action, name, *args, **kwargs) _clear_context() @@ -529,7 +530,9 @@ def _get_md5(name, path): """ Get the MD5 checksum of a file from a container """ - output = run_stdout(name, f"md5sum {shlex.quote(path)}", ignore_retcode=True) + output = run_stdout( + name, "md5sum {}".format(pipes.quote(path)), ignore_retcode=True + ) try: return output.split()[0] except IndexError: @@ -608,7 +611,7 @@ def _scrub_links(links, name): if isinstance(links, list): ret = [] for l in links: - ret.append(l.replace(f"/{name}/", "/", 1)) + ret.append(l.replace("/{}/".format(name), "/", 1)) else: ret = links @@ -631,11 +634,11 @@ def _size_fmt(num): try: num = int(num) if num < 1024: - return f"{num} bytes" + return "{} bytes".format(num) num /= 1024.0 for unit in ("KiB", "MiB", "GiB", "TiB", "PiB"): if num < 1024.0: - return f"{num:3.1f} {unit}" + return "{:3.1f} {}".format(num, unit) num /= 1024.0 except Exception: # pylint: disable=broad-except log.error("Unable to format file size for '%s'", num) @@ -650,7 +653,7 @@ def _client_wrapper(attr, *args, **kwargs): catch_api_errors = kwargs.pop("catch_api_errors", True) func = getattr(__context__["docker.client"], attr, None) if func is None or not hasattr(func, "__call__"): - raise SaltInvocationError(f"Invalid client action '{attr}'") + raise SaltInvocationError("Invalid client action '{}'".format(attr)) if attr in ("push", "pull"): try: # Refresh auth config from config.json @@ -670,7 +673,7 @@ def _client_wrapper(attr, *args, **kwargs): if catch_api_errors: # Generic handling of Docker API errors raise CommandExecutionError( - f"Error {exc.response.status_code}: {exc.explanation}" + "Error {}: {}".format(exc.response.status_code, exc.explanation) ) else: # Allow API errors to be caught further up the stack @@ -685,9 +688,9 @@ def _client_wrapper(attr, *args, **kwargs): # If we're here, it's because an exception was caught earlier, and the # API command failed. - msg = f"Unable to perform {attr}" + msg = "Unable to perform {}".format(attr) if err: - msg += f": {err}" + msg += ": {}".format(err) raise CommandExecutionError(msg) @@ -714,7 +717,7 @@ def _import_status(data, item, repo_name, repo_tag): return elif all(x in string.hexdigits for x in status): # Status is an image ID - data["Image"] = f"{repo_name}:{repo_tag}" + data["Image"] = "{}:{}".format(repo_name, repo_tag) data["Id"] = status except (AttributeError, TypeError): pass @@ -873,7 +876,7 @@ def _get_create_kwargs( ignore_collisions=False, validate_ip_addrs=True, client_args=None, - **kwargs, + **kwargs ): """ Take input kwargs and return a kwargs dict to pass to docker-py's @@ -891,7 +894,7 @@ def _get_create_kwargs( skip_translate=skip_translate, ignore_collisions=ignore_collisions, validate_ip_addrs=validate_ip_addrs, - **__utils__["args.clean_kwargs"](**kwargs), + **__utils__["args.clean_kwargs"](**kwargs) ) if networks: @@ -904,7 +907,7 @@ def _get_create_kwargs( log.error( "docker.create: Error getting client args: '%s'", exc, exc_info=True ) - raise CommandExecutionError(f"Failed to get client args: {exc}") + raise CommandExecutionError("Failed to get client args: {}".format(exc)) full_host_config = {} host_kwargs = {} @@ -1465,15 +1468,15 @@ def login(*registries): results = ret.setdefault("Results", {}) for registry in registries: if registry not in registry_auth: - errors.append(f"No match found for registry '{registry}'") + errors.append("No match found for registry '{}'".format(registry)) continue try: username = registry_auth[registry]["username"] password = registry_auth[registry]["password"] except TypeError: - errors.append(f"Invalid configuration for registry '{registry}'") + errors.append("Invalid configuration for registry '{}'".format(registry)) except KeyError as exc: - errors.append(f"Missing {exc} for registry '{registry}'") + errors.append("Missing {} for registry '{}'".format(exc, registry)) else: cmd = ["docker", "login", "-u", username, "-p", password] if registry.lower() != "hub": @@ -1559,7 +1562,7 @@ def logout(*registries): results = ret.setdefault("Results", {}) for registry in registries: if registry not in registry_auth: - errors.append(f"No match found for registry '{registry}'") + errors.append("No match found for registry '{}'".format(registry)) continue else: cmd = ["docker", "logout"] @@ -1681,7 +1684,7 @@ def exists(name): salt myminion docker.exists mycontainer """ - contextkey = f"docker.exists.{name}" + contextkey = "docker.exists.{}".format(name) if contextkey in __context__: return __context__[contextkey] try: @@ -1772,7 +1775,7 @@ def history(name, quiet=False): ) for param in ("Size",): if param in step: - step[f"{param}_Human"] = _size_fmt(step[param]) + step["{}_Human".format(param)] = _size_fmt(step[param]) ret.append(copy.deepcopy(step)) if quiet: return [x.get("Command") for x in ret] @@ -1834,7 +1837,9 @@ def images(verbose=False, **kwargs): ) for param in ("Size", "VirtualSize"): if param in bucket.get(img_id, {}): - bucket[img_id][f"{param}_Human"] = _size_fmt(bucket[img_id][param]) + bucket[img_id]["{}_Human".format(param)] = _size_fmt( + bucket[img_id][param] + ) context_data = __context__.get("docker.images", {}) ret = copy.deepcopy(context_data.get("tagged", {})) @@ -1917,7 +1922,7 @@ def inspect(name): raise raise CommandExecutionError( - f"Error 404: No such image/container/volume/network: {name}" + "Error 404: No such image/container/volume/network: {}".format(name) ) @@ -1973,7 +1978,7 @@ def inspect_image(name): ret = _client_wrapper("inspect_image", name) for param in ("Size", "VirtualSize"): if param in ret: - ret[f"{param}_Human"] = _size_fmt(ret[param]) + ret["{}_Human".format(param)] = _size_fmt(ret[param]) return ret @@ -2267,7 +2272,7 @@ def port(name, private_port=None): else: # Sanity checks if isinstance(private_port, int): - pattern = f"{private_port}/*" + pattern = "{}/*".format(private_port) else: err = ( "Invalid private_port '{}'. Must either be a port number, " @@ -2388,7 +2393,7 @@ def state(name): salt myminion docker.state mycontainer """ - contextkey = f"docker.state.{name}" + contextkey = "docker.state.{}".format(name) if contextkey in __context__: return __context__[contextkey] __context__[contextkey] = _get_state(inspect_container(name)) @@ -2428,7 +2433,9 @@ def search(name, official=False, trusted=False): """ response = _client_wrapper("search", name) if not response: - raise CommandExecutionError(f"No images matched the search string '{name}'") + raise CommandExecutionError( + "No images matched the search string '{}'".format(name) + ) key_map = { "description": "Description", @@ -2543,7 +2550,7 @@ def create( ignore_collisions=False, validate_ip_addrs=True, client_timeout=salt.utils.dockermod.CLIENT_TIMEOUT, - **kwargs, + **kwargs ): """ Create a new container @@ -3269,7 +3276,7 @@ def create( skip_translate=skip_translate, ignore_collisions=ignore_collisions, validate_ip_addrs=validate_ip_addrs, - **kwargs, + **kwargs ) if unused_kwargs: @@ -3281,7 +3288,7 @@ def create( log.debug( "docker.create: creating container %susing the following arguments: %s", - f"with name '{name}' " if name is not None else "", + "with name '{}' ".format(name) if name is not None else "", kwargs, ) time_started = time.time() @@ -3319,7 +3326,7 @@ def run_container( replace=False, force=False, networks=None, - **kwargs, + **kwargs ): """ .. versionadded:: 2018.3.0 @@ -3421,7 +3428,7 @@ def run_container( skip_translate=skip_translate, ignore_collisions=ignore_collisions, validate_ip_addrs=validate_ip_addrs, - **kwargs, + **kwargs ) # _get_create_kwargs() will have processed auto_remove and put it into the @@ -3446,7 +3453,7 @@ def run_container( log.debug( "docker.create: creating container %susing the following arguments: %s", - f"with name '{name}' " if name is not None else "", + "with name '{}' ".format(name) if name is not None else "", kwargs, ) @@ -3486,7 +3493,7 @@ def _append_warning(ret, msg): rm_(name) except CommandExecutionError as rm_exc: exc_info.setdefault("other_errors", []).append( - f"Failed to auto_remove container: {rm_exc}" + "Failed to auto_remove container: {}".format(rm_exc) ) # Raise original exception with additional info raise CommandExecutionError(exc.__str__(), info=exc_info) @@ -3581,7 +3588,7 @@ def copy_from(name, source, dest, overwrite=False, makedirs=False): """ c_state = state(name) if c_state != "running": - raise CommandExecutionError(f"Container '{name}' is not running") + raise CommandExecutionError("Container '{}' is not running".format(name)) # Destination file sanity checks if not os.path.isabs(dest): @@ -3607,7 +3614,9 @@ def copy_from(name, source, dest, overwrite=False, makedirs=False): ) ) else: - raise SaltInvocationError(f"Directory {dest_dir} does not exist") + raise SaltInvocationError( + "Directory {} does not exist".format(dest_dir) + ) if not overwrite and os.path.exists(dest): raise CommandExecutionError( "Destination path {} already exists. Use overwrite=True to " @@ -3618,14 +3627,19 @@ def copy_from(name, source, dest, overwrite=False, makedirs=False): if not os.path.isabs(source): raise SaltInvocationError("Source path must be absolute") else: - if retcode(name, f"test -e {shlex.quote(source)}", ignore_retcode=True) == 0: + if ( + retcode(name, "test -e {}".format(pipes.quote(source)), ignore_retcode=True) + == 0 + ): if ( - retcode(name, f"test -f {shlex.quote(source)}", ignore_retcode=True) + retcode( + name, "test -f {}".format(pipes.quote(source)), ignore_retcode=True + ) != 0 ): raise SaltInvocationError("Source must be a regular file") else: - raise SaltInvocationError(f"Source file {source} does not exist") + raise SaltInvocationError("Source file {} does not exist".format(source)) # Before we try to replace the file, compare checksums. source_md5 = _get_md5(name, source) @@ -3638,7 +3652,7 @@ def copy_from(name, source, dest, overwrite=False, makedirs=False): try: src_path = ":".join((name, source)) except TypeError: - src_path = f"{name}:{source}" + src_path = "{}:{}".format(name, source) cmd = ["docker", "cp", src_path, dest_dir] __salt__["cmd.run"](cmd, python_shell=False) return source_md5 == __salt__["file.get_sum"](dest, "md5") @@ -3765,7 +3779,7 @@ def export(name, path, overwrite=False, makedirs=False, compression=None, **kwar salt myminion docker.export mycontainer /tmp/mycontainer.tar salt myminion docker.export mycontainer /tmp/mycontainer.tar.xz push=True """ - err = f"Path '{path}' is not absolute" + err = "Path '{}' is not absolute".format(path) try: if not os.path.isabs(path): raise SaltInvocationError(err) @@ -3773,7 +3787,7 @@ def export(name, path, overwrite=False, makedirs=False, compression=None, **kwar raise SaltInvocationError(err) if os.path.exists(path) and not overwrite: - raise CommandExecutionError(f"{path} already exists") + raise CommandExecutionError("{} already exists".format(path)) if compression is None: if path.endswith(".tar.gz") or path.endswith(".tgz"): @@ -3796,7 +3810,7 @@ def export(name, path, overwrite=False, makedirs=False, compression=None, **kwar compression = "xz" if compression and compression not in ("gzip", "bzip2", "xz"): - raise SaltInvocationError(f"Invalid compression type '{compression}'") + raise SaltInvocationError("Invalid compression type '{}'".format(compression)) parent_dir = os.path.dirname(path) if not os.path.isdir(parent_dir): @@ -3809,14 +3823,16 @@ def export(name, path, overwrite=False, makedirs=False, compression=None, **kwar os.makedirs(parent_dir) except OSError as exc: raise CommandExecutionError( - f"Unable to make parent dir {parent_dir}: {exc}" + "Unable to make parent dir {}: {}".format(parent_dir, exc) ) if compression == "gzip": try: out = gzip.open(path, "wb") except OSError as exc: - raise CommandExecutionError(f"Unable to open {path} for writing: {exc}") + raise CommandExecutionError( + "Unable to open {} for writing: {}".format(path, exc) + ) elif compression == "bzip2": compressor = bz2.BZ2Compressor() elif compression == "xz": @@ -3854,7 +3870,9 @@ def export(name, path, overwrite=False, makedirs=False, compression=None, **kwar os.remove(path) except OSError: pass - raise CommandExecutionError(f"Error occurred during container export: {exc}") + raise CommandExecutionError( + "Error occurred during container export: {}".format(exc) + ) finally: out.close() ret = {"Time_Elapsed": time.time() - time_started} @@ -4085,7 +4103,7 @@ def build( # For the build function in the low-level API, the "tag" refers to the full # tag (e.g. myuser/myimage:mytag). This is different than in other # functions, where the repo and tag are passed separately. - image_tag = f"{repository}:{tag}" if repository and tag else None + image_tag = "{}:{}".format(repository, tag) if repository and tag else None time_started = time.time() response = _client_wrapper( @@ -4104,7 +4122,7 @@ def build( if not response: raise CommandExecutionError( - f"Build failed for {path}, no response returned from Docker API" + "Build failed for {}, no response returned from Docker API".format(path) ) stream_data = [] @@ -4127,7 +4145,7 @@ def build( if "Id" not in ret: # API returned information, but there was no confirmation of a # successful build. - msg = f"Build failed for {path}" + msg = "Build failed for {}".format(path) log.error(msg) log.error(stream_data) if errors: @@ -4138,7 +4156,7 @@ def build( if resolved_tag: ret["Image"] = resolved_tag else: - ret["Warning"] = f"Failed to tag image as {image_tag}" + ret["Warning"] = "Failed to tag image as {}".format(image_tag) if api_response: ret["API_Response"] = stream_data @@ -4345,7 +4363,7 @@ def import_(source, repository, tag="latest", api_response=False): if not response: raise CommandExecutionError( - f"Import failed for {source}, no response returned from Docker API" + "Import failed for {}, no response returned from Docker API".format(source) ) elif api_response: ret["API_Response"] = response @@ -4365,7 +4383,7 @@ def import_(source, repository, tag="latest", api_response=False): if "Id" not in ret: # API returned information, but there was no confirmation of a # successful push. - msg = f"Import failed for {source}" + msg = "Import failed for {}".format(source) if errors: msg += ". Error(s) follow:\n\n{}".format("\n\n".join(errors)) raise CommandExecutionError(msg) @@ -4440,7 +4458,7 @@ def load(path, repository=None, tag=None): local_path = __salt__["container_resource.cache_file"](path) if not os.path.isfile(local_path): - raise CommandExecutionError(f"Source file {path} does not exist") + raise CommandExecutionError("Source file {} does not exist".format(path)) pre = images(all=True) cmd = ["docker", "load", "-i", local_path] @@ -4450,7 +4468,7 @@ def load(path, repository=None, tag=None): _clear_context() post = images(all=True) if result["retcode"] != 0: - msg = f"Failed to load image(s) from {path}" + msg = "Failed to load image(s) from {}".format(path) if result["stderr"]: msg += ": {}".format(result["stderr"]) raise CommandExecutionError(msg) @@ -4471,7 +4489,7 @@ def load(path, repository=None, tag=None): # strings when passed (e.g. a numeric tag would be loaded as an int # or float), and because the tag_ function will stringify them if # need be, a str.format is the correct thing to do here. - tagged_image = f"{repository}:{tag}" + tagged_image = "{}:{}".format(repository, tag) try: result = tag_(top_level_images[0], repository=repository, tag=tag) ret["Image"] = tagged_image @@ -4508,7 +4526,7 @@ def layers(name): ): ret.append(line) if not ret: - raise CommandExecutionError(f"Image '{name}' not found") + raise CommandExecutionError("Image '{}' not found".format(name)) return ret @@ -4579,7 +4597,7 @@ def pull( if not response: raise CommandExecutionError( - f"Pull failed for {image}, no response returned from Docker API" + "Pull failed for {}, no response returned from Docker API".format(image) ) elif api_response: ret["API_Response"] = response @@ -4592,7 +4610,7 @@ def pull( event = salt.utils.json.loads(event) except Exception as exc: # pylint: disable=broad-except raise CommandExecutionError( - f"Unable to interpret API event: '{event}'", + "Unable to interpret API event: '{}'".format(event), info={"Error": exc.__str__()}, ) try: @@ -4674,7 +4692,7 @@ def push( if not response: raise CommandExecutionError( - f"Push failed for {image}, no response returned from Docker API" + "Push failed for {}, no response returned from Docker API".format(image) ) elif api_response: ret["API_Response"] = response @@ -4686,7 +4704,7 @@ def push( event = salt.utils.json.loads(event) except Exception as exc: # pylint: disable=broad-except raise CommandExecutionError( - f"Unable to interpret API event: '{event}'", + "Unable to interpret API event: '{}'".format(event), info={"Error": exc.__str__()}, ) try: @@ -4766,7 +4784,9 @@ def rmi(*names, **kwargs): err += "image(s): {}".format(", ".join(deps["Images"])) errors.append(err) else: - errors.append(f"Error {exc.response.status_code}: {exc.explanation}") + errors.append( + "Error {}: {}".format(exc.response.status_code, exc.explanation) + ) _clear_context() ret = { @@ -4854,7 +4874,7 @@ def save(name, path, overwrite=False, makedirs=False, compression=None, **kwargs salt myminion docker.save centos:7 /tmp/cent7.tar salt myminion docker.save 0123456789ab cdef01234567 /tmp/saved.tar """ - err = f"Path '{path}' is not absolute" + err = "Path '{}' is not absolute".format(path) try: if not os.path.isabs(path): raise SaltInvocationError(err) @@ -4862,7 +4882,7 @@ def save(name, path, overwrite=False, makedirs=False, compression=None, **kwargs raise SaltInvocationError(err) if os.path.exists(path) and not overwrite: - raise CommandExecutionError(f"{path} already exists") + raise CommandExecutionError("{} already exists".format(path)) if compression is None: if path.endswith(".tar.gz") or path.endswith(".tgz"): @@ -4885,7 +4905,7 @@ def save(name, path, overwrite=False, makedirs=False, compression=None, **kwargs compression = "xz" if compression and compression not in ("gzip", "bzip2", "xz"): - raise SaltInvocationError(f"Invalid compression type '{compression}'") + raise SaltInvocationError("Invalid compression type '{}'".format(compression)) parent_dir = os.path.dirname(path) if not os.path.isdir(parent_dir): @@ -4907,7 +4927,7 @@ def save(name, path, overwrite=False, makedirs=False, compression=None, **kwargs time_started = time.time() result = __salt__["cmd.run_all"](cmd, python_shell=False) if result["retcode"] != 0: - err = f"Failed to save image(s) to {path}" + err = "Failed to save image(s) to {}".format(path) if result["stderr"]: err += ": {}".format(result["stderr"]) raise CommandExecutionError(err) @@ -4917,7 +4937,9 @@ def save(name, path, overwrite=False, makedirs=False, compression=None, **kwargs try: out = gzip.open(path, "wb") except OSError as exc: - raise CommandExecutionError(f"Unable to open {path} for writing: {exc}") + raise CommandExecutionError( + "Unable to open {} for writing: {}".format(path, exc) + ) elif compression == "bzip2": compressor = bz2.BZ2Compressor() elif compression == "xz": @@ -4953,7 +4975,9 @@ def save(name, path, overwrite=False, makedirs=False, compression=None, **kwargs os.remove(path) except OSError: pass - raise CommandExecutionError(f"Error occurred during image save: {exc}") + raise CommandExecutionError( + "Error occurred during image save: {}".format(exc) + ) finally: try: # Clean up temp file @@ -5073,7 +5097,7 @@ def create_network( ignore_collisions=False, validate_ip_addrs=True, client_timeout=salt.utils.dockermod.CLIENT_TIMEOUT, - **kwargs, + **kwargs ): """ .. versionchanged:: 2018.3.0 @@ -5313,7 +5337,7 @@ def create_network( skip_translate=skip_translate, ignore_collisions=ignore_collisions, validate_ip_addrs=validate_ip_addrs, - **__utils__["args.clean_kwargs"](**kwargs), + **__utils__["args.clean_kwargs"](**kwargs) ) if "ipam" not in kwargs: @@ -5645,7 +5669,7 @@ def pause(name): return { "result": False, "state": {"old": orig_state, "new": orig_state}, - "comment": f"Container '{name}' is stopped, cannot pause", + "comment": "Container '{}' is stopped, cannot pause".format(name), } return _change_state(name, "pause", "paused") @@ -5744,7 +5768,7 @@ def start_(name): return { "result": False, "state": {"old": orig_state, "new": orig_state}, - "comment": f"Container '{name}' is paused, cannot start", + "comment": "Container '{}' is paused, cannot start".format(name), } return _change_state(name, "start", "running") @@ -5849,7 +5873,7 @@ def unpause(name): return { "result": False, "state": {"old": orig_state, "new": orig_state}, - "comment": f"Container '{name}' is stopped, cannot unpause", + "comment": "Container '{}' is stopped, cannot unpause".format(name), } return _change_state(name, "unpause", "running") @@ -5898,7 +5922,7 @@ def wait(name, ignore_already_stopped=False, fail_on_exit_status=False): # Container doesn't exist anymore return { "result": ignore_already_stopped, - "comment": f"Container '{name}' absent", + "comment": "Container '{}' absent".format(name), } already_stopped = pre == "stopped" response = _client_wrapper("wait", name) @@ -5922,7 +5946,7 @@ def wait(name, ignore_already_stopped=False, fail_on_exit_status=False): "exit_status": response, } if already_stopped: - result["comment"] = f"Container '{name}' already stopped" + result["comment"] = "Container '{}' already stopped".format(name) if fail_on_exit_status and result["result"]: result["result"] = result["exit_status"] == 0 return result @@ -5935,7 +5959,7 @@ def prune( build=False, volumes=False, system=None, - **filters, + **filters ): """ .. versionadded:: 2019.2.0 @@ -6621,7 +6645,7 @@ def script_retcode( def _generate_tmp_path(): - return os.path.join("/tmp", f"salt.docker.{uuid.uuid4().hex[:6]}") + return os.path.join("/tmp", "salt.docker.{}".format(uuid.uuid4().hex[:6])) def _prepare_trans_tar(name, sls_opts, mods=None, pillar=None, extra_filerefs=""): @@ -6756,7 +6780,7 @@ def call(name, function, *args, **kwargs): ] + list(args) + [ - f"{key}={value}" + "{}={}".format(key, value) for (key, value) in kwargs.items() if not key.startswith("__") ] diff --git a/salt/modules/lxc.py b/salt/modules/lxc.py index ba03d1f4180f..9d04963ba789 100644 --- a/salt/modules/lxc.py +++ b/salt/modules/lxc.py @@ -12,9 +12,9 @@ import difflib import logging import os +import pipes import random import re -import shlex import shutil import string import tempfile @@ -1834,7 +1834,7 @@ def _after_ignition_network_profile(cmd, ret, name, network_profile, path, nic_o # destroy the container if it was partially created cmd = "lxc-destroy" if path: - cmd += f" -P {shlex.quote(path)}" + cmd += f" -P {pipes.quote(path)}" cmd += f" -n {name}" __salt__["cmd.retcode"](cmd, python_shell=False) raise CommandExecutionError( @@ -1997,7 +1997,7 @@ def select(key, default=None): ) options["imgtar"] = img_tar if path: - cmd += f" -P {shlex.quote(path)}" + cmd += f" -P {pipes.quote(path)}" if not os.path.exists(path): os.makedirs(path) if config: @@ -2136,7 +2136,7 @@ def select(key, default=None): cmd = "lxc-clone" cmd += f" {snapshot} -o {orig} -n {name}" if path: - cmd += f" -P {shlex.quote(path)}" + cmd += f" -P {pipes.quote(path)}" if not os.path.exists(path): os.makedirs(path) if backing: @@ -2184,7 +2184,7 @@ def ls_(active=None, cache=True, path=None): ret = [] cmd = "lxc-ls" if path: - cmd += f" -P {shlex.quote(path)}" + cmd += f" -P {pipes.quote(path)}" if active: cmd += " --active" output = __salt__["cmd.run_stdout"](cmd, python_shell=False) @@ -2240,7 +2240,7 @@ def list_(extra=False, limit=None, path=None): for container in ctnrs: cmd = "lxc-info" if path: - cmd += f" -P {shlex.quote(path)}" + cmd += f" -P {pipes.quote(path)}" cmd += f" -n {container}" c_info = __salt__["cmd.run"](cmd, python_shell=False, output_loglevel="debug") c_state = None @@ -2299,12 +2299,12 @@ def _change_state( # Kill the container first scmd = "lxc-stop" if path: - scmd += f" -P {shlex.quote(path)}" + scmd += f" -P {pipes.quote(path)}" scmd += f" -k -n {name}" __salt__["cmd.run"](scmd, python_shell=False) if path and " -P " not in cmd: - cmd += f" -P {shlex.quote(path)}" + cmd += f" -P {pipes.quote(path)}" cmd += f" -n {name}" # certain lxc commands need to be taken with care (lxc-start) @@ -2335,7 +2335,7 @@ def _change_state( # some commands do not wait, so we will rcmd = "lxc-wait" if path: - rcmd += f" -P {shlex.quote(path)}" + rcmd += f" -P {pipes.quote(path)}" rcmd += f" -n {name} -s {expected.upper()}" __salt__["cmd.run"](rcmd, python_shell=False, timeout=30) _clear_context() @@ -2457,7 +2457,7 @@ def start(name, **kwargs): lxc_config = os.path.join(cpath, name, "config") # we try to start, even without config, if global opts are there if os.path.exists(lxc_config): - cmd += f" -f {shlex.quote(lxc_config)}" + cmd += f" -f {pipes.quote(lxc_config)}" cmd += " -d" _ensure_exists(name, path=path) if state(name, path=path) == "frozen": @@ -2560,7 +2560,7 @@ def freeze(name, **kwargs): start(name, path=path) cmd = "lxc-freeze" if path: - cmd += f" -P {shlex.quote(path)}" + cmd += f" -P {pipes.quote(path)}" ret = _change_state(cmd, name, "frozen", use_vt=use_vt, path=path) if orig_state == "stopped" and start_: ret["state"]["old"] = orig_state @@ -2595,7 +2595,7 @@ def unfreeze(name, path=None, use_vt=None): raise CommandExecutionError(f"Container '{name}' is stopped") cmd = "lxc-unfreeze" if path: - cmd += f" -P {shlex.quote(path)}" + cmd += f" -P {pipes.quote(path)}" return _change_state(cmd, name, "running", path=path, use_vt=use_vt) @@ -2689,7 +2689,7 @@ def state(name, path=None): else: cmd = "lxc-info" if path: - cmd += f" -P {shlex.quote(path)}" + cmd += f" -P {pipes.quote(path)}" cmd += f" -n {name}" ret = __salt__["cmd.run_all"](cmd, python_shell=False) if ret["retcode"] != 0: @@ -2727,7 +2727,7 @@ def get_parameter(name, parameter, path=None): _ensure_exists(name, path=path) cmd = "lxc-cgroup" if path: - cmd += f" -P {shlex.quote(path)}" + cmd += f" -P {pipes.quote(path)}" cmd += f" -n {name} {parameter}" ret = __salt__["cmd.run_all"](cmd, python_shell=False) if ret["retcode"] != 0: @@ -2756,7 +2756,7 @@ def set_parameter(name, parameter, value, path=None): cmd = "lxc-cgroup" if path: - cmd += f" -P {shlex.quote(path)}" + cmd += f" -P {pipes.quote(path)}" cmd += f" -n {name} {parameter} {value}" ret = __salt__["cmd.run_all"](cmd, python_shell=False) if ret["retcode"] != 0: @@ -3648,7 +3648,7 @@ def attachable(name, path=None): log.debug("Checking if LXC container %s is attachable", name) cmd = "lxc-attach" if path: - cmd += f" -P {shlex.quote(path)}" + cmd += f" -P {pipes.quote(path)}" cmd += f" --clear-env -n {name} -- /usr/bin/env" result = ( __salt__["cmd.retcode"]( diff --git a/salt/modules/mac_keychain.py b/salt/modules/mac_keychain.py index 7fdc162b9aa2..a823c428b760 100644 --- a/salt/modules/mac_keychain.py +++ b/salt/modules/mac_keychain.py @@ -11,6 +11,20 @@ import salt.utils.platform +try: + import pipes + + HAS_DEPS = True +except ImportError: + HAS_DEPS = False + +if hasattr(shlex, "quote"): + _quote = shlex.quote +elif HAS_DEPS and hasattr(pipes, "quote"): + _quote = pipes.quote +else: + _quote = None + log = logging.getLogger(__name__) __virtualname__ = "keychain" @@ -20,7 +34,7 @@ def __virtual__(): """ Only work on Mac OS """ - if salt.utils.platform.is_darwin(): + if salt.utils.platform.is_darwin() and _quote is not None: return __virtualname__ return (False, "Only available on Mac OS systems with pipes") @@ -68,7 +82,7 @@ def install( if keychain_password is not None: unlock_keychain(keychain, keychain_password) - cmd = f"security import {cert} -P {password} -k {keychain}" + cmd = "security import {} -P {} -k {}".format(cert, password, keychain) if allow_any: cmd += " -A" return __salt__["cmd.run"](cmd) @@ -103,7 +117,7 @@ def uninstall( if keychain_password is not None: unlock_keychain(keychain, keychain_password) - cmd = f'security delete-certificate -c "{cert_name}" {keychain}' + cmd = 'security delete-certificate -c "{}" {}'.format(cert_name, keychain) return __salt__["cmd.run"](cmd) @@ -123,7 +137,7 @@ def list_certs(keychain="/Library/Keychains/System.keychain"): """ cmd = ( 'security find-certificate -a {} | grep -o "alis".*\\" | ' - "grep -o '\\\"[-A-Za-z0-9.:() ]*\\\"'".format(shlex.quote(keychain)) + "grep -o '\\\"[-A-Za-z0-9.:() ]*\\\"'".format(_quote(keychain)) ) out = __salt__["cmd.run"](cmd, python_shell=True) return out.replace('"', "").split("\n") @@ -151,7 +165,7 @@ def get_friendly_name(cert, password): """ cmd = ( "openssl pkcs12 -in {} -passin pass:{} -info -nodes -nokeys 2> /dev/null | " - "grep friendlyName:".format(shlex.quote(cert), shlex.quote(password)) + "grep friendlyName:".format(_quote(cert), _quote(password)) ) out = __salt__["cmd.run"](cmd, python_shell=True) return out.replace("friendlyName: ", "").strip() @@ -173,7 +187,7 @@ def get_default_keychain(user=None, domain="user"): salt '*' keychain.get_default_keychain """ - cmd = f"security default-keychain -d {domain}" + cmd = "security default-keychain -d {}".format(domain) return __salt__["cmd.run"](cmd, runas=user) @@ -196,7 +210,7 @@ def set_default_keychain(keychain, domain="user", user=None): salt '*' keychain.set_keychain /Users/fred/Library/Keychains/login.keychain """ - cmd = f"security default-keychain -d {domain} -s {keychain}" + cmd = "security default-keychain -d {} -s {}".format(domain, keychain) return __salt__["cmd.run"](cmd, runas=user) @@ -219,7 +233,7 @@ def unlock_keychain(keychain, password): salt '*' keychain.unlock_keychain /tmp/test.p12 test123 """ - cmd = f"security unlock-keychain -p {password} {keychain}" + cmd = "security unlock-keychain -p {} {}".format(password, keychain) __salt__["cmd.run"](cmd) @@ -247,7 +261,7 @@ def get_hash(name, password=None): name, password ) else: - cmd = f'security find-certificate -c "{name}" -m -p' + cmd = 'security find-certificate -c "{}" -m -p'.format(name) out = __salt__["cmd.run"](cmd) matches = re.search( diff --git a/salt/modules/macpackage.py b/salt/modules/macpackage.py index f9a6b7bb95cc..faf5810d4fc7 100644 --- a/salt/modules/macpackage.py +++ b/salt/modules/macpackage.py @@ -9,16 +9,31 @@ import salt.utils.platform -log = logging.getLogger(__name__) +try: + import pipes + + HAS_DEPS = True +except ImportError: + HAS_DEPS = False + +log = logging.getLogger(__name__) __virtualname__ = "macpackage" +if hasattr(shlex, "quote"): + _quote = shlex.quote +elif HAS_DEPS and hasattr(pipes, "quote"): + _quote = pipes.quote +else: + _quote = None + + def __virtual__(): """ Only work on Mac OS """ - if salt.utils.platform.is_darwin(): + if salt.utils.platform.is_darwin() and _quote is not None: return __virtualname__ return (False, "Only available on Mac OS systems with pipes") @@ -45,11 +60,11 @@ def install(pkg, target="LocalSystem", store=False, allow_untrusted=False): """ if "*." not in pkg: # If we use wildcards, we cannot use quotes - pkg = shlex.quote(pkg) + pkg = _quote(pkg) - target = shlex.quote(target) + target = _quote(target) - cmd = f"installer -pkg {pkg} -target {target}" + cmd = "installer -pkg {} -target {}".format(pkg, target) if store: cmd += " -store" if allow_untrusted: @@ -94,7 +109,7 @@ def install_app(app, target="/Applications/"): if not app[-1] == "/": app += "/" - cmd = f'rsync -a --delete "{app}" "{target}"' + cmd = 'rsync -a --delete "{}" "{}"'.format(app, target) return __salt__["cmd.run"](cmd) @@ -139,7 +154,7 @@ def mount(dmg): temp_dir = __salt__["temp.dir"](prefix="dmg-") - cmd = f'hdiutil attach -readonly -nobrowse -mountpoint {temp_dir} "{dmg}"' + cmd = 'hdiutil attach -readonly -nobrowse -mountpoint {} "{}"'.format(temp_dir, dmg) return __salt__["cmd.run"](cmd), temp_dir @@ -161,7 +176,7 @@ def unmount(mountpoint): salt '*' macpackage.unmount /dev/disk2 """ - cmd = f'hdiutil detach "{mountpoint}"' + cmd = 'hdiutil detach "{}"'.format(mountpoint) return __salt__["cmd.run"](cmd) @@ -201,7 +216,7 @@ def get_pkg_id(pkg): salt '*' macpackage.get_pkg_id /tmp/test.pkg """ - pkg = shlex.quote(pkg) + pkg = _quote(pkg) package_ids = [] # Create temp directory @@ -209,7 +224,7 @@ def get_pkg_id(pkg): try: # List all of the PackageInfo files - cmd = f"xar -t -f {pkg} | grep PackageInfo" + cmd = "xar -t -f {} | grep PackageInfo".format(pkg) out = __salt__["cmd.run"](cmd, python_shell=True, output_loglevel="quiet") files = out.split("\n") @@ -249,12 +264,12 @@ def get_mpkg_ids(mpkg): salt '*' macpackage.get_mpkg_ids /dev/disk2 """ - mpkg = shlex.quote(mpkg) + mpkg = _quote(mpkg) package_infos = [] base_path = os.path.dirname(mpkg) # List all of the .pkg files - cmd = f"find {base_path} -name *.pkg" + cmd = "find {} -name *.pkg".format(base_path) out = __salt__["cmd.run"](cmd, python_shell=True) pkg_files = out.split("\n") @@ -266,7 +281,7 @@ def get_mpkg_ids(mpkg): def _get_pkg_id_from_pkginfo(pkginfo): # Find our identifiers - pkginfo = shlex.quote(pkginfo) + pkginfo = _quote(pkginfo) cmd = "cat {} | grep -Eo 'identifier=\"[a-zA-Z.0-9\\-]*\"' | cut -c 13- | tr -d '\"'".format( pkginfo ) @@ -279,8 +294,8 @@ def _get_pkg_id_from_pkginfo(pkginfo): def _get_pkg_id_dir(path): - path = shlex.quote(os.path.join(path, "Contents/Info.plist")) - cmd = f'/usr/libexec/PlistBuddy -c "print :CFBundleIdentifier" {path}' + path = _quote(os.path.join(path, "Contents/Info.plist")) + cmd = '/usr/libexec/PlistBuddy -c "print :CFBundleIdentifier" {}'.format(path) # We can only use wildcards in python_shell which is # sent by the macpackage state diff --git a/salt/modules/openstack_config.py b/salt/modules/openstack_config.py index 937c10da61a4..823afbf1c60d 100644 --- a/salt/modules/openstack_config.py +++ b/salt/modules/openstack_config.py @@ -13,11 +13,28 @@ import salt.exceptions import salt.utils.decorators.path +try: + import pipes + + HAS_DEPS = True +except ImportError: + HAS_DEPS = False + +if hasattr(shlex, "quote"): + _quote = shlex.quote +elif HAS_DEPS and hasattr(pipes, "quote"): + _quote = pipes.quote +else: + _quote = None + + # Don't shadow built-in's. __func_alias__ = {"set_": "set"} def __virtual__(): + if _quote is None and not HAS_DEPS: + return (False, "Missing dependencies") return True @@ -52,10 +69,10 @@ def set_(filename, section, parameter, value): salt-call openstack_config.set /etc/keystone/keystone.conf sql connection foo """ - filename = shlex.quote(filename) - section = shlex.quote(section) - parameter = shlex.quote(parameter) - value = shlex.quote(str(value)) + filename = _quote(filename) + section = _quote(section) + parameter = _quote(parameter) + value = _quote(str(value)) result = __salt__["cmd.run_all"]( "openstack-config --set {} {} {} {}".format( @@ -92,12 +109,12 @@ def get(filename, section, parameter): """ - filename = shlex.quote(filename) - section = shlex.quote(section) - parameter = shlex.quote(parameter) + filename = _quote(filename) + section = _quote(section) + parameter = _quote(parameter) result = __salt__["cmd.run_all"]( - f"openstack-config --get {filename} {section} {parameter}", + "openstack-config --get {} {} {}".format(filename, section, parameter), python_shell=False, ) @@ -128,12 +145,12 @@ def delete(filename, section, parameter): salt-call openstack_config.delete /etc/keystone/keystone.conf sql connection """ - filename = shlex.quote(filename) - section = shlex.quote(section) - parameter = shlex.quote(parameter) + filename = _quote(filename) + section = _quote(section) + parameter = _quote(parameter) result = __salt__["cmd.run_all"]( - f"openstack-config --del {filename} {section} {parameter}", + "openstack-config --del {} {} {}".format(filename, section, parameter), python_shell=False, ) diff --git a/salt/modules/postgres.py b/salt/modules/postgres.py index f73959a92eda..25a72f1063cc 100644 --- a/salt/modules/postgres.py +++ b/salt/modules/postgres.py @@ -46,8 +46,8 @@ import io import logging import os +import pipes import re -import shlex import tempfile import salt.utils.files @@ -136,7 +136,7 @@ def __virtual__(): for util in utils: if not salt.utils.path.which(util): if not _find_pg_binary(util): - return (False, f"{util} was not found") + return (False, "{} was not found".format(util)) return True @@ -241,14 +241,14 @@ def _run_initdb( raise CommandExecutionError("initdb executable not found.") cmd = [ _INITDB_BIN, - f"--pgdata={name}", - f"--username={user}", - f"--auth={auth}", - f"--encoding={encoding}", + "--pgdata={}".format(name), + "--username={}".format(user), + "--auth={}".format(auth), + "--encoding={}".format(encoding), ] if locale is not None: - cmd.append(f"--locale={locale}") + cmd.append("--locale={}".format(locale)) # intentionally use short option, as the long option name has been # renamed from "xlogdir" to "waldir" in PostgreSQL 10 @@ -262,9 +262,9 @@ def _run_initdb( if password is not None: pgpassfile = salt.utils.files.mkstemp(text=True) with salt.utils.files.fopen(pgpassfile, "w") as fp_: - fp_.write(salt.utils.stringutils.to_str(f"{password}")) + fp_.write(salt.utils.stringutils.to_str("{}".format(password))) __salt__["file.chown"](pgpassfile, runas, "") - cmd.extend([f"--pwfile={pgpassfile}"]) + cmd.extend(["--pwfile={}".format(pgpassfile)]) kwargs = dict( runas=runas, @@ -273,7 +273,7 @@ def _run_initdb( "postgres.timeout", default=_DEFAULT_COMMAND_TIMEOUT_SECS ), ) - cmdstr = " ".join([shlex.quote(c) for c in cmd]) + cmdstr = " ".join([pipes.quote(c) for c in cmd]) ret = __salt__["cmd.run_all"](cmdstr, python_shell=False, **kwargs) if ret.get("retcode", 0) != 0: @@ -582,7 +582,9 @@ def _quote_ddl_value(value, quote="'"): if value is None: return None if quote in value: # detect trivial sqli - raise SaltInvocationError(f"Unsupported character {quote} in value: {value}") + raise SaltInvocationError( + "Unsupported character {} in value: {}".format(quote, value) + ) return "{quote}{value}{quote}".format(quote=quote, value=value) @@ -615,7 +617,7 @@ def db_create( """ # Base query to create a database - query = f'CREATE DATABASE "{name}"' + query = 'CREATE DATABASE "{}"'.format(name) # "With"-options to create a database with_args = salt.utils.odict.OrderedDict( @@ -683,9 +685,11 @@ def db_alter( else: queries = [] if owner: - queries.append(f'ALTER DATABASE "{name}" OWNER TO "{owner}"') + queries.append('ALTER DATABASE "{}" OWNER TO "{}"'.format(name, owner)) if tablespace: - queries.append(f'ALTER DATABASE "{name}" SET TABLESPACE "{tablespace}"') + queries.append( + 'ALTER DATABASE "{}" SET TABLESPACE "{}"'.format(name, tablespace) + ) for query in queries: ret = _psql_prepare_and_run( ["-c", query], @@ -722,10 +726,10 @@ def db_remove( salt '*' postgres.db_remove 'dbname' """ for query in [ - f'REVOKE CONNECT ON DATABASE "{name}" FROM public;', + 'REVOKE CONNECT ON DATABASE "{db}" FROM public;'.format(db=name), "SELECT pid, pg_terminate_backend(pid) FROM pg_stat_activity WHERE datname =" " '{db}' AND pid <> pg_backend_pid();".format(db=name), - f'DROP DATABASE "{name}";', + 'DROP DATABASE "{db}";'.format(db=name), ]: ret = _psql_prepare_and_run( ["-c", query], @@ -737,7 +741,7 @@ def db_remove( password=password, ) if ret["retcode"] != 0: - raise Exception(f"Failed: ret={ret}") + raise Exception("Failed: ret={}".format(ret)) return True @@ -842,10 +846,10 @@ def tablespace_create( owner_query = "" options_query = "" if owner: - owner_query = f'OWNER "{owner}"' + owner_query = 'OWNER "{}"'.format(owner) # should come out looking like: 'OWNER postgres' if options: - optionstext = [f"{k} = {v}" for k, v in options.items()] + optionstext = ["{} = {}".format(k, v) for k, v in options.items()] options_query = "WITH ( {} )".format(", ".join(optionstext)) # should come out looking like: 'WITH ( opt1 = 1.0, opt2 = 4.0 )' query = "CREATE TABLESPACE \"{}\" {} LOCATION '{}' {}".format( @@ -898,9 +902,9 @@ def tablespace_alter( queries = [] if new_name: - queries.append(f'ALTER TABLESPACE "{name}" RENAME TO "{new_name}"') + queries.append('ALTER TABLESPACE "{}" RENAME TO "{}"'.format(name, new_name)) if new_owner: - queries.append(f'ALTER TABLESPACE "{name}" OWNER TO "{new_owner}"') + queries.append('ALTER TABLESPACE "{}" OWNER TO "{}"'.format(name, new_owner)) if set_option: queries.append( 'ALTER TABLESPACE "{}" SET ({} = {})'.format( @@ -908,7 +912,7 @@ def tablespace_alter( ) ) if reset_option: - queries.append(f'ALTER TABLESPACE "{name}" RESET ({reset_option})') + queries.append('ALTER TABLESPACE "{}" RESET ({})'.format(name, reset_option)) for query in queries: ret = _psql_prepare_and_run( @@ -946,7 +950,7 @@ def tablespace_remove( .. versionadded:: 2015.8.0 """ - query = f'DROP TABLESPACE "{name}"' + query = 'DROP TABLESPACE "{}"'.format(name) ret = _psql_prepare_and_run( ["-c", query], user=user, @@ -1154,11 +1158,11 @@ def _add_role_flag(string, test, flag, cond=None, prefix="NO", addtxt="", skip=F cond = test if test is not None: if cond: - string = f"{string} {flag}" + string = "{} {}".format(string, flag) else: - string = f"{string} {prefix}{flag}" + string = "{0} {2}{1}".format(string, flag, prefix) if addtxt: - string = f"{string} {addtxt}" + string = "{} {}".format(string, addtxt) return string @@ -1220,7 +1224,7 @@ def _verify_password(role, password, verifier, method): def _md5_password(role, password): return "md5{}".format( hashlib.md5( # nosec - salt.utils.stringutils.to_bytes(f"{password}{role}") + salt.utils.stringutils.to_bytes("{}{}".format(password, role)) ).hexdigest() ) @@ -1339,7 +1343,7 @@ def _role_cmd_args( if isinstance(groups, list): groups = ",".join(groups) for group in groups.split(","): - sub_cmd = f'{sub_cmd}; GRANT "{group}" TO "{name}"' + sub_cmd = '{}; GRANT "{}" TO "{}"'.format(sub_cmd, group, name) return sub_cmd @@ -1376,7 +1380,7 @@ def _role_create( log.info("%s '%s' already exists", typ_.capitalize(), name) return False - sub_cmd = f'CREATE ROLE "{name}" WITH' + sub_cmd = 'CREATE ROLE "{}" WITH'.format(name) sub_cmd = "{} {}".format( sub_cmd, _role_cmd_args( @@ -1502,7 +1506,7 @@ def _role_update( log.info("%s '%s' could not be found", typ_.capitalize(), name) return False - sub_cmd = f'ALTER ROLE "{name}" WITH' + sub_cmd = 'ALTER ROLE "{}" WITH'.format(name) sub_cmd = "{} {}".format( sub_cmd, _role_cmd_args( @@ -1609,7 +1613,7 @@ def _role_remove( return False # user exists, proceed - sub_cmd = f'DROP ROLE "{name}"' + sub_cmd = 'DROP ROLE "{}"'.format(name) _psql_prepare_and_run( ["-c", sub_cmd], runas=runas, @@ -1991,14 +1995,14 @@ def create_extension( args = ["CREATE EXTENSION"] if if_not_exists: args.append("IF NOT EXISTS") - args.append(f'"{name}"') + args.append('"{}"'.format(name)) sargs = [] if schema: - sargs.append(f'SCHEMA "{schema}"') + sargs.append('SCHEMA "{}"'.format(schema)) if ext_version: - sargs.append(f"VERSION {ext_version}") + sargs.append("VERSION {}".format(ext_version)) if from_version: - sargs.append(f"FROM {from_version}") + sargs.append("FROM {}".format(from_version)) if sargs: args.append("WITH") args.extend(sargs) @@ -2007,9 +2011,13 @@ def create_extension( else: args = [] if schema and _EXTENSION_TO_MOVE in mtdata: - args.append(f'ALTER EXTENSION "{name}" SET SCHEMA "{schema}";') + args.append( + 'ALTER EXTENSION "{}" SET SCHEMA "{}";'.format(name, schema) + ) if ext_version and _EXTENSION_TO_UPGRADE in mtdata: - args.append(f'ALTER EXTENSION "{name}" UPDATE TO {ext_version};') + args.append( + 'ALTER EXTENSION "{}" UPDATE TO {};'.format(name, ext_version) + ) cmd = " ".join(args).strip() if cmd: _psql_prepare_and_run( @@ -2219,7 +2227,7 @@ def owner_to( sqlfile = tempfile.NamedTemporaryFile() sqlfile.write("begin;\n") - sqlfile.write(f'alter database "{dbname}" owner to "{ownername}";\n') + sqlfile.write('alter database "{}" owner to "{}";\n'.format(dbname, ownername)) queries = ( # schemas @@ -2327,9 +2335,9 @@ def schema_create( log.info("'%s' already exists in '%s'", name, dbname) return False - sub_cmd = f'CREATE SCHEMA "{name}"' + sub_cmd = 'CREATE SCHEMA "{}"'.format(name) if owner is not None: - sub_cmd = f'{sub_cmd} AUTHORIZATION "{owner}"' + sub_cmd = '{} AUTHORIZATION "{}"'.format(sub_cmd, owner) ret = _psql_prepare_and_run( ["-c", sub_cmd], @@ -2393,7 +2401,7 @@ def schema_remove( return False # schema exists, proceed - sub_cmd = f'DROP SCHEMA "{name}"' + sub_cmd = 'DROP SCHEMA "{}"'.format(name) _psql_prepare_and_run( ["-c", sub_cmd], runas=user, @@ -2713,7 +2721,7 @@ def language_create( log.info("Language %s already exists in %s", name, maintenance_db) return False - query = f"CREATE LANGUAGE {name}" + query = "CREATE LANGUAGE {}".format(name) ret = _psql_prepare_and_run( ["-c", query], @@ -2768,7 +2776,7 @@ def language_remove( log.info("Language %s does not exist in %s", name, maintenance_db) return False - query = f"DROP LANGUAGE {name}" + query = "DROP LANGUAGE {}".format(name) ret = _psql_prepare_and_run( ["-c", query], @@ -3027,7 +3035,9 @@ def _validate_privileges(object_type, privs, privileges): _perms.append("ALL") if object_type not in _PRIVILEGES_OBJECTS: - raise SaltInvocationError(f"Invalid object_type: {object_type} provided") + raise SaltInvocationError( + "Invalid object_type: {} provided".format(object_type) + ) if not set(privs).issubset(set(_perms)): raise SaltInvocationError( @@ -3135,7 +3145,9 @@ def privileges_list( query = _make_privileges_list_query(name, object_type, prepend) if object_type not in _PRIVILEGES_OBJECTS: - raise SaltInvocationError(f"Invalid object_type: {object_type} provided") + raise SaltInvocationError( + "Invalid object_type: {} provided".format(object_type) + ) rows = psql_query( query, @@ -3427,15 +3439,15 @@ def privileges_grant( _grants = ",".join(_privs) if object_type in ["table", "sequence"]: - on_part = f'{prepend}."{object_name}"' + on_part = '{}."{}"'.format(prepend, object_name) elif object_type == "function": - on_part = f"{object_name}" + on_part = "{}".format(object_name) else: - on_part = f'"{object_name}"' + on_part = '"{}"'.format(object_name) if grant_option: if object_type == "group": - query = f'GRANT {object_name} TO "{name}" WITH ADMIN OPTION' + query = 'GRANT {} TO "{}" WITH ADMIN OPTION'.format(object_name, name) elif object_type in ("table", "sequence") and object_name.upper() == "ALL": query = 'GRANT {} ON ALL {}S IN SCHEMA {} TO "{}" WITH GRANT OPTION'.format( _grants, object_type.upper(), prepend, name @@ -3446,7 +3458,7 @@ def privileges_grant( ) else: if object_type == "group": - query = f'GRANT {object_name} TO "{name}"' + query = 'GRANT {} TO "{}"'.format(object_name, name) elif object_type in ("table", "sequence") and object_name.upper() == "ALL": query = 'GRANT {} ON ALL {}S IN SCHEMA {} TO "{}"'.format( _grants, object_type.upper(), prepend, name @@ -3575,12 +3587,12 @@ def privileges_revoke( _grants = ",".join(_privs) if object_type in ["table", "sequence"]: - on_part = f"{prepend}.{object_name}" + on_part = "{}.{}".format(prepend, object_name) else: on_part = object_name if object_type == "group": - query = f"REVOKE {object_name} FROM {name}" + query = "REVOKE {} FROM {}".format(object_name, name) else: query = "REVOKE {} ON {} {} FROM {}".format( _grants, object_type.upper(), on_part, name diff --git a/salt/utils/cloud.py b/salt/utils/cloud.py index a08431305930..841811dcdfe2 100644 --- a/salt/utils/cloud.py +++ b/salt/utils/cloud.py @@ -10,8 +10,8 @@ import logging import multiprocessing import os +import pipes import re -import shlex import shutil import socket import stat @@ -199,7 +199,7 @@ def __ssh_gateway_arguments(kwargs): "-oUserKnownHostsFile=/dev/null", "-oControlPath=none", str(ssh_gateway_key), - f"{ssh_gateway_user}@{ssh_gateway}", + "{}@{}".format(ssh_gateway_user, ssh_gateway), "-p", str(ssh_gateway_port), str(ssh_gateway_command), @@ -228,18 +228,18 @@ def os_script(os_, vm_=None, opts=None, minion=""): # The user provided an absolute path to the deploy script, let's use it return __render_script(os_, vm_, opts, minion) - if os.path.isabs(f"{os_}.sh"): + if os.path.isabs("{}.sh".format(os_)): # The user provided an absolute path to the deploy script, although no # extension was provided. Let's use it anyway. - return __render_script(f"{os_}.sh", vm_, opts, minion) + return __render_script("{}.sh".format(os_), vm_, opts, minion) for search_path in opts["deploy_scripts_search_path"]: if os.path.isfile(os.path.join(search_path, os_)): return __render_script(os.path.join(search_path, os_), vm_, opts, minion) - if os.path.isfile(os.path.join(search_path, f"{os_}.sh")): + if os.path.isfile(os.path.join(search_path, "{}.sh".format(os_))): return __render_script( - os.path.join(search_path, f"{os_}.sh"), vm_, opts, minion + os.path.join(search_path, "{}.sh".format(os_)), vm_, opts, minion ) # No deploy script was found, return an empty string return "" @@ -416,7 +416,7 @@ def bootstrap(vm_, opts=None): ) if key_filename is not None and not os.path.isfile(key_filename): raise SaltCloudConfigError( - f"The defined ssh_keyfile '{key_filename}' does not exist" + "The defined ssh_keyfile '{}' does not exist".format(key_filename) ) has_ssh_agent = False if ( @@ -782,8 +782,8 @@ def wait_for_port( # Don't add new hosts to the host key database "-oStrictHostKeyChecking=no", # make sure ssh can time out on connection lose - f"-oServerAliveInterval={server_alive_interval}", - f"-oServerAliveCountMax={server_alive_count_max}", + "-oServerAliveInterval={}".format(server_alive_interval), + "-oServerAliveCountMax={}".format(server_alive_count_max), # Set hosts key database path to /dev/null, i.e., non-existing "-oUserKnownHostsFile=/dev/null", # Don't re-use the SSH connection. Less failures. @@ -808,21 +808,21 @@ def wait_for_port( ] ) # Netcat command testing remote port - command = f"nc -z -w5 -q0 {host} {port}" + command = "nc -z -w5 -q0 {} {}".format(host, port) # SSH command pcmd = "ssh {} {}@{} -p {} {}".format( " ".join(ssh_args), gateway["ssh_gateway_user"], ssh_gateway, ssh_gateway_port, - shlex.quote("date"), + pipes.quote("date"), ) cmd = "ssh {} {}@{} -p {} {}".format( " ".join(ssh_args), gateway["ssh_gateway_user"], ssh_gateway, ssh_gateway_port, - shlex.quote(command), + pipes.quote(command), ) log.debug("SSH command: '%s'", cmd) @@ -893,7 +893,7 @@ def __init__( service_name=None, ): self.service_name = service_name - self._exe_file = f"{self.service_name}.exe" + self._exe_file = "{}.exe".format(self.service_name) self._client = PsExecClient(server, username, password, port, encrypt) self._client._service = ScmrService(self.service_name, self._client.session) @@ -943,7 +943,7 @@ def remove_service(self, wait_timeout=10, sleep_wait=1): # delete the PAExec executable smb_tree = TreeConnect( self._client.session, - rf"\\{self._client.connection.server_name}\ADMIN$", + r"\\{}\ADMIN$".format(self._client.connection.server_name), ) log.info("Connecting to SMB Tree %s", smb_tree.share_name) smb_tree.connect() @@ -968,10 +968,10 @@ def run_winexe_command(cmd, args, host, username, password, port=445): """ Run a command remotely via the winexe executable """ - creds = f"-U '{username}%{password}' //{host}" - logging_creds = f"-U '{username}%XXX-REDACTED-XXX' //{host}" - cmd = f"winexe {creds} {cmd} {args}" - logging_cmd = f"winexe {logging_creds} {cmd} {args}" + creds = "-U '{}%{}' //{}".format(username, password, host) + logging_creds = "-U '{}%XXX-REDACTED-XXX' //{}".format(username, host) + cmd = "winexe {} {} {}".format(creds, cmd, args) + logging_cmd = "winexe {} {} {}".format(logging_creds, cmd, args) return win_cmd(cmd, logging_command=logging_cmd) @@ -979,7 +979,7 @@ def run_psexec_command(cmd, args, host, username, password, port=445): """ Run a command remotely using the psexec protocol """ - service_name = f"PS-Exec-{uuid.uuid4()}" + service_name = "PS-Exec-{}".format(uuid.uuid4()) with Client( host, username, password, port=port, encrypt=False, service_name=service_name ) as client: @@ -1098,7 +1098,7 @@ def validate_windows_cred_winexe( """ Check if the windows credentials are valid """ - cmd = f"winexe -U '{username}%{password}' //{host} \"hostname\"" + cmd = "winexe -U '{}%{}' //{} \"hostname\"".format(username, password, host) logging_cmd = "winexe -U '{}%XXX-REDACTED-XXX' //{} \"hostname\"".format( username, host ) @@ -1240,7 +1240,7 @@ def deploy_windows( winrm_port=5986, winrm_use_ssl=True, winrm_verify_ssl=True, - **kwargs, + **kwargs ): """ Copy the install files to a remote Windows box, and execute them @@ -1299,20 +1299,20 @@ def deploy_windows( salt.utils.smb.mkdirs("salttemp", conn=smb_conn) root_dir = "ProgramData/Salt Project/Salt" - salt.utils.smb.mkdirs(f"{root_dir}/conf/pki/minion", conn=smb_conn) + salt.utils.smb.mkdirs("{}/conf/pki/minion".format(root_dir), conn=smb_conn) root_dir = "ProgramData\\Salt Project\\Salt" if minion_pub: salt.utils.smb.put_str( minion_pub, - f"{root_dir}\\conf\\pki\\minion\\minion.pub", + "{}\\conf\\pki\\minion\\minion.pub".format(root_dir), conn=smb_conn, ) if minion_pem: salt.utils.smb.put_str( minion_pem, - f"{root_dir}\\conf\\pki\\minion\\minion.pem", + "{}\\conf\\pki\\minion\\minion.pem".format(root_dir), conn=smb_conn, ) @@ -1324,7 +1324,7 @@ def deploy_windows( try: salt.utils.smb.put_file( master_sign_pub_file, - f"{root_dir}\\conf\\pki\\minion\\master_sign.pub", + "{}\\conf\\pki\\minion\\master_sign.pub".format(root_dir), conn=smb_conn, ) except Exception as e: # pylint: disable=broad-except @@ -1342,16 +1342,16 @@ def deploy_windows( installer = comps[-1] salt.utils.smb.put_file( win_installer, - f"salttemp\\{installer}", + "salttemp\\{}".format(installer), "C$", conn=smb_conn, ) - cmd = f"c:\\salttemp\\{installer}" + cmd = "c:\\salttemp\\{}".format(installer) args = [ "/S", - f"/master={_format_master_param(master)}", - f"/minion-name={name}", + "/master={}".format(_format_master_param(master)), + "/minion-name={}".format(name), ] if use_winrm: @@ -1362,7 +1362,7 @@ def deploy_windows( ) if ret_code != 0: - raise Exception(f"Fail installer {ret_code}") + raise Exception("Fail installer {}".format(ret_code)) # Copy over minion_conf if minion_conf: @@ -1378,7 +1378,7 @@ def deploy_windows( if minion_grains: salt.utils.smb.put_str( salt_config_to_yaml(minion_grains, line_break="\r\n"), - f"{root_dir}\\conf\\grains", + "{}\\conf\\grains".format(root_dir), conn=smb_conn, ) # Add special windows minion configuration @@ -1395,7 +1395,7 @@ def deploy_windows( minion_conf = dict(minion_conf, **windows_minion_conf) salt.utils.smb.put_str( salt_config_to_yaml(minion_conf, line_break="\r\n"), - f"{root_dir}\\conf\\minion", + "{}\\conf\\minion".format(root_dir), conn=smb_conn, ) # Delete C:\salttmp\ and installer file @@ -1405,7 +1405,7 @@ def deploy_windows( winrm_cmd(winrm_session, "rmdir", ["/Q", "/S", "C:\\salttemp\\"]) else: salt.utils.smb.delete_file( - f"salttemp\\{installer}", "C$", conn=smb_conn + "salttemp\\{}".format(installer), "C$", conn=smb_conn ) salt.utils.smb.delete_directory("salttemp", "C$", conn=smb_conn) # Shell out to psexec to ensure salt-minion service started @@ -1429,8 +1429,8 @@ def deploy_windows( # Fire deploy action fire_event( "event", - f"{name} has been deployed at {host}", - f"salt/cloud/{name}/deploy_windows", + "{} has been deployed at {}".format(name, host), + "salt/cloud/{}/deploy_windows".format(name), args={"name": name}, sock_dir=opts.get("sock_dir", os.path.join(__opts__["sock_dir"], "master")), transport=opts.get("transport", "zeromq"), @@ -1480,7 +1480,7 @@ def deploy_script( master_sign_pub_file=None, cloud_grains=None, force_minion_config=False, - **kwargs, + **kwargs ): """ Copy a deploy script to a remote server, execute it, and remove it @@ -1496,7 +1496,7 @@ def deploy_script( ) if key_filename is not None and not os.path.isfile(key_filename): raise SaltCloudConfigError( - f"The defined key_filename '{key_filename}' does not exist" + "The defined key_filename '{}' does not exist".format(key_filename) ) gateway = None @@ -1543,28 +1543,35 @@ def deploy_script( ssh_kwargs["password"] = password if root_cmd( - f"test -e '{tmp_dir}'", tty, sudo, allow_failure=True, **ssh_kwargs + "test -e '{}'".format(tmp_dir), + tty, + sudo, + allow_failure=True, + **ssh_kwargs ): ret = root_cmd( - f"sh -c \"( mkdir -p -m 700 '{tmp_dir}' )\"", + "sh -c \"( mkdir -p -m 700 '{}' )\"".format(tmp_dir), tty, sudo, - **ssh_kwargs, + **ssh_kwargs ) if ret: raise SaltCloudSystemExit( - f"Can't create temporary directory in {tmp_dir} !" + "Can't create temporary directory in {} !".format(tmp_dir) ) if sudo: comps = tmp_dir.lstrip("/").rstrip("/").split("/") if comps: if len(comps) > 1 or comps[0] != "tmp": ret = root_cmd( - f'chown {username} "{tmp_dir}"', tty, sudo, **ssh_kwargs + 'chown {} "{}"'.format(username, tmp_dir), + tty, + sudo, + **ssh_kwargs ) if ret: raise SaltCloudSystemExit( - f"Cant set {username} ownership on {tmp_dir}" + "Cant set {} ownership on {}".format(username, tmp_dir) ) if not isinstance(file_map, dict): @@ -1594,13 +1601,15 @@ def deploy_script( remote_dir = os.path.dirname(remote_file) if remote_dir not in remote_dirs: - root_cmd(f"mkdir -p '{remote_dir}'", tty, sudo, **ssh_kwargs) + root_cmd( + "mkdir -p '{}'".format(remote_dir), tty, sudo, **ssh_kwargs + ) if ssh_kwargs["username"] != "root": root_cmd( "chown {} '{}'".format(ssh_kwargs["username"], remote_dir), tty, sudo, - **ssh_kwargs, + **ssh_kwargs ) remote_dirs.append(remote_dir) ssh_file(opts, remote_file, kwargs=ssh_kwargs, local_file=local_file) @@ -1608,21 +1617,21 @@ def deploy_script( # Minion configuration if minion_pem: - ssh_file(opts, f"{tmp_dir}/minion.pem", minion_pem, ssh_kwargs) + ssh_file(opts, "{}/minion.pem".format(tmp_dir), minion_pem, ssh_kwargs) ret = root_cmd( - f"chmod 600 '{tmp_dir}/minion.pem'", tty, sudo, **ssh_kwargs + "chmod 600 '{}/minion.pem'".format(tmp_dir), tty, sudo, **ssh_kwargs ) if ret: raise SaltCloudSystemExit( - f"Can't set perms on {tmp_dir}/minion.pem" + "Can't set perms on {}/minion.pem".format(tmp_dir) ) if minion_pub: - ssh_file(opts, f"{tmp_dir}/minion.pub", minion_pub, ssh_kwargs) + ssh_file(opts, "{}/minion.pub".format(tmp_dir), minion_pub, ssh_kwargs) if master_sign_pub_file: ssh_file( opts, - f"{tmp_dir}/master_sign.pub", + "{}/master_sign.pub".format(tmp_dir), kwargs=ssh_kwargs, local_file=master_sign_pub_file, ) @@ -1640,7 +1649,7 @@ def deploy_script( if minion_grains: ssh_file( opts, - f"{tmp_dir}/grains", + "{}/grains".format(tmp_dir), salt_config_to_yaml(minion_grains), ssh_kwargs, ) @@ -1648,22 +1657,24 @@ def deploy_script( minion_conf["grains"] = {"salt-cloud": cloud_grains} ssh_file( opts, - f"{tmp_dir}/minion", + "{}/minion".format(tmp_dir), salt_config_to_yaml(minion_conf), ssh_kwargs, ) # Master configuration if master_pem: - ssh_file(opts, f"{tmp_dir}/master.pem", master_pem, ssh_kwargs) + ssh_file(opts, "{}/master.pem".format(tmp_dir), master_pem, ssh_kwargs) ret = root_cmd( - f"chmod 600 '{tmp_dir}/master.pem'", tty, sudo, **ssh_kwargs + "chmod 600 '{}/master.pem'".format(tmp_dir), tty, sudo, **ssh_kwargs ) if ret: - raise SaltCloudSystemExit(f"Cant set perms on {tmp_dir}/master.pem") + raise SaltCloudSystemExit( + "Cant set perms on {}/master.pem".format(tmp_dir) + ) if master_pub: - ssh_file(opts, f"{tmp_dir}/master.pub", master_pub, ssh_kwargs) + ssh_file(opts, "{}/master.pub".format(tmp_dir), master_pub, ssh_kwargs) if master_conf: if not isinstance(master_conf, dict): @@ -1677,31 +1688,34 @@ def deploy_script( ssh_file( opts, - f"{tmp_dir}/master", + "{}/master".format(tmp_dir), salt_config_to_yaml(master_conf), ssh_kwargs, ) # XXX: We need to make these paths configurable - preseed_minion_keys_tempdir = f"{tmp_dir}/preseed-minion-keys" + preseed_minion_keys_tempdir = "{}/preseed-minion-keys".format(tmp_dir) if preseed_minion_keys is not None: # Create remote temp dir ret = root_cmd( - f"mkdir '{preseed_minion_keys_tempdir}'", tty, sudo, **ssh_kwargs + "mkdir '{}'".format(preseed_minion_keys_tempdir), + tty, + sudo, + **ssh_kwargs ) if ret: raise SaltCloudSystemExit( - f"Cant create {preseed_minion_keys_tempdir}" + "Cant create {}".format(preseed_minion_keys_tempdir) ) ret = root_cmd( - f"chmod 700 '{preseed_minion_keys_tempdir}'", + "chmod 700 '{}'".format(preseed_minion_keys_tempdir), tty, sudo, - **ssh_kwargs, + **ssh_kwargs ) if ret: raise SaltCloudSystemExit( - f"Can't set perms on {preseed_minion_keys_tempdir}" + "Can't set perms on {}".format(preseed_minion_keys_tempdir) ) if ssh_kwargs["username"] != "root": root_cmd( @@ -1710,7 +1724,7 @@ def deploy_script( ), tty, sudo, - **ssh_kwargs, + **ssh_kwargs ) # Copy pre-seed minion keys @@ -1720,10 +1734,10 @@ def deploy_script( if ssh_kwargs["username"] != "root": root_cmd( - f"chown -R root '{preseed_minion_keys_tempdir}'", + "chown -R root '{}'".format(preseed_minion_keys_tempdir), tty, sudo, - **ssh_kwargs, + **ssh_kwargs ) if ret: raise SaltCloudSystemExit( @@ -1737,21 +1751,25 @@ def deploy_script( for command in preflight_cmds: cmd_ret = root_cmd(command, tty, sudo, **ssh_kwargs) if cmd_ret: - raise SaltCloudSystemExit(f"Pre-flight command failed: '{command}'") + raise SaltCloudSystemExit( + "Pre-flight command failed: '{}'".format(command) + ) # The actual deploy script if script: # got strange escaping issues with sudoer, going onto a # subshell fixes that - ssh_file(opts, f"{tmp_dir}/deploy.sh", script, ssh_kwargs) + ssh_file(opts, "{}/deploy.sh".format(tmp_dir), script, ssh_kwargs) ret = root_cmd( - f"sh -c \"( chmod +x '{tmp_dir}/deploy.sh' )\";exit $?", + "sh -c \"( chmod +x '{}/deploy.sh' )\";exit $?".format(tmp_dir), tty, sudo, - **ssh_kwargs, + **ssh_kwargs ) if ret: - raise SaltCloudSystemExit(f"Can't set perms on {tmp_dir}/deploy.sh") + raise SaltCloudSystemExit( + "Can't set perms on {}/deploy.sh".format(tmp_dir) + ) time_used = time.mktime(time.localtime()) - time.mktime(starttime) newtimeout = timeout - time_used @@ -1767,7 +1785,7 @@ def deploy_script( kwargs=dict( name=name, sock_dir=sock_dir, timeout=newtimeout, queue=queue ), - name=f"DeployScriptCheckAuth({name})", + name="DeployScriptCheckAuth({})".format(name), ) log.debug("Starting new process to wait for salt-minion") process.start() @@ -1775,7 +1793,7 @@ def deploy_script( # Run the deploy script if script: if "bootstrap-salt" in script: - deploy_command += f" -c '{tmp_dir}'" + deploy_command += " -c '{}'".format(tmp_dir) if force_minion_config: deploy_command += " -F" if make_syndic is True: @@ -1787,9 +1805,9 @@ def deploy_script( if keep_tmp is True: deploy_command += " -K" if preseed_minion_keys is not None: - deploy_command += f" -k '{preseed_minion_keys_tempdir}'" + deploy_command += " -k '{}'".format(preseed_minion_keys_tempdir) if script_args: - deploy_command += f" {script_args}" + deploy_command += " {}".format(script_args) if script_env: if not isinstance(script_env, dict): @@ -1808,15 +1826,15 @@ def deploy_script( # Upload our environ setter wrapper ssh_file( opts, - f"{tmp_dir}/environ-deploy-wrapper.sh", + "{}/environ-deploy-wrapper.sh".format(tmp_dir), "\n".join(environ_script_contents), ssh_kwargs, ) root_cmd( - f"chmod +x '{tmp_dir}/environ-deploy-wrapper.sh'", + "chmod +x '{}/environ-deploy-wrapper.sh'".format(tmp_dir), tty, sudo, - **ssh_kwargs, + **ssh_kwargs ) # The deploy command is now our wrapper deploy_command = "'{}/environ-deploy-wrapper.sh'".format( @@ -1824,20 +1842,22 @@ def deploy_script( ) if root_cmd(deploy_command, tty, sudo, **ssh_kwargs) != 0: raise SaltCloudSystemExit( - f"Executing the command '{deploy_command}' failed" + "Executing the command '{}' failed".format(deploy_command) ) log.debug("Executed command '%s'", deploy_command) # Remove the deploy script if not keep_tmp: - root_cmd(f"rm -f '{tmp_dir}/deploy.sh'", tty, sudo, **ssh_kwargs) + root_cmd( + "rm -f '{}/deploy.sh'".format(tmp_dir), tty, sudo, **ssh_kwargs + ) log.debug("Removed %s/deploy.sh", tmp_dir) if script_env: root_cmd( - f"rm -f '{tmp_dir}/environ-deploy-wrapper.sh'", + "rm -f '{}/environ-deploy-wrapper.sh'".format(tmp_dir), tty, sudo, - **ssh_kwargs, + **ssh_kwargs ) log.debug("Removed %s/environ-deploy-wrapper.sh", tmp_dir) @@ -1846,40 +1866,57 @@ def deploy_script( else: # Remove minion configuration if minion_pub: - root_cmd(f"rm -f '{tmp_dir}/minion.pub'", tty, sudo, **ssh_kwargs) + root_cmd( + "rm -f '{}/minion.pub'".format(tmp_dir), tty, sudo, **ssh_kwargs + ) log.debug("Removed %s/minion.pub", tmp_dir) if minion_pem: - root_cmd(f"rm -f '{tmp_dir}/minion.pem'", tty, sudo, **ssh_kwargs) + root_cmd( + "rm -f '{}/minion.pem'".format(tmp_dir), tty, sudo, **ssh_kwargs + ) log.debug("Removed %s/minion.pem", tmp_dir) if minion_conf: - root_cmd(f"rm -f '{tmp_dir}/grains'", tty, sudo, **ssh_kwargs) + root_cmd( + "rm -f '{}/grains'".format(tmp_dir), tty, sudo, **ssh_kwargs + ) log.debug("Removed %s/grains", tmp_dir) - root_cmd(f"rm -f '{tmp_dir}/minion'", tty, sudo, **ssh_kwargs) + root_cmd( + "rm -f '{}/minion'".format(tmp_dir), tty, sudo, **ssh_kwargs + ) log.debug("Removed %s/minion", tmp_dir) if master_sign_pub_file: root_cmd( - f"rm -f {tmp_dir}/master_sign.pub", tty, sudo, **ssh_kwargs + "rm -f {}/master_sign.pub".format(tmp_dir), + tty, + sudo, + **ssh_kwargs ) log.debug("Removed %s/master_sign.pub", tmp_dir) # Remove master configuration if master_pub: - root_cmd(f"rm -f '{tmp_dir}/master.pub'", tty, sudo, **ssh_kwargs) + root_cmd( + "rm -f '{}/master.pub'".format(tmp_dir), tty, sudo, **ssh_kwargs + ) log.debug("Removed %s/master.pub", tmp_dir) if master_pem: - root_cmd(f"rm -f '{tmp_dir}/master.pem'", tty, sudo, **ssh_kwargs) + root_cmd( + "rm -f '{}/master.pem'".format(tmp_dir), tty, sudo, **ssh_kwargs + ) log.debug("Removed %s/master.pem", tmp_dir) if master_conf: - root_cmd(f"rm -f '{tmp_dir}/master'", tty, sudo, **ssh_kwargs) + root_cmd( + "rm -f '{}/master'".format(tmp_dir), tty, sudo, **ssh_kwargs + ) log.debug("Removed %s/master", tmp_dir) # Remove pre-seed keys directory if preseed_minion_keys is not None: root_cmd( - f"rm -rf '{preseed_minion_keys_tempdir}'", + "rm -rf '{}'".format(preseed_minion_keys_tempdir), tty, sudo, - **ssh_kwargs, + **ssh_kwargs ) log.debug("Removed %s", preseed_minion_keys_tempdir) @@ -1894,13 +1931,15 @@ def deploy_script( # for line in output: # print(line) log.info("Executing %s on the salt-minion", start_action) - root_cmd(f"salt-call {start_action}", tty, sudo, **ssh_kwargs) + root_cmd( + "salt-call {}".format(start_action), tty, sudo, **ssh_kwargs + ) log.info("Finished executing %s on the salt-minion", start_action) # Fire deploy action fire_event( "event", - f"{name} has been deployed at {host}", - f"salt/cloud/{name}/deploy_script", + "{} has been deployed at {}".format(name, host), + "salt/cloud/{}/deploy_script".format(name), args={"name": name, "host": host}, sock_dir=opts.get( "sock_dir", os.path.join(__opts__["sock_dir"], "master") @@ -1933,7 +1972,7 @@ def run_inline_script( tty=None, opts=None, tmp_dir="/tmp/.saltcloud-inline_script", - **kwargs, + **kwargs ): """ Run the inline script commands, one by one @@ -1990,11 +2029,11 @@ def run_inline_script( # TODO: check edge cases (e.g. ssh gateways, salt deploy disabled, etc.) if ( root_cmd( - f'test -e \\"{tmp_dir}\\"', + 'test -e \\"{}\\"'.format(tmp_dir), tty, sudo, allow_failure=True, - **ssh_kwargs, + **ssh_kwargs ) and inline_script ): @@ -2002,11 +2041,11 @@ def run_inline_script( for cmd_line in inline_script: log.info("Executing inline command: %s", cmd_line) ret = root_cmd( - f'sh -c "( {cmd_line} )"', + 'sh -c "( {} )"'.format(cmd_line), tty, sudo, allow_failure=True, - **ssh_kwargs, + **ssh_kwargs ) if ret: log.info("[%s] Output: %s", cmd_line, ret) @@ -2110,7 +2149,7 @@ def _exec_ssh_cmd(cmd, error_msg=None, allow_failure=False, **kwargs): time.sleep(0.5) if proc.exitstatus != 0 and allow_failure is False: raise SaltCloudSystemExit( - f"Command '{cmd}' failed. Exit code: {proc.exitstatus}" + "Command '{}' failed. Exit code: {}".format(cmd, proc.exitstatus) ) return proc.exitstatus except salt.utils.vt.TerminalException as err: @@ -2213,7 +2252,7 @@ def scp_file(dest_path, contents=None, kwargs=None, local_file=None): cmd, error_msg="Failed to upload file '{0}': {1}\n{2}", password_retries=3, - **kwargs, + **kwargs ) finally: if contents is not None: @@ -2331,7 +2370,7 @@ def sftp_file(dest_path, contents=None, kwargs=None, local_file=None): cmd, error_msg="Failed to upload file '{0}': {1}\n{2}", password_retries=3, - **kwargs, + **kwargs ) finally: if contents is not None: @@ -2391,11 +2430,11 @@ def root_cmd(command, tty, sudo, allow_failure=False, **kwargs): if sudo: if sudo_password is None: - command = f"sudo {command}" + command = "sudo {}".format(command) logging_command = command else: - logging_command = f'sudo -S "XXX-REDACTED-XXX" {command}' - command = f"sudo -S {command}" + logging_command = 'sudo -S "XXX-REDACTED-XXX" {}'.format(command) + command = "sudo -S {}".format(command) log.debug("Using sudo to run command %s", logging_command) @@ -2414,9 +2453,9 @@ def root_cmd(command, tty, sudo, allow_failure=False, **kwargs): ssh_args.extend( [ # Don't add new hosts to the host key database - f"-oStrictHostKeyChecking={host_key_checking}", + "-oStrictHostKeyChecking={}".format(host_key_checking), # Set hosts key database path to /dev/null, i.e., non-existing - f"-oUserKnownHostsFile={known_hosts_file}", + "-oUserKnownHostsFile={}".format(known_hosts_file), # Don't re-use the SSH connection. Less failures. "-oControlPath=none", ] @@ -2449,12 +2488,12 @@ def root_cmd(command, tty, sudo, allow_failure=False, **kwargs): cmd = "ssh {0} {1[username]}@{1[hostname]} ".format(" ".join(ssh_args), kwargs) logging_command = cmd + logging_command - cmd = cmd + shlex.quote(command) + cmd = cmd + pipes.quote(command) hard_timeout = kwargs.get("hard_timeout") if hard_timeout is not None: - logging_command = f"timeout {hard_timeout} {logging_command}" - cmd = f"timeout {hard_timeout} {cmd}" + logging_command = "timeout {} {}".format(hard_timeout, logging_command) + cmd = "timeout {} {}".format(hard_timeout, cmd) log.debug("SSH command: '%s'", logging_command) @@ -2476,7 +2515,7 @@ def check_auth(name, sock_dir=None, queue=None, timeout=300): ret = event.get_event(full=True) if ret is None: continue - if ret["tag"] == f"salt/minion/{name}/start": + if ret["tag"] == "salt/minion/{}/start".format(name): queue.put(name) newtimeout = 0 log.debug("Minion %s is ready to receive commands", name) @@ -2522,7 +2561,7 @@ def check_name(name, safe_chars): """ Check whether the specified name contains invalid characters """ - regexp = re.compile(f"[^{safe_chars}]") + regexp = re.compile("[^{}]".format(safe_chars)) if regexp.search(name): raise SaltCloudException( "{} contains characters not supported by this cloud provider. " @@ -2816,7 +2855,7 @@ def request_minion_cachedir( "provider": provider, } - fname = f"{minion_id}.p" + fname = "{}.p".format(minion_id) path = os.path.join(base, "requested", fname) with salt.utils.files.fopen(path, "wb") as fh_: salt.utils.msgpack.dump(data, fh_, encoding=MSGPACK_ENCODING) @@ -2847,7 +2886,7 @@ def change_minion_cachedir( if base is None: base = __opts__["cachedir"] - fname = f"{minion_id}.p" + fname = "{}.p".format(minion_id) path = os.path.join(base, cachedir, fname) with salt.utils.files.fopen(path, "r") as fh_: @@ -2870,7 +2909,7 @@ def activate_minion_cachedir(minion_id, base=None): if base is None: base = __opts__["cachedir"] - fname = f"{minion_id}.p" + fname = "{}.p".format(minion_id) src = os.path.join(base, "requested", fname) dst = os.path.join(base, "active") shutil.move(src, dst) @@ -2892,7 +2931,7 @@ def delete_minion_cachedir(minion_id, provider, opts, base=None): base = __opts__["cachedir"] driver = next(iter(__opts__["providers"][provider].keys())) - fname = f"{minion_id}.p" + fname = "{}.p".format(minion_id) for cachedir in "requested", "active": path = os.path.join(base, cachedir, driver, provider, fname) log.debug("path: %s", path) @@ -2985,7 +3024,7 @@ def update_bootstrap(config, url=None): # in last case, assuming we got a script content else: script_content = url - script_name = f"{hashlib.sha1(script_content).hexdigest()}.sh" + script_name = "{}.sh".format(hashlib.sha1(script_content).hexdigest()) if not script_content: raise ValueError("No content in bootstrap script !") @@ -3079,7 +3118,7 @@ def cache_node_list(nodes, provider, opts): for node in nodes: diff_node_cache(prov_dir, node, nodes[node], opts) - path = os.path.join(prov_dir, f"{node}.p") + path = os.path.join(prov_dir, "{}.p".format(node)) with salt.utils.files.fopen(path, "wb") as fh_: salt.utils.msgpack.dump(nodes[node], fh_, encoding=MSGPACK_ENCODING) @@ -3134,7 +3173,7 @@ def missing_node_cache(prov_dir, node_list, provider, opts): fire_event( "event", "cached node missing from provider", - f"salt/cloud/{node}/cache_node_missing", + "salt/cloud/{}/cache_node_missing".format(node), args={"missing node": node}, sock_dir=opts.get( "sock_dir", os.path.join(__opts__["sock_dir"], "master") @@ -3162,7 +3201,7 @@ def diff_node_cache(prov_dir, node, new_data, opts): if node is None: return - path = f"{os.path.join(prov_dir, node)}.p" + path = "{}.p".format(os.path.join(prov_dir, node)) if not os.path.exists(path): event_data = _strip_cache_events(new_data, opts) @@ -3170,7 +3209,7 @@ def diff_node_cache(prov_dir, node, new_data, opts): fire_event( "event", "new node found", - f"salt/cloud/{node}/cache_node_new", + "salt/cloud/{}/cache_node_new".format(node), args={"new_data": event_data}, sock_dir=opts.get("sock_dir", os.path.join(__opts__["sock_dir"], "master")), transport=opts.get("transport", "zeromq"), @@ -3194,7 +3233,7 @@ def diff_node_cache(prov_dir, node, new_data, opts): fire_event( "event", "node data differs", - f"salt/cloud/{node}/cache_node_diff", + "salt/cloud/{}/cache_node_diff".format(node), args={ "new_data": _strip_cache_events(new_data, opts), "cache_data": _strip_cache_events(cache_data, opts), @@ -3238,7 +3277,7 @@ def _salt_cloud_force_ascii(exc): errors. """ if not isinstance(exc, (UnicodeEncodeError, UnicodeTranslateError)): - raise TypeError(f"Can't handle {exc}") + raise TypeError("Can't handle {}".format(exc)) unicode_trans = { # Convert non-breaking space to space @@ -3298,7 +3337,7 @@ def store_password_in_keyring(credential_id, username, password=None): # pylint: enable=import-error if password is None: - prompt = f"Please enter password for {credential_id}: " + prompt = "Please enter password for {}: ".format(credential_id) try: password = getpass.getpass(prompt) except EOFError: diff --git a/salt/utils/jinja.py b/salt/utils/jinja.py index d90957a0087c..a6a8a2796051 100644 --- a/salt/utils/jinja.py +++ b/salt/utils/jinja.py @@ -2,12 +2,13 @@ Jinja loading utils to enable a more powerful backend for jinja templates """ + import itertools import logging import os.path +import pipes import pprint import re -import shlex import time import uuid import warnings @@ -241,11 +242,11 @@ def __str__(self): if isinstance(value, str): # keeps quotes around strings # pylint: disable=repr-flag-used-in-string - output.append(f"{key!r}: {value!r}") + output.append("{!r}: {!r}".format(key, value)) # pylint: enable=repr-flag-used-in-string else: # let default output - output.append(f"{key!r}: {value!s}") + output.append("{!r}: {!s}".format(key, value)) return "{" + ", ".join(output) + "}" def __repr__(self): # pylint: disable=W0221 @@ -254,7 +255,7 @@ def __repr__(self): # pylint: disable=W0221 # Raw string formatter required here because this is a repr # function. # pylint: disable=repr-flag-used-in-string - output.append(f"{key!r}: {value!r}") + output.append("{!r}: {!r}".format(key, value)) # pylint: enable=repr-flag-used-in-string return "{" + ", ".join(output) + "}" @@ -440,7 +441,7 @@ def quote(txt): 'my_text' """ - return shlex.quote(txt) + return pipes.quote(txt) @jinja_filter() @@ -1094,13 +1095,13 @@ def load_yaml(self, value): # to the stringified version of the exception. msg += str(exc) else: - msg += f"{problem}\n" + msg += "{}\n".format(problem) msg += salt.utils.stringutils.get_context( buf, line, marker=" <======================" ) raise TemplateRuntimeError(msg) except AttributeError: - raise TemplateRuntimeError(f"Unable to load yaml from {value}") + raise TemplateRuntimeError("Unable to load yaml from {}".format(value)) def load_json(self, value): if isinstance(value, TemplateModule): @@ -1108,7 +1109,7 @@ def load_json(self, value): try: return salt.utils.json.loads(value) except (ValueError, TypeError, AttributeError): - raise TemplateRuntimeError(f"Unable to load json from {value}") + raise TemplateRuntimeError("Unable to load json from {}".format(value)) def load_text(self, value): if isinstance(value, TemplateModule): @@ -1143,7 +1144,7 @@ def parse_profile(self, parser): return self._parse_profile_block(parser, label, "profile block", body, lineno) def _create_profile_id(self, parser): - return f"_salt_profile_{parser.free_identifier().name}" + return "_salt_profile_{}".format(parser.free_identifier().name) def _profile_start(self, label, source): return (label, source, time.time()) @@ -1185,7 +1186,7 @@ def parse_load(self, parser): filter_name = parser.stream.current.value lineno = next(parser.stream).lineno if filter_name not in self.environment.filters: - parser.fail(f"Unable to parse {filter_name}", lineno) + parser.fail("Unable to parse {}".format(filter_name), lineno) parser.stream.expect("name:as") target = parser.parse_assign_target() @@ -1224,7 +1225,7 @@ def parse_import(self, parser, converter): nodes.Name(target, "store").set_lineno(lineno), nodes.Filter( nodes.Name(target, "load").set_lineno(lineno), - f"load_{converter}", + "load_{}".format(converter), [], [], None, @@ -1233,7 +1234,7 @@ def parse_import(self, parser, converter): ).set_lineno(lineno), ] return self._parse_profile_block( - parser, import_node.template, f"import_{converter}", body, lineno + parser, import_node.template, "import_{}".format(converter), body, lineno ) def dict_to_sls_yaml_params(self, value, flow_style=False): From ef6ec3a43786fd84e1cf1860b505e02153efffff Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Tue, 27 Jun 2023 08:05:57 +0100 Subject: [PATCH 11/13] Revert "Stop using the deprecated `cgi` module." This reverts commit 72fc1094cef37fd433d560bd094b611f38b7dd5b. --- salt/utils/http.py | 48 ++++++++++++++++++++++++++-------------------- 1 file changed, 27 insertions(+), 21 deletions(-) diff --git a/salt/utils/http.py b/salt/utils/http.py index 53a03377df65..9928847ed629 100644 --- a/salt/utils/http.py +++ b/salt/utils/http.py @@ -5,7 +5,7 @@ .. versionadded:: 2015.5.0 """ -import email.message +import cgi import gzip import http.client import http.cookiejar @@ -85,7 +85,7 @@ HAS_CERTIFI = False log = logging.getLogger(__name__) -USERAGENT = f"Salt/{salt.version.__version__}" +USERAGENT = "Salt/{}".format(salt.version.__version__) def __decompressContent(coding, pgctnt): @@ -171,7 +171,7 @@ def query( formdata_fieldname=None, formdata_filename=None, decode_body=True, - **kwargs, + **kwargs ): """ Query a resource, and decode the return data @@ -296,7 +296,7 @@ def query( auth = (username, password) if agent == USERAGENT: - agent = f"{agent} http.query()" + agent = "{} http.query()".format(agent) header_dict["User-agent"] = agent if backend == "requests": @@ -361,14 +361,14 @@ def query( url, params=params, files={formdata_fieldname: (formdata_filename, io.StringIO(data))}, - **req_kwargs, + **req_kwargs ) else: result = sess.request(method, url, params=params, data=data, **req_kwargs) result.raise_for_status() if stream is True: # fake a HTTP response header - header_callback(f"HTTP/1.0 {result.status_code} MESSAGE") + header_callback("HTTP/1.0 {} MESSAGE".format(result.status_code)) # fake streaming the content streaming_callback(result.content) return { @@ -484,12 +484,15 @@ def query( result_headers = dict(result.info()) result_text = result.read() if "Content-Type" in result_headers: - msg = email.message.EmailMessage() - msg.add_header("Content-Type", result_headers["Content-Type"]) - if msg.get_content_type().startswith("text/"): - content_charset = msg.get_content_charset() - if content_charset and not isinstance(result_text, str): - result_text = result_text.decode(content_charset) + res_content_type, res_params = cgi.parse_header( + result_headers["Content-Type"] + ) + if ( + res_content_type.startswith("text/") + and "charset" in res_params + and not isinstance(result_text, str) + ): + result_text = result_text.decode(res_params["charset"]) if isinstance(result_text, bytes) and decode_body: result_text = result_text.decode("utf-8") ret["body"] = result_text @@ -634,12 +637,15 @@ def query( result_headers = result.headers result_text = result.body if "Content-Type" in result_headers: - msg = email.message.EmailMessage() - msg.add_header("Content-Type", result_headers["Content-Type"]) - if msg.get_content_type().startswith("text/"): - content_charset = msg.get_content_charset() - if content_charset and not isinstance(result_text, str): - result_text = result_text.decode(content_charset) + res_content_type, res_params = cgi.parse_header( + result_headers["Content-Type"] + ) + if ( + res_content_type.startswith("text/") + and "charset" in res_params + and not isinstance(result_text, str) + ): + result_text = result_text.decode(res_params["charset"]) if isinstance(result_text, bytes) and decode_body: result_text = result_text.decode("utf-8") ret["body"] = result_text @@ -1033,12 +1039,12 @@ def _sanitize_url_components(comp_list, field): """ if not comp_list: return "" - elif comp_list[0].startswith(f"{field}="): - ret = f"{field}=XXXXXXXXXX&" + elif comp_list[0].startswith("{}=".format(field)): + ret = "{}=XXXXXXXXXX&".format(field) comp_list.remove(comp_list[0]) return ret + _sanitize_url_components(comp_list, field) else: - ret = f"{comp_list[0]}&" + ret = "{}&".format(comp_list[0]) comp_list.remove(comp_list[0]) return ret + _sanitize_url_components(comp_list, field) From 48b4916d22b8c0a480e63d4a8a37d064e0cc69cf Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Tue, 27 Jun 2023 08:05:57 +0100 Subject: [PATCH 12/13] Revert "Switch to `FullArgSpec` since Py 3.11 no longer has `ArgSpec`, deprecated since Py 3.0" This reverts commit 7d57774710229a091d186bbfa8fe4d01039c53c5. --- tests/unit/states/test_module.py | 56 ++++++++++++++------------------ 1 file changed, 25 insertions(+), 31 deletions(-) diff --git a/tests/unit/states/test_module.py b/tests/unit/states/test_module.py index 4853c24ca07f..a705bd30285f 100644 --- a/tests/unit/states/test_module.py +++ b/tests/unit/states/test_module.py @@ -4,7 +4,7 @@ import logging -from inspect import FullArgSpec +from inspect import ArgSpec import salt.states.module as module from tests.support.mixins import LoaderModuleMockMixin @@ -117,25 +117,11 @@ def setup_loader_modules(self): @classmethod def setUpClass(cls): - cls.aspec = FullArgSpec( - args=["hello", "world"], - varargs=None, - varkw=None, - defaults=False, - kwonlyargs=None, - kwonlydefaults=None, - annotations=None, + cls.aspec = ArgSpec( + args=["hello", "world"], varargs=None, keywords=None, defaults=False ) - cls.bspec = FullArgSpec( - args=[], - varargs="names", - varkw=None, - defaults=None, - kwonlyargs="kwargs", - kwonlydefaults=None, - annotations=None, - ) + cls.bspec = ArgSpec(args=[], varargs="names", keywords="kwargs", defaults=None) @classmethod def tearDownClass(cls): @@ -151,8 +137,8 @@ def test_run_module_not_available(self): module.__opts__, {"use_superseded": ["module.run"]} ): ret = module.run(**{CMD: None}) - if ret["comment"] != f"Unavailable function: {CMD}." or ret["result"]: - self.fail(f"module.run did not fail as expected: {ret}") + if ret["comment"] != "Unavailable function: {}.".format(CMD) or ret["result"]: + self.fail("module.run did not fail as expected: {}".format(ret)) def test_run_module_not_available_testmode(self): """ @@ -165,10 +151,10 @@ def test_run_module_not_available_testmode(self): ): ret = module.run(**{CMD: None}) if ( - ret["comment"] != f"Unavailable function: {CMD}." + ret["comment"] != "Unavailable function: {}.".format(CMD) or ret["result"] is not False ): - self.fail(f"module.run did not fail as expected: {ret}") + self.fail("module.run did not fail as expected: {}".format(ret)) def test_run_module_noop(self): """ @@ -180,7 +166,7 @@ def test_run_module_noop(self): ): ret = module.run() if ret["comment"] != "No function provided." or ret["result"] is not False: - self.fail(f"module.run did not fail as expected: {ret}") + self.fail("module.run did not fail as expected: {}".format(ret)) def test_module_run_hidden_varargs(self): """ @@ -203,10 +189,10 @@ def test_run_testmode(self): ): ret = module.run(**{CMD: None}) if ( - ret["comment"] != f"Function {CMD} to be executed." + ret["comment"] != "Function {} to be executed.".format(CMD) or ret["result"] is not None ): - self.fail(f"module.run failed: {ret}") + self.fail("module.run failed: {}".format(ret)) def test_run_missing_arg(self): """ @@ -217,7 +203,9 @@ def test_run_missing_arg(self): module.__opts__, {"use_superseded": ["module.run"]} ): ret = module.run(**{CMD: None}) - self.assertEqual(ret["comment"], f"'{CMD}' failed: Missing arguments: name") + self.assertEqual( + ret["comment"], "'{}' failed: Missing arguments: name".format(CMD) + ) def test_run_correct_arg(self): """ @@ -228,8 +216,8 @@ def test_run_correct_arg(self): module.__opts__, {"use_superseded": ["module.run"]} ): ret = module.run(**{CMD: ["Fred"]}) - if ret["comment"] != f"{CMD}: Success" or not ret["result"]: - self.fail(f"module.run failed: {ret}") + if ret["comment"] != "{}: Success".format(CMD) or not ret["result"]: + self.fail("module.run failed: {}".format(ret)) def test_run_state_apply_result_false(self): """ @@ -306,7 +294,9 @@ def test_func(arg1, arg2, **kwargs): ): ret = module.run(**{CMD: ["bla", {"example": "bla"}]}) self.assertFalse(ret["result"]) - self.assertEqual(ret["comment"], f"'{CMD}' failed: Missing arguments: arg2") + self.assertEqual( + ret["comment"], "'{}' failed: Missing arguments: arg2".format(CMD) + ) def test_run_42270_kwargs_to_args(self): """ @@ -400,7 +390,9 @@ def test_module_run_module_not_available(self): with patch.dict(module.__salt__, {}, clear=True): ret = module._legacy_run(CMD) self.assertFalse(ret["result"]) - self.assertEqual(ret["comment"], f"Module function {CMD} is not available") + self.assertEqual( + ret["comment"], "Module function {} is not available".format(CMD) + ) def test_module_run_test_true(self): """ @@ -408,7 +400,9 @@ def test_module_run_test_true(self): """ with patch.dict(module.__opts__, {"test": True}): ret = module._legacy_run(CMD) - self.assertEqual(ret["comment"], f"Module function {CMD} is set to execute") + self.assertEqual( + ret["comment"], "Module function {} is set to execute".format(CMD) + ) def test_module_run_missing_arg(self): """ From 65ee2c27d516a784b3e9fe422c47da0bd5591db8 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Tue, 27 Jun 2023 08:05:57 +0100 Subject: [PATCH 13/13] Revert "Don't hide output" This reverts commit b8e3a0adca5367e250f4e00e3dddeaec51936b73. --- pkg/macos/build_python.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/macos/build_python.sh b/pkg/macos/build_python.sh index be179b7b1662..b4ef1656bc41 100755 --- a/pkg/macos/build_python.sh +++ b/pkg/macos/build_python.sh @@ -191,16 +191,16 @@ fi #------------------------------------------------------------------------------- _msg "Installing relenv" if [ -n "${RELENV_VERSION}" ]; then - pip install relenv==${RELENV_VERSION} + pip install relenv==${RELENV_VERSION} >/dev/null 2>&1 + export RELENV_FETCH_VERSION=${RELENV_VERSION} else - pip install relenv + pip install relenv >/dev/null 2>&1 fi if [ -n "$(relenv --version)" ]; then _success else _failure fi -export RELENV_FETCH_VERSION=$(relenv --version) #------------------------------------------------------------------------------- # Building Python with Relenv @@ -212,7 +212,7 @@ else # We want to suppress the output here so it looks nice # To see the output, remove the output redirection _msg "Fetching python (relenv)" - relenv fetch --python=$PY_VERSION + relenv fetch --python $PY_VERSION >/dev/null 2>&1 if [ -f "$RELENV_DIR/build/$PY_VERSION-x86_64-macos.tar.xz" ]; then _success else