Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[3006.x] Remove psutil_compat.py file, (RHEL 6 EOL era file) and fix pkg downgrade test #66763

Merged
merged 20 commits into from
Aug 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog/66467.removed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Remove psutil_compat.py file, which should have been removed when RHEL 6 EOL
2 changes: 2 additions & 0 deletions requirements/pytest.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ flaky
more-itertools
pyfakefs
trustme
pytest-skip-markers >= 1.5.2 ; python_version >= '3.8'
pytest-skip-markers <= 1.5.1 ; python_version < '3.8'
3 changes: 2 additions & 1 deletion requirements/static/ci/py3.10/cloud.txt
Original file line number Diff line number Diff line change
Expand Up @@ -482,9 +482,10 @@ pytest-shell-utilities==1.8.0
# via
# -c requirements/static/ci/py3.10/linux.txt
# pytest-salt-factories
pytest-skip-markers==1.5.0
pytest-skip-markers==1.5.2 ; python_version >= "3.8"
# via
# -c requirements/static/ci/py3.10/linux.txt
# -r requirements/pytest.txt
# pytest-salt-factories
# pytest-shell-utilities
# pytest-system-statistics
Expand Down
3 changes: 2 additions & 1 deletion requirements/static/ci/py3.10/darwin.txt
Original file line number Diff line number Diff line change
Expand Up @@ -337,8 +337,9 @@ pytest-salt-factories==1.0.1
# via -r requirements/pytest.txt
pytest-shell-utilities==1.8.0
# via pytest-salt-factories
pytest-skip-markers==1.5.0
pytest-skip-markers==1.5.2 ; python_version >= "3.8"
# via
# -r requirements/pytest.txt
# pytest-salt-factories
# pytest-shell-utilities
# pytest-system-statistics
Expand Down
3 changes: 2 additions & 1 deletion requirements/static/ci/py3.10/freebsd.txt
Original file line number Diff line number Diff line change
Expand Up @@ -330,8 +330,9 @@ pytest-salt-factories==1.0.1
# via -r requirements/pytest.txt
pytest-shell-utilities==1.8.0
# via pytest-salt-factories
pytest-skip-markers==1.5.0
pytest-skip-markers==1.5.2 ; python_version >= "3.8"
# via
# -r requirements/pytest.txt
# pytest-salt-factories
# pytest-shell-utilities
# pytest-system-statistics
Expand Down
3 changes: 2 additions & 1 deletion requirements/static/ci/py3.10/linux.txt
Original file line number Diff line number Diff line change
Expand Up @@ -347,8 +347,9 @@ pytest-salt-factories==1.0.1
# via -r requirements/pytest.txt
pytest-shell-utilities==1.8.0
# via pytest-salt-factories
pytest-skip-markers==1.5.0
pytest-skip-markers==1.5.2 ; python_version >= "3.8"
# via
# -r requirements/pytest.txt
# pytest-salt-factories
# pytest-shell-utilities
# pytest-system-statistics
Expand Down
3 changes: 2 additions & 1 deletion requirements/static/ci/py3.10/windows.txt
Original file line number Diff line number Diff line change
Expand Up @@ -308,8 +308,9 @@ pytest-salt-factories==1.0.1
# via -r requirements/pytest.txt
pytest-shell-utilities==1.8.0
# via pytest-salt-factories
pytest-skip-markers==1.5.0
pytest-skip-markers==1.5.2 ; python_version >= "3.8"
# via
# -r requirements/pytest.txt
# pytest-salt-factories
# pytest-shell-utilities
# pytest-system-statistics
Expand Down
3 changes: 2 additions & 1 deletion requirements/static/ci/py3.11/cloud.txt
Original file line number Diff line number Diff line change
Expand Up @@ -446,9 +446,10 @@ pytest-shell-utilities==1.8.0
# via
# -c requirements/static/ci/py3.11/linux.txt
# pytest-salt-factories
pytest-skip-markers==1.5.0
pytest-skip-markers==1.5.2 ; python_version >= "3.8"
# via
# -c requirements/static/ci/py3.11/linux.txt
# -r requirements/pytest.txt
# pytest-salt-factories
# pytest-shell-utilities
# pytest-system-statistics
Expand Down
3 changes: 2 additions & 1 deletion requirements/static/ci/py3.11/darwin.txt
Original file line number Diff line number Diff line change
Expand Up @@ -308,8 +308,9 @@ pytest-salt-factories==1.0.1
# via -r requirements/pytest.txt
pytest-shell-utilities==1.8.0
# via pytest-salt-factories
pytest-skip-markers==1.5.0
pytest-skip-markers==1.5.2 ; python_version >= "3.8"
# via
# -r requirements/pytest.txt
# pytest-salt-factories
# pytest-shell-utilities
# pytest-system-statistics
Expand Down
3 changes: 2 additions & 1 deletion requirements/static/ci/py3.11/freebsd.txt
Original file line number Diff line number Diff line change
Expand Up @@ -307,8 +307,9 @@ pytest-salt-factories==1.0.1
# via -r requirements/pytest.txt
pytest-shell-utilities==1.8.0
# via pytest-salt-factories
pytest-skip-markers==1.5.0
pytest-skip-markers==1.5.2 ; python_version >= "3.8"
# via
# -r requirements/pytest.txt
# pytest-salt-factories
# pytest-shell-utilities
# pytest-system-statistics
Expand Down
3 changes: 2 additions & 1 deletion requirements/static/ci/py3.11/linux.txt
Original file line number Diff line number Diff line change
Expand Up @@ -324,8 +324,9 @@ pytest-salt-factories==1.0.1
# via -r requirements/pytest.txt
pytest-shell-utilities==1.8.0
# via pytest-salt-factories
pytest-skip-markers==1.5.0
pytest-skip-markers==1.5.2 ; python_version >= "3.8"
# via
# -r requirements/pytest.txt
# pytest-salt-factories
# pytest-shell-utilities
# pytest-system-statistics
Expand Down
3 changes: 2 additions & 1 deletion requirements/static/ci/py3.11/windows.txt
Original file line number Diff line number Diff line change
Expand Up @@ -304,8 +304,9 @@ pytest-salt-factories==1.0.1
# via -r requirements/pytest.txt
pytest-shell-utilities==1.8.0
# via pytest-salt-factories
pytest-skip-markers==1.5.0
pytest-skip-markers==1.5.2 ; python_version >= "3.8"
# via
# -r requirements/pytest.txt
# pytest-salt-factories
# pytest-shell-utilities
# pytest-system-statistics
Expand Down
3 changes: 2 additions & 1 deletion requirements/static/ci/py3.12/cloud.txt
Original file line number Diff line number Diff line change
Expand Up @@ -446,9 +446,10 @@ pytest-shell-utilities==1.8.0
# via
# -c requirements/static/ci/py3.12/linux.txt
# pytest-salt-factories
pytest-skip-markers==1.5.0
pytest-skip-markers==1.5.2 ; python_version >= "3.8"
# via
# -c requirements/static/ci/py3.12/linux.txt
# -r requirements/pytest.txt
# pytest-salt-factories
# pytest-shell-utilities
# pytest-system-statistics
Expand Down
3 changes: 2 additions & 1 deletion requirements/static/ci/py3.12/darwin.txt
Original file line number Diff line number Diff line change
Expand Up @@ -308,8 +308,9 @@ pytest-salt-factories==1.0.1
# via -r requirements/pytest.txt
pytest-shell-utilities==1.8.0
# via pytest-salt-factories
pytest-skip-markers==1.5.0
pytest-skip-markers==1.5.2 ; python_version >= "3.8"
# via
# -r requirements/pytest.txt
# pytest-salt-factories
# pytest-shell-utilities
# pytest-system-statistics
Expand Down
3 changes: 2 additions & 1 deletion requirements/static/ci/py3.12/freebsd.txt
Original file line number Diff line number Diff line change
Expand Up @@ -307,8 +307,9 @@ pytest-salt-factories==1.0.1
# via -r requirements/pytest.txt
pytest-shell-utilities==1.8.0
# via pytest-salt-factories
pytest-skip-markers==1.5.0
pytest-skip-markers==1.5.2 ; python_version >= "3.8"
# via
# -r requirements/pytest.txt
# pytest-salt-factories
# pytest-shell-utilities
# pytest-system-statistics
Expand Down
3 changes: 2 additions & 1 deletion requirements/static/ci/py3.12/linux.txt
Original file line number Diff line number Diff line change
Expand Up @@ -324,8 +324,9 @@ pytest-salt-factories==1.0.1
# via -r requirements/pytest.txt
pytest-shell-utilities==1.8.0
# via pytest-salt-factories
pytest-skip-markers==1.5.0
pytest-skip-markers==1.5.2 ; python_version >= "3.8"
# via
# -r requirements/pytest.txt
# pytest-salt-factories
# pytest-shell-utilities
# pytest-system-statistics
Expand Down
3 changes: 2 additions & 1 deletion requirements/static/ci/py3.12/windows.txt
Original file line number Diff line number Diff line change
Expand Up @@ -304,8 +304,9 @@ pytest-salt-factories==1.0.1
# via -r requirements/pytest.txt
pytest-shell-utilities==1.8.0
# via pytest-salt-factories
pytest-skip-markers==1.5.0
pytest-skip-markers==1.5.2 ; python_version >= "3.8"
# via
# -r requirements/pytest.txt
# pytest-salt-factories
# pytest-shell-utilities
# pytest-system-statistics
Expand Down
3 changes: 2 additions & 1 deletion requirements/static/ci/py3.7/cloud.txt
Original file line number Diff line number Diff line change
Expand Up @@ -530,9 +530,10 @@ pytest-shell-utilities==1.8.0
# via
# -c requirements/static/ci/py3.7/linux.txt
# pytest-salt-factories
pytest-skip-markers==1.5.0
pytest-skip-markers==1.5.0 ; python_version < "3.8"
# via
# -c requirements/static/ci/py3.7/linux.txt
# -r requirements/pytest.txt
# pytest-salt-factories
# pytest-shell-utilities
# pytest-system-statistics
Expand Down
3 changes: 2 additions & 1 deletion requirements/static/ci/py3.7/freebsd.txt
Original file line number Diff line number Diff line change
Expand Up @@ -371,8 +371,9 @@ pytest-salt-factories==1.0.1
# via -r requirements/pytest.txt
pytest-shell-utilities==1.8.0
# via pytest-salt-factories
pytest-skip-markers==1.5.0
pytest-skip-markers==1.5.0 ; python_version < "3.8"
# via
# -r requirements/pytest.txt
# pytest-salt-factories
# pytest-shell-utilities
# pytest-system-statistics
Expand Down
3 changes: 2 additions & 1 deletion requirements/static/ci/py3.7/linux.txt
Original file line number Diff line number Diff line change
Expand Up @@ -383,8 +383,9 @@ pytest-salt-factories==1.0.1
# via -r requirements/pytest.txt
pytest-shell-utilities==1.8.0
# via pytest-salt-factories
pytest-skip-markers==1.5.0
pytest-skip-markers==1.5.0 ; python_version < "3.8"
# via
# -r requirements/pytest.txt
# pytest-salt-factories
# pytest-shell-utilities
# pytest-system-statistics
Expand Down
3 changes: 2 additions & 1 deletion requirements/static/ci/py3.7/windows.txt
Original file line number Diff line number Diff line change
Expand Up @@ -323,8 +323,9 @@ pytest-salt-factories==1.0.1
# via -r requirements/pytest.txt
pytest-shell-utilities==1.8.0
# via pytest-salt-factories
pytest-skip-markers==1.5.0
pytest-skip-markers==1.5.0 ; python_version < "3.8"
# via
# -r requirements/pytest.txt
# pytest-salt-factories
# pytest-shell-utilities
# pytest-system-statistics
Expand Down
3 changes: 2 additions & 1 deletion requirements/static/ci/py3.8/cloud.txt
Original file line number Diff line number Diff line change
Expand Up @@ -516,9 +516,10 @@ pytest-shell-utilities==1.8.0
# via
# -c requirements/static/ci/py3.8/linux.txt
# pytest-salt-factories
pytest-skip-markers==1.5.0
pytest-skip-markers==1.5.2 ; python_version >= "3.8"
# via
# -c requirements/static/ci/py3.8/linux.txt
# -r requirements/pytest.txt
# pytest-salt-factories
# pytest-shell-utilities
# pytest-system-statistics
Expand Down
3 changes: 2 additions & 1 deletion requirements/static/ci/py3.8/freebsd.txt
Original file line number Diff line number Diff line change
Expand Up @@ -357,8 +357,9 @@ pytest-salt-factories==1.0.1
# via -r requirements/pytest.txt
pytest-shell-utilities==1.8.0
# via pytest-salt-factories
pytest-skip-markers==1.5.0
pytest-skip-markers==1.5.2 ; python_version >= "3.8"
# via
# -r requirements/pytest.txt
# pytest-salt-factories
# pytest-shell-utilities
# pytest-system-statistics
Expand Down
3 changes: 2 additions & 1 deletion requirements/static/ci/py3.8/linux.txt
Original file line number Diff line number Diff line change
Expand Up @@ -369,8 +369,9 @@ pytest-salt-factories==1.0.1
# via -r requirements/pytest.txt
pytest-shell-utilities==1.8.0
# via pytest-salt-factories
pytest-skip-markers==1.5.0
pytest-skip-markers==1.5.2 ; python_version >= "3.8"
# via
# -r requirements/pytest.txt
# pytest-salt-factories
# pytest-shell-utilities
# pytest-system-statistics
Expand Down
3 changes: 2 additions & 1 deletion requirements/static/ci/py3.8/windows.txt
Original file line number Diff line number Diff line change
Expand Up @@ -309,8 +309,9 @@ pytest-salt-factories==1.0.1
# via -r requirements/pytest.txt
pytest-shell-utilities==1.8.0
# via pytest-salt-factories
pytest-skip-markers==1.5.0
pytest-skip-markers==1.5.2 ; python_version >= "3.8"
# via
# -r requirements/pytest.txt
# pytest-salt-factories
# pytest-shell-utilities
# pytest-system-statistics
Expand Down
3 changes: 2 additions & 1 deletion requirements/static/ci/py3.9/cloud.txt
Original file line number Diff line number Diff line change
Expand Up @@ -518,9 +518,10 @@ pytest-shell-utilities==1.8.0
# via
# -c requirements/static/ci/py3.9/linux.txt
# pytest-salt-factories
pytest-skip-markers==1.5.0
pytest-skip-markers==1.5.2 ; python_version >= "3.8"
# via
# -c requirements/static/ci/py3.9/linux.txt
# -r requirements/pytest.txt
# pytest-salt-factories
# pytest-shell-utilities
# pytest-system-statistics
Expand Down
3 changes: 2 additions & 1 deletion requirements/static/ci/py3.9/darwin.txt
Original file line number Diff line number Diff line change
Expand Up @@ -366,8 +366,9 @@ pytest-salt-factories==1.0.1
# via -r requirements/pytest.txt
pytest-shell-utilities==1.8.0
# via pytest-salt-factories
pytest-skip-markers==1.5.0
pytest-skip-markers==1.5.2 ; python_version >= "3.8"
# via
# -r requirements/pytest.txt
# pytest-salt-factories
# pytest-shell-utilities
# pytest-system-statistics
Expand Down
3 changes: 2 additions & 1 deletion requirements/static/ci/py3.9/freebsd.txt
Original file line number Diff line number Diff line change
Expand Up @@ -359,8 +359,9 @@ pytest-salt-factories==1.0.1
# via -r requirements/pytest.txt
pytest-shell-utilities==1.8.0
# via pytest-salt-factories
pytest-skip-markers==1.5.0
pytest-skip-markers==1.5.2 ; python_version >= "3.8"
# via
# -r requirements/pytest.txt
# pytest-salt-factories
# pytest-shell-utilities
# pytest-system-statistics
Expand Down
3 changes: 2 additions & 1 deletion requirements/static/ci/py3.9/linux.txt
Original file line number Diff line number Diff line change
Expand Up @@ -369,8 +369,9 @@ pytest-salt-factories==1.0.1
# via -r requirements/pytest.txt
pytest-shell-utilities==1.8.0
# via pytest-salt-factories
pytest-skip-markers==1.5.0
pytest-skip-markers==1.5.2 ; python_version >= "3.8"
# via
# -r requirements/pytest.txt
# pytest-salt-factories
# pytest-shell-utilities
# pytest-system-statistics
Expand Down
3 changes: 2 additions & 1 deletion requirements/static/ci/py3.9/windows.txt
Original file line number Diff line number Diff line change
Expand Up @@ -310,8 +310,9 @@ pytest-salt-factories==1.0.1
# via -r requirements/pytest.txt
pytest-shell-utilities==1.8.0
# via pytest-salt-factories
pytest-skip-markers==1.5.0
pytest-skip-markers==1.5.2 ; python_version >= "3.8"
# via
# -r requirements/pytest.txt
# pytest-salt-factories
# pytest-shell-utilities
# pytest-system-statistics
Expand Down
6 changes: 5 additions & 1 deletion salt/utils/platform.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,11 @@ def is_aarch64():
"""
Simple function to return if host is AArch64 or not
"""
return platform.machine().startswith("aarch64")
if is_darwin():
# Allow for MacOS Arm64 platform returning differently from Linux
return platform.machine().startswith("arm64")
else:
return platform.machine().startswith("aarch64")


def spawning_platform():
Expand Down
21 changes: 0 additions & 21 deletions salt/utils/psutil_compat.py

This file was deleted.

12 changes: 10 additions & 2 deletions tests/pytests/pkg/downgrade/test_salt_downgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def test_salt_downgrade_minion(salt_call_cli, install_salt):
original_py_version = install_salt.package_python_version()

# Verify current install version is setup correctly and works
ret = salt_call_cli.run("test.version")
ret = salt_call_cli.run("--local", "test.version")
assert ret.returncode == 0
assert packaging.version.parse(ret.data) == packaging.version.parse(
install_salt.artifact_version
Expand Down Expand Up @@ -76,6 +76,14 @@ def test_salt_downgrade_minion(salt_call_cli, install_salt):
# Downgrade Salt to the previous version and test
install_salt.install(downgrade=True)

time.sleep(10) # give it some time
# downgrade install will stop services on Debian/Ubuntu
# This is due to RedHat systems are not active after an install, but Debian/Ubuntu are active after an install
# want to ensure our tests start with the config settings we have set,
# trying restart for Debian/Ubuntu to see the outcome
if install_salt.distro_id in ("ubuntu", "debian"):
install_salt.restart_services()

time.sleep(60) # give it some time

# Verify there is a new running minion by getting its PID and comparing it
Expand All @@ -99,7 +107,7 @@ def test_salt_downgrade_minion(salt_call_cli, install_salt):
ret.stdout.strip().split()[1]
) < packaging.version.parse(install_salt.artifact_version)

if is_downgrade_to_relenv:
if is_downgrade_to_relenv and not platform.is_darwin():
new_py_version = install_salt.package_python_version()
if new_py_version == original_py_version:
# test pip install after a downgrade
Expand Down
Loading
Loading