From 26c550003f531250479d4dda263e6e792bff97ff Mon Sep 17 00:00:00 2001 From: nicholasmhughes Date: Tue, 13 Jun 2023 15:21:36 -0400 Subject: [PATCH 001/393] fixes saltstack/salt#64477 file.symlink will not replace/update existing symlink --- changelog/64477.fixed.md | 1 + salt/states/file.py | 4 +++- tests/pytests/functional/states/test_file.py | 22 ++++++++++++++++++++ 3 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 changelog/64477.fixed.md diff --git a/changelog/64477.fixed.md b/changelog/64477.fixed.md new file mode 100644 index 00000000000..d43f01714d9 --- /dev/null +++ b/changelog/64477.fixed.md @@ -0,0 +1 @@ +Fix file.symlink will not replace/update existing symlink diff --git a/salt/states/file.py b/salt/states/file.py index b40f5ef84c0..e00c07b57f1 100644 --- a/salt/states/file.py +++ b/salt/states/file.py @@ -1799,9 +1799,11 @@ def symlink( if __salt__["file.is_link"](name): # The link exists, verify that it matches the target - if os.path.normpath(__salt__["file.readlink"](name)) == os.path.normpath( + if os.path.normpath(__salt__["file.readlink"](name)) != os.path.normpath( target ): + __salt__["file.remove"](name) + else: if _check_symlink_ownership(name, user, group, win_owner): # The link looks good! if salt.utils.platform.is_windows(): diff --git a/tests/pytests/functional/states/test_file.py b/tests/pytests/functional/states/test_file.py index cea0552f365..a28ab64a35f 100644 --- a/tests/pytests/functional/states/test_file.py +++ b/tests/pytests/functional/states/test_file.py @@ -201,3 +201,25 @@ def test_file_managed_web_source_etag_operation( # The modified time of the cached file now changes assert cached_file_mtime != os.path.getmtime(cached_file) + + +def test_file_symlink_replace_existing_link(states, tmp_path): + # symlink name and target for state + name = tmp_path / "foo" + target = tmp_path / "baz" + + # create existing symlink to replace + old_target = tmp_path / "bar" + name.symlink_to(old_target) + + ret = states.file.symlink( + name=str(name), + target=str(target), + ) + + assert ret.filtered == { + "name": str(name), + "changes": {"new": str(name)}, + "comment": f"Created new symlink {str(name)} -> {str(target)}", + "result": True, + } From 367c4fda9c8edc811873f6b75ae04abcd8eb3b71 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Mon, 19 Jun 2023 14:06:31 +0100 Subject: [PATCH 002/393] Improved slack notifications Signed-off-by: Pedro Algarvio --- .github/workflows/nightly.yml | 52 ++++++- .github/workflows/templates/nightly.yml.jinja | 130 +++++++++++++++++- 2 files changed, 168 insertions(+), 14 deletions(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 75aea9f8afb..a5371f7878b 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -2103,18 +2103,56 @@ jobs: - name: Notify Slack id: slack + if: always() uses: slackapi/slack-github-action@v1.24.0 with: payload: | { - "text": "Nightly Workflow build result for the `${{ github.ref_name }}` branch(attempt: ${{ github.run_attempt }}): `${{ steps.get-workflow-info.outputs.conclusion }}`\n${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}", - "blocks": [ + "attachments": [ { - "type": "section", - "text": { - "type": "mrkdwn", - "text": "Nightly Workflow build result for the `${{ github.ref_name }}` branch(attempt: ${{ github.run_attempt }}): `${{ steps.get-workflow-info.outputs.conclusion }}`\n${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" - } + "fallback": "${{ github.workflow }} Workflow build result for the `${{ github.ref_name }}` branch(attempt: ${{ github.run_attempt }}): `${{ steps.get-workflow-info.outputs.conclusion }}`\n${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}", + "color": "${{ steps.get-workflow-info.outputs.conclusion != 'success' && 'ff3d00' || '00e676' }}", + "fields": [ + { + "title": "Workflow", + "short": true, + "value": "${{ github.workflow }}", + "type": "mrkdwn" + }, + { + "title": "Workflow Run", + "short": true, + "value": "<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|${{ github.run_id }}>", + "type": "mrkdwn" + }, + { + "title": "Branch", + "short": true, + "value": "${{ github.ref_name }}", + "type": "mrkdwn" + }, + { + "title": "Commit", + "short": true, + "value": "<${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }}|${{ github.sha }}>", + "type": "mrkdwn" + }, + { + "title": "Attempt", + "short": true, + "value": "${{ github.run_attempt }}", + "type": "mrkdwn" + }, + { + "title": "Status", + "short": true, + "value": "${{ steps.get-workflow-info.outputs.conclusion }}", + "type": "mrkdwn" + } + ], + "author_name": "${{ github.event.sender.login }}", + "author_link": "${{ github.event.sender.html_url }}", + "author_icon": "${{ github.event.sender.avatar_url }}" } ] } diff --git a/.github/workflows/templates/nightly.yml.jinja b/.github/workflows/templates/nightly.yml.jinja index ae77bdda713..d36d0a72aa8 100644 --- a/.github/workflows/templates/nightly.yml.jinja +++ b/.github/workflows/templates/nightly.yml.jinja @@ -52,6 +52,81 @@ concurrency: <%- include "workflow-requirements-check.yml.jinja" %> <%- include "trigger-branch-workflows.yml.jinja" %> + {#- When we start using a slack app, we can update messages, not while using incoming webhooks + <%- if workflow_slug == "nightly" %> + + <%- do conclusion_needs.append('notify-slack') %> + notify-slack: + name: Notify Slack + runs-on: ubuntu-latest + environment: <{ gh_environment }> + needs: + <%- for need in prepare_workflow_needs.iter(consume=False) %> + - <{ need }> + <%- endfor %> + outputs: + update-ts: ${{ steps.slack.outputs.update-ts }} + steps: + - name: Notify Slack + id: slack + uses: slackapi/slack-github-action@v1.24.0 + with: + payload: | + { + "attachments": [ + { + "color": "ffca28", + "fields": [ + { + "title": "Workflow", + "short": true, + "value": "${{ github.workflow }}", + "type": "mrkdwn" + }, + { + "title": "Workflow Run", + "short": true, + "value": "<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|${{ github.run_id }}>", + "type": "mrkdwn" + }, + { + "title": "Branch", + "short": true, + "value": "${{ github.ref_name }}", + "type": "mrkdwn" + }, + { + "title": "Commit", + "short": true, + "value": "<${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }}|${{ github.sha }}>", + "type": "mrkdwn" + }, + { + "title": "Attempt", + "short": true, + "value": "${{ github.run_attempt }}", + "type": "mrkdwn" + }, + { + "title": "Status", + "short": true, + "value": "running", + "type": "mrkdwn" + } + ], + "author_name": "${{ github.event.sender.login }}", + "author_link": "${{ github.event.sender.html_url }}", + "author_icon": "${{ github.event.sender.avatar_url }}" + } + ] + } + env: + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} + SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK + + <%- endif %> + #} + <%- endblock pre_jobs %> <%- block jobs %> @@ -123,18 +198,59 @@ concurrency: - name: Notify Slack id: slack + if: always() uses: slackapi/slack-github-action@v1.24.0 with: + {#- When we start using a slack app, we can update messages, not while using incoming webhooks + update-ts: ${{ needs.notify-slack.outputs.update-ts }} + #} payload: | { - "text": "Nightly Workflow build result for the `${{ github.ref_name }}` branch(attempt: ${{ github.run_attempt }}): `${{ steps.get-workflow-info.outputs.conclusion }}`\n${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}", - "blocks": [ + "attachments": [ { - "type": "section", - "text": { - "type": "mrkdwn", - "text": "Nightly Workflow build result for the `${{ github.ref_name }}` branch(attempt: ${{ github.run_attempt }}): `${{ steps.get-workflow-info.outputs.conclusion }}`\n${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" - } + "fallback": "${{ github.workflow }} Workflow build result for the `${{ github.ref_name }}` branch(attempt: ${{ github.run_attempt }}): `${{ steps.get-workflow-info.outputs.conclusion }}`\n${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}", + "color": "${{ steps.get-workflow-info.outputs.conclusion != 'success' && 'ff3d00' || '00e676' }}", + "fields": [ + { + "title": "Workflow", + "short": true, + "value": "${{ github.workflow }}", + "type": "mrkdwn" + }, + { + "title": "Workflow Run", + "short": true, + "value": "<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|${{ github.run_id }}>", + "type": "mrkdwn" + }, + { + "title": "Branch", + "short": true, + "value": "${{ github.ref_name }}", + "type": "mrkdwn" + }, + { + "title": "Commit", + "short": true, + "value": "<${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }}|${{ github.sha }}>", + "type": "mrkdwn" + }, + { + "title": "Attempt", + "short": true, + "value": "${{ github.run_attempt }}", + "type": "mrkdwn" + }, + { + "title": "Status", + "short": true, + "value": "${{ steps.get-workflow-info.outputs.conclusion }}", + "type": "mrkdwn" + } + ], + "author_name": "${{ github.event.sender.login }}", + "author_link": "${{ github.event.sender.html_url }}", + "author_icon": "${{ github.event.sender.avatar_url }}" } ] } From 97e6ff7a1a2ae0e42a07ee1e6d1c8d024af23f95 Mon Sep 17 00:00:00 2001 From: Twangboy Date: Thu, 4 May 2023 18:28:43 -0600 Subject: [PATCH 003/393] Add scripts for setting up multi-minion on Windows --- pkg/windows/multi-master.cmd | 3 + pkg/windows/multi-minion.ps1 | 359 +++++++++++++++++++++++++++++++++++ 2 files changed, 362 insertions(+) create mode 100644 pkg/windows/multi-master.cmd create mode 100644 pkg/windows/multi-minion.ps1 diff --git a/pkg/windows/multi-master.cmd b/pkg/windows/multi-master.cmd new file mode 100644 index 00000000000..aa8dbc72e45 --- /dev/null +++ b/pkg/windows/multi-master.cmd @@ -0,0 +1,3 @@ +@ echo off +Set "CurDir=%~dp0" +PowerShell -ExecutionPolicy RemoteSigned -File "%CurDir%\multi-master.ps1" %* diff --git a/pkg/windows/multi-minion.ps1 b/pkg/windows/multi-minion.ps1 new file mode 100644 index 00000000000..855a8fef2d5 --- /dev/null +++ b/pkg/windows/multi-minion.ps1 @@ -0,0 +1,359 @@ +<# +.SYNOPSIS +Script for setting up an additional salt-minion on a machine with Salt installed + +.DESCRIPTION +This script will install an additional minion on a machine that already has a +Salt installtion using one of the Salt packages. It will set up the directory +structure required by Salt. It will also lay down a minion config to be used +by the Salt minion. Additionaly, this script will install and start a Salt +minion service that uses the root_dir and minion config. You can also pass the +name of a service account to be used by the service. + +You can also remove the multiminion setup with this script. + +This script should be run with Administrator privileges + +The following example will install a service named `salt-minion-mm10` that +starts with the LOCALSYSTEM account. It is the `-s` parameter that creates the +service: + +.EXAMPLE +PS>multi-minion.ps1 -Name mm10 -s + +The following example will install a service that starts with a user named +mmuser: + +.EXAMPLE +PS>multi-minion.ps1 -Name mm10 -s -m 192.168.0.10 -u mmuser -p secretword + +The following example will set up config for minion that can be run in the +background under a user account. Notice the command does not have the `-s` +parameter: + +.EXAMPLE +PS>multi-minion.ps1 -Name mm10 -m 192.168.0.10 + +The following example will remove a multiminion that has been installed with +this script: + +.EXAMPLE +PS>multi-minion.ps1 -Name mm10 -d + +#> + +[CmdletBinding()] +param( + + [Parameter(Mandatory=$true)] + [Alias("n")] + # The name used to create the service and root_dir. This is the only + # required parameter + [String] $Name, + + [Parameter(Mandatory=$false)] + [Alias("m")] + # The master to connect to. This can be an ip address or an fqdn. Default + # is salt + [String] $Master = "salt", + + [Parameter(Mandatory=$false)] + [Alias("r")] + # The root dir to place the minion config and directory structure. The + # default is %PROGRAMDATA%\Salt Project\Salt-$Name + [String] $RootDir = "$env:ProgramData\Salt Project\Salt-$Name", + + [Parameter(Mandatory=$false)] + [Alias("u")] + # User account to run the service under. The user account must be present on + # the system. The default is to use the LOCALSYSTEM account + [String] $User, + + [Parameter(Mandatory=$false)] + [Alias("p")] + # The password to the user account. Required if User is passed. We should + # probably figure out how to make this more secure + [String] $Password, + + [Parameter(Mandatory=$false)] + [Alias("s")] + # Set this switch to install the service. Default is to not install the + # service + [Switch] $Service, + + [Parameter(Mandatory=$false)] + [Alias("d")] + # Remove the specified multi-minion. All other parameters are ignored + [Switch] $Remove +) + +########################### Script Variables ############################# +$ssm_bin = "$env:ProgramFiles\Salt Project\Salt\ssm.exe" +$salt_bin = "$env:ProgramFiles\Salt Project\Salt\salt-minion.exe" +$service_name = "salt-minion-$($Name.ToLower())" +$default_root_dir = Resolve-Path -Path "$env:ProgramData\Salt Project\Salt" +$cache_dir = "$RootDir\var\cache\salt\minion" + +################################ Remove ################################## +if ( $Remove ) { + Write-Host "######################################################################" -ForegroundColor Cyan + Write-Host "Removing multi-minion" + Write-Host "Name: $Name" + Write-Host "Service Name: $service_name" + Write-Host "Root Dir: $RootDir" + Write-Host "######################################################################" -ForegroundColor Cyan + + # Stop Service + $service_object = Get-Service -Name $service_name -ErrorAction SilentlyContinue + if ( $service_object -and ($service_object.Status -ne "Stopped") ) { + Write-Host "Stopping service: " -NoNewline + Stop-Service -Name $service_name *> $null + $service_object.Refresh() + if ( $service_object.Status -eq "Stopped" ) { + Write-Host "Success" -ForegroundColor Green + } else { + Write-Host "Failed" -ForegroundColor Red + exit 1 + } + } + + # Remove Service + $service_object = Get-Service -Name $service_name -ErrorAction SilentlyContinue + if ( $service_object ) { + Write-Host "Removing service: " -NoNewline + & $ssm_bin remove $service_name confirm *> $null + $service_object = Get-Service -Name $service_name -ErrorAction SilentlyContinue + if ( !$service_object ) { + Write-Host "Success" -ForegroundColor Green + } else { + Write-Host "Failed" -ForegroundColor Red + exit 1 + } + } + + # Remove Directory + if ( Test-Path -Path $RootDir ) { + Write-Host "Removing RootDir: " -NoNewline + Remove-Item -Path $RootDir -Force -Recurse + + if ( !(Test-Path -Path $RootDir) ) { + Write-Host "Success" -ForegroundColor Green + } else { + Write-Host "Failed" -ForegroundColor Red + exit 1 + } + } + # Remind to delete keys from master + Write-Host "######################################################################" -ForegroundColor Cyan + Write-Host "Multi-Minion installed successfully" + Write-Host ">>>>> Don't forget to remove keys from the master <<<<<" + Write-Host "######################################################################" -ForegroundColor Cyan + exit 0 +} + +################################ Install ################################# +# We don't want to share config with the current running minion +if ( $RootDir.Trim("\") -eq $default_root_dir ) { + Write-Host "WARNING: RootDir can't be default Salt rootdir" -ForegroundColor Red + exit 1 +} + +# Make sure password is set if user is passed +if ( $User -and !$Password ) { + Write-Host "WARNING: You must pass a password when defining a user account" -ForegroundColor Red + exit 1 +} + +Write-Host "######################################################################" -ForegroundColor Cyan +Write-Host "Installing multi-minion" +Write-Host "Name: $Name" +Write-Host "Master: $Master" +Write-Host "Root Directory: $RootDir" +Write-Host "Create Service: $Service" +if ( $Service ) { + Write-Host "Service Account: $User" + Write-Host "Password: **********" + Write-Host "Service Name: $service_name" +} +Write-Host "######################################################################" -ForegroundColor Cyan + +# Create file_roots Directory Structure +if ( !( Test-Path -path "$RootDir" ) ) { + Write-Host "Creating RootDir: " -NoNewline + New-Item -Path "$RootDir" -Type Directory | Out-Null + if ( Test-Path -path "$RootDir" ) { + Write-Host "Success" -ForegroundColor Green + } else { + Write-Host "Failed" -ForegroundColor Red + exit 1 + } +} + +# Set permissions +if ( $User ) { + Write-Host "Setting Permissions: " -NoNewline + $acl = Get-Acl -Path "$RootDir" + $access_rule = New-Object System.Security.AccessControl.FileSystemAccessRule($User, "Modify", "Allow") + $acl.AddAccessRule($access_rule) + Set-Acl -Path "$RootDir" -AclObject $acl + + $found = $false + $acl = Get-Acl -Path "$RootDir" + $acl.Access | ForEach-Object { + if ( $_.IdentityReference.Value.Contains($User) ) { + $found = $true + } + } + if ( $found ) { + Write-Host "Success" -ForegroundColor Green + } else { + Write-Host "Failed" -ForegroundColor Red + exit 1 + } +} + +# Child directories will inherit permissions from the parent +if ( !( Test-Path -path "$RootDir\conf" ) ) { + Write-Host "Creating config dir: " -NoNewline + New-Item -Path "$RootDir\conf" -Type Directory | Out-Null + if ( Test-Path -path "$RootDir\conf" ) { + Write-Host "Success" -ForegroundColor Green + } else { + Write-Host "Failed" -ForegroundColor Red + exit 1 + } +} +if ( !( Test-Path -path "$RootDir\conf\minion.d" ) ) { + Write-Host "Creating minion.d dir: " -NoNewline + New-Item -Path "$RootDir\conf\minion.d" -Type Directory | Out-Null + if ( Test-Path -path "$RootDir\conf\minion.d" ) { + Write-Host "Success" -ForegroundColor Green + } else { + Write-Host "Failed" -ForegroundColor Red + exit 1 + } +} +if ( !( Test-Path -path "$RootDir\conf\pki" ) ) { + Write-Host "Creating pki dir: " -NoNewline + New-Item -Path "$RootDir\conf\pki" -Type Directory | Out-Null + if ( Test-Path -path "$RootDir\conf\pki" ) { + Write-Host "Success" -ForegroundColor Green + } else { + Write-Host "Failed" -ForegroundColor Red + exit 1 + } +} +if ( !( Test-Path -path "$RootDir\var\log\salt" ) ) { + Write-Host "Creating log dir: " -NoNewline + New-Item -Path "$RootDir\var\log\salt" -Type Directory | Out-Null + if ( Test-Path -path "$RootDir\var\log\salt" ) { + Write-Host "Success" -ForegroundColor Green + } else { + Write-Host "Failed" -ForegroundColor Red + exit 1 + } +} +if ( !( Test-Path -path "$RootDir\var\run" ) ) { + Write-Host "Creating run dir: " -NoNewline + New-Item -Path "$RootDir\var\run" -Type Directory | Out-Null + if ( Test-Path -path "$RootDir\var\run" ) { + Write-Host "Success" -ForegroundColor Green + } else { + Write-Host "Failed" -ForegroundColor Red + exit 1 + } +} +if ( !( Test-Path -path "$cache_dir\extmods\grains" ) ) { + Write-Host "Creating extmods grains dir: " -NoNewline + New-Item -Path "$cache_dir\extmods\grains" -Type Directory | Out-Null + if ( Test-Path -path "$cache_dir\extmods\grains" ) { + Write-Host "Success" -ForegroundColor Green + } else { + Write-Host "Failed" -ForegroundColor Red + exit 1 + } +} +if ( !( Test-Path -path "$cache_dir\proc" ) ) { + Write-Host "Creating proc dir: " -NoNewline + New-Item -Path "$cache_dir\proc" -Type Directory | Out-Null + if ( Test-Path -path "$cache_dir\proc" ) { + Write-Host "Success" -ForegroundColor Green + } else { + Write-Host "Failed" -ForegroundColor Red + exit 1 + } +} + +# Write minion config +Write-Host "Writing minion config: " -NoNewline +Add-Content -Force -Path "$RootDir\conf\minion" -Value "master: $Master" +Add-Content -Force -Path "$RootDir\conf\minion" -Value "id: $Name" +Add-Content -Force -Path "$RootDir\conf\minion" -Value "root_dir: $RootDir" +Add-Content -Force -Path "$RootDir\conf\minion" -Value "log_file: $RootDir\var\log\salt\minion" +Add-Content -Force -Path "$RootDir\conf\minion" -Value "utils_dirs: $RootDir\var\cache\salt\minion\extmods\utils" +Add-Content -Force -Path "$RootDir\conf\minion" -Value "winrepo_dir: $RootDir\srv\salt\win\repo" +Add-Content -Force -Path "$RootDir\conf\minion" -Value "winrepo_dir_ng: $RootDir\srv\salt\win\repo-ng" + +Add-Content -Force -Path "$RootDir\conf\minion" -Value "file_roots:" +Add-Content -Force -Path "$RootDir\conf\minion" -Value " base:" +Add-Content -Force -Path "$RootDir\conf\minion" -Value " - $RootDir\srv\salt" +Add-Content -Force -Path "$RootDir\conf\minion" -Value " - $RootDir\srv\spm\salt" + +Add-Content -Force -Path "$RootDir\conf\minion" -Value "pillar_roots:" +Add-Content -Force -Path "$RootDir\conf\minion" -Value " base:" +Add-Content -Force -Path "$RootDir\conf\minion" -Value " - $RootDir\srv\pillar" +Add-Content -Force -Path "$RootDir\conf\minion" -Value " - $RootDir\srv\spm\pillar" + +Add-Content -Force -Path "$RootDir\conf\minion" -Value "thorium_roots:" +Add-Content -Force -Path "$RootDir\conf\minion" -Value " base:" +Add-Content -Force -Path "$RootDir\conf\minion" -Value " - $RootDir\srv\thorium" + +if ( Test-Path -path "$RootDir\conf\minion" ) { + Write-Host "Success" -ForegroundColor Green +} else { + Write-Host "Failed" -ForegroundColor Red + exit 1 +} + +if ( $Service ) { + # Register salt-minion service using SSM + Write-Host "Registering service $service_name`: " -NoNewline + & $ssm_bin install $service_name "$salt_bin" "-c """"$RootDir\conf"""" -l quiet" *> $null + & $ssm_bin set $service_name Description "Salt Minion $Name" *> $null + & $ssm_bin set $service_name Start SERVICE_AUTO_START *> $null + & $ssm_bin set $service_name AppStopMethodConsole 24000 *> $null + & $ssm_bin set $service_name AppStopMethodWindow 2000 *> $null + & $ssm_bin set $service_name AppRestartDelay 60000 *> $null + if ( $User -and $Password ) { + & $ssm_bin set $service_name ObjectName ".\$User" "$Password" *> $null + } + + $service_object = Get-Service -Name $service_name -ErrorAction SilentlyContinue + if ( $service_object ) { + Write-Host "Success" -ForegroundColor Green + } else { + Write-Host "Failed" -ForegroundColor Red + exit 1 + } + + Write-Host "Starting service: " -NoNewline + Start-Service -Name $service_name + $service_object.Refresh() + if ( $service_object.Status -eq "Running" ) { + Write-Host "Success" -ForegroundColor Green + } else { + Write-Host "Failed" -ForegroundColor Red + exit 1 + } +} + +Write-Host "######################################################################" -ForegroundColor Cyan +Write-Host "Multi-Minion installed successfully" +Write-Host "Root Directory: $RootDir" +if ( $Service ) { + Write-Host "Service Name: $service_name" +} else { + Write-Host "To start the minion, run the following command:" + Write-Host "salt-minion -c `"$RootDir\conf`"" +} +Write-Host "######################################################################" -ForegroundColor Cyan From c016b46029a2a1f5677bf0ffc2c1bf6254e16ee4 Mon Sep 17 00:00:00 2001 From: Twangboy Date: Fri, 5 May 2023 09:29:53 -0600 Subject: [PATCH 004/393] Remove BOM to fix pre-commit --- pkg/windows/multi-minion.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/windows/multi-minion.ps1 b/pkg/windows/multi-minion.ps1 index 855a8fef2d5..dfd68fce573 100644 --- a/pkg/windows/multi-minion.ps1 +++ b/pkg/windows/multi-minion.ps1 @@ -1,4 +1,4 @@ -<# +<# .SYNOPSIS Script for setting up an additional salt-minion on a machine with Salt installed From 2f07a4e3af1c01e7a7f4a56b8f6638d031d93e1e Mon Sep 17 00:00:00 2001 From: Twangboy Date: Fri, 5 May 2023 10:39:50 -0600 Subject: [PATCH 005/393] Fix name of cmd script from master to minion --- pkg/windows/{multi-master.cmd => multi-minion.cmd} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename pkg/windows/{multi-master.cmd => multi-minion.cmd} (87%) diff --git a/pkg/windows/multi-master.cmd b/pkg/windows/multi-minion.cmd similarity index 87% rename from pkg/windows/multi-master.cmd rename to pkg/windows/multi-minion.cmd index aa8dbc72e45..2ec0e2ea578 100644 --- a/pkg/windows/multi-master.cmd +++ b/pkg/windows/multi-minion.cmd @@ -1,3 +1,3 @@ @ echo off Set "CurDir=%~dp0" -PowerShell -ExecutionPolicy RemoteSigned -File "%CurDir%\multi-master.ps1" %* +PowerShell -ExecutionPolicy RemoteSigned -File "%CurDir%\multi-minion.ps1" %* From 7a802fbb6ecd9e1a5d93a655a111a84bd88986ef Mon Sep 17 00:00:00 2001 From: twangboy Date: Mon, 5 Jun 2023 16:49:18 -0600 Subject: [PATCH 006/393] Add scripts to installer, clean msi files --- pkg/windows/clean.ps1 | 27 +++++++++++++++++++++++++++ pkg/windows/multi-minion.cmd | 2 ++ pkg/windows/multi-minion.ps1 | 6 +++--- pkg/windows/prep_salt.ps1 | 20 ++++++++++++++++++++ 4 files changed, 52 insertions(+), 3 deletions(-) diff --git a/pkg/windows/clean.ps1 b/pkg/windows/clean.ps1 index 7d2234ad6b8..466cf812dcc 100644 --- a/pkg/windows/clean.ps1 +++ b/pkg/windows/clean.ps1 @@ -140,6 +140,33 @@ if ( Test-Path -Path "$RELENV_DIR" ) { } } +#------------------------------------------------------------------------------- +# Remove MSI build files +#------------------------------------------------------------------------------- +$files = @( + "msi/CustomAction01/CustomAction01.CA.dll", + "msi/CustomAction01/CustomAction01.dll", + "msi/CustomAction01/CustomAction01.pdb", + "msi/Product-discovered-files-config.wixobj", + "msi/Product-discovered-files-config.wxs", + "msi/Product-discovered-files-x64.wixobj", + "msi/Product-discovered-files-x64.wxs", + "msi/Product.wixobj" +) +$files | ForEach-Object { + if ( Test-Path -Path "$SCRIPT_DIR\$_" ) { + # Use .net, the powershell function is asynchronous + Write-Host "Removing $_`: " -NoNewline + [System.IO.File]::Delete("$SCRIPT_DIR\$_") + if ( ! (Test-Path -Path "$SCRIPT_DIR\$_") ) { + Write-Result "Success" -ForegroundColor Green + } else { + Write-Result "Failed" -ForegroundColor Red + exit 1 + } + } +} + #------------------------------------------------------------------------------- # Script Completed #------------------------------------------------------------------------------- diff --git a/pkg/windows/multi-minion.cmd b/pkg/windows/multi-minion.cmd index 2ec0e2ea578..3142158b469 100644 --- a/pkg/windows/multi-minion.cmd +++ b/pkg/windows/multi-minion.cmd @@ -1,3 +1,5 @@ +:: This is a helper script for multi-minion.ps1. +:: See multi-minion.ps1 for documentation @ echo off Set "CurDir=%~dp0" PowerShell -ExecutionPolicy RemoteSigned -File "%CurDir%\multi-minion.ps1" %* diff --git a/pkg/windows/multi-minion.ps1 b/pkg/windows/multi-minion.ps1 index dfd68fce573..c5f7977afaa 100644 --- a/pkg/windows/multi-minion.ps1 +++ b/pkg/windows/multi-minion.ps1 @@ -4,11 +4,11 @@ Script for setting up an additional salt-minion on a machine with Salt installed .DESCRIPTION This script will install an additional minion on a machine that already has a -Salt installtion using one of the Salt packages. It will set up the directory +Salt installation using one of the Salt packages. It will set up the directory structure required by Salt. It will also lay down a minion config to be used by the Salt minion. Additionaly, this script will install and start a Salt -minion service that uses the root_dir and minion config. You can also pass the -name of a service account to be used by the service. +minion service that uses the root_dir specified in the minion config. You can +also pass the name of a service account to be used by the service. You can also remove the multiminion setup with this script. diff --git a/pkg/windows/prep_salt.ps1 b/pkg/windows/prep_salt.ps1 index a3ee01a36d3..21ce25daaa6 100644 --- a/pkg/windows/prep_salt.ps1 +++ b/pkg/windows/prep_salt.ps1 @@ -165,6 +165,25 @@ if ( ! (Test-Path -Path "$BUILD_DIR\ssm.exe") ) { } } +# Copy the multiminion scripts to the Build directory +$scripts = @( + "multi-minion.cmd", + "multi-minion.ps1" +) +$scripts | ForEach-Object { + if (!(Test-Path -Path "$BUILD_DIR\$_")) { + Write-Host "Copying $_ to the Build directory: " -NoNewline + Copy-Item -Path "$SCRIPT_DIR\$_" -Destination "$BUILD_DIR\$_" + if (Test-Path -Path "$BUILD_DIR\$_") { + Write-Result "Success" -ForegroundColor Green + } else { + Write-Result "Failed" -ForegroundColor Red + exit 1 + } + } +} + +# Copy VCRedist 2013 to the prereqs directory New-Item -Path $PREREQ_DIR -ItemType Directory | Out-Null Write-Host "Copying VCRedist 2013 $ARCH_X to prereqs: " -NoNewline $file = "vcredist_$ARCH_X`_2013.exe" @@ -176,6 +195,7 @@ if ( Test-Path -Path "$PREREQ_DIR\$file" ) { exit 1 } +# Copy Universal C Runtimes to the prereqs directory Write-Host "Copying Universal C Runtimes $ARCH_X to prereqs: " -NoNewline $file = "ucrt_$ARCH_X.zip" Invoke-WebRequest -Uri "$SALT_DEP_URL/$file" -OutFile "$PREREQ_DIR\$file" From b0d14780fa908a7654357129d3c5c5820cd9a9f5 Mon Sep 17 00:00:00 2001 From: twangboy Date: Sun, 11 Jun 2023 13:01:35 -0600 Subject: [PATCH 007/393] Add docs, don't run as service --- doc/topics/windows/multi-minion.rst | 165 ++++++++++++ pkg/windows/multi-minion.ps1 | 386 ++++++++++++++-------------- 2 files changed, 360 insertions(+), 191 deletions(-) create mode 100644 doc/topics/windows/multi-minion.rst diff --git a/doc/topics/windows/multi-minion.rst b/doc/topics/windows/multi-minion.rst new file mode 100644 index 00000000000..292f322e4c7 --- /dev/null +++ b/doc/topics/windows/multi-minion.rst @@ -0,0 +1,165 @@ +============================= +Multi-Minion Setup on Windows +============================= + +There may be a scenario where having a minion running in the context of the +current logged in user would be useful. For example, the normal minion running +under the service account would perform machine-wide, administrative tasks. The +minion runing under the user context could be launched when the user logs in +and would be able to perform configuration tasks as if it were the user itself. +This would be useful for setting user registry settings, for example. + +The steps required to do this are as follows: + +1. Create new root_dir +2. Set root_dir permissions +3. Create directory structure +4. Write minion config + +We will now go through each of these steps in detail. + +.. note:: + + We have created a powershell script that will configure an additional minion + on the system for you. It can be found in the root of the Salt installation. + The script is named ``multi-minion.ps1``. You can get help on how to use the + script by running the following in a PowerShell prompt: + + ``Get-Help .\multi-minion.ps1 -Detailed`` + +1. Create new ``root_dir`` +-------------------------- + +The minion requires a root directory to store config, cache, logs, etc. The user +must have full permissions to this directory. The easiest way to do this is to +put the ``root_dir`` in the Local AppData directory (``$env:LocalAppData``). + +.. code-block:: powershell + + New-Item -Path "$env:LocalAppData\Salt Project\Salt" -Type Directory + +2. Set ``root_dir`` permissions +------------------------------- + +The user running Salt requires full access to the ``root_dir``. If you have +placed the root_dir in a location that the user does not have access to, you'll +need to give the user full permissions to that directory. + +.. code-block:: powershell + + $RootDir = "" + $User = "" + $acl = Get-Acl -Path "$RootDir" + $access_rule = New-Object System.Security.AccessControl.FileSystemAccessRule($User, "Modify", "Allow") + $acl.AddAccessRule($access_rule) + Set-Acl -Path "$RootDir" -AclObject $acl + +3. Create directory structure +----------------------------- + +Salt expects a certain directory structure to be present to avoid unnecessary +messages in the logs. This is usually handled by the installer. Since we're +running our own instance, we need to do it. Make sure the following directories +are present: + + - root_dir\\conf\\minion.d + - root_dir\\conf\\pki + - root_dir\\var\\log\\salt + - root_dir\\var\\run + - root_dir\\var\\cache\\salt\\minion\\extmods\\grains + - root_dir\\var\\cache\\salt\\minion\\proc + +.. code-block:: powershell + + $RootDir = "" + $cache_dir = "$RootDir\var\cache\salt\minion" + New-Item -Path "$RootDir\conf" -Type Directory + New-Item -Path "$RootDir\conf\minion.d" -Type Directory + New-Item -Path "$RootDir\conf\pki" -Type Directory + New-Item -Path "$RootDir\var\log\salt" -Type Directory + New-Item -Path "$RootDir\var\run" -Type Directory + New-Item -Path "$cache_dir\extmods\grains" -Type Directory + New-Item -Path "$cache_dir\proc" -Type Directory + +4. Write minion config +---------------------- + +The minion will need is own config, separate from the system minion config. This +config tells the minion where everything is as well as defines the master and +minion id. Create a minion config file named minion in the conf directory. + +.. code-block:: powershell + + New-Item -Path "$env:LocalAppData\Salt Project\Salt\conf\minion" -Type File + +Make sure the config file has at least the following contents: + +.. code-block:: yaml + + master: + id: + + root_dir: + log_file: \val\log\salt\minion + utils_dirs: + - \var\cache\salt\minion\extmods + winrepo_dir: \srv\salt\win\repo + winrepo_dir_ng: \srv\salt\win\repo-ng + + file_roots: + base: + - \srv\salt + - \srv\spm\salt + + pillar_roots: + base: + - \srv\pillar + - \srv\spm\pillar + + thorium_roots: + base: + - \srv\thorium + +Run the minion +-------------- + +Everything is now set up to run the minion. You can start the minion as you +would normally, but you need to specify the full path to the config file you +created above. + +.. code-block:: powershell + + salt-minion.exe -c \conf + +Register the minion as a service +-------------------------------- + +You can also register the minion as a service, but you need to understand the +implications of doing so. + +- You will need to have administrator privileges to register this minion service +- You will need the password to the user account that will be running the minion +- If the user password changes, you will have to update the service definition + to reflect the new password +- The minion will run all the time under the user context, whether that user is + logged in or not +- This requires great trust from the user as the minion will be able to perform + operations under the user's name without the user knowing, whether they are + logged in or not +- If you decide to run the new minion under the Local System account, it might + as well just be a normal minion +- The helper script does not support registering the 2nd minion as a service + +To register the minion as a service, use the ``ssm.exe`` binary that came with +the Salt installation. Run the following commands, replacing ````, +````, ````, and ```` as necessary: + +.. code-block:: powershell + + ssm.exe install "salt-minion.exe" "-c `"\conf`" -l quiet" + ssm.exe set Description "Salt Minion " + ssm.exe set Start SERVICE_AUTO_START + ssm.exe set AppStopMethodConsole 24000 + ssm.exe set AppStopMethodWindow 2000 + ssm.exe set AppRestartDelay 60000 + ssm.exe set ObjectName ".\" "" diff --git a/pkg/windows/multi-minion.ps1 b/pkg/windows/multi-minion.ps1 index c5f7977afaa..c4adfc4d17d 100644 --- a/pkg/windows/multi-minion.ps1 +++ b/pkg/windows/multi-minion.ps1 @@ -3,140 +3,160 @@ Script for setting up an additional salt-minion on a machine with Salt installed .DESCRIPTION -This script will install an additional minion on a machine that already has a +This script will configure an additional minion on a machine that already has a Salt installation using one of the Salt packages. It will set up the directory structure required by Salt. It will also lay down a minion config to be used -by the Salt minion. Additionaly, this script will install and start a Salt -minion service that uses the root_dir specified in the minion config. You can -also pass the name of a service account to be used by the service. +by the Salt minion. Additionaly, this script can start the new minion in a +hidden window. You can also remove the multiminion setup with this script. -This script should be run with Administrator privileges +This script does not need to be run with Administrator privileges -The following example will install a service named `salt-minion-mm10` that -starts with the LOCALSYSTEM account. It is the `-s` parameter that creates the -service: +If a minion that was configured with this script is already running, the script +will exit. + +The following example will set up a minion for the current logged in account. It +configures the minion to connect to the master at 192.168.0.10 .EXAMPLE -PS>multi-minion.ps1 -Name mm10 -s +PS>multi-minion.ps1 -Master 192.168.0.10 +PS>multi-minion.ps1 -m 192.168.0.10 -The following example will install a service that starts with a user named -mmuser: +The following example will set up a minion for the current logged in account. It +configures the minion to connect to the master at 192.168.0.10. It will also +prefix the minion id with `spongebob` .EXAMPLE -PS>multi-minion.ps1 -Name mm10 -s -m 192.168.0.10 -u mmuser -p secretword +PS>multi-minion.ps1 -Master 192.168.0.10 -Prefix spongebob +PS>multi-minion.ps1 -m 192.168.0.10 -p spongebob -The following example will set up config for minion that can be run in the -background under a user account. Notice the command does not have the `-s` -parameter: +The following example will set up a minion for the current logged in account. It +configures the minion to connect to the master at 192.168.0.10. It will also +start the minion in a hidden window: .EXAMPLE -PS>multi-minion.ps1 -Name mm10 -m 192.168.0.10 +PS>multi-minion.ps1 -Master 192.168.0.10 -Start +PS>multi-minion.ps1 -m 192.168.0.10 -s -The following example will remove a multiminion that has been installed with -this script: +The following example will remove a multiminion for the current running account: .EXAMPLE -PS>multi-minion.ps1 -Name mm10 -d +PS>multi-minion.ps1 -Delete +PS>multi-minion.ps1 -d #> [CmdletBinding()] param( - [Parameter(Mandatory=$true)] - [Alias("n")] - # The name used to create the service and root_dir. This is the only - # required parameter - [String] $Name, - [Parameter(Mandatory=$false)] [Alias("m")] # The master to connect to. This can be an ip address or an fqdn. Default # is salt [String] $Master = "salt", - [Parameter(Mandatory=$false)] - [Alias("r")] - # The root dir to place the minion config and directory structure. The - # default is %PROGRAMDATA%\Salt Project\Salt-$Name - [String] $RootDir = "$env:ProgramData\Salt Project\Salt-$Name", - - [Parameter(Mandatory=$false)] - [Alias("u")] - # User account to run the service under. The user account must be present on - # the system. The default is to use the LOCALSYSTEM account - [String] $User, - [Parameter(Mandatory=$false)] [Alias("p")] - # The password to the user account. Required if User is passed. We should - # probably figure out how to make this more secure - [String] $Password, + # The prefix to the minion id to differentiate it from the installed system + # minion. The default is $env:COMPUTERNAME. It might be helpful to use the + # minion id of the System minion if you know it + [String] $Prefix = "$env:COMPUTERNAME", [Parameter(Mandatory=$false)] [Alias("s")] - # Set this switch to install the service. Default is to not install the - # service - [Switch] $Service, + # Start the minion in the background + [Switch] $Start, + + [Parameter(Mandatory=$false)] + [Alias("l")] + [ValidateSet( + "all", + "garbage", + "trace", + "debug", + "profile", + "info", + "warning", + "error", + "critical", + "quiet" + )] + # Start the minion in the background + [String] $LogLevel = "warning", [Parameter(Mandatory=$false)] [Alias("d")] - # Remove the specified multi-minion. All other parameters are ignored + # Remove the multi-minion in the current account. All other parameters are + # ignored [Switch] $Remove ) ########################### Script Variables ############################# -$ssm_bin = "$env:ProgramFiles\Salt Project\Salt\ssm.exe" +$user_name = [System.Security.Principal.WindowsIdentity]::GetCurrent().Name.Split("\")[-1].ToLower() $salt_bin = "$env:ProgramFiles\Salt Project\Salt\salt-minion.exe" -$service_name = "salt-minion-$($Name.ToLower())" -$default_root_dir = Resolve-Path -Path "$env:ProgramData\Salt Project\Salt" -$cache_dir = "$RootDir\var\cache\salt\minion" +$root_dir = "$env:LocalAppData\Salt Project\Salt" +$cache_dir = "$root_dir\var\cache\salt\minion" +$minion_id = "$Prefix-$user_name" + +########################### Script Functions ############################# +function Test-FileLock { + param ( + [parameter(Mandatory=$true)] + # The path to the file to check + [string]$Path + ) + if ((Test-Path -Path $Path) -eq $false) { + return $false + } + $oFile = New-Object System.IO.FileInfo $Path + try { + $oStream = $oFile.Open([System.IO.FileMode]::Open, [System.IO.FileAccess]::ReadWrite, [System.IO.FileShare]::None) + if ($oStream) { + $oStream.Close() + } + return $false + } catch { + # file is locked by a process. + return $true + } +} ################################ Remove ################################## if ( $Remove ) { Write-Host "######################################################################" -ForegroundColor Cyan Write-Host "Removing multi-minion" - Write-Host "Name: $Name" - Write-Host "Service Name: $service_name" - Write-Host "Root Dir: $RootDir" + Write-Host "Root Dir: $root_dir" Write-Host "######################################################################" -ForegroundColor Cyan - # Stop Service - $service_object = Get-Service -Name $service_name -ErrorAction SilentlyContinue - if ( $service_object -and ($service_object.Status -ne "Stopped") ) { - Write-Host "Stopping service: " -NoNewline - Stop-Service -Name $service_name *> $null - $service_object.Refresh() - if ( $service_object.Status -eq "Stopped" ) { - Write-Host "Success" -ForegroundColor Green - } else { - Write-Host "Failed" -ForegroundColor Red - exit 1 + # Stop salt-minion service if running + $processes = Get-WmiObject win32_process -filter "name like '%salt-minion%'" | Select-Object commandline,handle + $processes | ForEach-Object { + if ( $_.commandline -like "*$root_dir*" ) { + Write-Host "Killing process: " -NoNewline + $process = Get-Process -Id $_.handle + $process.Kill() + if ( $process.HasExited ) { + Write-Host "Success" -ForegroundColor Green + } else { + Write-Host "Failed" -ForegroundColor Red + exit 1 + } } } - # Remove Service - $service_object = Get-Service -Name $service_name -ErrorAction SilentlyContinue - if ( $service_object ) { - Write-Host "Removing service: " -NoNewline - & $ssm_bin remove $service_name confirm *> $null - $service_object = Get-Service -Name $service_name -ErrorAction SilentlyContinue - if ( !$service_object ) { - Write-Host "Success" -ForegroundColor Green - } else { - Write-Host "Failed" -ForegroundColor Red - exit 1 - } + # Check for locked log file + # The log file will be locked until the running process releases it + while (Test-FileLock -Path "$root_dir\var\log\salt\minion") { + Start-Sleep -Seconds 1 } # Remove Directory - if ( Test-Path -Path $RootDir ) { - Write-Host "Removing RootDir: " -NoNewline - Remove-Item -Path $RootDir -Force -Recurse + if ( Test-Path -Path $root_dir) { + Write-Host "Removing Root Dir: " -NoNewline + Remove-Item -Path $root_dir -Force -Recurse - if ( !(Test-Path -Path $RootDir) ) { + if ( !(Test-Path -Path $root_dir) ) { Write-Host "Success" -ForegroundColor Green } else { Write-Host "Failed" -ForegroundColor Red @@ -145,43 +165,44 @@ if ( $Remove ) { } # Remind to delete keys from master Write-Host "######################################################################" -ForegroundColor Cyan - Write-Host "Multi-Minion installed successfully" + Write-Host "Multi-Minion successfully removed" Write-Host ">>>>> Don't forget to remove keys from the master <<<<<" Write-Host "######################################################################" -ForegroundColor Cyan exit 0 } -################################ Install ################################# -# We don't want to share config with the current running minion -if ( $RootDir.Trim("\") -eq $default_root_dir ) { - Write-Host "WARNING: RootDir can't be default Salt rootdir" -ForegroundColor Red - exit 1 +################################ EXISTING CHECK ################################ + +# See there is already a running minion +$running = $false +$processes = Get-WmiObject win32_process -filter "name like '%salt-minion%'" | Select-Object commandline,handle +$processes | ForEach-Object { + if ( $_.commandline -like "*$root_dir*" ) { + $running = $true + } +} +if ( $running ) { + Write-Host "######################################################################" -ForegroundColor Cyan + Write-Host "Multi-Minion" + Write-Host "A minion is already running for this user" + Write-Host "######################################################################" -ForegroundColor Cyan + exit 0 } -# Make sure password is set if user is passed -if ( $User -and !$Password ) { - Write-Host "WARNING: You must pass a password when defining a user account" -ForegroundColor Red - exit 1 -} +################################### INSTALL #################################### Write-Host "######################################################################" -ForegroundColor Cyan -Write-Host "Installing multi-minion" -Write-Host "Name: $Name" -Write-Host "Master: $Master" -Write-Host "Root Directory: $RootDir" -Write-Host "Create Service: $Service" -if ( $Service ) { - Write-Host "Service Account: $User" - Write-Host "Password: **********" - Write-Host "Service Name: $service_name" -} +Write-Host "Installing Multi-Minion" +Write-Host "Master: $Master" +Write-Host "Minion ID: $minion_id" +Write-Host "Root Directory: $root_dir" Write-Host "######################################################################" -ForegroundColor Cyan -# Create file_roots Directory Structure -if ( !( Test-Path -path "$RootDir" ) ) { - Write-Host "Creating RootDir: " -NoNewline - New-Item -Path "$RootDir" -Type Directory | Out-Null - if ( Test-Path -path "$RootDir" ) { +# Create Root Directory Structure +if ( !( Test-Path -path "$root_dir" ) ) { + Write-Host "Creating Root Dir: " -NoNewline + New-Item -Path "$root_dir" -Type Directory | Out-Null + if ( Test-Path -path "$root_dir" ) { Write-Host "Success" -ForegroundColor Green } else { Write-Host "Failed" -ForegroundColor Red @@ -189,80 +210,67 @@ if ( !( Test-Path -path "$RootDir" ) ) { } } -# Set permissions -if ( $User ) { - Write-Host "Setting Permissions: " -NoNewline - $acl = Get-Acl -Path "$RootDir" - $access_rule = New-Object System.Security.AccessControl.FileSystemAccessRule($User, "Modify", "Allow") - $acl.AddAccessRule($access_rule) - Set-Acl -Path "$RootDir" -AclObject $acl - - $found = $false - $acl = Get-Acl -Path "$RootDir" - $acl.Access | ForEach-Object { - if ( $_.IdentityReference.Value.Contains($User) ) { - $found = $true - } - } - if ( $found ) { - Write-Host "Success" -ForegroundColor Green - } else { - Write-Host "Failed" -ForegroundColor Red - exit 1 - } -} - -# Child directories will inherit permissions from the parent -if ( !( Test-Path -path "$RootDir\conf" ) ) { +# Config dir +if ( !( Test-Path -path "$root_dir\conf" ) ) { Write-Host "Creating config dir: " -NoNewline - New-Item -Path "$RootDir\conf" -Type Directory | Out-Null - if ( Test-Path -path "$RootDir\conf" ) { + New-Item -Path "$root_dir\conf" -Type Directory | Out-Null + if ( Test-Path -path "$root_dir\conf" ) { Write-Host "Success" -ForegroundColor Green } else { Write-Host "Failed" -ForegroundColor Red exit 1 } } -if ( !( Test-Path -path "$RootDir\conf\minion.d" ) ) { + +# Minion.d dir +if ( !( Test-Path -path "$root_dir\conf\minion.d" ) ) { Write-Host "Creating minion.d dir: " -NoNewline - New-Item -Path "$RootDir\conf\minion.d" -Type Directory | Out-Null - if ( Test-Path -path "$RootDir\conf\minion.d" ) { + New-Item -Path "$root_dir\conf\minion.d" -Type Directory | Out-Null + if ( Test-Path -path "$root_dir\conf\minion.d" ) { Write-Host "Success" -ForegroundColor Green } else { Write-Host "Failed" -ForegroundColor Red exit 1 } } -if ( !( Test-Path -path "$RootDir\conf\pki" ) ) { + +# PKI dir +if ( !( Test-Path -path "$root_dir\conf\pki" ) ) { Write-Host "Creating pki dir: " -NoNewline - New-Item -Path "$RootDir\conf\pki" -Type Directory | Out-Null - if ( Test-Path -path "$RootDir\conf\pki" ) { + New-Item -Path "$root_dir\conf\pki" -Type Directory | Out-Null + if ( Test-Path -path "$root_dir\conf\pki" ) { Write-Host "Success" -ForegroundColor Green } else { Write-Host "Failed" -ForegroundColor Red exit 1 } } -if ( !( Test-Path -path "$RootDir\var\log\salt" ) ) { + +# Log dir +if ( !( Test-Path -path "$root_dir\var\log\salt" ) ) { Write-Host "Creating log dir: " -NoNewline - New-Item -Path "$RootDir\var\log\salt" -Type Directory | Out-Null - if ( Test-Path -path "$RootDir\var\log\salt" ) { + New-Item -Path "$root_dir\var\log\salt" -Type Directory | Out-Null + if ( Test-Path -path "$root_dir\var\log\salt" ) { Write-Host "Success" -ForegroundColor Green } else { Write-Host "Failed" -ForegroundColor Red exit 1 } } -if ( !( Test-Path -path "$RootDir\var\run" ) ) { + +# Run dir +if ( !( Test-Path -path "$root_dir\var\run" ) ) { Write-Host "Creating run dir: " -NoNewline - New-Item -Path "$RootDir\var\run" -Type Directory | Out-Null - if ( Test-Path -path "$RootDir\var\run" ) { + New-Item -Path "$root_dir\var\run" -Type Directory | Out-Null + if ( Test-Path -path "$root_dir\var\run" ) { Write-Host "Success" -ForegroundColor Green } else { Write-Host "Failed" -ForegroundColor Red exit 1 } } + +# Extmods grains dir if ( !( Test-Path -path "$cache_dir\extmods\grains" ) ) { Write-Host "Creating extmods grains dir: " -NoNewline New-Item -Path "$cache_dir\extmods\grains" -Type Directory | Out-Null @@ -273,6 +281,8 @@ if ( !( Test-Path -path "$cache_dir\extmods\grains" ) ) { exit 1 } } + +# Proc dir if ( !( Test-Path -path "$cache_dir\proc" ) ) { Write-Host "Creating proc dir: " -NoNewline New-Item -Path "$cache_dir\proc" -Type Directory | Out-Null @@ -286,60 +296,53 @@ if ( !( Test-Path -path "$cache_dir\proc" ) ) { # Write minion config Write-Host "Writing minion config: " -NoNewline -Add-Content -Force -Path "$RootDir\conf\minion" -Value "master: $Master" -Add-Content -Force -Path "$RootDir\conf\minion" -Value "id: $Name" -Add-Content -Force -Path "$RootDir\conf\minion" -Value "root_dir: $RootDir" -Add-Content -Force -Path "$RootDir\conf\minion" -Value "log_file: $RootDir\var\log\salt\minion" -Add-Content -Force -Path "$RootDir\conf\minion" -Value "utils_dirs: $RootDir\var\cache\salt\minion\extmods\utils" -Add-Content -Force -Path "$RootDir\conf\minion" -Value "winrepo_dir: $RootDir\srv\salt\win\repo" -Add-Content -Force -Path "$RootDir\conf\minion" -Value "winrepo_dir_ng: $RootDir\srv\salt\win\repo-ng" +Set-Content -Force -Path "$root_dir\conf\minion" -Value "master: $Master" +Add-Content -Force -Path "$root_dir\conf\minion" -Value "id: $minion_id" +Add-Content -Force -Path "$root_dir\conf\minion" -Value "root_dir: $root_dir" +Add-Content -Force -Path "$root_dir\conf\minion" -Value "log_file: $root_dir\var\log\salt\minion" +Add-Content -Force -Path "$root_dir\conf\minion" -Value "log_level_logfile: $LogLevel" -Add-Content -Force -Path "$RootDir\conf\minion" -Value "file_roots:" -Add-Content -Force -Path "$RootDir\conf\minion" -Value " base:" -Add-Content -Force -Path "$RootDir\conf\minion" -Value " - $RootDir\srv\salt" -Add-Content -Force -Path "$RootDir\conf\minion" -Value " - $RootDir\srv\spm\salt" +Add-Content -Force -Path "$root_dir\conf\minion" -Value "utils_dirs:" +Add-Content -Force -Path "$root_dir\conf\minion" -Value " - $root_dir\var\cache\salt\minion\extmods\utils" +Add-Content -Force -Path "$root_dir\conf\minion" -Value "winrepo_dir: $root_dir\srv\salt\win\repo" +Add-Content -Force -Path "$root_dir\conf\minion" -Value "winrepo_dir_ng: $root_dir\srv\salt\win\repo-ng" -Add-Content -Force -Path "$RootDir\conf\minion" -Value "pillar_roots:" -Add-Content -Force -Path "$RootDir\conf\minion" -Value " base:" -Add-Content -Force -Path "$RootDir\conf\minion" -Value " - $RootDir\srv\pillar" -Add-Content -Force -Path "$RootDir\conf\minion" -Value " - $RootDir\srv\spm\pillar" +Add-Content -Force -Path "$root_dir\conf\minion" -Value "file_roots:" +Add-Content -Force -Path "$root_dir\conf\minion" -Value " base:" +Add-Content -Force -Path "$root_dir\conf\minion" -Value " - $root_dir\srv\salt" +Add-Content -Force -Path "$root_dir\conf\minion" -Value " - $root_dir\srv\spm\salt" -Add-Content -Force -Path "$RootDir\conf\minion" -Value "thorium_roots:" -Add-Content -Force -Path "$RootDir\conf\minion" -Value " base:" -Add-Content -Force -Path "$RootDir\conf\minion" -Value " - $RootDir\srv\thorium" +Add-Content -Force -Path "$root_dir\conf\minion" -Value "pillar_roots:" +Add-Content -Force -Path "$root_dir\conf\minion" -Value " base:" +Add-Content -Force -Path "$root_dir\conf\minion" -Value " - $root_dir\srv\pillar" +Add-Content -Force -Path "$root_dir\conf\minion" -Value " - $root_dir\srv\spm\pillar" -if ( Test-Path -path "$RootDir\conf\minion" ) { +Add-Content -Force -Path "$root_dir\conf\minion" -Value "thorium_roots:" +Add-Content -Force -Path "$root_dir\conf\minion" -Value " base:" +Add-Content -Force -Path "$root_dir\conf\minion" -Value " - $root_dir\srv\thorium" + +if ( Test-Path -path "$root_dir\conf\minion" ) { Write-Host "Success" -ForegroundColor Green } else { Write-Host "Failed" -ForegroundColor Red exit 1 } -if ( $Service ) { - # Register salt-minion service using SSM - Write-Host "Registering service $service_name`: " -NoNewline - & $ssm_bin install $service_name "$salt_bin" "-c """"$RootDir\conf"""" -l quiet" *> $null - & $ssm_bin set $service_name Description "Salt Minion $Name" *> $null - & $ssm_bin set $service_name Start SERVICE_AUTO_START *> $null - & $ssm_bin set $service_name AppStopMethodConsole 24000 *> $null - & $ssm_bin set $service_name AppStopMethodWindow 2000 *> $null - & $ssm_bin set $service_name AppRestartDelay 60000 *> $null - if ( $User -and $Password ) { - & $ssm_bin set $service_name ObjectName ".\$User" "$Password" *> $null +# Start the minion +if ( $Start ) { + Write-Host "Starting minion process: " -NoNewline + Start-Process -FilePath "$salt_bin" ` + -ArgumentList "-c","`"$root_dir\conf`"" ` + -WindowStyle Hidden + # Verify running minion + $running = $false + $processes = Get-WmiObject win32_process -filter "name like '%salt-minion%'" | Select-Object commandline,handle + $processes | ForEach-Object { + if ( $_.commandline -like "*$root_dir*" ) { + $running = $true + } } - - $service_object = Get-Service -Name $service_name -ErrorAction SilentlyContinue - if ( $service_object ) { - Write-Host "Success" -ForegroundColor Green - } else { - Write-Host "Failed" -ForegroundColor Red - exit 1 - } - - Write-Host "Starting service: " -NoNewline - Start-Service -Name $service_name - $service_object.Refresh() - if ( $service_object.Status -eq "Running" ) { + if ( $running ) { Write-Host "Success" -ForegroundColor Green } else { Write-Host "Failed" -ForegroundColor Red @@ -349,11 +352,12 @@ if ( $Service ) { Write-Host "######################################################################" -ForegroundColor Cyan Write-Host "Multi-Minion installed successfully" -Write-Host "Root Directory: $RootDir" -if ( $Service ) { - Write-Host "Service Name: $service_name" -} else { +if ( ! $Start ) { + Write-Host "" Write-Host "To start the minion, run the following command:" - Write-Host "salt-minion -c `"$RootDir\conf`"" + Write-Host "salt-minion -c `"$root_dir\conf`"" + Write-Host "" + Write-Host "To start the minion in the background, run the following command:" + Write-Host "Start-Process -FilePath salt-minion.exe -ArgumentList `"-c`",'`"$root_dir\conf`"' -WindowStyle Hidden" } Write-Host "######################################################################" -ForegroundColor Cyan From 71a8f79313b76ec0fdd7e1412600377858619eb7 Mon Sep 17 00:00:00 2001 From: twangboy Date: Sun, 11 Jun 2023 13:05:43 -0600 Subject: [PATCH 008/393] Add changelog --- changelog/64439.added.md | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 changelog/64439.added.md diff --git a/changelog/64439.added.md b/changelog/64439.added.md new file mode 100644 index 00000000000..93c3000643c --- /dev/null +++ b/changelog/64439.added.md @@ -0,0 +1,2 @@ +Added documentation on how to run a 2nd minion in a user context on Windows +Also created a script to automate setting up a 2nd minion From a404f9ec1a6d364edecc753c74d24a31eda76d14 Mon Sep 17 00:00:00 2001 From: twangboy Date: Mon, 12 Jun 2023 13:35:08 -0600 Subject: [PATCH 009/393] Fix spelling issues --- doc/topics/windows/multi-minion.rst | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/doc/topics/windows/multi-minion.rst b/doc/topics/windows/multi-minion.rst index 292f322e4c7..049cd05079f 100644 --- a/doc/topics/windows/multi-minion.rst +++ b/doc/topics/windows/multi-minion.rst @@ -3,11 +3,10 @@ Multi-Minion Setup on Windows ============================= There may be a scenario where having a minion running in the context of the -current logged in user would be useful. For example, the normal minion running +current, logged-in user would be useful. For example, the normal minion running under the service account would perform machine-wide, administrative tasks. The -minion runing under the user context could be launched when the user logs in +minion running under the user context could be launched when the user logs in and would be able to perform configuration tasks as if it were the user itself. -This would be useful for setting user registry settings, for example. The steps required to do this are as follows: @@ -86,7 +85,7 @@ are present: The minion will need is own config, separate from the system minion config. This config tells the minion where everything is as well as defines the master and -minion id. Create a minion config file named minion in the conf directory. +minion id. Create a minion config file named ``minion`` in the conf directory. .. code-block:: powershell From 901708cf0963da1a00a0f3dc169a3f6b0e625c59 Mon Sep 17 00:00:00 2001 From: twangboy Date: Mon, 12 Jun 2023 16:56:06 -0600 Subject: [PATCH 010/393] Add tests for multi-minion script --- pkg/tests/integration/test_multi_minion.py | 127 +++++++++++++++++++++ 1 file changed, 127 insertions(+) create mode 100644 pkg/tests/integration/test_multi_minion.py diff --git a/pkg/tests/integration/test_multi_minion.py b/pkg/tests/integration/test_multi_minion.py new file mode 100644 index 00000000000..1eb3b70cbb3 --- /dev/null +++ b/pkg/tests/integration/test_multi_minion.py @@ -0,0 +1,127 @@ +import os +import pathlib +import subprocess + +import psutil +import pytest + +pytestmark = [ + pytest.mark.skip_unless_on_windows, +] + + +@pytest.fixture +def mm_script(install_salt): + yield install_salt.ssm_bin.parent / "multi-minion.ps1" + + +@pytest.fixture(scope="function") +def mm_conf(mm_script): + yield pathlib.Path(os.getenv("LocalAppData"), "Salt Project", "Salt", "conf") + subprocess.run( + ["powershell", "-c", str(mm_script), "-d"], + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + check=False, + universal_newlines=True, + ) + + +def test_script_present(mm_script): + """ + Ensure the multi-minion.ps1 file is present in the root of the installation + """ + assert mm_script.exists() + + +def test_install(mm_script, mm_conf): + """ + Install a 2nd minion with default settings. Should create a minion config + file in Local AppData + """ + ret = subprocess.run( + ["powershell", "-c", str(mm_script)], + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + check=False, + universal_newlines=True, + ) + assert ret.returncode == 0, ret.stderr + conf_file = mm_conf / "minion" + assert conf_file.exists() + assert conf_file.read_text().find("master: salt") > -1 + + +def test_install_master(mm_script, mm_conf): + """ + Install a 2nd minion and set the master to spongebob + """ + ret = subprocess.run( + ["powershell", "-c", str(mm_script), "-m", "spongebob"], + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + check=False, + universal_newlines=True, + ) + assert ret.returncode == 0, ret.stderr + conf_file = mm_conf / "minion" + assert conf_file.exists() + assert conf_file.read_text().find("master: spongebob") > -1 + + +def test_install_prefix(mm_script, mm_conf): + """ + Install a 2nd minion and add a prefix to the minion id + """ + ret = subprocess.run( + ["powershell", "-c", str(mm_script), "-p", "squarepants"], + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + check=False, + universal_newlines=True, + ) + assert ret.returncode == 0, ret.stderr + conf_file = mm_conf / "minion" + assert conf_file.exists() + assert conf_file.read_text().find("id: squarepants") > -1 + + +def test_install_log_level(mm_script, mm_conf): + """ + Install a 2nd minion and set the log level in the log file to debug + """ + ret = subprocess.run( + ["powershell", "-c", str(mm_script), "-l", "debug"], + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + check=False, + universal_newlines=True, + ) + assert ret.returncode == 0, ret.stderr + conf_file = mm_conf / "minion" + assert conf_file.exists() + assert conf_file.read_text().find("log_level_logfile: debug") > -1 + + +def test_install_start(mm_script, mm_conf): + """ + Install a 2nd minion and start that minion in a hidden process + """ + ret = subprocess.run( + ["powershell", "-c", str(mm_script), "-s"], + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + check=False, + universal_newlines=True, + ) + assert ret.returncode == 0, ret.stderr + conf_file = mm_conf / "minion" + assert conf_file.exists() + assert conf_file.read_text().find("master: salt") > -1 + + found = False + for p in psutil.process_iter(["cmdline", "name"]): + if p.info["name"] and p.info["name"] == "salt-minion.exe": + if f"{mm_conf}" in p.info["cmdline"]: + found = True + assert found is True From d516d1784042b88a62e6d9cf52bb05562d326b75 Mon Sep 17 00:00:00 2001 From: twangboy Date: Tue, 13 Jun 2023 10:17:42 -0600 Subject: [PATCH 011/393] Quote path to salt-bin --- pkg/windows/multi-minion.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/windows/multi-minion.ps1 b/pkg/windows/multi-minion.ps1 index c4adfc4d17d..838fbef1a3f 100644 --- a/pkg/windows/multi-minion.ps1 +++ b/pkg/windows/multi-minion.ps1 @@ -331,7 +331,7 @@ if ( Test-Path -path "$root_dir\conf\minion" ) { # Start the minion if ( $Start ) { Write-Host "Starting minion process: " -NoNewline - Start-Process -FilePath "$salt_bin" ` + Start-Process -FilePath "`"$salt_bin`"" ` -ArgumentList "-c","`"$root_dir\conf`"" ` -WindowStyle Hidden # Verify running minion From f036af2953836745e17f425da454445dcf3ea132 Mon Sep 17 00:00:00 2001 From: twangboy Date: Tue, 13 Jun 2023 11:42:57 -0600 Subject: [PATCH 012/393] Quote spaces in the script path --- pkg/tests/integration/test_multi_minion.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pkg/tests/integration/test_multi_minion.py b/pkg/tests/integration/test_multi_minion.py index 1eb3b70cbb3..f4162958e6b 100644 --- a/pkg/tests/integration/test_multi_minion.py +++ b/pkg/tests/integration/test_multi_minion.py @@ -19,7 +19,7 @@ def mm_script(install_salt): def mm_conf(mm_script): yield pathlib.Path(os.getenv("LocalAppData"), "Salt Project", "Salt", "conf") subprocess.run( - ["powershell", "-c", str(mm_script), "-d"], + ["powershell", str(mm_script).replace(" ", "' '"), "-d"], stdout=subprocess.PIPE, stderr=subprocess.PIPE, check=False, @@ -40,7 +40,7 @@ def test_install(mm_script, mm_conf): file in Local AppData """ ret = subprocess.run( - ["powershell", "-c", str(mm_script)], + ["powershell", str(mm_script).replace(" ", "' '")], stdout=subprocess.PIPE, stderr=subprocess.PIPE, check=False, @@ -57,7 +57,7 @@ def test_install_master(mm_script, mm_conf): Install a 2nd minion and set the master to spongebob """ ret = subprocess.run( - ["powershell", "-c", str(mm_script), "-m", "spongebob"], + ["powershell", str(mm_script).replace(" ", "' '"), "-m", "spongebob"], stdout=subprocess.PIPE, stderr=subprocess.PIPE, check=False, @@ -74,7 +74,7 @@ def test_install_prefix(mm_script, mm_conf): Install a 2nd minion and add a prefix to the minion id """ ret = subprocess.run( - ["powershell", "-c", str(mm_script), "-p", "squarepants"], + ["powershell", str(mm_script).replace(" ", "' '"), "-p", "squarepants"], stdout=subprocess.PIPE, stderr=subprocess.PIPE, check=False, @@ -91,7 +91,7 @@ def test_install_log_level(mm_script, mm_conf): Install a 2nd minion and set the log level in the log file to debug """ ret = subprocess.run( - ["powershell", "-c", str(mm_script), "-l", "debug"], + ["powershell", str(mm_script).replace(" ", "' '"), "-l", "debug"], stdout=subprocess.PIPE, stderr=subprocess.PIPE, check=False, @@ -108,7 +108,7 @@ def test_install_start(mm_script, mm_conf): Install a 2nd minion and start that minion in a hidden process """ ret = subprocess.run( - ["powershell", "-c", str(mm_script), "-s"], + ["powershell", str(mm_script).replace(" ", "' '"), "-s"], stdout=subprocess.PIPE, stderr=subprocess.PIPE, check=False, From e7832f772d5c2c84c8c027f9c1953969a5c63279 Mon Sep 17 00:00:00 2001 From: twangboy Date: Wed, 14 Jun 2023 22:47:08 -0600 Subject: [PATCH 013/393] Add suggested docs fixes --- changelog/64439.added.md | 3 +- doc/topics/windows/multi-minion.rst | 59 ++++++++++++---------- pkg/tests/integration/test_multi_minion.py | 10 ++-- pkg/windows/multi-minion.ps1 | 26 +++++----- 4 files changed, 52 insertions(+), 46 deletions(-) diff --git a/changelog/64439.added.md b/changelog/64439.added.md index 93c3000643c..a26b56f9cbc 100644 --- a/changelog/64439.added.md +++ b/changelog/64439.added.md @@ -1,2 +1 @@ -Added documentation on how to run a 2nd minion in a user context on Windows -Also created a script to automate setting up a 2nd minion +Added a script to automate setting up a 2nd minion in a user context on Windows diff --git a/doc/topics/windows/multi-minion.rst b/doc/topics/windows/multi-minion.rst index 049cd05079f..17f50e96259 100644 --- a/doc/topics/windows/multi-minion.rst +++ b/doc/topics/windows/multi-minion.rst @@ -1,5 +1,5 @@ ============================= -Multi-Minion Setup on Windows +Multi-minion setup on Windows ============================= There may be a scenario where having a minion running in the context of the @@ -14,18 +14,21 @@ The steps required to do this are as follows: 2. Set root_dir permissions 3. Create directory structure 4. Write minion config - -We will now go through each of these steps in detail. +5. Start the minion +6. Register the minion as a service (optional) .. note:: - We have created a powershell script that will configure an additional minion - on the system for you. It can be found in the root of the Salt installation. - The script is named ``multi-minion.ps1``. You can get help on how to use the - script by running the following in a PowerShell prompt: + The Salt Project has created a powershell script that will configure an + additional minion on the system for you. It can be found in the root of the + Salt installation. The script is named ``multi-minion.ps1``. You can get + help on how to use the script by running the following in a PowerShell + prompt: ``Get-Help .\multi-minion.ps1 -Detailed`` +The following guide explains these steps in more detail. + 1. Create new ``root_dir`` -------------------------- @@ -42,7 +45,8 @@ put the ``root_dir`` in the Local AppData directory (``$env:LocalAppData``). The user running Salt requires full access to the ``root_dir``. If you have placed the root_dir in a location that the user does not have access to, you'll -need to give the user full permissions to that directory. +need to give the user full permissions to that directory. Replace the + in this example with your own configuration information. .. code-block:: powershell @@ -57,9 +61,9 @@ need to give the user full permissions to that directory. ----------------------------- Salt expects a certain directory structure to be present to avoid unnecessary -messages in the logs. This is usually handled by the installer. Since we're -running our own instance, we need to do it. Make sure the following directories -are present: +messages in the logs. This is usually handled by the installer. Since you're +running your own instance, you need to do it. Make sure the following +directories are present: - root_dir\\conf\\minion.d - root_dir\\conf\\pki @@ -83,9 +87,10 @@ are present: 4. Write minion config ---------------------- -The minion will need is own config, separate from the system minion config. This -config tells the minion where everything is as well as defines the master and -minion id. Create a minion config file named ``minion`` in the conf directory. +The minion will need its own config, separate from the system minion config. +This config tells the minion where everything is located in the file structure +and also defines the master and minion id. Create a minion config file named +``minion`` in the conf directory. .. code-block:: powershell @@ -119,8 +124,8 @@ Make sure the config file has at least the following contents: base: - \srv\thorium -Run the minion --------------- +5. Run the minion +----------------- Everything is now set up to run the minion. You can start the minion as you would normally, but you need to specify the full path to the config file you @@ -130,24 +135,26 @@ created above. salt-minion.exe -c \conf -Register the minion as a service --------------------------------- +6. Register the minion as a service (optional) +---------------------------------------------- You can also register the minion as a service, but you need to understand the implications of doing so. -- You will need to have administrator privileges to register this minion service -- You will need the password to the user account that will be running the minion +- You will need to have administrator privileges to register this minion + service. +- You will need the password to the user account that will be running the + minion. - If the user password changes, you will have to update the service definition - to reflect the new password -- The minion will run all the time under the user context, whether that user is - logged in or not + to reflect the new password. +- The minion runs all the time under the user context, whether that user is + logged in or not. - This requires great trust from the user as the minion will be able to perform operations under the user's name without the user knowing, whether they are - logged in or not + logged in or not. - If you decide to run the new minion under the Local System account, it might - as well just be a normal minion -- The helper script does not support registering the 2nd minion as a service + as well just be a normal minion. +- The helper script does not support registering the second minion as a service. To register the minion as a service, use the ``ssm.exe`` binary that came with the Salt installation. Run the following commands, replacing ````, diff --git a/pkg/tests/integration/test_multi_minion.py b/pkg/tests/integration/test_multi_minion.py index f4162958e6b..13d64f31f6e 100644 --- a/pkg/tests/integration/test_multi_minion.py +++ b/pkg/tests/integration/test_multi_minion.py @@ -36,7 +36,7 @@ def test_script_present(mm_script): def test_install(mm_script, mm_conf): """ - Install a 2nd minion with default settings. Should create a minion config + Install a second minion with default settings. Should create a minion config file in Local AppData """ ret = subprocess.run( @@ -54,7 +54,7 @@ def test_install(mm_script, mm_conf): def test_install_master(mm_script, mm_conf): """ - Install a 2nd minion and set the master to spongebob + Install a second minion and set the master to spongebob """ ret = subprocess.run( ["powershell", str(mm_script).replace(" ", "' '"), "-m", "spongebob"], @@ -71,7 +71,7 @@ def test_install_master(mm_script, mm_conf): def test_install_prefix(mm_script, mm_conf): """ - Install a 2nd minion and add a prefix to the minion id + Install a second minion and add a prefix to the minion id """ ret = subprocess.run( ["powershell", str(mm_script).replace(" ", "' '"), "-p", "squarepants"], @@ -88,7 +88,7 @@ def test_install_prefix(mm_script, mm_conf): def test_install_log_level(mm_script, mm_conf): """ - Install a 2nd minion and set the log level in the log file to debug + Install a second minion and set the log level in the log file to debug """ ret = subprocess.run( ["powershell", str(mm_script).replace(" ", "' '"), "-l", "debug"], @@ -105,7 +105,7 @@ def test_install_log_level(mm_script, mm_conf): def test_install_start(mm_script, mm_conf): """ - Install a 2nd minion and start that minion in a hidden process + Install a second minion and start that minion in a hidden process """ ret = subprocess.run( ["powershell", str(mm_script).replace(" ", "' '"), "-s"], diff --git a/pkg/windows/multi-minion.ps1 b/pkg/windows/multi-minion.ps1 index 838fbef1a3f..8ad709c04cc 100644 --- a/pkg/windows/multi-minion.ps1 +++ b/pkg/windows/multi-minion.ps1 @@ -3,9 +3,9 @@ Script for setting up an additional salt-minion on a machine with Salt installed .DESCRIPTION -This script will configure an additional minion on a machine that already has a -Salt installation using one of the Salt packages. It will set up the directory -structure required by Salt. It will also lay down a minion config to be used +This script configures an additional minion on a machine that already has a Salt +installation using one of the Salt packages. It sets up the directory structure +required by Salt. It also lays down a minion config to be used by the Salt minion. Additionaly, this script can start the new minion in a hidden window. @@ -16,30 +16,30 @@ This script does not need to be run with Administrator privileges If a minion that was configured with this script is already running, the script will exit. -The following example will set up a minion for the current logged in account. It +The following example sets up a minion for the current logged in account. It configures the minion to connect to the master at 192.168.0.10 .EXAMPLE PS>multi-minion.ps1 -Master 192.168.0.10 PS>multi-minion.ps1 -m 192.168.0.10 -The following example will set up a minion for the current logged in account. It -configures the minion to connect to the master at 192.168.0.10. It will also -prefix the minion id with `spongebob` +The following example sets up a minion for the current logged in account. It +configures the minion to connect to the master at 192.168.0.10. It also prefixes +the minion id with `spongebob` .EXAMPLE PS>multi-minion.ps1 -Master 192.168.0.10 -Prefix spongebob PS>multi-minion.ps1 -m 192.168.0.10 -p spongebob -The following example will set up a minion for the current logged in account. It -configures the minion to connect to the master at 192.168.0.10. It will also -start the minion in a hidden window: +The following example sets up a minion for the current logged in account. It +configures the minion to connect to the master at 192.168.0.10. It also starts +the minion in a hidden window: .EXAMPLE PS>multi-minion.ps1 -Master 192.168.0.10 -Start PS>multi-minion.ps1 -m 192.168.0.10 -s -The following example will remove a multiminion for the current running account: +The following example removes a multiminion for the current running account: .EXAMPLE PS>multi-minion.ps1 -Delete @@ -60,7 +60,7 @@ param( [Alias("p")] # The prefix to the minion id to differentiate it from the installed system # minion. The default is $env:COMPUTERNAME. It might be helpful to use the - # minion id of the System minion if you know it + # minion id of the system minion if you know it [String] $Prefix = "$env:COMPUTERNAME", [Parameter(Mandatory=$false)] @@ -82,7 +82,7 @@ param( "critical", "quiet" )] - # Start the minion in the background + # Set the log level for log file. Default is `warning` [String] $LogLevel = "warning", [Parameter(Mandatory=$false)] From eabc42cce72ce185fdbe36df9cd9e5f6b027fb78 Mon Sep 17 00:00:00 2001 From: jeanluc Date: Wed, 21 Jun 2023 13:40:20 +0200 Subject: [PATCH 014/393] Add tests for salt-ssh `state.*` exitcodes --- tests/pytests/integration/ssh/test_state.py | 341 ++++++++++++++++++++ 1 file changed, 341 insertions(+) diff --git a/tests/pytests/integration/ssh/test_state.py b/tests/pytests/integration/ssh/test_state.py index 9d3a38d2c9f..5f9bfb45e9f 100644 --- a/tests/pytests/integration/ssh/test_state.py +++ b/tests/pytests/integration/ssh/test_state.py @@ -2,6 +2,8 @@ import json import pytest +from salt.defaults.exitcodes import EX_AGGREGATE + pytestmark = [ pytest.mark.skip_on_windows(reason="salt-ssh not available on Windows"), ] @@ -75,6 +77,129 @@ def state_tree_dir(base_env_state_tree_root_dir): yield +@pytest.fixture(scope="class") +def state_tree_render_fail(base_env_state_tree_root_dir): + top_file = """ + base: + 'localhost': + - fail_render + '127.0.0.1': + - fail_render + """ + state_file = r""" + abc var is not defined {{ abc }}: + test.nop + """ + top_tempfile = pytest.helpers.temp_file( + "top.sls", top_file, base_env_state_tree_root_dir + ) + state_tempfile = pytest.helpers.temp_file( + "fail_render.sls", state_file, base_env_state_tree_root_dir + ) + with top_tempfile, state_tempfile: + yield + + +@pytest.fixture(scope="class") +def state_tree_req_fail(base_env_state_tree_root_dir): + top_file = """ + base: + 'localhost': + - fail_req + '127.0.0.1': + - fail_req + """ + state_file = """ + This has an invalid requisite: + test.nop: + - name: foo + - require_in: + - file.managed: invalid_requisite + """ + top_tempfile = pytest.helpers.temp_file( + "top.sls", top_file, base_env_state_tree_root_dir + ) + state_tempfile = pytest.helpers.temp_file( + "fail_req.sls", state_file, base_env_state_tree_root_dir + ) + with top_tempfile, state_tempfile: + yield + + +@pytest.fixture(scope="class") +def state_tree_structure_fail(base_env_state_tree_root_dir): + top_file = """ + base: + 'localhost': + - fail_structure + '127.0.0.1': + - fail_structure + """ + state_file = """ + extend: + Some file state: + file: + - name: /tmp/bar + - contents: bar + """ + top_tempfile = pytest.helpers.temp_file( + "top.sls", top_file, base_env_state_tree_root_dir + ) + state_tempfile = pytest.helpers.temp_file( + "fail_structure.sls", state_file, base_env_state_tree_root_dir + ) + with top_tempfile, state_tempfile: + yield + + +@pytest.fixture(scope="class") +def state_tree_run_fail(base_env_state_tree_root_dir): + top_file = """ + base: + 'localhost': + - fail_run + '127.0.0.1': + - fail_run + """ + state_file = """ + This file state fails: + file.managed: + - name: /tmp/non/ex/is/tent + - makedirs: false + - contents: foo + """ + top_tempfile = pytest.helpers.temp_file( + "top.sls", top_file, base_env_state_tree_root_dir + ) + state_tempfile = pytest.helpers.temp_file( + "fail_run.sls", state_file, base_env_state_tree_root_dir + ) + with top_tempfile, state_tempfile: + yield + + +@pytest.fixture(scope="class") +def pillar_tree_render_fail(base_env_pillar_tree_root_dir): + top_file = """ + base: + 'localhost': + - fail_render + '127.0.0.1': + - fail_render + """ + pillar_file = r""" + not_defined: {{ abc }} + """ + top_tempfile = pytest.helpers.temp_file( + "top.sls", top_file, base_env_pillar_tree_root_dir + ) + pillar_tempfile = pytest.helpers.temp_file( + "fail_render.sls", pillar_file, base_env_pillar_tree_root_dir + ) + with top_tempfile, pillar_tempfile: + yield + + @pytest.mark.slow_test def test_state_with_import(salt_ssh_cli, state_tree): """ @@ -220,3 +345,219 @@ def test_state_high(salt_ssh_cli): ]["stdout"] == "blah" ) + + +@pytest.mark.slow_test +@pytest.mark.usefixtures("state_tree_render_fail") +class TestRenderExceptionRetcode: + """ + Verify salt-ssh fails with a retcode > 0 when a state rendering fails. + """ + + def test_retcode_state_sls_render_exception(self, salt_ssh_cli): + ret = salt_ssh_cli.run("state.sls", "fail_render") + self._assert_ret(ret, EX_AGGREGATE) + + def test_retcode_state_highstate_render_exception(self, salt_ssh_cli): + ret = salt_ssh_cli.run("state.highstate") + self._assert_ret(ret, EX_AGGREGATE) + + def test_retcode_state_sls_id_render_exception(self, salt_ssh_cli): + ret = salt_ssh_cli.run("state.sls_id", "foo", "fail_render") + self._assert_ret(ret, EX_AGGREGATE) + + def test_retcode_state_show_sls_render_exception(self, salt_ssh_cli): + ret = salt_ssh_cli.run("state.show_sls", "fail_render") + self._assert_ret(ret, EX_AGGREGATE) + + def test_retcode_state_show_low_sls_render_exception(self, salt_ssh_cli): + ret = salt_ssh_cli.run("state.show_low_sls", "fail_render") + self._assert_ret(ret, EX_AGGREGATE) + + def test_retcode_state_show_highstate_render_exception(self, salt_ssh_cli): + ret = salt_ssh_cli.run("state.show_highstate") + self._assert_ret(ret, EX_AGGREGATE) + + def test_retcode_state_show_lowstate_render_exception(self, salt_ssh_cli): + ret = salt_ssh_cli.run("state.show_lowstate") + # state.show_lowstate exits with 0 for non-ssh as well + self._assert_ret(ret, 0) + + def test_retcode_state_top_render_exception(self, salt_ssh_cli): + ret = salt_ssh_cli.run("state.top", "top.sls") + self._assert_ret(ret, EX_AGGREGATE) + + def test_retcode_state_single_render_exception(self, salt_ssh_cli): + ret = salt_ssh_cli.run("state.single", "file") + assert ret.returncode == EX_AGGREGATE + assert isinstance(ret.data, str) + assert "single() missing 1 required positional argument" in ret.data + + def _assert_ret(self, ret, retcode): + assert ret.returncode == retcode + assert isinstance(ret.data, list) + assert ret.data + assert isinstance(ret.data[0], str) + assert ret.data[0].startswith( + "Rendering SLS 'base:fail_render' failed: Jinja variable 'abc' is undefined;" + ) + + +@pytest.mark.slow_test +@pytest.mark.usefixtures("pillar_tree_render_fail") +class TestPillarRenderExceptionRetcode: + """ + Verify salt-ssh fails with a retcode > 0 when a pillar rendering fails. + """ + + def test_retcode_state_sls_pillar_render_exception(self, salt_ssh_cli): + ret = salt_ssh_cli.run("state.sls", "basic") + self._assert_ret(ret) + + def test_retcode_state_highstate_pillar_render_exception(self, salt_ssh_cli): + ret = salt_ssh_cli.run("state.highstate") + self._assert_ret(ret) + + def test_retcode_state_sls_id_pillar_render_exception(self, salt_ssh_cli): + ret = salt_ssh_cli.run("state.sls_id", "foo", "basic") + self._assert_ret(ret) + + def test_retcode_state_show_sls_pillar_render_exception(self, salt_ssh_cli): + ret = salt_ssh_cli.run("state.show_sls", "basic") + self._assert_ret(ret) + + def test_retcode_state_show_low_sls_pillar_render_exception(self, salt_ssh_cli): + ret = salt_ssh_cli.run("state.show_low_sls", "basic") + self._assert_ret(ret) + + def test_retcode_state_show_highstate_pillar_render_exception(self, salt_ssh_cli): + ret = salt_ssh_cli.run("state.show_highstate") + self._assert_ret(ret) + + def test_retcode_state_show_lowstate_pillar_render_exception(self, salt_ssh_cli): + ret = salt_ssh_cli.run("state.show_lowstate") + self._assert_ret(ret) + + def test_retcode_state_top_pillar_render_exception(self, salt_ssh_cli): + ret = salt_ssh_cli.run("state.top", "top.sls") + self._assert_ret(ret) + + def _assert_ret(self, ret): + assert ret.returncode == EX_AGGREGATE + assert isinstance(ret.data, list) + assert ret.data + assert isinstance(ret.data[0], str) + assert ret.data[0] == "Pillar failed to render with the following messages:" + assert ret.data[1].startswith("Rendering SLS 'fail_render' failed.") + + +@pytest.mark.slow_test +@pytest.mark.usefixtures("state_tree_req_fail") +class TestStateReqFailRetcode: + """ + Verify salt-ssh fails with a retcode > 0 when a highstate verification fails. + ``state.show_highstate`` does not validate this. + """ + + def test_retcode_state_sls_invalid_requisite(self, salt_ssh_cli): + ret = salt_ssh_cli.run("state.sls", "fail_req") + self._assert_ret(ret, EX_AGGREGATE) + + def test_retcode_state_highstate_invalid_requisite(self, salt_ssh_cli): + ret = salt_ssh_cli.run("state.highstate") + self._assert_ret(ret, EX_AGGREGATE) + + def test_retcode_state_show_sls_invalid_requisite(self, salt_ssh_cli): + ret = salt_ssh_cli.run("state.show_sls", "fail_req") + self._assert_ret(ret, EX_AGGREGATE) + + def test_retcode_state_show_low_sls_invalid_requisite(self, salt_ssh_cli): + ret = salt_ssh_cli.run("state.show_low_sls", "fail_req") + self._assert_ret(ret, EX_AGGREGATE) + + def test_retcode_state_show_lowstate_invalid_requisite(self, salt_ssh_cli): + ret = salt_ssh_cli.run("state.show_lowstate") + # state.show_lowstate exits with 0 for non-ssh as well + self._assert_ret(ret, 0) + + def test_retcode_state_top_invalid_requisite(self, salt_ssh_cli): + ret = salt_ssh_cli.run("state.top", "top.sls") + self._assert_ret(ret, EX_AGGREGATE) + + def _assert_ret(self, ret, retcode): + assert ret.returncode == retcode + assert isinstance(ret.data, list) + assert ret.data + assert isinstance(ret.data[0], str) + assert ret.data[0].startswith( + "Invalid requisite in require: file.managed for invalid_requisite" + ) + + +@pytest.mark.slow_test +@pytest.mark.usefixtures("state_tree_structure_fail") +class TestStateStructureFailRetcode: + """ + Verify salt-ssh fails with a retcode > 0 when a highstate verification fails. + This targets another step of the verification. + ``state.sls_id`` does not seem to support extends. + ``state.show_highstate`` does not validate this. + """ + + def test_retcode_state_sls_invalid_structure(self, salt_ssh_cli): + ret = salt_ssh_cli.run("state.sls", "fail_structure") + self._assert_ret(ret, EX_AGGREGATE) + + def test_retcode_state_highstate_invalid_structure(self, salt_ssh_cli): + ret = salt_ssh_cli.run("state.highstate") + self._assert_ret(ret, EX_AGGREGATE) + + def test_retcode_state_show_sls_invalid_structure(self, salt_ssh_cli): + ret = salt_ssh_cli.run("state.show_sls", "fail_structure") + self._assert_ret(ret, EX_AGGREGATE) + + def test_retcode_state_show_low_sls_invalid_structure(self, salt_ssh_cli): + ret = salt_ssh_cli.run("state.show_low_sls", "fail_structure") + self._assert_ret(ret, EX_AGGREGATE) + + def test_retcode_state_show_lowstate_invalid_structure(self, salt_ssh_cli): + ret = salt_ssh_cli.run("state.show_lowstate") + # state.show_lowstate exits with 0 for non-ssh as well + self._assert_ret(ret, 0) + + def test_retcode_state_top_invalid_structure(self, salt_ssh_cli): + ret = salt_ssh_cli.run("state.top", "top.sls") + self._assert_ret(ret, EX_AGGREGATE) + + def _assert_ret(self, ret, retcode): + assert ret.returncode == retcode + assert isinstance(ret.data, list) + assert ret.data + assert isinstance(ret.data[0], str) + assert ret.data[0].startswith( + "Cannot extend ID 'Some file state' in 'base:fail_structure" + ) + + +@pytest.mark.slow_test +@pytest.mark.usefixtures("state_tree_run_fail") +class TestStateRunFailRetcode: + """ + Verify salt-ssh passes on a failing retcode from state execution. + """ + + def test_retcode_state_sls_run_fail(self, salt_ssh_cli): + ret = salt_ssh_cli.run("state.sls", "fail_run") + assert ret.returncode == EX_AGGREGATE + + def test_retcode_state_highstate_run_fail(self, salt_ssh_cli): + ret = salt_ssh_cli.run("state.highstate") + assert ret.returncode == EX_AGGREGATE + + def test_retcode_state_sls_id_render_exception(self, salt_ssh_cli): + ret = salt_ssh_cli.run("state.sls_id", "This file state fails", "fail_run") + assert ret.returncode == EX_AGGREGATE + + def test_retcode_state_top_run_fail(self, salt_ssh_cli): + ret = salt_ssh_cli.run("state.top", "top.sls") + assert ret.returncode == EX_AGGREGATE From b58190a56e1986dfca357472c113afb26ce5535a Mon Sep 17 00:00:00 2001 From: jeanluc Date: Wed, 21 Jun 2023 15:38:32 +0200 Subject: [PATCH 015/393] Fix salt-ssh state.* commands retcode for render fail --- changelog/64514.fixed.md | 1 + salt/client/ssh/__init__.py | 40 ++++++++++-------- salt/client/ssh/wrapper/state.py | 70 ++++++++++++++++++++++++++++---- 3 files changed, 84 insertions(+), 27 deletions(-) create mode 100644 changelog/64514.fixed.md diff --git a/changelog/64514.fixed.md b/changelog/64514.fixed.md new file mode 100644 index 00000000000..b84fb366bf1 --- /dev/null +++ b/changelog/64514.fixed.md @@ -0,0 +1 @@ +Fixed salt-ssh state.* commands returning retcode 0 when state/pillar rendering fails diff --git a/salt/client/ssh/__init__.py b/salt/client/ssh/__init__.py index 88365a60994..4a1e785e6b6 100644 --- a/salt/client/ssh/__init__.py +++ b/salt/client/ssh/__init__.py @@ -552,6 +552,11 @@ class SSH(MultiprocessingStateMixin): data = salt.utils.json.find_json(stdout) if len(data) < 2 and "local" in data: ret["ret"] = data["local"] + try: + # Ensure a reported local retcode is kept + retcode = data["local"]["retcode"] + except (KeyError, TypeError): + pass else: ret["ret"] = { "stdout": stdout, @@ -564,7 +569,7 @@ class SSH(MultiprocessingStateMixin): "stderr": stderr, "retcode": retcode, } - que.put(ret) + que.put((ret, retcode)) def handle_ssh(self, mine=False): """ @@ -608,7 +613,7 @@ class SSH(MultiprocessingStateMixin): "fun": "", "id": host, } - yield {host: no_ret} + yield {host: no_ret}, 1 continue args = ( que, @@ -622,11 +627,12 @@ class SSH(MultiprocessingStateMixin): running[host] = {"thread": routine} continue ret = {} + retcode = 0 try: - ret = que.get(False) + ret, retcode = que.get(False) if "id" in ret: returned.add(ret["id"]) - yield {ret["id"]: ret["ret"]} + yield {ret["id"]: ret["ret"]}, retcode except queue.Empty: pass for host in running: @@ -636,10 +642,10 @@ class SSH(MultiprocessingStateMixin): # last checked try: while True: - ret = que.get(False) + ret, retcode = que.get(False) if "id" in ret: returned.add(ret["id"]) - yield {ret["id"]: ret["ret"]} + yield {ret["id"]: ret["ret"]}, retcode except queue.Empty: pass @@ -650,7 +656,7 @@ class SSH(MultiprocessingStateMixin): ) ret = {"id": host, "ret": error} log.error(error) - yield {ret["id"]: ret["ret"]} + yield {ret["id"]: ret["ret"]}, 1 running[host]["thread"].join() rets.add(host) for host in rets: @@ -705,8 +711,8 @@ class SSH(MultiprocessingStateMixin): jid, job_load ) - for ret in self.handle_ssh(mine=mine): - host = next(iter(ret.keys())) + for ret, _ in self.handle_ssh(mine=mine): + host = next(iter(ret)) self.cache_job(jid, host, ret[host], fun) if self.event: id_, data = next(iter(ret.items())) @@ -799,15 +805,9 @@ class SSH(MultiprocessingStateMixin): sret = {} outputter = self.opts.get("output", "nested") final_exit = 0 - for ret in self.handle_ssh(): - host = next(iter(ret.keys())) - if isinstance(ret[host], dict): - host_ret = ret[host].get("retcode", 0) - if host_ret != 0: - final_exit = 1 - else: - # Error on host - final_exit = 1 + for ret, retcode in self.handle_ssh(): + host = next(iter(ret)) + final_exit = max(final_exit, retcode) self.cache_job(jid, host, ret[host], fun) ret = self.key_deploy(host, ret) @@ -1274,6 +1274,10 @@ class Single: ) log.error(result, exc_info_on_loglevel=logging.DEBUG) retcode = 1 + + # Ensure retcode from wrappers is respected, especially state render exceptions + retcode = max(retcode, self.context.get("retcode", 0)) + # Mimic the json data-structure that "salt-call --local" will # emit (as seen in ssh_py_shim.py) if isinstance(result, dict) and "local" in result: diff --git a/salt/client/ssh/wrapper/state.py b/salt/client/ssh/wrapper/state.py index 002853972ab..0a1d5bdf5f9 100644 --- a/salt/client/ssh/wrapper/state.py +++ b/salt/client/ssh/wrapper/state.py @@ -8,6 +8,7 @@ import time import salt.client.ssh.shell import salt.client.ssh.state +import salt.defaults.exitcodes import salt.loader import salt.minion import salt.roster @@ -84,14 +85,14 @@ def _set_retcode(ret, highstate=None): """ # Set default retcode to 0 - __context__["retcode"] = 0 + __context__["retcode"] = salt.defaults.exitcodes.EX_OK if isinstance(ret, list): - __context__["retcode"] = 1 + __context__["retcode"] = salt.defaults.exitcodes.EX_STATE_COMPILER_ERROR return if not salt.utils.state.check_result(ret, highstate=highstate): - __context__["retcode"] = 2 + __context__["retcode"] = salt.defaults.exitcodes.EX_STATE_FAILURE def _check_pillar(kwargs, pillar=None): @@ -182,6 +183,11 @@ def sls(mods, saltenv="base", test=None, exclude=None, **kwargs): __context__["fileclient"], context=__context__.value(), ) as st_: + if not _check_pillar(kwargs, st_.opts["pillar"]): + __context__["retcode"] = salt.defaults.exitcodes.EX_PILLAR_FAILURE + err = ["Pillar failed to render with the following messages:"] + err += st_.opts["pillar"]["_errors"] + return err st_.push_active() mods = _parse_mods(mods) high_data, errors = st_.render_highstate( @@ -198,12 +204,14 @@ def sls(mods, saltenv="base", test=None, exclude=None, **kwargs): errors += ext_errors errors += st_.state.verify_high(high_data) if errors: + __context__["retcode"] = salt.defaults.exitcodes.EX_STATE_COMPILER_ERROR return errors high_data, req_in_errors = st_.state.requisite_in(high_data) errors += req_in_errors high_data = st_.state.apply_exclude(high_data) # Verify that the high data is structurally sound if errors: + __context__["retcode"] = salt.defaults.exitcodes.EX_STATE_COMPILER_ERROR return errors # Compile and verify the raw chunks chunks = st_.state.compile_high_data(high_data) @@ -316,7 +324,7 @@ def _check_queue(queue, kwargs): else: conflict = running(concurrent=kwargs.get("concurrent", False)) if conflict: - __context__["retcode"] = 1 + __context__["retcode"] = salt.defaults.exitcodes.EX_STATE_COMPILER_ERROR return conflict @@ -681,6 +689,11 @@ def highstate(test=None, **kwargs): __context__["fileclient"], context=__context__.value(), ) as st_: + if not _check_pillar(kwargs, st_.opts["pillar"]): + __context__["retcode"] = salt.defaults.exitcodes.EX_PILLAR_FAILURE + err = ["Pillar failed to render with the following messages:"] + err += st_.opts["pillar"]["_errors"] + return err st_.push_active() chunks = st_.compile_low_chunks(context=__context__.value()) file_refs = salt.client.ssh.state.lowstate_file_refs( @@ -692,7 +705,7 @@ def highstate(test=None, **kwargs): # Check for errors for chunk in chunks: if not isinstance(chunk, dict): - __context__["retcode"] = 1 + __context__["retcode"] = salt.defaults.exitcodes.EX_STATE_COMPILER_ERROR return chunks roster = salt.roster.Roster(opts, opts.get("roster", "flat")) @@ -766,9 +779,19 @@ def top(topfn, test=None, **kwargs): __context__["fileclient"], context=__context__.value(), ) as st_: + if not _check_pillar(kwargs, st_.opts["pillar"]): + __context__["retcode"] = salt.defaults.exitcodes.EX_PILLAR_FAILURE + err = ["Pillar failed to render with the following messages:"] + err += st_.opts["pillar"]["_errors"] + return err st_.opts["state_top"] = os.path.join("salt://", topfn) st_.push_active() chunks = st_.compile_low_chunks(context=__context__.value()) + # Check for errors + for chunk in chunks: + if not isinstance(chunk, dict): + __context__["retcode"] = salt.defaults.exitcodes.EX_STATE_COMPILER_ERROR + return chunks file_refs = salt.client.ssh.state.lowstate_file_refs( chunks, _merge_extra_filerefs( @@ -839,8 +862,17 @@ def show_highstate(**kwargs): __context__["fileclient"], context=__context__.value(), ) as st_: + if not _check_pillar(kwargs, st_.opts["pillar"]): + __context__["retcode"] = salt.defaults.exitcodes.EX_PILLAR_FAILURE + err = ["Pillar failed to render with the following messages:"] + err += st_.opts["pillar"]["_errors"] + return err st_.push_active() chunks = st_.compile_highstate(context=__context__.value()) + # Check for errors + if not isinstance(chunks, dict): + __context__["retcode"] = salt.defaults.exitcodes.EX_STATE_COMPILER_ERROR + return chunks _cleanup_slsmod_high_data(chunks) return chunks @@ -864,6 +896,11 @@ def show_lowstate(**kwargs): __context__["fileclient"], context=__context__.value(), ) as st_: + if not _check_pillar(kwargs, st_.opts["pillar"]): + __context__["retcode"] = salt.defaults.exitcodes.EX_PILLAR_FAILURE + err = ["Pillar failed to render with the following messages:"] + err += st_.opts["pillar"]["_errors"] + return err st_.push_active() chunks = st_.compile_low_chunks(context=__context__.value()) _cleanup_slsmod_low_data(chunks) @@ -925,7 +962,7 @@ def sls_id(id_, mods, test=None, queue=False, **kwargs): ) as st_: if not _check_pillar(kwargs, st_.opts["pillar"]): - __context__["retcode"] = 5 + __context__["retcode"] = salt.defaults.exitcodes.EX_PILLAR_FAILURE err = ["Pillar failed to render with the following messages:"] err += __pillar__["_errors"] return err @@ -943,7 +980,7 @@ def sls_id(id_, mods, test=None, queue=False, **kwargs): # but it is required to get the unit tests to pass. errors.extend(req_in_errors) if errors: - __context__["retcode"] = 1 + __context__["retcode"] = salt.defaults.exitcodes.EX_STATE_COMPILER_ERROR return errors chunks = st_.state.compile_high_data(high_) chunk = [x for x in chunks if x.get("__id__", "") == id_] @@ -988,6 +1025,11 @@ def show_sls(mods, saltenv="base", test=None, **kwargs): __context__["fileclient"], context=__context__.value(), ) as st_: + if not _check_pillar(kwargs, st_.opts["pillar"]): + __context__["retcode"] = salt.defaults.exitcodes.EX_PILLAR_FAILURE + err = ["Pillar failed to render with the following messages:"] + err += st_.opts["pillar"]["_errors"] + return err st_.push_active() mods = _parse_mods(mods) high_data, errors = st_.render_highstate( @@ -997,12 +1039,14 @@ def show_sls(mods, saltenv="base", test=None, **kwargs): errors += ext_errors errors += st_.state.verify_high(high_data) if errors: + __context__["retcode"] = salt.defaults.exitcodes.EX_STATE_COMPILER_ERROR return errors high_data, req_in_errors = st_.state.requisite_in(high_data) errors += req_in_errors high_data = st_.state.apply_exclude(high_data) # Verify that the high data is structurally sound if errors: + __context__["retcode"] = salt.defaults.exitcodes.EX_STATE_COMPILER_ERROR return errors _cleanup_slsmod_high_data(high_data) return high_data @@ -1036,6 +1080,11 @@ def show_low_sls(mods, saltenv="base", test=None, **kwargs): __context__["fileclient"], context=__context__.value(), ) as st_: + if not _check_pillar(kwargs, st_.opts["pillar"]): + __context__["retcode"] = salt.defaults.exitcodes.EX_PILLAR_FAILURE + err = ["Pillar failed to render with the following messages:"] + err += st_.opts["pillar"]["_errors"] + return err st_.push_active() mods = _parse_mods(mods) high_data, errors = st_.render_highstate( @@ -1045,12 +1094,14 @@ def show_low_sls(mods, saltenv="base", test=None, **kwargs): errors += ext_errors errors += st_.state.verify_high(high_data) if errors: + __context__["retcode"] = salt.defaults.exitcodes.EX_STATE_COMPILER_ERROR return errors high_data, req_in_errors = st_.state.requisite_in(high_data) errors += req_in_errors high_data = st_.state.apply_exclude(high_data) # Verify that the high data is structurally sound if errors: + __context__["retcode"] = salt.defaults.exitcodes.EX_STATE_COMPILER_ERROR return errors ret = st_.state.compile_high_data(high_data) _cleanup_slsmod_low_data(ret) @@ -1080,6 +1131,7 @@ def show_top(**kwargs): errors = [] errors += st_.verify_tops(top_data) if errors: + __context__["retcode"] = salt.defaults.exitcodes.EX_STATE_COMPILER_ERROR return errors matches = st_.top_matches(top_data) return matches @@ -1110,7 +1162,7 @@ def single(fun, name, test=None, **kwargs): # state.fun -> [state, fun] comps = fun.split(".") if len(comps) < 2: - __context__["retcode"] = 1 + __context__["retcode"] = salt.defaults.exitcodes.EX_STATE_COMPILER_ERROR return "Invalid function passed" # Create the low chunk, using kwargs as a base @@ -1133,7 +1185,7 @@ def single(fun, name, test=None, **kwargs): # Verify the low chunk err = st_.verify_data(kwargs) if err: - __context__["retcode"] = 1 + __context__["retcode"] = salt.defaults.exitcodes.EX_STATE_COMPILER_ERROR return err # Must be a list of low-chunks From a86675d4139b857de41e6b6c44b43a9f24a95936 Mon Sep 17 00:00:00 2001 From: jeanluc Date: Wed, 21 Jun 2023 15:40:54 +0200 Subject: [PATCH 016/393] Add misc tests for retcode passthrough --- tests/pytests/integration/ssh/test_deploy.py | 24 ++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/tests/pytests/integration/ssh/test_deploy.py b/tests/pytests/integration/ssh/test_deploy.py index dac28f84f37..d70f8fce23b 100644 --- a/tests/pytests/integration/ssh/test_deploy.py +++ b/tests/pytests/integration/ssh/test_deploy.py @@ -9,6 +9,7 @@ import pytest import salt.utils.files import salt.utils.yaml +from salt.defaults.exitcodes import EX_AGGREGATE pytestmark = [ pytest.mark.slow_test, @@ -100,3 +101,26 @@ def test_tty(salt_ssh_cli, tmp_path, salt_ssh_roster_file): ret = salt_ssh_cli.run("--roster-file={}".format(roster_file), "test.ping") assert ret.returncode == 0 assert ret.data is True + + +def test_retcode_exe_run_fail(salt_ssh_cli): + """ + Verify salt-ssh passes through the retcode it receives. + """ + ret = salt_ssh_cli.run("file.touch", "/tmp/non/ex/is/tent") + assert ret.returncode == EX_AGGREGATE + assert isinstance(ret.data, dict) + assert ret.data["stderr"] == "Error running 'file.touch': No such file or directory" + assert ret.data["retcode"] == 1 + + +def test_retcode_exe_run_exception(salt_ssh_cli): + """ + Verify salt-ssh passes through the retcode it receives + when an exception is thrown. (Ref #50727) + """ + ret = salt_ssh_cli.run("salttest.jinja_error") + assert ret.returncode == EX_AGGREGATE + assert isinstance(ret.data, dict) + assert ret.data["stderr"].endswith("Exception: hehehe") + assert ret.data["retcode"] == 1 From 9f70585e344be51fd774ceb7a5ee7b81c91822a4 Mon Sep 17 00:00:00 2001 From: jeanluc Date: Wed, 21 Jun 2023 15:41:52 +0200 Subject: [PATCH 017/393] run pre-commit upgrade code for Py3.8+ --- salt/client/ssh/__init__.py | 50 +++++++++----------- salt/client/ssh/wrapper/state.py | 18 +++---- tests/pytests/integration/ssh/test_deploy.py | 8 ++-- 3 files changed, 34 insertions(+), 42 deletions(-) diff --git a/salt/client/ssh/__init__.py b/salt/client/ssh/__init__.py index 4a1e785e6b6..0d9ac9509b6 100644 --- a/salt/client/ssh/__init__.py +++ b/salt/client/ssh/__init__.py @@ -304,7 +304,7 @@ class SSH(MultiprocessingStateMixin): } if self.opts.get("rand_thin_dir"): self.defaults["thin_dir"] = os.path.join( - "/var/tmp", ".{}".format(uuid.uuid4().hex[:6]) + "/var/tmp", f".{uuid.uuid4().hex[:6]}" ) self.opts["ssh_wipe"] = "True" self.returners = salt.loader.returners(self.opts, {}) @@ -454,9 +454,9 @@ class SSH(MultiprocessingStateMixin): priv = self.opts.get( "ssh_priv", os.path.join(self.opts["pki_dir"], "ssh", "salt-ssh.rsa") ) - pub = "{}.pub".format(priv) + pub = f"{priv}.pub" with salt.utils.files.fopen(pub, "r") as fp_: - return "{} rsa root@master".format(fp_.read().split()[1]) + return f"{fp_.read().split()[1]} rsa root@master" def key_deploy(self, host, ret): """ @@ -500,7 +500,7 @@ class SSH(MultiprocessingStateMixin): mods=self.mods, fsclient=self.fsclient, thin=self.thin, - **target + **target, ) if salt.utils.path.which("ssh-copy-id"): # we have ssh-copy-id, use it! @@ -516,7 +516,7 @@ class SSH(MultiprocessingStateMixin): mods=self.mods, fsclient=self.fsclient, thin=self.thin, - **target + **target, ) stdout, stderr, retcode = single.cmd_block() try: @@ -543,7 +543,7 @@ class SSH(MultiprocessingStateMixin): fsclient=self.fsclient, thin=self.thin, mine=mine, - **target + **target, ) ret = {"id": single.id} stdout, stderr, retcode = single.run() @@ -798,7 +798,7 @@ class SSH(MultiprocessingStateMixin): ) if self.opts.get("verbose"): - msg = "Executing job with jid {}".format(jid) + msg = f"Executing job with jid {jid}" print(msg) print("-" * len(msg) + "\n") print("") @@ -883,7 +883,7 @@ class Single: remote_port_forwards=None, winrm=False, ssh_options=None, - **kwargs + **kwargs, ): # Get mine setting and mine_functions if defined in kwargs (from roster) self.mine = mine @@ -1017,9 +1017,7 @@ class Single: """ check if the thindir exists on the remote machine """ - stdout, stderr, retcode = self.shell.exec_cmd( - "test -d {}".format(self.thin_dir) - ) + stdout, stderr, retcode = self.shell.exec_cmd(f"test -d {self.thin_dir}") if retcode != 0: return False return True @@ -1131,7 +1129,7 @@ class Single: self.id, fsclient=self.fsclient, minion_opts=self.minion_opts, - **self.target + **self.target, ) opts_pkg = pre_wrapper["test.opts_pkg"]() # pylint: disable=E1102 @@ -1217,7 +1215,7 @@ class Single: self.id, fsclient=self.fsclient, minion_opts=self.minion_opts, - **self.target + **self.target, ) wrapper.fsclient.opts["cachedir"] = opts["cachedir"] self.wfuncs = salt.loader.ssh_wrapper(opts, wrapper, self.context) @@ -1265,7 +1263,7 @@ class Single: else: result = self.wfuncs[self.fun](*self.args, **self.kwargs) except TypeError as exc: - result = "TypeError encountered executing {}: {}".format(self.fun, exc) + result = f"TypeError encountered executing {self.fun}: {exc}" log.error(result, exc_info_on_loglevel=logging.DEBUG) retcode = 1 except Exception as exc: # pylint: disable=broad-except @@ -1292,7 +1290,7 @@ class Single: """ if self.target.get("sudo"): sudo = ( - "sudo -p '{}'".format(salt.client.ssh.shell.SUDO_PROMPT) + f"sudo -p '{salt.client.ssh.shell.SUDO_PROMPT}'" if self.target.get("passwd") else "sudo" ) @@ -1364,20 +1362,18 @@ ARGS = {arguments}\n'''.format( script_args = shlex.split(str(script_args)) args = " {}".format(" ".join([shlex.quote(str(el)) for el in script_args])) if extension == "ps1": - ret = self.shell.exec_cmd('"powershell {}"'.format(script)) + ret = self.shell.exec_cmd(f'"powershell {script}"') else: if not self.winrm: - ret = self.shell.exec_cmd( - "/bin/sh '{}{}'{}".format(pre_dir, script, args) - ) + ret = self.shell.exec_cmd(f"/bin/sh '{pre_dir}{script}'{args}") else: ret = saltwinshell.call_python(self, script) # Remove file from target system if not self.winrm: - self.shell.exec_cmd("rm '{}{}'".format(pre_dir, script)) + self.shell.exec_cmd(f"rm '{pre_dir}{script}'") else: - self.shell.exec_cmd("del {}".format(script)) + self.shell.exec_cmd(f"del {script}") return ret @@ -1465,7 +1461,7 @@ ARGS = {arguments}\n'''.format( while re.search(RSTR_RE, stderr): stderr = re.split(RSTR_RE, stderr, 1)[1].strip() else: - return "ERROR: {}".format(error), stderr, retcode + return f"ERROR: {error}", stderr, retcode # FIXME: this discards output from ssh_shim if the shim succeeds. It should # always save the shim output regardless of shim success or failure. @@ -1525,7 +1521,7 @@ ARGS = {arguments}\n'''.format( # If RSTR is not seen in both stdout and stderr then there # was a thin deployment problem. return ( - "ERROR: Failure deploying ext_mods: {}".format(stdout), + f"ERROR: Failure deploying ext_mods: {stdout}", stderr, retcode, ) @@ -1693,7 +1689,7 @@ def mod_data(fsclient): files = fsclient.file_list(env) for ref in sync_refs: mods_data = {} - pref = "_{}".format(ref) + pref = f"_{ref}" for fn_ in sorted(files): if fn_.startswith(pref): if fn_.endswith((".py", ".so", ".pyx")): @@ -1715,9 +1711,7 @@ def mod_data(fsclient): ver_base = salt.utils.stringutils.to_bytes(ver_base) ver = hashlib.sha1(ver_base).hexdigest() - ext_tar_path = os.path.join( - fsclient.opts["cachedir"], "ext_mods.{}.tgz".format(ver) - ) + ext_tar_path = os.path.join(fsclient.opts["cachedir"], f"ext_mods.{ver}.tgz") mods = {"version": ver, "file": ext_tar_path} if os.path.isfile(ext_tar_path): return mods @@ -1766,7 +1760,7 @@ def _convert_args(args): for key in list(arg.keys()): if key == "__kwarg__": continue - converted.append("{}={}".format(key, arg[key])) + converted.append(f"{key}={arg[key]}") else: converted.append(arg) return converted diff --git a/salt/client/ssh/wrapper/state.py b/salt/client/ssh/wrapper/state.py index 0a1d5bdf5f9..353d8a0e03e 100644 --- a/salt/client/ssh/wrapper/state.py +++ b/salt/client/ssh/wrapper/state.py @@ -55,7 +55,7 @@ def _ssh_state(chunks, st_kwargs, kwargs, test=False): cmd, fsclient=__context__["fileclient"], minion_opts=__salt__.minion_opts, - **st_kwargs + **st_kwargs, ) single.shell.send(trans_tar, "{}/salt_state.tgz".format(__opts__["thin_dir"])) stdout, stderr, _ = single.cmd_block() @@ -244,7 +244,7 @@ def sls(mods, saltenv="base", test=None, exclude=None, **kwargs): cmd, fsclient=__context__["fileclient"], minion_opts=__salt__.minion_opts, - **st_kwargs + **st_kwargs, ) single.shell.send(trans_tar, "{}/salt_state.tgz".format(opts["thin_dir"])) stdout, stderr, _ = single.cmd_block() @@ -392,7 +392,7 @@ def low(data, **kwargs): cmd, fsclient=__context__["fileclient"], minion_opts=__salt__.minion_opts, - **st_kwargs + **st_kwargs, ) single.shell.send(trans_tar, "{}/salt_state.tgz".format(__opts__["thin_dir"])) stdout, stderr, _ = single.cmd_block() @@ -482,7 +482,7 @@ def high(data, **kwargs): cmd, fsclient=__context__["fileclient"], minion_opts=__salt__.minion_opts, - **st_kwargs + **st_kwargs, ) single.shell.send(trans_tar, "{}/salt_state.tgz".format(opts["thin_dir"])) stdout, stderr, _ = single.cmd_block() @@ -558,7 +558,7 @@ def request(mods=None, **kwargs): try: if salt.utils.platform.is_windows(): # Make sure cache file isn't read-only - __salt__["cmd.run"]('attrib -R "{}"'.format(notify_path)) + __salt__["cmd.run"](f'attrib -R "{notify_path}"') with salt.utils.files.fopen(notify_path, "w+b") as fp_: salt.payload.dump(req, fp_) except OSError: @@ -622,7 +622,7 @@ def clear_request(name=None): try: if salt.utils.platform.is_windows(): # Make sure cache file isn't read-only - __salt__["cmd.run"]('attrib -R "{}"'.format(notify_path)) + __salt__["cmd.run"](f'attrib -R "{notify_path}"') with salt.utils.files.fopen(notify_path, "w+b") as fp_: salt.payload.dump(req, fp_) except OSError: @@ -730,7 +730,7 @@ def highstate(test=None, **kwargs): cmd, fsclient=__context__["fileclient"], minion_opts=__salt__.minion_opts, - **st_kwargs + **st_kwargs, ) single.shell.send(trans_tar, "{}/salt_state.tgz".format(opts["thin_dir"])) stdout, stderr, _ = single.cmd_block() @@ -821,7 +821,7 @@ def top(topfn, test=None, **kwargs): cmd, fsclient=__context__["fileclient"], minion_opts=__salt__.minion_opts, - **st_kwargs + **st_kwargs, ) single.shell.send(trans_tar, "{}/salt_state.tgz".format(opts["thin_dir"])) stdout, stderr, _ = single.cmd_block() @@ -1227,7 +1227,7 @@ def single(fun, name, test=None, **kwargs): cmd, fsclient=__context__["fileclient"], minion_opts=__salt__.minion_opts, - **st_kwargs + **st_kwargs, ) # Copy the tar down diff --git a/tests/pytests/integration/ssh/test_deploy.py b/tests/pytests/integration/ssh/test_deploy.py index d70f8fce23b..8512813f6e6 100644 --- a/tests/pytests/integration/ssh/test_deploy.py +++ b/tests/pytests/integration/ssh/test_deploy.py @@ -75,15 +75,13 @@ def test_set_path(salt_ssh_cli, tmp_path, salt_ssh_roster_file): roster_data = salt.utils.yaml.safe_load(rfh) roster_data["localhost"].update( { - "set_path": "$PATH:/usr/local/bin/:{}".format(path), + "set_path": f"$PATH:/usr/local/bin/:{path}", } ) with salt.utils.files.fopen(roster_file, "w") as wfh: salt.utils.yaml.safe_dump(roster_data, wfh) - ret = salt_ssh_cli.run( - "--roster-file={}".format(roster_file), "environ.get", "PATH" - ) + ret = salt_ssh_cli.run(f"--roster-file={roster_file}", "environ.get", "PATH") assert ret.returncode == 0 assert path in ret.data @@ -98,7 +96,7 @@ def test_tty(salt_ssh_cli, tmp_path, salt_ssh_roster_file): roster_data["localhost"].update({"tty": True}) with salt.utils.files.fopen(roster_file, "w") as wfh: salt.utils.yaml.safe_dump(roster_data, wfh) - ret = salt_ssh_cli.run("--roster-file={}".format(roster_file), "test.ping") + ret = salt_ssh_cli.run(f"--roster-file={roster_file}", "test.ping") assert ret.returncode == 0 assert ret.data is True From a7d7c4151bac4cabc195bc3fa2a04c2466fe91d2 Mon Sep 17 00:00:00 2001 From: MKLeb Date: Wed, 21 Jun 2023 17:58:17 -0400 Subject: [PATCH 018/393] Lock to `immutables>0.16`, as that version has problems installing now --- requirements/static/ci/py3.10/cloud.txt | 2 +- requirements/static/ci/py3.10/lint.txt | 2 +- requirements/static/ci/py3.7/cloud.txt | 2 +- requirements/static/ci/py3.7/lint.txt | 2 +- requirements/static/ci/py3.8/cloud.txt | 2 +- requirements/static/ci/py3.8/lint.txt | 2 +- requirements/static/ci/py3.9/cloud.txt | 2 +- requirements/static/ci/py3.9/lint.txt | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/requirements/static/ci/py3.10/cloud.txt b/requirements/static/ci/py3.10/cloud.txt index c43683e5e13..daf4d5e1570 100644 --- a/requirements/static/ci/py3.10/cloud.txt +++ b/requirements/static/ci/py3.10/cloud.txt @@ -441,7 +441,7 @@ idna==2.8 # etcd3-py # requests # yarl -immutables==0.16 +immutables==0.19 # via contextvars importlib-metadata==6.0.0 # via -r requirements/static/pkg/linux.in diff --git a/requirements/static/ci/py3.10/lint.txt b/requirements/static/ci/py3.10/lint.txt index 3ce019cab6f..72daefca405 100644 --- a/requirements/static/ci/py3.10/lint.txt +++ b/requirements/static/ci/py3.10/lint.txt @@ -438,7 +438,7 @@ idna==3.2 # etcd3-py # requests # yarl -immutables==0.16 +immutables==0.19 # via contextvars importlib-metadata==6.0.0 # via -r requirements/static/pkg/linux.in diff --git a/requirements/static/ci/py3.7/cloud.txt b/requirements/static/ci/py3.7/cloud.txt index 9fa1a9adff6..74e67f129c1 100644 --- a/requirements/static/ci/py3.7/cloud.txt +++ b/requirements/static/ci/py3.7/cloud.txt @@ -453,7 +453,7 @@ idna==2.8 # etcd3-py # requests # yarl -immutables==0.16 +immutables==0.19 # via contextvars importlib-metadata==4.8.1 # via diff --git a/requirements/static/ci/py3.7/lint.txt b/requirements/static/ci/py3.7/lint.txt index 1cabc19bb58..8d8771573c6 100644 --- a/requirements/static/ci/py3.7/lint.txt +++ b/requirements/static/ci/py3.7/lint.txt @@ -452,7 +452,7 @@ idna==3.2 # etcd3-py # requests # yarl -immutables==0.16 +immutables==0.19 # via contextvars importlib-metadata==4.6.4 # via diff --git a/requirements/static/ci/py3.8/cloud.txt b/requirements/static/ci/py3.8/cloud.txt index 0911e6619c0..fe4a7bcea2b 100644 --- a/requirements/static/ci/py3.8/cloud.txt +++ b/requirements/static/ci/py3.8/cloud.txt @@ -451,7 +451,7 @@ idna==2.8 # etcd3-py # requests # yarl -immutables==0.16 +immutables==0.19 # via contextvars importlib-metadata==4.8.1 # via -r requirements/static/pkg/linux.in diff --git a/requirements/static/ci/py3.8/lint.txt b/requirements/static/ci/py3.8/lint.txt index 3bd160808e6..b0a9aa31f4a 100644 --- a/requirements/static/ci/py3.8/lint.txt +++ b/requirements/static/ci/py3.8/lint.txt @@ -450,7 +450,7 @@ idna==3.2 # etcd3-py # requests # yarl -immutables==0.16 +immutables==0.19 # via contextvars importlib-metadata==4.6.4 # via -r requirements/static/pkg/linux.in diff --git a/requirements/static/ci/py3.9/cloud.txt b/requirements/static/ci/py3.9/cloud.txt index 9db7aaccdcb..ec7cb3da6ba 100644 --- a/requirements/static/ci/py3.9/cloud.txt +++ b/requirements/static/ci/py3.9/cloud.txt @@ -451,7 +451,7 @@ idna==2.8 # etcd3-py # requests # yarl -immutables==0.16 +immutables==0.19 # via contextvars importlib-metadata==6.0.0 # via -r requirements/static/pkg/linux.in diff --git a/requirements/static/ci/py3.9/lint.txt b/requirements/static/ci/py3.9/lint.txt index c7236117c66..50e4c72ed5e 100644 --- a/requirements/static/ci/py3.9/lint.txt +++ b/requirements/static/ci/py3.9/lint.txt @@ -448,7 +448,7 @@ idna==3.2 # etcd3-py # requests # yarl -immutables==0.16 +immutables==0.19 # via contextvars importlib-metadata==6.0.0 # via -r requirements/static/pkg/linux.in From c1292aecbf746a7704b1367901cdc7c934c109df Mon Sep 17 00:00:00 2001 From: Thomas Phipps Date: Tue, 13 Jun 2023 19:33:09 +0000 Subject: [PATCH 019/393] add code to pass full_return through stack so exceptions can return retcode properly to salt-run cli --- changelog/61173.fixed.md | 1 + salt/client/mixins.py | 29 ++++++++++++++++--- salt/runner.py | 3 +- .../pytests/functional/cli/test_salt_run_.py | 10 +++++++ 4 files changed, 38 insertions(+), 5 deletions(-) create mode 100644 changelog/61173.fixed.md create mode 100644 tests/pytests/functional/cli/test_salt_run_.py diff --git a/changelog/61173.fixed.md b/changelog/61173.fixed.md new file mode 100644 index 00000000000..edcb75b028f --- /dev/null +++ b/changelog/61173.fixed.md @@ -0,0 +1 @@ +fix fixed runner not having a proper exit code when runner modules throw an exception. diff --git a/salt/client/mixins.py b/salt/client/mixins.py index 7cdae88ae8a..27e12fea194 100644 --- a/salt/client/mixins.py +++ b/salt/client/mixins.py @@ -412,6 +412,7 @@ class SyncClientMixin(ClientStateMixin): traceback.format_exc(), ) data["success"] = False + data["retcode"] = 1 if self.store_job: try: @@ -480,7 +481,17 @@ class AsyncClientMixin(ClientStateMixin): @classmethod def _proc_function_remote( - cls, *, instance, opts, fun, low, user, tag, jid, daemonize=True + cls, + *, + instance, + opts, + fun, + low, + user, + tag, + jid, + daemonize=True, + full_return=False ): """ Run this method in a multiprocess target to execute the function on the @@ -506,13 +517,23 @@ class AsyncClientMixin(ClientStateMixin): instance = cls(opts) try: - return instance.cmd_sync(low) + return instance.cmd_sync(low, full_return=False) except salt.exceptions.EauthAuthenticationError as exc: log.error(exc) @classmethod def _proc_function( - cls, *, instance, opts, fun, low, user, tag, jid, daemonize=True + cls, + *, + instance, + opts, + fun, + low, + user, + tag, + jid, + daemonize=True, + full_return=False ): """ Run this method in a multiprocess target to execute the function @@ -537,7 +558,7 @@ class AsyncClientMixin(ClientStateMixin): low["__user__"] = user low["__tag__"] = tag - return instance.low(fun, low) + return instance.low(fun, low, full_return=full_return) def cmd_async(self, low): """ diff --git a/salt/runner.py b/salt/runner.py index caf6471fa08..d20cf275fe1 100644 --- a/salt/runner.py +++ b/salt/runner.py @@ -289,7 +289,7 @@ class Runner(RunnerClient): # otherwise run it in the main process if self.opts.get("eauth"): - ret = self.cmd_sync(low) + ret = self.cmd_sync(low, full_return=True) if isinstance(ret, dict) and set(ret) == {"data", "outputter"}: outputter = ret["outputter"] ret = ret["data"] @@ -306,6 +306,7 @@ class Runner(RunnerClient): tag=async_pub["tag"], jid=async_pub["jid"], daemonize=False, + full_return=True, ) except salt.exceptions.SaltException as exc: with salt.utils.event.get_event("master", opts=self.opts) as evt: diff --git a/tests/pytests/functional/cli/test_salt_run_.py b/tests/pytests/functional/cli/test_salt_run_.py new file mode 100644 index 00000000000..e41692894a6 --- /dev/null +++ b/tests/pytests/functional/cli/test_salt_run_.py @@ -0,0 +1,10 @@ +import logging + +log = logging.getLogger(__name__) + + +def test_exception_exit(salt_run_cli): + ret = salt_run_cli.run( + "error.error", "name='Exception'", "message='This is an error.'" + ) + assert ret.returncode == 1 From 0078f83664f06a479307c804bc4891b86069a116 Mon Sep 17 00:00:00 2001 From: Thomas Phipps Date: Tue, 13 Jun 2023 20:05:08 +0000 Subject: [PATCH 020/393] add secondary tests for salt-run. they were not requested by ticket but should be tested to make sure they do not break --- .../pytests/functional/cli/test_salt_run_.py | 78 ++++++++++++++++++- 1 file changed, 77 insertions(+), 1 deletion(-) diff --git a/tests/pytests/functional/cli/test_salt_run_.py b/tests/pytests/functional/cli/test_salt_run_.py index e41692894a6..7f534f76987 100644 --- a/tests/pytests/functional/cli/test_salt_run_.py +++ b/tests/pytests/functional/cli/test_salt_run_.py @@ -1,10 +1,86 @@ import logging +import os + +import salt.version log = logging.getLogger(__name__) -def test_exception_exit(salt_run_cli): +def test_salt_run_exception_exit(salt_run_cli): + """ + test that the exitcode is 1 when an exception is + thrown in a salt runner + """ ret = salt_run_cli.run( "error.error", "name='Exception'", "message='This is an error.'" ) assert ret.returncode == 1 + + +def test_salt_run_non_exception_exit(salt_run_cli): + """ + Test standard exitcode and output when runner works. + """ + ret = salt_run_cli.run("test.stdout_print") + assert ret.returncode == 0 + assert ret.stdout == 'foo\n"bar"\n' + + +def test_versions_report(salt_run_cli): + """ + test salt-run --versions-report + """ + expected = salt.version.versions_information() + # sanitize expected of unnnecessary whitespace + for _, section in expected.items(): + for key in section: + if isinstance(section[key], str): + section[key] = section[key].strip() + + ret = salt_run_cli.run("--versions-report") + assert ret.returncode == 0 + assert ret.stdout + ret_lines = ret.stdout.split("\n") + + assert ret_lines + # sanitize lines + ret_lines = [line.strip() for line in ret_lines] + + for header in expected: + assert "{}:".format(header) in ret_lines + + ret_dict = {} + expected_keys = set() + for line in ret_lines: + if not line: + continue + if line.endswith(":"): + assert not expected_keys + current_header = line.rstrip(":") + assert current_header in expected + ret_dict[current_header] = {} + expected_keys = set(expected[current_header].keys()) + else: + key, *value_list = line.split(":", 1) + assert value_list + assert len(value_list) == 1 + value = value_list[0].strip() + if value == "Not Installed": + value = None + ret_dict[current_header][key] = value + assert key in expected_keys + expected_keys.remove(key) + assert not expected_keys + if os.environ.get("ONEDIR_TESTRUN", "0") == "0": + # Stop any more testing + return + + assert "relenv" in ret_dict["Dependency Versions"] + assert "Salt Extensions" in ret_dict + assert "salt-analytics-framework" in ret_dict["Salt Extensions"] + + +def test_salt_run_version(salt_run_cli): + expected = salt.version.__version__ + ret = salt_run_cli.run("--version") + assert f"cli_salt_run.py {expected}\n" == ret.stdout From 48ba8089e11c461ae6ba6cdc90dc1885d5bc7df8 Mon Sep 17 00:00:00 2001 From: Thomas Phipps Date: Tue, 13 Jun 2023 20:11:07 +0000 Subject: [PATCH 021/393] fix full_return=False to follow flow of function, instead of force to False --- salt/client/mixins.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/salt/client/mixins.py b/salt/client/mixins.py index 27e12fea194..60861e73e7e 100644 --- a/salt/client/mixins.py +++ b/salt/client/mixins.py @@ -517,7 +517,7 @@ class AsyncClientMixin(ClientStateMixin): instance = cls(opts) try: - return instance.cmd_sync(low, full_return=False) + return instance.cmd_sync(low, full_return=full_return) except salt.exceptions.EauthAuthenticationError as exc: log.error(exc) From e9b1b14b97707b8c617b33713572546bac8e7414 Mon Sep 17 00:00:00 2001 From: Thomas Phipps Date: Tue, 13 Jun 2023 21:52:51 +0000 Subject: [PATCH 022/393] try fixing broken eauth test --- salt/client/mixins.py | 14 ++------------ tests/pytests/functional/cli/test_salt_run_.py | 1 - 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/salt/client/mixins.py b/salt/client/mixins.py index 60861e73e7e..c6b479e106b 100644 --- a/salt/client/mixins.py +++ b/salt/client/mixins.py @@ -481,17 +481,7 @@ class AsyncClientMixin(ClientStateMixin): @classmethod def _proc_function_remote( - cls, - *, - instance, - opts, - fun, - low, - user, - tag, - jid, - daemonize=True, - full_return=False + cls, *, instance, opts, fun, low, user, tag, jid, daemonize=True ): """ Run this method in a multiprocess target to execute the function on the @@ -517,7 +507,7 @@ class AsyncClientMixin(ClientStateMixin): instance = cls(opts) try: - return instance.cmd_sync(low, full_return=full_return) + return instance.cmd_sync(low) except salt.exceptions.EauthAuthenticationError as exc: log.error(exc) diff --git a/tests/pytests/functional/cli/test_salt_run_.py b/tests/pytests/functional/cli/test_salt_run_.py index 7f534f76987..66c28fc3aae 100644 --- a/tests/pytests/functional/cli/test_salt_run_.py +++ b/tests/pytests/functional/cli/test_salt_run_.py @@ -77,7 +77,6 @@ def test_versions_report(salt_run_cli): assert "relenv" in ret_dict["Dependency Versions"] assert "Salt Extensions" in ret_dict - assert "salt-analytics-framework" in ret_dict["Salt Extensions"] def test_salt_run_version(salt_run_cli): From b662bbeb69e9e3a3ddc21101d8e717a84ab48cec Mon Sep 17 00:00:00 2001 From: Thomas Phipps Date: Tue, 13 Jun 2023 22:05:19 +0000 Subject: [PATCH 023/393] no full_return for eauth --- salt/runner.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/salt/runner.py b/salt/runner.py index d20cf275fe1..d390af93cde 100644 --- a/salt/runner.py +++ b/salt/runner.py @@ -289,7 +289,7 @@ class Runner(RunnerClient): # otherwise run it in the main process if self.opts.get("eauth"): - ret = self.cmd_sync(low, full_return=True) + ret = self.cmd_sync(low) if isinstance(ret, dict) and set(ret) == {"data", "outputter"}: outputter = ret["outputter"] ret = ret["data"] From c608df741bef78511d449c82e081ddbfc56d7b60 Mon Sep 17 00:00:00 2001 From: Thomas Phipps Date: Fri, 16 Jun 2023 18:54:07 +0000 Subject: [PATCH 024/393] fix slow_kill test by checking if return but no retcode in ret --- salt/cli/run.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/salt/cli/run.py b/salt/cli/run.py index 93387479bca..c6f6f42c14e 100644 --- a/salt/cli/run.py +++ b/salt/cli/run.py @@ -38,6 +38,12 @@ class SaltRun(salt.utils.parsers.SaltRunOptionParser): # runners might still use it. For this reason, we # also check ret['data']['retcode'] if # ret['retcode'] is not available. + if ( + isinstance(ret, dict) + and "return" in ret + and "retcode" not in ret + ): + ret = ret["return"] if isinstance(ret, dict) and "retcode" in ret: self.exit(ret["retcode"]) elif isinstance(ret, dict) and "retcode" in ret.get("data", {}): From 79b5eeec967190c7fcfc9b906f30f4f14095323d Mon Sep 17 00:00:00 2001 From: Thomas Phipps Date: Tue, 20 Jun 2023 12:34:50 -0700 Subject: [PATCH 025/393] Update changelog/61173.fixed.md remove fix Co-authored-by: Megan Wilhite --- changelog/61173.fixed.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog/61173.fixed.md b/changelog/61173.fixed.md index edcb75b028f..d1e1161be7a 100644 --- a/changelog/61173.fixed.md +++ b/changelog/61173.fixed.md @@ -1 +1 @@ -fix fixed runner not having a proper exit code when runner modules throw an exception. +fixed runner not having a proper exit code when runner modules throw an exception. From 2f5c44a45eba58a8786e5050c5073f7d1171b830 Mon Sep 17 00:00:00 2001 From: MKLeb Date: Thu, 22 Jun 2023 11:49:45 -0400 Subject: [PATCH 026/393] Fixes for the `handle_ssh` return values now being lists of tuples --- .../pytests/unit/client/ssh/test_password.py | 19 +++++++++++-------- .../unit/client/ssh/test_return_events.py | 6 ++---- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/tests/pytests/unit/client/ssh/test_password.py b/tests/pytests/unit/client/ssh/test_password.py index 8a7794d2f4a..71130691812 100644 --- a/tests/pytests/unit/client/ssh/test_password.py +++ b/tests/pytests/unit/client/ssh/test_password.py @@ -30,13 +30,16 @@ def test_password_failure(temp_salt_master, tmp_path): opts["arg"] = [] roster = str(tmp_path / "roster") handle_ssh_ret = [ - { - "localhost": { - "retcode": 255, - "stderr": "Permission denied (publickey).\r\n", - "stdout": "", - } - }, + ( + { + "localhost": { + "retcode": 255, + "stderr": "Permission denied (publickey).\r\n", + "stdout": "", + } + }, + 1, + ) ] expected = {"localhost": "Permission denied (publickey)"} display_output = MagicMock() @@ -50,4 +53,4 @@ def test_password_failure(temp_salt_master, tmp_path): with pytest.raises(SystemExit): client.run() display_output.assert_called_once_with(expected, "nested", opts) - assert ret is handle_ssh_ret[0] + assert ret is handle_ssh_ret[0][0] diff --git a/tests/pytests/unit/client/ssh/test_return_events.py b/tests/pytests/unit/client/ssh/test_return_events.py index 1f0b0dbf335..382a7b2e57a 100644 --- a/tests/pytests/unit/client/ssh/test_return_events.py +++ b/tests/pytests/unit/client/ssh/test_return_events.py @@ -26,9 +26,7 @@ def test_not_missing_fun_calling_wfuncs(temp_salt_master, tmp_path): opts["tgt"] = "localhost" opts["arg"] = [] roster = str(tmp_path / "roster") - handle_ssh_ret = [ - {"localhost": {}}, - ] + handle_ssh_ret = [({"localhost": {}}, 0)] expected = {"localhost": {}} display_output = MagicMock() @@ -44,7 +42,7 @@ def test_not_missing_fun_calling_wfuncs(temp_salt_master, tmp_path): assert "fun" in ret["localhost"] client.run() display_output.assert_called_once_with(expected, "nested", opts) - assert ret is handle_ssh_ret[0] + assert ret is handle_ssh_ret[0][0] assert len(client.event.fire_event.call_args_list) == 2 assert "fun" in client.event.fire_event.call_args_list[0][0][0] assert "fun" in client.event.fire_event.call_args_list[1][0][0] From dedade07d7e94ac31207cc473fe72de51f0fd234 Mon Sep 17 00:00:00 2001 From: Thomas Phipps Date: Fri, 23 Jun 2023 17:32:00 +0000 Subject: [PATCH 027/393] fix nightlys by mimicing what cli.run does to runner.run output in run_run_plus --- tests/support/case.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/support/case.py b/tests/support/case.py index 55b537f6ffd..4b3222877b1 100644 --- a/tests/support/case.py +++ b/tests/support/case.py @@ -191,6 +191,12 @@ class ShellCase(TestCase, AdaptedConfigurationTestCaseMixin, ScriptPathMixin): with RedirectStdStreams(): runner = salt.runner.Runner(opts) ret["return"] = runner.run() + if ( + isinstance(ret["return"], dict) + and "return" in ret["return"] + and "retcode" not in ret["return"] + ): + ret["return"] = ret["return"]["return"] try: ret["jid"] = runner.jid except AttributeError: From 848b9dcfdd5823f91f413d739e6dfe3929529544 Mon Sep 17 00:00:00 2001 From: Megan Wilhite Date: Thu, 22 Jun 2023 11:20:04 -0600 Subject: [PATCH 028/393] Fix user.present state when group is unset --- changelog/64211.fixed.md | 1 + salt/states/user.py | 2 +- tests/pytests/functional/states/test_user.py | 72 ++++++++++++++++++++ 3 files changed, 74 insertions(+), 1 deletion(-) create mode 100644 changelog/64211.fixed.md diff --git a/changelog/64211.fixed.md b/changelog/64211.fixed.md new file mode 100644 index 00000000000..26b39acf028 --- /dev/null +++ b/changelog/64211.fixed.md @@ -0,0 +1 @@ +Fix user.present state when groups is unset to ensure the groups are unchanged, as documented. diff --git a/salt/states/user.py b/salt/states/user.py index e0f620cac89..d575655cf34 100644 --- a/salt/states/user.py +++ b/salt/states/user.py @@ -127,7 +127,7 @@ def _changes( if _gid not in dupe_groups: dupe_groups[_gid] = [] dupe_groups[_gid].append(lusr["groups"][idx]) - if not remove_groups: + if not remove_groups or groups is None and not optional_groups: wanted_groups = sorted(set(wanted_groups + lusr["groups"])) if uid and lusr["uid"] != uid: change["uid"] = uid diff --git a/tests/pytests/functional/states/test_user.py b/tests/pytests/functional/states/test_user.py index 09d34da168a..7b334b51793 100644 --- a/tests/pytests/functional/states/test_user.py +++ b/tests/pytests/functional/states/test_user.py @@ -429,3 +429,75 @@ def test_user_present_change_optional_groups( user_info = modules.user.info(username) assert user_info assert user_info["groups"] == [group_1.name] + + +@pytest.mark.skip_unless_on_linux(reason="underlying functionality only runs on Linux") +def test_user_present_no_groups(modules, states, username): + """ + test user.present when groups arg is not + included by the group is created in another + state. Re-run the states to ensure there are + not changes and it is idempotent. + """ + groups = ["testgroup1", "testgroup2"] + try: + ret = states.group.present(name=username, gid=61121) + assert ret.result is True + + ret = states.user.present( + name=username, + uid=61121, + gid=61121, + ) + assert ret.result is True + assert ret.changes["groups"] == [username] + assert ret.changes["name"] == username + + ret = states.group.present( + name=groups[0], + members=[username], + ) + assert ret.changes["members"] == [username] + + ret = states.group.present( + name=groups[1], + members=[username], + ) + assert ret.changes["members"] == [username] + + user_info = modules.user.info(username) + assert user_info + assert user_info["groups"] == [username, groups[0], groups[1]] + + # run again, expecting no changes + ret = states.group.present(name=username) + assert ret.result is True + assert ret.changes == {} + + ret = states.user.present( + name=username, + ) + assert ret.result is True + assert ret.changes == {} + + ret = states.group.present( + name=groups[0], + members=[username], + ) + assert ret.result is True + assert ret.changes == {} + + ret = states.group.present( + name=groups[1], + members=[username], + ) + assert ret.result is True + assert ret.changes == {} + + user_info = modules.user.info(username) + assert user_info + assert user_info["groups"] == [username, groups[0], groups[1]] + finally: + for group in groups: + ret = states.group.absent(name=group) + assert ret.result is True From 617f9e92de5872f2ce6300f2dded83c4ffb8b5d2 Mon Sep 17 00:00:00 2001 From: Megan Wilhite Date: Fri, 23 Jun 2023 11:45:55 -0600 Subject: [PATCH 029/393] Fix user unit test --- tests/pytests/functional/states/test_user.py | 2 -- tests/pytests/unit/states/test_user.py | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/pytests/functional/states/test_user.py b/tests/pytests/functional/states/test_user.py index 7b334b51793..96b1ec55c88 100644 --- a/tests/pytests/functional/states/test_user.py +++ b/tests/pytests/functional/states/test_user.py @@ -117,7 +117,6 @@ def test_user_present_when_home_dir_does_not_18843(states, existing_account): ret = states.user.present( name=existing_account.username, home=existing_account.info.home, - remove_groups=False, ) assert ret.result is True assert pathlib.Path(existing_account.info.home).is_dir() @@ -228,7 +227,6 @@ def test_user_present_unicode(states, username, subtests): roomnumber="①②③", workphone="١٢٣٤", homephone="६७८", - remove_groups=False, ) assert ret.result is True diff --git a/tests/pytests/unit/states/test_user.py b/tests/pytests/unit/states/test_user.py index 0476cee40f8..ffbd2d7d4d1 100644 --- a/tests/pytests/unit/states/test_user.py +++ b/tests/pytests/unit/states/test_user.py @@ -189,6 +189,8 @@ def test_present_uid_gid_change(): "user.chgid": Mock(), "file.group_to_gid": mock_group_to_gid, "file.gid_to_group": mock_gid_to_group, + "group.info": MagicMock(return_value=after), + "user.chgroups": MagicMock(return_value=True), } with patch.dict(user.__grains__, {"kernel": "Linux"}), patch.dict( user.__salt__, dunder_salt From 6f5b4e4e5454b6f71267b6aea0d5e7bc4b7286d8 Mon Sep 17 00:00:00 2001 From: Thomas Phipps Date: Mon, 26 Jun 2023 16:26:08 +0000 Subject: [PATCH 030/393] fix 3006.x nightly, this test should have already been testing for exitcode 1 not 0. as the is_leader throws an exception internal to it. --- tests/pytests/integration/reactor/test_reactor.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/pytests/integration/reactor/test_reactor.py b/tests/pytests/integration/reactor/test_reactor.py index 875d71623e3..0c73d282a71 100644 --- a/tests/pytests/integration/reactor/test_reactor.py +++ b/tests/pytests/integration/reactor/test_reactor.py @@ -119,21 +119,21 @@ def test_reactor_is_leader( When leader is set to false reactor should timeout/not do anything. """ ret = salt_run_cli.run("reactor.is_leader") - assert ret.returncode == 0 + assert ret.returncode == 1 assert ( "salt.exceptions.CommandExecutionError: Reactor system is not running." in ret.stdout ) ret = salt_run_cli.run("reactor.set_leader", value=True) - assert ret.returncode == 0 + assert ret.returncode == 1 assert ( "salt.exceptions.CommandExecutionError: Reactor system is not running." in ret.stdout ) ret = salt_run_cli.run("reactor.is_leader") - assert ret.returncode == 0 + assert ret.returncode == 1 assert ( "salt.exceptions.CommandExecutionError: Reactor system is not running." in ret.stdout @@ -220,7 +220,7 @@ def test_reactor_is_leader( # Let's just confirm the engine is not running once again(because the config file is deleted by now) ret = salt_run_cli.run("reactor.is_leader") - assert ret.returncode == 0 + assert ret.returncode == 1 assert ( "salt.exceptions.CommandExecutionError: Reactor system is not running." in ret.stdout From 1d852298866c7c701112e307bbc38d2ee3f58454 Mon Sep 17 00:00:00 2001 From: Thomas Phipps Date: Tue, 20 Jun 2023 18:25:50 +0000 Subject: [PATCH 031/393] fix #58667 by checking for blank comps in both source and request --- changelog/58667.fixed.md | 1 + salt/modules/aptpkg.py | 4 +- .../pytests/functional/modules/test_aptpkg.py | 45 ++++++++++++++++--- 3 files changed, 42 insertions(+), 8 deletions(-) create mode 100644 changelog/58667.fixed.md diff --git a/changelog/58667.fixed.md b/changelog/58667.fixed.md new file mode 100644 index 00000000000..c664e34e16a --- /dev/null +++ b/changelog/58667.fixed.md @@ -0,0 +1 @@ +fixes 58667 by checking for blank comps. diff --git a/salt/modules/aptpkg.py b/salt/modules/aptpkg.py index cbf9c7706c5..11e0dad6298 100644 --- a/salt/modules/aptpkg.py +++ b/salt/modules/aptpkg.py @@ -2072,7 +2072,7 @@ def del_repo(repo, **kwargs): s_comps = set(source.comps) r_comps = set(repo_comps) - if s_comps.intersection(r_comps): + if s_comps.intersection(r_comps) or (not s_comps and not r_comps): deleted_from[source.file] = 0 source.comps = list(s_comps.difference(r_comps)) if not source.comps: @@ -2093,7 +2093,7 @@ def del_repo(repo, **kwargs): s_comps = set(source.comps) r_comps = set(repo_comps) - if s_comps.intersection(r_comps): + if s_comps.intersection(r_comps) or (not s_comps and not r_comps): deleted_from[source.file] = 0 source.comps = list(s_comps.difference(r_comps)) if not source.comps: diff --git a/tests/pytests/functional/modules/test_aptpkg.py b/tests/pytests/functional/modules/test_aptpkg.py index 5bc8209f4c7..baf88a1c82f 100644 --- a/tests/pytests/functional/modules/test_aptpkg.py +++ b/tests/pytests/functional/modules/test_aptpkg.py @@ -98,6 +98,38 @@ def revert_repo_file(tmp_path): aptpkg.refresh_db() +@pytest.fixture +def build_repo_file(): + source_path = "/etc/apt/sources.list.d/source_test_list.list" + try: + test_repos = [ + "deb [signed-by=/etc/apt/keyrings/salt-archive-keyring-2023.gpg arch=amd64] https://repo.saltproject.io/salt/py3/ubuntu/22.04/amd64/latest jammy main", + "deb http://dist.list stable/all/", + ] + with salt.utils.files.fopen(source_path, "wr+") as fp: + fp.write("\n".join(test_repos)) + yield source_path + finally: + if os.path.exists(source_path): + os.remove(source_path) + + +def get_repos_from_file(source_path): + """ + Get list of repos from repo in source_path + """ + test_repos = [] + try: + with salt.utils.files.fopen(source_path) as fp: + for line in fp: + test_repos.append(line.strip()) + except FileNotFoundError as error: + pytest.skip("Missing {}".format(error.filename)) + if not test_repos: + pytest.skip("Did not detect an APT repo") + return test_repos + + def get_current_repo(multiple_comps=False): """ Get a repo currently in sources.list @@ -195,18 +227,19 @@ def test_get_repos_doesnot_exist(): @pytest.mark.destructive_test -def test_del_repo(revert_repo_file): +def test_del_repo(build_repo_file): """ Test aptpkg.del_repo when passing repo that exists. And checking correct error is returned when it no longer exists. """ - test_repo, comps = get_current_repo() - ret = aptpkg.del_repo(repo=test_repo) - assert "Repo '{}' has been removed".format(test_repo) - with pytest.raises(salt.exceptions.CommandExecutionError) as exc: + test_repos = get_repos_from_file(build_repo_file) + for test_repo in test_repos: ret = aptpkg.del_repo(repo=test_repo) - assert "Repo {} doesn't exist".format(test_repo) in exc.value.message + assert "Repo '{}' has been removed".format(test_repo) + with pytest.raises(salt.exceptions.CommandExecutionError) as exc: + ret = aptpkg.del_repo(repo=test_repo) + assert "Repo {} doesn't exist".format(test_repo) in exc.value.message @pytest.mark.skipif( From 31428b617d93465603b217306ba3b774c24fe138 Mon Sep 17 00:00:00 2001 From: Thomas Phipps Date: Tue, 20 Jun 2023 19:32:02 +0000 Subject: [PATCH 032/393] not sure why i included that r only needed w+ anyway --- tests/pytests/functional/modules/test_aptpkg.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/pytests/functional/modules/test_aptpkg.py b/tests/pytests/functional/modules/test_aptpkg.py index baf88a1c82f..1d12db0a6a6 100644 --- a/tests/pytests/functional/modules/test_aptpkg.py +++ b/tests/pytests/functional/modules/test_aptpkg.py @@ -106,7 +106,7 @@ def build_repo_file(): "deb [signed-by=/etc/apt/keyrings/salt-archive-keyring-2023.gpg arch=amd64] https://repo.saltproject.io/salt/py3/ubuntu/22.04/amd64/latest jammy main", "deb http://dist.list stable/all/", ] - with salt.utils.files.fopen(source_path, "wr+") as fp: + with salt.utils.files.fopen(source_path, "w+") as fp: fp.write("\n".join(test_repos)) yield source_path finally: From dc83ef63ba5bf5a39e12e60e703c4d3dcbc61ce5 Mon Sep 17 00:00:00 2001 From: Thomas Phipps Date: Tue, 20 Jun 2023 12:38:37 -0700 Subject: [PATCH 033/393] Update changelog/58667.fixed.md Co-authored-by: Megan Wilhite --- changelog/58667.fixed.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog/58667.fixed.md b/changelog/58667.fixed.md index c664e34e16a..ebc2cb617cd 100644 --- a/changelog/58667.fixed.md +++ b/changelog/58667.fixed.md @@ -1 +1 @@ -fixes 58667 by checking for blank comps. +fixes aptpkg module by checking for blank comps. From b265eaecb74ee4963a3d4ba4968a5154e6a0fa6a Mon Sep 17 00:00:00 2001 From: Thomas Phipps Date: Wed, 21 Jun 2023 21:08:20 +0000 Subject: [PATCH 034/393] add skip_if_not_root to destructive tests in aptpkg as they all manipulate the filesystem. --- tests/pytests/functional/modules/test_aptpkg.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/pytests/functional/modules/test_aptpkg.py b/tests/pytests/functional/modules/test_aptpkg.py index 1d12db0a6a6..71693655c60 100644 --- a/tests/pytests/functional/modules/test_aptpkg.py +++ b/tests/pytests/functional/modules/test_aptpkg.py @@ -85,6 +85,8 @@ def configure_loader_modules(minion_opts): @pytest.fixture() +@pytest.mark.destructive_test +@pytest.mark.skip_if_not_root def revert_repo_file(tmp_path): try: repo_file = pathlib.Path("/etc") / "apt" / "sources.list" @@ -99,6 +101,8 @@ def revert_repo_file(tmp_path): @pytest.fixture +@pytest.mark.destructive_test +@pytest.mark.skip_if_not_root def build_repo_file(): source_path = "/etc/apt/sources.list.d/source_test_list.list" try: @@ -227,6 +231,7 @@ def test_get_repos_doesnot_exist(): @pytest.mark.destructive_test +@pytest.mark.skip_if_not_root def test_del_repo(build_repo_file): """ Test aptpkg.del_repo when passing repo @@ -275,6 +280,7 @@ def test__expand_repo_def(grains): @pytest.mark.destructive_test +@pytest.mark.skip_if_not_root def test_mod_repo(revert_repo_file): """ Test aptpkg.mod_repo when the repo exists. @@ -289,6 +295,7 @@ def test_mod_repo(revert_repo_file): @pytest.mark.destructive_test +@pytest.mark.skip_if_not_root def test_mod_repo_no_file(tmp_path, revert_repo_file): """ Test aptpkg.mod_repo when the file does not exist. @@ -317,6 +324,7 @@ def add_key(request, get_key_file): @pytest.mark.parametrize("get_key_file", KEY_FILES, indirect=True) @pytest.mark.parametrize("add_key", [False, True], indirect=True) @pytest.mark.destructive_test +@pytest.mark.skip_if_not_root def test_get_repo_keys(get_key_file, add_key): """ Test aptpkg.get_repo_keys when aptkey is False and True @@ -330,6 +338,7 @@ def test_get_repo_keys(get_key_file, add_key): @pytest.mark.parametrize("key", [False, True]) @pytest.mark.destructive_test +@pytest.mark.skip_if_not_root def test_get_repo_keys_keydir_not_exist(key): """ Test aptpkg.get_repo_keys when aptkey is False and True From 52f965eb42f75815599e768f61667aaacc371c5c Mon Sep 17 00:00:00 2001 From: Thomas Phipps Date: Thu, 22 Jun 2023 00:17:36 +0000 Subject: [PATCH 035/393] remove destructive and skip_if_not_root from pytest.fixture --- tests/pytests/functional/modules/test_aptpkg.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/pytests/functional/modules/test_aptpkg.py b/tests/pytests/functional/modules/test_aptpkg.py index 71693655c60..3e89ed700b1 100644 --- a/tests/pytests/functional/modules/test_aptpkg.py +++ b/tests/pytests/functional/modules/test_aptpkg.py @@ -85,8 +85,6 @@ def configure_loader_modules(minion_opts): @pytest.fixture() -@pytest.mark.destructive_test -@pytest.mark.skip_if_not_root def revert_repo_file(tmp_path): try: repo_file = pathlib.Path("/etc") / "apt" / "sources.list" From 90b3c25364f9388b3e967b03bfdbb4c33e4dbd4e Mon Sep 17 00:00:00 2001 From: Thomas Phipps Date: Thu, 22 Jun 2023 22:58:24 +0000 Subject: [PATCH 036/393] remove destructive and skip_if_not_root from fixture --- tests/pytests/functional/modules/test_aptpkg.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/pytests/functional/modules/test_aptpkg.py b/tests/pytests/functional/modules/test_aptpkg.py index 3e89ed700b1..7e086e498e2 100644 --- a/tests/pytests/functional/modules/test_aptpkg.py +++ b/tests/pytests/functional/modules/test_aptpkg.py @@ -99,8 +99,6 @@ def revert_repo_file(tmp_path): @pytest.fixture -@pytest.mark.destructive_test -@pytest.mark.skip_if_not_root def build_repo_file(): source_path = "/etc/apt/sources.list.d/source_test_list.list" try: From 021c6792bfe655071e80864acad21e27f762cc10 Mon Sep 17 00:00:00 2001 From: Thomas Phipps Date: Mon, 26 Jun 2023 19:11:54 +0000 Subject: [PATCH 037/393] fix the runner.run to have its own full_return that defautls to False so anything currently using runner.run will work the same as before. this is what i should have done from the start. --- salt/cli/run.py | 2 +- salt/runner.py | 4 ++-- tests/support/case.py | 6 ------ 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/salt/cli/run.py b/salt/cli/run.py index c6f6f42c14e..fba70fffbec 100644 --- a/salt/cli/run.py +++ b/salt/cli/run.py @@ -31,7 +31,7 @@ class SaltRun(salt.utils.parsers.SaltRunOptionParser): if check_user(self.config["user"]): pr = salt.utils.profile.activate_profile(profiling_enabled) try: - ret = runner.run() + ret = runner.run(full_return=True) # In older versions ret['data']['retcode'] was used # for signaling the return code. This has been # changed for the orchestrate runner, but external diff --git a/salt/runner.py b/salt/runner.py index d390af93cde..2a19636b8ed 100644 --- a/salt/runner.py +++ b/salt/runner.py @@ -207,7 +207,7 @@ class Runner(RunnerClient): print(docs[fun]) # TODO: move to mixin whenever we want a salt-wheel cli - def run(self): + def run(self, full_return=False): """ Execute the runner sequence """ @@ -306,7 +306,7 @@ class Runner(RunnerClient): tag=async_pub["tag"], jid=async_pub["jid"], daemonize=False, - full_return=True, + full_return=full_return, ) except salt.exceptions.SaltException as exc: with salt.utils.event.get_event("master", opts=self.opts) as evt: diff --git a/tests/support/case.py b/tests/support/case.py index 4b3222877b1..55b537f6ffd 100644 --- a/tests/support/case.py +++ b/tests/support/case.py @@ -191,12 +191,6 @@ class ShellCase(TestCase, AdaptedConfigurationTestCaseMixin, ScriptPathMixin): with RedirectStdStreams(): runner = salt.runner.Runner(opts) ret["return"] = runner.run() - if ( - isinstance(ret["return"], dict) - and "return" in ret["return"] - and "retcode" not in ret["return"] - ): - ret["return"] = ret["return"]["return"] try: ret["jid"] = runner.jid except AttributeError: From 5bad773949ae4fc4c90f926e6d3f70c9e8dec29b Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Tue, 27 Jun 2023 09:38:37 +0100 Subject: [PATCH 038/393] Don't override the `on` jinja block on the CI workflow template Signed-off-by: Pedro Algarvio --- .github/workflows/ci.yml | 9 ++++++++- .github/workflows/templates/ci.yml.jinja | 6 ------ changelog/64547.added.md | 4 ++++ 3 files changed, 12 insertions(+), 7 deletions(-) create mode 100644 changelog/64547.added.md diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 11db8968e25..0763c5176ee 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,9 +3,16 @@ --- name: CI run-name: "CI (${{ github.event_name == 'pull_request' && format('pr: #{0}', github.event.number) || format('{0}: {1}', startsWith(github.event.ref, 'refs/tags') && 'tag' || 'branch', github.ref_name) }})" + on: push: {} - pull_request: {} + pull_request: + types: + - labeled + - unlabeled + - opened + - reopened + - synchronize env: COLUMNS: 190 diff --git a/.github/workflows/templates/ci.yml.jinja b/.github/workflows/templates/ci.yml.jinja index 809b3c05412..5faeabf91f4 100644 --- a/.github/workflows/templates/ci.yml.jinja +++ b/.github/workflows/templates/ci.yml.jinja @@ -1,12 +1,6 @@ <%- extends 'layout.yml.jinja' %> <%- set pre_commit_version = "3.0.4" %> -<%- block on %> -on: - push: {} - pull_request: {} -<%- endblock on %> - <%- block jobs %> <{- super() }> diff --git a/changelog/64547.added.md b/changelog/64547.added.md new file mode 100644 index 00000000000..a28c6314215 --- /dev/null +++ b/changelog/64547.added.md @@ -0,0 +1,4 @@ +Several fixes to the CI workflow: + +* Don't override the `on` Jinja block on the `ci.yaml` template. This enables reacting to labels getting added/removed + to/from pull requests. From 2d513978a5d4b1a578fe89d6622c2f79e1292220 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Mon, 26 Jun 2023 18:21:35 +0100 Subject: [PATCH 039/393] Switch to using `tools` and re-use the event payload available instead of querying again Signed-off-by: Pedro Algarvio --- .github/actions/get-pull-labels/action.yml | 23 ---- .github/actions/get-pull-number/action.yml | 46 -------- .github/actions/get-pull-request/action.yml | 30 ----- .github/workflows/ci.yml | 33 +----- .github/workflows/nightly.yml | 33 +----- .github/workflows/scheduled.yml | 33 +----- .github/workflows/staging.yml | 33 +----- .github/workflows/templates/layout.yml.jinja | 37 ++----- changelog/64547.added.md | 2 + tools/ci.py | 109 ++++++++++++++++++- 10 files changed, 138 insertions(+), 241 deletions(-) delete mode 100644 .github/actions/get-pull-labels/action.yml delete mode 100644 .github/actions/get-pull-number/action.yml delete mode 100644 .github/actions/get-pull-request/action.yml diff --git a/.github/actions/get-pull-labels/action.yml b/.github/actions/get-pull-labels/action.yml deleted file mode 100644 index 2da0a2c9dae..00000000000 --- a/.github/actions/get-pull-labels/action.yml +++ /dev/null @@ -1,23 +0,0 @@ ---- -name: get-pull-labels -description: Get Pull Labels -inputs: - pull-request: - type: string - -outputs: - labels: - value: ${{ steps.get-pull-labels.outputs.labels }} - -runs: - using: composite - steps: - - name: Get Pull Labels - id: get-pull-labels - shell: bash - env: - PULL_REQUEST: ${{ inputs.pull-request }} - run: | - labels=$(jq -c '[.labels[].name]' <<< $PULL_REQUEST) - echo $labels - echo "labels=$labels" >> "$GITHUB_OUTPUT" diff --git a/.github/actions/get-pull-number/action.yml b/.github/actions/get-pull-number/action.yml deleted file mode 100644 index 00fd0425aff..00000000000 --- a/.github/actions/get-pull-number/action.yml +++ /dev/null @@ -1,46 +0,0 @@ - ---- -name: get-pull-number -description: Get Pull Number -inputs: - owner: - type: string - repo: - type: string - sha: - type: string - pull-number: - default: null - -outputs: - number: - value: ${{ steps.get-pull-number.outputs.number }} - -runs: - using: composite - steps: - - name: Get Pull Number - id: get-pull-number - shell: bash - env: - GITHUB_OWNER: ${{ inputs.owner }} - GITHUB_REPO: ${{ inputs.repo }} - GITHUB_SHA: ${{ inputs.sha }} - GITHUB_PULL_NUMBER: ${{ inputs.pull-number }} - run: | - if [ -z "$GITHUB_PULL_NUMBER" ] - then - echo "Searching For Pull Number" - echo $GITHUB_OWNER - echo $GITHUB_REPO - echo $GITHUB_SHA - pulls=$(gh api repos/$GITHUB_OWNER/$GITHUB_REPO/commits/$GITHUB_SHA/pulls) - echo $pulls - full_name=$GITHUB_OWNER/$GITHUB_REPO - number=$(jq -c --arg r "$full_name" '[.[] | select(.url | contains($r))][0].number' <<< $pulls ) - else - echo "Given Pull Number" - number=$GITHUB_PULL_NUMBER - fi - echo $number - echo "number=$number" >> "$GITHUB_OUTPUT" diff --git a/.github/actions/get-pull-request/action.yml b/.github/actions/get-pull-request/action.yml deleted file mode 100644 index 781aa24fe98..00000000000 --- a/.github/actions/get-pull-request/action.yml +++ /dev/null @@ -1,30 +0,0 @@ - ---- -name: get-pull-request -description: Get Pull Request -inputs: - owner: - type: string - repo: - type: string - pull-number: - type: number - -outputs: - pull-request: - value: ${{ steps.get-pull-request.outputs.request }} - -runs: - using: composite - steps: - - name: Get Pull Request - id: get-pull-request - shell: bash - env: - GITHUB_OWNER: ${{ inputs.owner }} - GITHUB_REPO: ${{ inputs.repo }} - GITHUB_PULL_NUMBER: ${{ inputs.pull-number }} - run: | - pull=$(gh api repos/$GITHUB_OWNER/$GITHUB_REPO/pulls/$GITHUB_PULL_NUMBER) - echo $pull - echo "request=$pull" >> "$GITHUB_OUTPUT" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0763c5176ee..51970256ae0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -146,35 +146,12 @@ jobs: salt-version: "" validate-version: true - - name: Get Pull Number - if: ${{ github.event_name == 'pull_request' }} - id: get-pull-number - uses: ./.github/actions/get-pull-number - with: - owner: ${{ github.repository_owner }} - repo: ${{ github.event.repository.name }} - sha: ${{ github.sha }} - pull-number: ${{ github.event.pull_request.number }} - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Get Pull Request - if: ${{ github.event_name == 'pull_request' }} - id: get-pull-request - uses: ./.github/actions/get-pull-request - with: - owner: ${{ github.repository_owner }} - repo: ${{ github.event.repository.name }} - pull-number: ${{ steps.get-pull-number.outputs.number }} - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Get Pull Labels - if: ${{ github.event_name == 'pull_request' }} + - name: Get Pull Request Test Labels id: get-pull-labels - uses: ./.github/actions/get-pull-labels - with: - pull-request: ${{ steps.get-pull-request.outputs.pull-request }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + tools ci get-pr-test-labels --repository ${{ github.repository }} - name: Write Changed Files To A Local File run: diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index a5371f7878b..6dd4f84bfd8 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -192,35 +192,12 @@ jobs: salt-version: "" validate-version: true - - name: Get Pull Number - if: ${{ github.event_name == 'pull_request' }} - id: get-pull-number - uses: ./.github/actions/get-pull-number - with: - owner: ${{ github.repository_owner }} - repo: ${{ github.event.repository.name }} - sha: ${{ github.sha }} - pull-number: ${{ github.event.pull_request.number }} - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Get Pull Request - if: ${{ github.event_name == 'pull_request' }} - id: get-pull-request - uses: ./.github/actions/get-pull-request - with: - owner: ${{ github.repository_owner }} - repo: ${{ github.event.repository.name }} - pull-number: ${{ steps.get-pull-number.outputs.number }} - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Get Pull Labels - if: ${{ github.event_name == 'pull_request' }} + - name: Get Pull Request Test Labels id: get-pull-labels - uses: ./.github/actions/get-pull-labels - with: - pull-request: ${{ steps.get-pull-request.outputs.pull-request }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + tools ci get-pr-test-labels --repository ${{ github.repository }} - name: Write Changed Files To A Local File run: diff --git a/.github/workflows/scheduled.yml b/.github/workflows/scheduled.yml index 2597688b0c3..242560a992c 100644 --- a/.github/workflows/scheduled.yml +++ b/.github/workflows/scheduled.yml @@ -182,35 +182,12 @@ jobs: salt-version: "" validate-version: true - - name: Get Pull Number - if: ${{ github.event_name == 'pull_request' }} - id: get-pull-number - uses: ./.github/actions/get-pull-number - with: - owner: ${{ github.repository_owner }} - repo: ${{ github.event.repository.name }} - sha: ${{ github.sha }} - pull-number: ${{ github.event.pull_request.number }} - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Get Pull Request - if: ${{ github.event_name == 'pull_request' }} - id: get-pull-request - uses: ./.github/actions/get-pull-request - with: - owner: ${{ github.repository_owner }} - repo: ${{ github.event.repository.name }} - pull-number: ${{ steps.get-pull-number.outputs.number }} - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Get Pull Labels - if: ${{ github.event_name == 'pull_request' }} + - name: Get Pull Request Test Labels id: get-pull-labels - uses: ./.github/actions/get-pull-labels - with: - pull-request: ${{ steps.get-pull-request.outputs.pull-request }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + tools ci get-pr-test-labels --repository ${{ github.repository }} - name: Write Changed Files To A Local File run: diff --git a/.github/workflows/staging.yml b/.github/workflows/staging.yml index ff5a727408e..f883cba1e43 100644 --- a/.github/workflows/staging.yml +++ b/.github/workflows/staging.yml @@ -172,35 +172,12 @@ jobs: salt-version: "${{ inputs.salt-version }}" validate-version: true - - name: Get Pull Number - if: ${{ github.event_name == 'pull_request' }} - id: get-pull-number - uses: ./.github/actions/get-pull-number - with: - owner: ${{ github.repository_owner }} - repo: ${{ github.event.repository.name }} - sha: ${{ github.sha }} - pull-number: ${{ github.event.pull_request.number }} - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Get Pull Request - if: ${{ github.event_name == 'pull_request' }} - id: get-pull-request - uses: ./.github/actions/get-pull-request - with: - owner: ${{ github.repository_owner }} - repo: ${{ github.event.repository.name }} - pull-number: ${{ steps.get-pull-number.outputs.number }} - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Get Pull Labels - if: ${{ github.event_name == 'pull_request' }} + - name: Get Pull Request Test Labels id: get-pull-labels - uses: ./.github/actions/get-pull-labels - with: - pull-request: ${{ steps.get-pull-request.outputs.pull-request }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + tools ci get-pr-test-labels --repository ${{ github.repository }} - name: Check Existing Releases env: diff --git a/.github/workflows/templates/layout.yml.jinja b/.github/workflows/templates/layout.yml.jinja index 855c8a78654..9ca3bf76fa8 100644 --- a/.github/workflows/templates/layout.yml.jinja +++ b/.github/workflows/templates/layout.yml.jinja @@ -191,35 +191,12 @@ jobs: salt-version: "<{ prepare_workflow_salt_version_input }>" validate-version: true - - name: Get Pull Number - if: ${{ github.event_name == 'pull_request' }} - id: get-pull-number - uses: ./.github/actions/get-pull-number - with: - owner: ${{ github.repository_owner }} - repo: ${{ github.event.repository.name }} - sha: ${{ github.sha }} - pull-number: ${{ github.event.pull_request.number }} - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Get Pull Request - if: ${{ github.event_name == 'pull_request' }} - id: get-pull-request - uses: ./.github/actions/get-pull-request - with: - owner: ${{ github.repository_owner }} - repo: ${{ github.event.repository.name }} - pull-number: ${{ steps.get-pull-number.outputs.number }} - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Get Pull Labels - if: ${{ github.event_name == 'pull_request' }} + - name: Get Pull Request Test Labels id: get-pull-labels - uses: ./.github/actions/get-pull-labels - with: - pull-request: ${{ steps.get-pull-request.outputs.pull-request }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + tools ci get-pr-test-labels --repository ${{ github.repository }} <%- if prepare_actual_release %> @@ -262,7 +239,9 @@ jobs: - name: Define Jobs id: define-jobs run: | - tools ci define-jobs<{ prepare_workflow_skip_test_suite }><{ prepare_workflow_skip_pkg_test_suite }><{ prepare_workflow_skip_pkg_download_test_suite }> ${{ github.event_name }} changed-files.json + tools ci define-jobs<{ prepare_workflow_skip_test_suite }><{ + prepare_workflow_skip_pkg_test_suite }><{ prepare_workflow_skip_pkg_download_test_suite + }> ${{ github.event_name }} changed-files.json - name: Check Defined Jobs run: | diff --git a/changelog/64547.added.md b/changelog/64547.added.md index a28c6314215..daa1edaa0d6 100644 --- a/changelog/64547.added.md +++ b/changelog/64547.added.md @@ -2,3 +2,5 @@ Several fixes to the CI workflow: * Don't override the `on` Jinja block on the `ci.yaml` template. This enables reacting to labels getting added/removed to/from pull requests. +* Switch to using `tools` and re-use the event payload available instead of querying the GH API again to get the pull + request labels diff --git a/tools/ci.py b/tools/ci.py index ba7a7c2f849..c75310dd09c 100644 --- a/tools/ci.py +++ b/tools/ci.py @@ -9,7 +9,7 @@ import logging import os import pathlib import time -from typing import TYPE_CHECKING +from typing import TYPE_CHECKING, Any from ptscripts import Context, command_group @@ -672,3 +672,110 @@ def get_releases(ctx: Context, repository: str = "saltstack/salt"): wfh.write(f"latest-release={latest}\n") wfh.write(f"releases={json.dumps(str_releases)}\n") ctx.exit(0) + + +@ci.command( + name="get-pr-test-labels", + arguments={ + "pr": { + "help": "Pull request number", + }, + "repository": { + "help": "Github repository.", + }, + }, +) +def get_pr_test_labels( + ctx: Context, repository: str = "saltstack/salt", pr: int = None +): + """ + Set the pull-request labels. + """ + gh_event_path = os.environ.get("GITHUB_EVENT_PATH") or None + if gh_event_path is None: + labels = _get_pr_test_labels_from_api(ctx, repository, pr=pr) + else: + if TYPE_CHECKING: + assert gh_event_path is not None + + try: + gh_event = json.loads(open(gh_event_path).read()) + except Exception as exc: + ctx.error( + f"Could not load the GH Event payload from {gh_event_path!r}:\n", exc + ) + ctx.exit(1) + + if "pull_request" not in gh_event: + ctx.warning("The 'pull_request' key was not found on the event payload.") + ctx.exit(1) + + pr = gh_event["pull_request"]["number"] + labels = _get_pr_test_labels_from_event_payload(gh_event) + + if labels: + ctx.info(f"Test labels for pull-request #{pr} on {repository}:") + for name, description in labels: + ctx.info(f" * [yellow]{name}[/yellow]: {description}") + else: + ctx.info(f"No test labels for pull-request #{pr} on {repository}") + + github_output = os.environ.get("GITHUB_OUTPUT") + if github_output is None: + ctx.exit(0) + + if TYPE_CHECKING: + assert github_output is not None + + ctx.info("Writing 'labels' to the github outputs file") + with open(github_output, "a", encoding="utf-8") as wfh: + wfh.write(f"labels={json.dumps([label[0] for label in labels])}\n") + ctx.exit(0) + + +def _get_pr_test_labels_from_api( + ctx: Context, repository: str = "saltstack/salt", pr: int = None +) -> list[tuple[str, str]]: + """ + Set the pull-request labels. + """ + if pr is None: + ctx.error( + "Could not find the 'GITHUB_EVENT_PATH' variable and the " + "--pr flag was not passed. Unable to detect pull-request number." + ) + ctx.exit(1) + with ctx.web as web: + headers = { + "Accept": "application/vnd.github+json", + } + if "GITHUB_TOKEN" in os.environ: + headers["Authorization"] = f"Bearer {os.environ['GITHUB_TOKEN']}" + web.headers.update(headers) + ret = web.get(f"https://api.github.com/repos/{repository}/pulls/{pr}") + if ret.status_code != 200: + ctx.error( + f"Failed to get the #{pr} pull-request details on repository {repository!r}: {ret.reason}" + ) + ctx.exit(1) + pr_details = ret.json() + return _filter_test_labels(pr_details["labels"]) + + +def _get_pr_test_labels_from_event_payload( + gh_event: dict[str, Any] +) -> list[tuple[str, str]]: + """ + Get the pull-request test labels. + """ + if "pull_request" not in gh_event: + return [] + return _filter_test_labels(gh_event["pull_request"]["labels"]) + + +def _filter_test_labels(labels: list[dict[str, Any]]) -> list[tuple[str, str]]: + return [ + (label["name"], label["description"]) + for label in labels + if label["name"].startswith("test:") + ] From 3fe2f449031e8924881b349127e34a32fb43d50d Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Tue, 27 Jun 2023 10:26:08 +0100 Subject: [PATCH 040/393] Choose a full test run when a PR has the `test:full` label Fixes #64539 Signed-off-by: Pedro Algarvio --- changelog/64539.fixed.md | 1 + tools/ci.py | 21 ++++++++++++++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 changelog/64539.fixed.md diff --git a/changelog/64539.fixed.md b/changelog/64539.fixed.md new file mode 100644 index 00000000000..38c3af47edf --- /dev/null +++ b/changelog/64539.fixed.md @@ -0,0 +1 @@ +Added a `test:full` label in the salt repository, which, when selected, will force a full test run. diff --git a/tools/ci.py b/tools/ci.py index c75310dd09c..c49b3f8e02f 100644 --- a/tools/ci.py +++ b/tools/ci.py @@ -439,8 +439,23 @@ def define_testrun(ctx: Context, event_name: str, changed_files: pathlib.Path): ctx.error(f"Could not load the changed files from '{changed_files}': {exc}") ctx.exit(1) + labels: list[str] = [] + gh_event_path = os.environ.get("GITHUB_EVENT_PATH") or None + if gh_event_path is not None: + try: + gh_event = json.loads(open(gh_event_path).read()) + except Exception as exc: + ctx.error( + f"Could not load the GH Event payload from {gh_event_path!r}:\n", exc + ) + ctx.exit(1) + + labels.extend( + label[0] for label in _get_pr_test_labels_from_event_payload(gh_event) + ) + # So, it's a pull request... - # Based on which files changed, or other things like PR comments we can + # Based on which files changed, or other things like PR labels we can # decide what to run, or even if the full test run should be running on the # pull request, etc... changed_pkg_requirements_files = json.loads( @@ -471,6 +486,10 @@ def define_testrun(ctx: Context, event_name: str, changed_files: pathlib.Path): wfh.write(f"{path}\n") wfh.write("\n\n") testrun = {"type": "full"} + elif "test:full" in labels: + with open(github_step_summary, "a", encoding="utf-8") as wfh: + wfh.write("Full test run chosen because the label `test:full` is set.\n") + testrun = {"type": "full"} else: testrun_changed_files_path = tools.utils.REPO_ROOT / "testrun-changed-files.txt" testrun = { From 4b85fc6e17224f8ea231620d3e53a6a5e2d3321d Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Tue, 27 Jun 2023 12:35:02 +0100 Subject: [PATCH 041/393] Concentrate test selection to a single place Signed-off-by: Pedro Algarvio --- .github/workflows/ci.yml | 23 --------- .github/workflows/nightly.yml | 23 --------- .github/workflows/scheduled.yml | 23 --------- .github/workflows/staging.yml | 23 --------- .../workflows/templates/test-salt.yml.jinja | 3 -- .github/workflows/test-action-macos.yml | 46 +++-------------- .github/workflows/test-action.yml | 46 +++-------------- changelog/64547.added.md | 1 + tools/ci.py | 50 ++++++++++++++++--- 9 files changed, 57 insertions(+), 181 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 51970256ae0..baf729efce6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -854,7 +854,6 @@ jobs: testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" 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' }} @@ -873,7 +872,6 @@ jobs: testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" 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' }} @@ -892,7 +890,6 @@ jobs: testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" 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' }} @@ -911,7 +908,6 @@ jobs: testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" 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' }} @@ -930,7 +926,6 @@ jobs: testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" 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' }} @@ -949,7 +944,6 @@ jobs: testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" 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' }} @@ -968,7 +962,6 @@ jobs: testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" 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' }} @@ -987,7 +980,6 @@ jobs: testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" 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' }} @@ -1006,7 +998,6 @@ jobs: testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" 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' }} @@ -1025,7 +1016,6 @@ jobs: testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" 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' }} @@ -1044,7 +1034,6 @@ jobs: testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" 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' }} @@ -1063,7 +1052,6 @@ jobs: testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" 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' }} @@ -1082,7 +1070,6 @@ jobs: testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" 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' }} @@ -1101,7 +1088,6 @@ jobs: testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" 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' }} @@ -1120,7 +1106,6 @@ jobs: testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" 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' }} @@ -1139,7 +1124,6 @@ jobs: testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" 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' }} @@ -1158,7 +1142,6 @@ jobs: testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" 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' }} @@ -1177,7 +1160,6 @@ jobs: testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" 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' }} @@ -1196,7 +1178,6 @@ jobs: testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" 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' }} @@ -1215,7 +1196,6 @@ jobs: testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" 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' }} @@ -1234,7 +1214,6 @@ jobs: testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" 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' }} @@ -1253,7 +1232,6 @@ jobs: testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" 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' }} @@ -1272,7 +1250,6 @@ jobs: testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" 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 6dd4f84bfd8..0bde1d78e3c 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -911,7 +911,6 @@ jobs: testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" 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 @@ -930,7 +929,6 @@ jobs: testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" 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 @@ -949,7 +947,6 @@ jobs: testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" 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 +965,6 @@ jobs: testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" 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 +983,6 @@ jobs: testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" 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 +1001,6 @@ jobs: testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" 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 +1019,6 @@ jobs: testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" 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 +1037,6 @@ jobs: testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" 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 +1055,6 @@ jobs: testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" 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 +1073,6 @@ jobs: testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" 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 +1091,6 @@ jobs: testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" 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 +1109,6 @@ jobs: testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" 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 +1127,6 @@ jobs: testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" 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 +1145,6 @@ jobs: testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" 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 +1163,6 @@ jobs: testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" 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 +1181,6 @@ jobs: testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" 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 +1199,6 @@ jobs: testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" 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 +1217,6 @@ jobs: testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" 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 +1235,6 @@ jobs: testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" 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 +1253,6 @@ jobs: testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" 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 +1271,6 @@ jobs: testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" 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 +1289,6 @@ jobs: testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" 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 +1307,6 @@ jobs: testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" 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/scheduled.yml b/.github/workflows/scheduled.yml index 242560a992c..603f2d4c579 100644 --- a/.github/workflows/scheduled.yml +++ b/.github/workflows/scheduled.yml @@ -890,7 +890,6 @@ jobs: testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" 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 @@ -909,7 +908,6 @@ jobs: testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" 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 @@ -928,7 +926,6 @@ jobs: testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" 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 @@ -947,7 +944,6 @@ jobs: testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" 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 @@ -966,7 +962,6 @@ jobs: testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" 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 @@ -985,7 +980,6 @@ jobs: testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" 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 @@ -1004,7 +998,6 @@ jobs: testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" 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 @@ -1023,7 +1016,6 @@ jobs: testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" 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 @@ -1042,7 +1034,6 @@ jobs: testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" 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 @@ -1061,7 +1052,6 @@ jobs: testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" 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 @@ -1080,7 +1070,6 @@ jobs: testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" 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 @@ -1099,7 +1088,6 @@ jobs: testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" 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 @@ -1118,7 +1106,6 @@ jobs: testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" 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 @@ -1137,7 +1124,6 @@ jobs: testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" 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 @@ -1156,7 +1142,6 @@ jobs: testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" 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 @@ -1175,7 +1160,6 @@ jobs: testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" 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 @@ -1194,7 +1178,6 @@ jobs: testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" 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 @@ -1213,7 +1196,6 @@ jobs: testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" 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 @@ -1232,7 +1214,6 @@ jobs: testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" 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 @@ -1251,7 +1232,6 @@ jobs: testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" 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 @@ -1270,7 +1250,6 @@ jobs: testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" 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 @@ -1289,7 +1268,6 @@ jobs: testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" 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 @@ -1308,7 +1286,6 @@ jobs: testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" 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 f883cba1e43..7eab1044545 100644 --- a/.github/workflows/staging.yml +++ b/.github/workflows/staging.yml @@ -896,7 +896,6 @@ jobs: testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" 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 @@ -915,7 +914,6 @@ jobs: testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" 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 @@ -934,7 +932,6 @@ jobs: testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" 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 @@ -953,7 +950,6 @@ jobs: testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" 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 @@ -972,7 +968,6 @@ jobs: testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" 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 @@ -991,7 +986,6 @@ jobs: testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" 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 @@ -1010,7 +1004,6 @@ jobs: testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" 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 @@ -1029,7 +1022,6 @@ jobs: testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" 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 @@ -1048,7 +1040,6 @@ jobs: testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" 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 @@ -1067,7 +1058,6 @@ jobs: testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" 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 @@ -1086,7 +1076,6 @@ jobs: testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" 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 @@ -1105,7 +1094,6 @@ jobs: testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" 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 @@ -1124,7 +1112,6 @@ jobs: testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" 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 @@ -1143,7 +1130,6 @@ jobs: testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" 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 @@ -1162,7 +1148,6 @@ jobs: testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" 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 @@ -1181,7 +1166,6 @@ jobs: testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" 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 @@ -1200,7 +1184,6 @@ jobs: testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" 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 @@ -1219,7 +1202,6 @@ jobs: testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" 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 @@ -1238,7 +1220,6 @@ jobs: testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" 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 @@ -1257,7 +1238,6 @@ jobs: testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" 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 @@ -1276,7 +1256,6 @@ jobs: testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" 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 @@ -1295,7 +1274,6 @@ jobs: testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" 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 @@ -1314,7 +1292,6 @@ jobs: testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" 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 diff --git a/.github/workflows/templates/test-salt.yml.jinja b/.github/workflows/templates/test-salt.yml.jinja index 0d6d3557dcf..d54ab8181ee 100644 --- a/.github/workflows/templates/test-salt.yml.jinja +++ b/.github/workflows/templates/test-salt.yml.jinja @@ -19,7 +19,6 @@ testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|<{ python_version }> - pull-labels: ${{ needs.prepare-workflow.outputs.pull-labels }} skip-code-coverage: <{ skip_test_coverage_check }> skip-junit-reports: <{ skip_junit_reports_check }> @@ -43,7 +42,6 @@ testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|<{ python_version }> - pull-labels: ${{ needs.prepare-workflow.outputs.pull-labels }} skip-code-coverage: <{ skip_test_coverage_check }> skip-junit-reports: <{ skip_junit_reports_check }> @@ -85,7 +83,6 @@ testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|<{ python_version }> - pull-labels: ${{ needs.prepare-workflow.outputs.pull-labels }} skip-code-coverage: <{ skip_test_coverage_check }> skip-junit-reports: <{ skip_junit_reports_check }> diff --git a/.github/workflows/test-action-macos.yml b/.github/workflows/test-action-macos.yml index b8088c64522..3d1edefdf96 100644 --- a/.github/workflows/test-action-macos.yml +++ b/.github/workflows/test-action-macos.yml @@ -42,11 +42,6 @@ on: type: string description: The onedir package name to use default: salt - pull-labels: - required: false - type: string - description: List of all the pull labels - default: '["test:slow", "test:core"]' skip-code-coverage: required: false type: boolean @@ -269,36 +264,9 @@ jobs: run: | sudo -E nox -e ${{ env.NOX_SESSION }} -- ${{ matrix.tests-chunk }} -- -k "mac or darwin" - - name: Get Test Flags - id: get-test-flags - shell: bash - env: - PULL_LABELS: ${{ inputs.pull-labels }} - run: | - echo "$PULL_LABELS" - # shellcheck disable=SC2086 - no_fast_tests="$(jq -c '. | any(index("test:no-fast"))' <<< $PULL_LABELS)" - # shellcheck disable=SC2086 - slow_tests="$(jq -c '. | any(index("test:slow"))' <<< $PULL_LABELS)" - # shellcheck disable=SC2086 - core_tests="$(jq -c '. | any(index("test:core"))' <<< $PULL_LABELS)" - # shellcheck disable=SC2086 - flaky_jail_tests="$(jq -c '. | any(index("test:flaky-jail"))' <<< $PULL_LABELS)" - echo "$no_fast_tests" - echo "$slow_tests" - echo "$core_tests" - echo "$flaky_jail_tests" - # shellcheck disable=SC2086 - { - echo "no_fast_tests=$no_fast_tests"; - echo "slow_tests=$slow_tests"; - echo "core_tests=$core_tests"; - echo "flaky_jail_tests=$flaky_jail_tests"; - } >> "$GITHUB_OUTPUT" - - name: Run Fast/Changed Tests id: run-fast-changed-tests - if: ${{ fromJSON(inputs.testrun)['type'] != 'full' && steps.get-test-flags.outputs.no_fast_tests == 'true' }} + if: ${{ fromJSON(inputs.testrun)['type'] != 'full' && fromJSON(inputs.testrun)['selected_tests']['fast'] == false }} env: SKIP_REQUIREMENTS_INSTALL: "1" PRINT_TEST_SELECTION: "0" @@ -315,7 +283,7 @@ jobs: - name: Run Slow/Changed Tests id: run-slow-changed-tests - if: ${{ fromJSON(inputs.testrun)['type'] != 'full' && steps.get-test-flags.outputs.slow_tests == 'false' }} + if: ${{ fromJSON(inputs.testrun)['type'] != 'full' && fromJSON(inputs.testrun)['selected_tests']['slow'] == false }} env: SKIP_REQUIREMENTS_INSTALL: "1" PRINT_TEST_SELECTION: "0" @@ -332,7 +300,7 @@ jobs: - name: Run Core/Changed Tests id: run-core-changed-tests - if: ${{ fromJSON(inputs.testrun)['type'] != 'full' && steps.get-test-flags.outputs.core_tests == 'false' }} + if: ${{ fromJSON(inputs.testrun)['type'] != 'full' && fromJSON(inputs.testrun)['selected_tests']['core'] == false }} env: SKIP_REQUIREMENTS_INSTALL: "1" PRINT_TEST_SELECTION: "0" @@ -349,7 +317,7 @@ jobs: - name: Run Fast Tests id: run-fast-tests - if: ${{ fromJSON(inputs.testrun)['type'] != 'full' && steps.get-test-flags.outputs.no_fast_tests == 'false' }} + if: ${{ fromJSON(inputs.testrun)['type'] != 'full' && fromJSON(inputs.testrun)['selected_tests']['fast'] }} env: SKIP_REQUIREMENTS_INSTALL: "1" PRINT_TEST_SELECTION: "0" @@ -365,7 +333,7 @@ jobs: - name: Run Slow Tests id: run-slow-tests - if: ${{ fromJSON(inputs.testrun)['type'] != 'full' && steps.get-test-flags.outputs.slow_tests == 'true' }} + if: ${{ fromJSON(inputs.testrun)['type'] != 'full' && fromJSON(inputs.testrun)['selected_tests']['slow'] }} env: SKIP_REQUIREMENTS_INSTALL: "1" PRINT_TEST_SELECTION: "0" @@ -381,7 +349,7 @@ jobs: - name: Run Core Tests id: run-core-tests - if: ${{ fromJSON(inputs.testrun)['type'] != 'full' && steps.get-test-flags.outputs.core_tests == 'true' }} + if: ${{ fromJSON(inputs.testrun)['type'] != 'full' && fromJSON(inputs.testrun)['selected_tests']['core'] }} env: SKIP_REQUIREMENTS_INSTALL: "1" PRINT_TEST_SELECTION: "0" @@ -397,7 +365,7 @@ jobs: - name: Run Flaky Tests id: run-flaky-tests - if: ${{ fromJSON(inputs.testrun)['type'] != 'full' && steps.get-test-flags.outputs.flaky_jail_tests == 'true' }} + if: ${{ fromJSON(inputs.testrun)['selected_tests']['flaky'] }} env: SKIP_REQUIREMENTS_INSTALL: "1" PRINT_TEST_SELECTION: "0" diff --git a/.github/workflows/test-action.yml b/.github/workflows/test-action.yml index 0982e7446eb..49d75dcd86b 100644 --- a/.github/workflows/test-action.yml +++ b/.github/workflows/test-action.yml @@ -37,11 +37,6 @@ on: type: string description: The onedir package name to use default: salt - pull-labels: - required: false - type: string - description: List of all the pull labels - default: '["test:slow", "test:core"]' skip-code-coverage: required: false type: boolean @@ -303,36 +298,9 @@ jobs: --nox-session=${{ env.NOX_SESSION }} ${{ inputs.distro-slug }} \ ${{ matrix.tests-chunk }} - - name: Get Test Flags - id: get-test-flags - shell: bash - env: - PULL_LABELS: ${{ inputs.pull-labels }} - run: | - echo "$PULL_LABELS" - # shellcheck disable=SC2086 - no_fast_tests="$(jq -c '. | any(index("test:no-fast"))' <<< $PULL_LABELS)" - # shellcheck disable=SC2086 - slow_tests="$(jq -c '. | any(index("test:slow"))' <<< $PULL_LABELS)" - # shellcheck disable=SC2086 - core_tests="$(jq -c '. | any(index("test:core"))' <<< $PULL_LABELS)" - # shellcheck disable=SC2086 - flaky_jail_tests="$(jq -c '. | any(index("test:flaky-jail"))' <<< $PULL_LABELS)" - echo "$no_fast_tests" - echo "$slow_tests" - echo "$core_tests" - echo "$flaky_jail_tests" - # shellcheck disable=SC2086 - { - echo "no_fast_tests=$no_fast_tests"; - echo "slow_tests=$slow_tests"; - echo "core_tests=$core_tests"; - echo "flaky_jail_tests=$flaky_jail_tests"; - } >> "$GITHUB_OUTPUT" - - name: Run Fast/Changed Tests id: run-fast-changed-tests - if: ${{ fromJSON(inputs.testrun)['type'] != 'full' && steps.get-test-flags.outputs.no_fast_tests == 'true' }} + if: ${{ fromJSON(inputs.testrun)['type'] != 'full' && fromJSON(inputs.testrun)['selected_tests']['fast'] == false }} run: | tools --timestamps --no-output-timeout-secs=1800 --timeout-secs=14400 vm test --skip-requirements-install \ --nox-session=${{ env.NOX_SESSION }} --rerun-failures ${{ inputs.distro-slug }} \ @@ -341,7 +309,7 @@ jobs: - name: Run Slow/Changed Tests id: run-slow-changed-tests - if: ${{ fromJSON(inputs.testrun)['type'] != 'full' && steps.get-test-flags.outputs.slow_tests == 'false' }} + if: ${{ fromJSON(inputs.testrun)['type'] != 'full' && fromJSON(inputs.testrun)['selected_tests']['slow'] == false }} run: | tools --timestamps --no-output-timeout-secs=1800 --timeout-secs=14400 vm test --skip-requirements-install \ --nox-session=${{ env.NOX_SESSION }} --rerun-failures ${{ inputs.distro-slug }} \ @@ -350,7 +318,7 @@ jobs: - name: Run Core/Changed Tests id: run-core-changed-tests - if: ${{ fromJSON(inputs.testrun)['type'] != 'full' && steps.get-test-flags.outputs.core_tests == 'false' }} + if: ${{ fromJSON(inputs.testrun)['type'] != 'full' && fromJSON(inputs.testrun)['selected_tests']['core'] == false }} run: | tools --timestamps --no-output-timeout-secs=1800 --timeout-secs=14400 vm test --skip-requirements-install \ --nox-session=${{ env.NOX_SESSION }} --rerun-failures ${{ inputs.distro-slug }} \ @@ -359,7 +327,7 @@ jobs: - name: Run Fast Tests id: run-fast-tests - if: ${{ fromJSON(inputs.testrun)['type'] != 'full' && steps.get-test-flags.outputs.no_fast_tests == 'false' }} + if: ${{ fromJSON(inputs.testrun)['type'] != 'full' && fromJSON(inputs.testrun)['selected_tests']['fast'] }} run: | tools --timestamps --no-output-timeout-secs=1800 --timeout-secs=14400 vm test --skip-requirements-install \ --nox-session=${{ env.NOX_SESSION }} --rerun-failures ${{ (inputs.skip-code-coverage && matrix.tests-chunk != 'unit') && '--skip-code-coverage' || '' }} \ @@ -367,7 +335,7 @@ jobs: - name: Run Slow Tests id: run-slow-tests - if: ${{ fromJSON(inputs.testrun)['type'] != 'full' && steps.get-test-flags.outputs.slow_tests == 'true' }} + if: ${{ fromJSON(inputs.testrun)['type'] != 'full' && fromJSON(inputs.testrun)['selected_tests']['slow'] }} run: | tools --timestamps --no-output-timeout-secs=1800 --timeout-secs=14400 vm test --skip-requirements-install \ --nox-session=${{ env.NOX_SESSION }} --rerun-failures ${{ inputs.distro-slug }} \ @@ -375,7 +343,7 @@ jobs: - name: Run Core Tests id: run-core-tests - if: ${{ fromJSON(inputs.testrun)['type'] != 'full' && steps.get-test-flags.outputs.core_tests == 'true' }} + if: ${{ fromJSON(inputs.testrun)['type'] != 'full' && fromJSON(inputs.testrun)['selected_tests']['core'] }} run: | tools --timestamps --no-output-timeout-secs=1800 --timeout-secs=14400 vm test --skip-requirements-install \ --nox-session=${{ env.NOX_SESSION }} --rerun-failures ${{ inputs.distro-slug }} \ @@ -383,7 +351,7 @@ jobs: - name: Run Flaky Tests id: run-flaky-tests - if: ${{ fromJSON(inputs.testrun)['type'] != 'full' && steps.get-test-flags.outputs.flaky_jail_tests == 'true' }} + if: ${{ fromJSON(inputs.testrun)['selected_tests']['flaky'] }} run: | tools --timestamps --no-output-timeout-secs=1800 --timeout-secs=14400 vm test --skip-requirements-install \ --nox-session=${{ env.NOX_SESSION }} --rerun-failures ${{ inputs.distro-slug }} \ diff --git a/changelog/64547.added.md b/changelog/64547.added.md index daa1edaa0d6..f1bc6e6a131 100644 --- a/changelog/64547.added.md +++ b/changelog/64547.added.md @@ -4,3 +4,4 @@ Several fixes to the CI workflow: to/from pull requests. * Switch to using `tools` and re-use the event payload available instead of querying the GH API again to get the pull request labels +* Concentrate test selection by labels to a single place diff --git a/tools/ci.py b/tools/ci.py index c49b3f8e02f..c3f79aab355 100644 --- a/tools/ci.py +++ b/tools/ci.py @@ -8,6 +8,7 @@ import json import logging import os import pathlib +import sys import time from typing import TYPE_CHECKING, Any @@ -15,6 +16,11 @@ from ptscripts import Context, command_group import tools.utils +if sys.version_info < (3, 11): + from typing_extensions import NotRequired, TypedDict +else: + from typing import NotRequired, TypedDict # pylint: disable=no-name-in-module + log = logging.getLogger(__name__) # Define the command group @@ -381,6 +387,12 @@ def define_jobs( wfh.write(f"jobs={json.dumps(jobs)}\n") +class TestRun(TypedDict): + type: str + from_filenames: NotRequired[str] + selected_tests: NotRequired[dict[str, bool]] + + @ci.command( name="define-testrun", arguments={ @@ -418,7 +430,7 @@ def define_testrun(ctx: Context, event_name: str, changed_files: pathlib.Path): if event_name != "pull_request": # In this case, a full test run is in order ctx.info("Writing 'testrun' to the github outputs file") - testrun = {"type": "full"} + testrun = TestRun(type="full") with open(github_output, "a", encoding="utf-8") as wfh: wfh.write(f"testrun={json.dumps(testrun)}\n") @@ -470,7 +482,7 @@ def define_testrun(ctx: Context, event_name: str, changed_files: pathlib.Path): "Full test run chosen because there was a change made " "to `cicd/golden-images.json`.\n" ) - testrun = {"type": "full"} + testrun = TestRun(type="full") elif changed_pkg_requirements_files or changed_test_requirements_files: with open(github_step_summary, "a", encoding="utf-8") as wfh: wfh.write( @@ -485,19 +497,19 @@ def define_testrun(ctx: Context, event_name: str, changed_files: pathlib.Path): ): wfh.write(f"{path}\n") wfh.write("\n\n") - testrun = {"type": "full"} + testrun = TestRun(type="full") elif "test:full" in labels: with open(github_step_summary, "a", encoding="utf-8") as wfh: wfh.write("Full test run chosen because the label `test:full` is set.\n") - testrun = {"type": "full"} + testrun = TestRun(type="full") else: testrun_changed_files_path = tools.utils.REPO_ROOT / "testrun-changed-files.txt" - testrun = { - "type": "changed", - "from-filenames": str( + testrun = TestRun( + type="changed", + from_filenames=str( testrun_changed_files_path.relative_to(tools.utils.REPO_ROOT) ), - } + ) ctx.info(f"Writing {testrun_changed_files_path.name} ...") selected_changed_files = [] for fpath in json.loads(changed_files_contents["testrun_files"]): @@ -517,6 +529,28 @@ def define_testrun(ctx: Context, event_name: str, changed_files: pathlib.Path): if testrun["type"] == "changed": with open(github_step_summary, "a", encoding="utf-8") as wfh: wfh.write("Partial test run chosen.\n") + testrun["selected_tests"] = { + "core": False, + "slow": False, + "fast": True, + "flaky": False, + } + if "test:slow" in labels: + with open(github_step_summary, "a", encoding="utf-8") as wfh: + wfh.write("Slow tests chosen by `test:slow` label.\n") + testrun["selected_tests"]["slow"] = True + if "test:core" in labels: + with open(github_step_summary, "a", encoding="utf-8") as wfh: + wfh.write("Core tests chosen by `test:core` label.\n") + testrun["selected_tests"]["core"] = True + if "test:no-fast" in labels: + with open(github_step_summary, "a", encoding="utf-8") as wfh: + wfh.write("Fast tests deselected by `test:no-fast` label.\n") + testrun["selected_tests"]["fast"] = False + if "test:flaky-jail" in labels: + with open(github_step_summary, "a", encoding="utf-8") as wfh: + wfh.write("Flaky jailed tests chosen by `test:flaky-jail` label.\n") + testrun["selected_tests"]["flaky"] = True if selected_changed_files: with open(github_step_summary, "a", encoding="utf-8") as wfh: wfh.write( From 2d824c91534991fafcae051afc376d7ef9e8be5c Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Tue, 27 Jun 2023 16:44:44 +0100 Subject: [PATCH 042/393] Enable code coverage on pull-requests by setting the `test:coverage` label Signed-off-by: Pedro Algarvio --- .github/workflows/ci.yml | 86 ++++++++++---------- .github/workflows/templates/layout.yml.jinja | 2 +- changelog/64547.added.md | 1 + tools/ci.py | 46 ++++++----- 4 files changed, 72 insertions(+), 63 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index baf729efce6..05284621f9f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -513,7 +513,7 @@ jobs: salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" pkg-type: rpm cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 - skip-code-coverage: ${{ github.event_name == 'pull_request' }} + skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} centos-7-pkg-tests: @@ -530,7 +530,7 @@ jobs: salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" pkg-type: rpm cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 - skip-code-coverage: ${{ github.event_name == 'pull_request' }} + skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} centosstream-8-pkg-tests: @@ -547,7 +547,7 @@ jobs: salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" pkg-type: rpm cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 - skip-code-coverage: ${{ github.event_name == 'pull_request' }} + skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} centosstream-9-pkg-tests: @@ -564,7 +564,7 @@ jobs: salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" pkg-type: rpm cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 - skip-code-coverage: ${{ github.event_name == 'pull_request' }} + skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} debian-10-pkg-tests: @@ -581,7 +581,7 @@ jobs: salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" pkg-type: deb cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 - skip-code-coverage: ${{ github.event_name == 'pull_request' }} + skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} debian-11-pkg-tests: @@ -598,7 +598,7 @@ jobs: salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" pkg-type: deb cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 - skip-code-coverage: ${{ github.event_name == 'pull_request' }} + skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} debian-11-arm64-pkg-tests: @@ -615,7 +615,7 @@ jobs: salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" pkg-type: deb cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 - skip-code-coverage: ${{ github.event_name == 'pull_request' }} + skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} photonos-3-pkg-tests: @@ -632,7 +632,7 @@ jobs: salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" pkg-type: rpm cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 - skip-code-coverage: ${{ github.event_name == 'pull_request' }} + skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} photonos-4-pkg-tests: @@ -649,7 +649,7 @@ jobs: salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" pkg-type: rpm cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 - skip-code-coverage: ${{ github.event_name == 'pull_request' }} + skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} ubuntu-2004-pkg-tests: @@ -666,7 +666,7 @@ jobs: salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" pkg-type: deb cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 - skip-code-coverage: ${{ github.event_name == 'pull_request' }} + skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} ubuntu-2004-arm64-pkg-tests: @@ -683,7 +683,7 @@ jobs: salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" pkg-type: deb cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 - skip-code-coverage: ${{ github.event_name == 'pull_request' }} + skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} ubuntu-2204-pkg-tests: @@ -700,7 +700,7 @@ jobs: salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" pkg-type: deb cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 - skip-code-coverage: ${{ github.event_name == 'pull_request' }} + skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} ubuntu-2204-arm64-pkg-tests: @@ -717,7 +717,7 @@ jobs: salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" pkg-type: deb cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 - skip-code-coverage: ${{ github.event_name == 'pull_request' }} + skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} macos-12-pkg-tests: @@ -734,7 +734,7 @@ jobs: salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" pkg-type: macos cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 - skip-code-coverage: ${{ github.event_name == 'pull_request' }} + skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} windows-2016-nsis-pkg-tests: @@ -751,7 +751,7 @@ jobs: salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" pkg-type: NSIS cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 - skip-code-coverage: ${{ github.event_name == 'pull_request' }} + skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} windows-2016-msi-pkg-tests: @@ -768,7 +768,7 @@ jobs: salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" pkg-type: MSI cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 - skip-code-coverage: ${{ github.event_name == 'pull_request' }} + skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} windows-2019-nsis-pkg-tests: @@ -785,7 +785,7 @@ jobs: salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" pkg-type: NSIS cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 - skip-code-coverage: ${{ github.event_name == 'pull_request' }} + skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} windows-2019-msi-pkg-tests: @@ -802,7 +802,7 @@ jobs: salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" pkg-type: MSI cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 - skip-code-coverage: ${{ github.event_name == 'pull_request' }} + skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} windows-2022-nsis-pkg-tests: @@ -819,7 +819,7 @@ jobs: salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" pkg-type: NSIS cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 - skip-code-coverage: ${{ github.event_name == 'pull_request' }} + skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} windows-2022-msi-pkg-tests: @@ -836,7 +836,7 @@ jobs: salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" pkg-type: MSI cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 - skip-code-coverage: ${{ github.event_name == 'pull_request' }} + skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} windows-2016: @@ -854,7 +854,7 @@ jobs: testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 - skip-code-coverage: ${{ github.event_name == 'pull_request' }} + skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} windows-2019: @@ -872,7 +872,7 @@ jobs: testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 - skip-code-coverage: ${{ github.event_name == 'pull_request' }} + skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} windows-2022: @@ -890,7 +890,7 @@ jobs: testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 - skip-code-coverage: ${{ github.event_name == 'pull_request' }} + skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} macos-12: @@ -908,7 +908,7 @@ jobs: testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 - skip-code-coverage: ${{ github.event_name == 'pull_request' }} + skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} almalinux-8: @@ -926,7 +926,7 @@ jobs: testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 - skip-code-coverage: ${{ github.event_name == 'pull_request' }} + skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} almalinux-9: @@ -944,7 +944,7 @@ jobs: testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 - skip-code-coverage: ${{ github.event_name == 'pull_request' }} + skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} amazonlinux-2: @@ -962,7 +962,7 @@ jobs: testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 - skip-code-coverage: ${{ github.event_name == 'pull_request' }} + skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} archlinux-lts: @@ -980,7 +980,7 @@ jobs: testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 - skip-code-coverage: ${{ github.event_name == 'pull_request' }} + skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} centos-7: @@ -998,7 +998,7 @@ jobs: testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 - skip-code-coverage: ${{ github.event_name == 'pull_request' }} + skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} centosstream-8: @@ -1016,7 +1016,7 @@ jobs: testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 - skip-code-coverage: ${{ github.event_name == 'pull_request' }} + skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} centosstream-9: @@ -1034,7 +1034,7 @@ jobs: testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 - skip-code-coverage: ${{ github.event_name == 'pull_request' }} + skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} debian-10: @@ -1052,7 +1052,7 @@ jobs: testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 - skip-code-coverage: ${{ github.event_name == 'pull_request' }} + skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} debian-11: @@ -1070,7 +1070,7 @@ jobs: testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 - skip-code-coverage: ${{ github.event_name == 'pull_request' }} + skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} debian-11-arm64: @@ -1088,7 +1088,7 @@ jobs: testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 - skip-code-coverage: ${{ github.event_name == 'pull_request' }} + skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} fedora-37: @@ -1106,7 +1106,7 @@ jobs: testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 - skip-code-coverage: ${{ github.event_name == 'pull_request' }} + skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} fedora-38: @@ -1124,7 +1124,7 @@ jobs: testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 - skip-code-coverage: ${{ github.event_name == 'pull_request' }} + skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} opensuse-15: @@ -1142,7 +1142,7 @@ jobs: testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 - skip-code-coverage: ${{ github.event_name == 'pull_request' }} + skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} photonos-3: @@ -1160,7 +1160,7 @@ jobs: testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 - skip-code-coverage: ${{ github.event_name == 'pull_request' }} + skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} photonos-4: @@ -1178,7 +1178,7 @@ jobs: testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 - skip-code-coverage: ${{ github.event_name == 'pull_request' }} + skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} ubuntu-2004: @@ -1196,7 +1196,7 @@ jobs: testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 - skip-code-coverage: ${{ github.event_name == 'pull_request' }} + skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} ubuntu-2004-arm64: @@ -1214,7 +1214,7 @@ jobs: testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 - skip-code-coverage: ${{ github.event_name == 'pull_request' }} + skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} ubuntu-2204: @@ -1232,7 +1232,7 @@ jobs: testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 - skip-code-coverage: ${{ github.event_name == 'pull_request' }} + skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} ubuntu-2204-arm64: @@ -1250,7 +1250,7 @@ jobs: testrun: ${{ needs.prepare-workflow.outputs.testrun }} salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 - skip-code-coverage: ${{ github.event_name == 'pull_request' }} + skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} set-pipeline-exit-status: diff --git a/.github/workflows/templates/layout.yml.jinja b/.github/workflows/templates/layout.yml.jinja index 9ca3bf76fa8..ea52a8df37a 100644 --- a/.github/workflows/templates/layout.yml.jinja +++ b/.github/workflows/templates/layout.yml.jinja @@ -5,7 +5,7 @@ <%- set prepare_workflow_skip_pkg_test_suite = prepare_workflow_skip_pkg_test_suite|default("") %> <%- set prepare_workflow_skip_pkg_download_test_suite = prepare_workflow_skip_pkg_download_test_suite|default("") %> <%- set prepare_workflow_salt_version_input = prepare_workflow_salt_version_input|default("") %> -<%- set skip_test_coverage_check = skip_test_coverage_check|default("${{ github.event_name == 'pull_request' }}") %> +<%- set skip_test_coverage_check = skip_test_coverage_check|default("${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }}") %> <%- set skip_junit_reports_check = skip_junit_reports_check|default("${{ github.event_name == 'pull_request' }}") %> <%- set gpg_key_id = "64CBBC8173D76B3F" %> <%- set prepare_actual_release = prepare_actual_release | default(False) %> diff --git a/changelog/64547.added.md b/changelog/64547.added.md index f1bc6e6a131..e3ae3a3a449 100644 --- a/changelog/64547.added.md +++ b/changelog/64547.added.md @@ -5,3 +5,4 @@ Several fixes to the CI workflow: * Switch to using `tools` and re-use the event payload available instead of querying the GH API again to get the pull request labels * Concentrate test selection by labels to a single place +* Enable code coverage on pull-requests by setting the `test:coverage` label diff --git a/tools/ci.py b/tools/ci.py index c3f79aab355..60df792d25fb 100644 --- a/tools/ci.py +++ b/tools/ci.py @@ -389,6 +389,7 @@ def define_jobs( class TestRun(TypedDict): type: str + skip_code_coverage: bool from_filenames: NotRequired[str] selected_tests: NotRequired[dict[str, bool]] @@ -427,10 +428,31 @@ def define_testrun(ctx: Context, event_name: str, changed_files: pathlib.Path): if TYPE_CHECKING: assert github_step_summary is not None + labels: list[str] = [] + gh_event_path = os.environ.get("GITHUB_EVENT_PATH") or None + if gh_event_path is not None: + try: + gh_event = json.loads(open(gh_event_path).read()) + except Exception as exc: + ctx.error( + f"Could not load the GH Event payload from {gh_event_path!r}:\n", exc + ) + ctx.exit(1) + + labels.extend( + label[0] for label in _get_pr_test_labels_from_event_payload(gh_event) + ) + + skip_code_coverage = True + if "test:coverage" in labels: + skip_code_coverage = False + elif event_name != "pull_request": + skip_code_coverage = False + if event_name != "pull_request": # In this case, a full test run is in order ctx.info("Writing 'testrun' to the github outputs file") - testrun = TestRun(type="full") + testrun = TestRun(type="full", skip_code_coverage=skip_code_coverage) with open(github_output, "a", encoding="utf-8") as wfh: wfh.write(f"testrun={json.dumps(testrun)}\n") @@ -451,21 +473,6 @@ def define_testrun(ctx: Context, event_name: str, changed_files: pathlib.Path): ctx.error(f"Could not load the changed files from '{changed_files}': {exc}") ctx.exit(1) - labels: list[str] = [] - gh_event_path = os.environ.get("GITHUB_EVENT_PATH") or None - if gh_event_path is not None: - try: - gh_event = json.loads(open(gh_event_path).read()) - except Exception as exc: - ctx.error( - f"Could not load the GH Event payload from {gh_event_path!r}:\n", exc - ) - ctx.exit(1) - - labels.extend( - label[0] for label in _get_pr_test_labels_from_event_payload(gh_event) - ) - # So, it's a pull request... # Based on which files changed, or other things like PR labels we can # decide what to run, or even if the full test run should be running on the @@ -482,7 +489,7 @@ def define_testrun(ctx: Context, event_name: str, changed_files: pathlib.Path): "Full test run chosen because there was a change made " "to `cicd/golden-images.json`.\n" ) - testrun = TestRun(type="full") + testrun = TestRun(type="full", skip_code_coverage=skip_code_coverage) elif changed_pkg_requirements_files or changed_test_requirements_files: with open(github_step_summary, "a", encoding="utf-8") as wfh: wfh.write( @@ -497,15 +504,16 @@ def define_testrun(ctx: Context, event_name: str, changed_files: pathlib.Path): ): wfh.write(f"{path}\n") wfh.write("\n\n") - testrun = TestRun(type="full") + testrun = TestRun(type="full", skip_code_coverage=skip_code_coverage) elif "test:full" in labels: with open(github_step_summary, "a", encoding="utf-8") as wfh: wfh.write("Full test run chosen because the label `test:full` is set.\n") - testrun = TestRun(type="full") + testrun = TestRun(type="full", skip_code_coverage=skip_code_coverage) else: testrun_changed_files_path = tools.utils.REPO_ROOT / "testrun-changed-files.txt" testrun = TestRun( type="changed", + skip_code_coverage=skip_code_coverage, from_filenames=str( testrun_changed_files_path.relative_to(tools.utils.REPO_ROOT) ), From 2cf3094331d129fd9167506e8d561dc36a789594 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Wed, 22 Feb 2023 16:08:35 +0000 Subject: [PATCH 043/393] Stop using the deprecated `cgi` module. Signed-off-by: Pedro Algarvio --- salt/utils/http.py | 48 ++++++++++++++++++++-------------------------- 1 file changed, 21 insertions(+), 27 deletions(-) diff --git a/salt/utils/http.py b/salt/utils/http.py index 91c5cbf08ed..26f2e85c2ee 100644 --- a/salt/utils/http.py +++ b/salt/utils/http.py @@ -5,7 +5,7 @@ and the like, but also useful for basic HTTP testing. .. versionadded:: 2015.5.0 """ -import cgi +import email.message import gzip import http.client import http.cookiejar @@ -84,7 +84,7 @@ except ImportError: HAS_CERTIFI = False log = logging.getLogger(__name__) -USERAGENT = "Salt/{}".format(salt.version.__version__) +USERAGENT = f"Salt/{salt.version.__version__}" def __decompressContent(coding, pgctnt): @@ -170,7 +170,7 @@ def query( formdata_fieldname=None, formdata_filename=None, decode_body=True, - **kwargs + **kwargs, ): """ Query a resource, and decode the return data @@ -295,7 +295,7 @@ def query( auth = (username, password) if agent == USERAGENT: - agent = "{} http.query()".format(agent) + agent = f"{agent} http.query()" header_dict["User-agent"] = agent if backend == "requests": @@ -360,14 +360,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("HTTP/1.0 {} MESSAGE".format(result.status_code)) + header_callback(f"HTTP/1.0 {result.status_code} MESSAGE") # fake streaming the content streaming_callback(result.content) return { @@ -483,15 +483,12 @@ def query( result_headers = dict(result.info()) result_text = result.read() if "Content-Type" in result_headers: - 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"]) + 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) if isinstance(result_text, bytes) and decode_body: result_text = result_text.decode("utf-8") ret["body"] = result_text @@ -636,15 +633,12 @@ def query( result_headers = result.headers result_text = result.body if "Content-Type" in result_headers: - 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"]) + 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) if isinstance(result_text, bytes) and decode_body: result_text = result_text.decode("utf-8") ret["body"] = result_text @@ -1038,12 +1032,12 @@ def _sanitize_url_components(comp_list, field): """ if not comp_list: return "" - elif comp_list[0].startswith("{}=".format(field)): - ret = "{}=XXXXXXXXXX&".format(field) + elif comp_list[0].startswith(f"{field}="): + ret = f"{field}=XXXXXXXXXX&" comp_list.remove(comp_list[0]) return ret + _sanitize_url_components(comp_list, field) else: - ret = "{}&".format(comp_list[0]) + ret = f"{comp_list[0]}&" comp_list.remove(comp_list[0]) return ret + _sanitize_url_components(comp_list, field) From 1f9d094b8f957ff374d5adfbf15cf6cce8277c7c Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Wed, 22 Feb 2023 16:12:16 +0000 Subject: [PATCH 044/393] Stop using the deprecated `pipes` module Signed-off-by: Pedro Algarvio --- salt/modules/container_resource.py | 74 +++----- salt/modules/deb_postgres.py | 16 +- salt/modules/dockermod.py | 178 ++++++++---------- salt/modules/lxc.py | 278 +++++++++++++-------------- 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, 467 insertions(+), 627 deletions(-) diff --git a/salt/modules/container_resource.py b/salt/modules/container_resource.py index a29cba2e468..ceec72a7b20 100644 --- a/salt/modules/container_resource.py +++ b/salt/modules/container_resource.py @@ -8,13 +8,11 @@ These functions are not designed to be called directly, but instead from the :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 pipes +import shlex import time import traceback @@ -68,14 +66,14 @@ def _nsenter(pid): """ Return the nsenter command to attach to the named container """ - return "nsenter --target {} --mount --uts --ipc --net --pid".format(pid) + return f"nsenter --target {pid} --mount --uts --ipc --net --pid" def _get_md5(name, path, run_func): """ Get the MD5 checksum of a file from a container """ - output = run_func(name, "md5sum {}".format(pipes.quote(path)), ignore_retcode=True)[ + output = run_func(name, f"md5sum {shlex.quote(path)}", ignore_retcode=True)[ "stdout" ] try: @@ -102,10 +100,10 @@ def cache_file(source): if source.startswith("salt://"): cached_source = __salt__["cp.cache_file"](source) if not cached_source: - raise CommandExecutionError("Unable to cache {}".format(source)) + raise CommandExecutionError(f"Unable to cache {source}") return cached_source except AttributeError: - raise SaltInvocationError("Invalid source file {}".format(source)) + raise SaltInvocationError(f"Invalid source file {source}") return source @@ -164,55 +162,47 @@ def run( if exec_driver == "lxc-attach": full_cmd = "lxc-attach " if path: - full_cmd += "-P {} ".format(pipes.quote(path)) + full_cmd += f"-P {shlex.quote(path)} " if keep_env is not True: full_cmd += "--clear-env " if "PATH" not in to_keep: - full_cmd += "--set-var {} ".format(PATH) + full_cmd += f"--set-var {PATH} " # --clear-env results in a very restrictive PATH # (/bin:/usr/bin), use a good fallback. full_cmd += " ".join( [ - "--set-var {}={}".format(x, pipes.quote(os.environ[x])) + f"--set-var {x}={shlex.quote(os.environ[x])}" for x in to_keep if x in os.environ ] ) - full_cmd += " -n {} -- {}".format(pipes.quote(name), cmd) + full_cmd += f" -n {shlex.quote(name)} -- {cmd}" elif exec_driver == "nsenter": - pid = __salt__["{}.pid".format(container_type)](name) - full_cmd = "nsenter --target {} --mount --uts --ipc --net --pid -- ".format(pid) + pid = __salt__[f"{container_type}.pid"](name) + full_cmd = f"nsenter --target {pid} --mount --uts --ipc --net --pid -- " if keep_env is not True: full_cmd += "env -i " if "PATH" not in to_keep: - full_cmd += "{} ".format(PATH) + full_cmd += f"{PATH} " full_cmd += " ".join( - [ - "{}={}".format(x, pipes.quote(os.environ[x])) - for x in to_keep - if x in os.environ - ] + [f"{x}={shlex.quote(os.environ[x])}" for x in to_keep if x in os.environ] ) - full_cmd += " {}".format(cmd) + full_cmd += f" {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 += "{} ".format(name) + full_cmd += f"{name} " if keep_env is not True: full_cmd += "env -i " if "PATH" not in to_keep: - full_cmd += "{} ".format(PATH) + full_cmd += f"{PATH} " full_cmd += " ".join( - [ - "{}={}".format(x, pipes.quote(os.environ[x])) - for x in to_keep - if x in os.environ - ] + [f"{x}={shlex.quote(os.environ[x])}" for x in to_keep if x in os.environ] ) - full_cmd += " {}".format(cmd) + full_cmd += f" {cmd}" if not use_vt: ret = __salt__[cmd_func]( @@ -299,13 +289,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__["{}.state".format(container_type)] + state = __salt__[f"{container_type}.state"] def run_all(*args, **akwargs): akwargs = copy.deepcopy(akwargs) if container_type in ["lxc"] and "path" not in akwargs: akwargs["path"] = path - return __salt__["{}.run_all".format(container_type)](*args, **akwargs) + return __salt__[f"{container_type}.run_all"](*args, **akwargs) state_kwargs = {} cmd_kwargs = {"ignore_retcode": True} @@ -321,7 +311,7 @@ def copy_to( c_state = _state(name) if c_state != "running": - raise CommandExecutionError("Container '{}' is not running".format(name)) + raise CommandExecutionError(f"Container '{name}' is not running") local_file = cache_file(source) source_dir, source_name = os.path.split(local_file) @@ -330,17 +320,14 @@ def copy_to( if not os.path.isabs(local_file): raise SaltInvocationError("Source path must be absolute") elif not os.path.exists(local_file): - raise SaltInvocationError("Source file {} does not exist".format(local_file)) + raise SaltInvocationError(f"Source file {local_file} does not exist") 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, "test -d {}".format(pipes.quote(dest)), **cmd_kwargs)["retcode"] - == 0 - ): + if run_all(name, f"test -d {shlex.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) @@ -350,14 +337,12 @@ def copy_to( # parent directory. dest_dir, dest_name = os.path.split(dest) if ( - run_all(name, "test -d {}".format(pipes.quote(dest_dir)), **cmd_kwargs)[ - "retcode" - ] + run_all(name, f"test -d {shlex.quote(dest_dir)}", **cmd_kwargs)["retcode"] != 0 ): if makedirs: result = run_all( - name, "mkdir -p {}".format(pipes.quote(dest_dir)), **cmd_kwargs + name, f"mkdir -p {shlex.quote(dest_dir)}", **cmd_kwargs ) if result["retcode"] != 0: error = ( @@ -375,10 +360,7 @@ def copy_to( ) if ( not overwrite - and run_all(name, "test -e {}".format(pipes.quote(dest)), **cmd_kwargs)[ - "retcode" - ] - == 0 + and run_all(name, f"test -e {shlex.quote(dest)}", **cmd_kwargs)["retcode"] == 0 ): raise CommandExecutionError( "Destination path {} already exists. Use overwrite=True to " @@ -401,14 +383,14 @@ def copy_to( if exec_driver == "lxc-attach": lxcattach = "lxc-attach" if path: - lxcattach += " -P {}".format(pipes.quote(path)) + lxcattach += f" -P {shlex.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__["{}.pid".format(container_type)](name) + pid = __salt__[f"{container_type}.pid"](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 3ecd4a8ba49..d92859562d4 100644 --- a/salt/modules/deb_postgres.py +++ b/salt/modules/deb_postgres.py @@ -2,10 +2,8 @@ Module to provide Postgres compatibility to salt for debian family specific tools. """ - - import logging -import pipes +import shlex import salt.utils.path @@ -76,7 +74,7 @@ def cluster_create( cmd += ["--data-checksums"] if wal_segsize: cmd += ["--wal-segsize", wal_segsize] - cmdstr = " ".join([pipes.quote(c) for c in cmd]) + cmdstr = " ".join([shlex.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) @@ -97,7 +95,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([pipes.quote(c) for c in cmd])) + ret = __salt__["cmd.run_all"](" ".join([shlex.quote(c) for c in cmd])) if ret.get("retcode", 0) != 0: log.error("Error listing clusters") cluster_dict = _parse_pg_lscluster(ret["stdout"]) @@ -118,7 +116,7 @@ def cluster_exists(version, name="main"): salt '*' postgres.cluster_exists '9.3' 'main' """ - return "{}/{}".format(version, name) in cluster_list() + return f"{version}/{name}" in cluster_list() def cluster_remove(version, name="main", stop=False): @@ -141,13 +139,13 @@ def cluster_remove(version, name="main", stop=False): if stop: cmd += ["--stop"] cmd += [str(version), name] - cmdstr = " ".join([pipes.quote(c) for c in cmd]) + cmdstr = " ".join([shlex.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"] = "Successfully removed cluster {}/{}".format(version, name) + ret["changes"] = f"Successfully removed cluster {version}/{name}" return ret @@ -158,7 +156,7 @@ def _parse_pg_lscluster(output): cluster_dict = {} for line in output.splitlines(): version, name, port, status, user, datadir, log = line.split() - cluster_dict["{}/{}".format(version, name)] = { + cluster_dict[f"{version}/{name}"] = { "port": int(port), "status": status, "user": user, diff --git a/salt/modules/dockermod.py b/salt/modules/dockermod.py index 3e35700788d..b58fd1b32bc 100644 --- a/salt/modules/dockermod.py +++ b/salt/modules/dockermod.py @@ -204,8 +204,8 @@ import gzip import json import logging import os -import pipes import re +import shlex import shutil import string import subprocess @@ -252,7 +252,6 @@ except ImportError: HAS_NSENTER = bool(salt.utils.path.which("nsenter")) -# Set up logging log = logging.getLogger(__name__) # Don't shadow built-in's. @@ -392,7 +391,7 @@ def _get_client(timeout=NOTSET, **kwargs): ) except Exception as exc: # pylint: disable=broad-except raise CommandExecutionError( - "Docker machine {} failed: {}".format(docker_machine, exc) + f"Docker machine {docker_machine} failed: {exc}" ) try: # docker-py 2.0 renamed this client attribute @@ -492,7 +491,7 @@ def _change_state(name, action, expected, *args, **kwargs): return { "result": False, "state": {"old": expected, "new": expected}, - "comment": "Container '{}' already {}".format(name, expected), + "comment": f"Container '{name}' already {expected}", } _client_wrapper(action, name, *args, **kwargs) _clear_context() @@ -530,9 +529,7 @@ def _get_md5(name, path): """ Get the MD5 checksum of a file from a container """ - output = run_stdout( - name, "md5sum {}".format(pipes.quote(path)), ignore_retcode=True - ) + output = run_stdout(name, f"md5sum {shlex.quote(path)}", ignore_retcode=True) try: return output.split()[0] except IndexError: @@ -611,7 +608,7 @@ def _scrub_links(links, name): if isinstance(links, list): ret = [] for l in links: - ret.append(l.replace("/{}/".format(name), "/", 1)) + ret.append(l.replace(f"/{name}/", "/", 1)) else: ret = links @@ -634,11 +631,11 @@ def _size_fmt(num): try: num = int(num) if num < 1024: - return "{} bytes".format(num) + return f"{num} bytes" num /= 1024.0 for unit in ("KiB", "MiB", "GiB", "TiB", "PiB"): if num < 1024.0: - return "{:3.1f} {}".format(num, unit) + return f"{num:3.1f} {unit}" num /= 1024.0 except Exception: # pylint: disable=broad-except log.error("Unable to format file size for '%s'", num) @@ -653,7 +650,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("Invalid client action '{}'".format(attr)) + raise SaltInvocationError(f"Invalid client action '{attr}'") if attr in ("push", "pull"): try: # Refresh auth config from config.json @@ -673,7 +670,7 @@ def _client_wrapper(attr, *args, **kwargs): if catch_api_errors: # Generic handling of Docker API errors raise CommandExecutionError( - "Error {}: {}".format(exc.response.status_code, exc.explanation) + f"Error {exc.response.status_code}: {exc.explanation}" ) else: # Allow API errors to be caught further up the stack @@ -688,9 +685,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 = "Unable to perform {}".format(attr) + msg = f"Unable to perform {attr}" if err: - msg += ": {}".format(err) + msg += f": {err}" raise CommandExecutionError(msg) @@ -717,7 +714,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"] = "{}:{}".format(repo_name, repo_tag) + data["Image"] = f"{repo_name}:{repo_tag}" data["Id"] = status except (AttributeError, TypeError): pass @@ -876,7 +873,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 @@ -894,7 +891,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: @@ -907,7 +904,7 @@ def _get_create_kwargs( log.error( "docker.create: Error getting client args: '%s'", exc, exc_info=True ) - raise CommandExecutionError("Failed to get client args: {}".format(exc)) + raise CommandExecutionError(f"Failed to get client args: {exc}") full_host_config = {} host_kwargs = {} @@ -1468,15 +1465,15 @@ def login(*registries): results = ret.setdefault("Results", {}) for registry in registries: if registry not in registry_auth: - errors.append("No match found for registry '{}'".format(registry)) + errors.append(f"No match found for registry '{registry}'") continue try: username = registry_auth[registry]["username"] password = registry_auth[registry]["password"] except TypeError: - errors.append("Invalid configuration for registry '{}'".format(registry)) + errors.append(f"Invalid configuration for registry '{registry}'") except KeyError as exc: - errors.append("Missing {} for registry '{}'".format(exc, registry)) + errors.append(f"Missing {exc} for registry '{registry}'") else: cmd = ["docker", "login", "-u", username, "-p", password] if registry.lower() != "hub": @@ -1562,7 +1559,7 @@ def logout(*registries): results = ret.setdefault("Results", {}) for registry in registries: if registry not in registry_auth: - errors.append("No match found for registry '{}'".format(registry)) + errors.append(f"No match found for registry '{registry}'") continue else: cmd = ["docker", "logout"] @@ -1684,7 +1681,7 @@ def exists(name): salt myminion docker.exists mycontainer """ - contextkey = "docker.exists.{}".format(name) + contextkey = f"docker.exists.{name}" if contextkey in __context__: return __context__[contextkey] try: @@ -1775,7 +1772,7 @@ def history(name, quiet=False): ) for param in ("Size",): if param in step: - step["{}_Human".format(param)] = _size_fmt(step[param]) + step[f"{param}_Human"] = _size_fmt(step[param]) ret.append(copy.deepcopy(step)) if quiet: return [x.get("Command") for x in ret] @@ -1837,9 +1834,7 @@ def images(verbose=False, **kwargs): ) for param in ("Size", "VirtualSize"): if param in bucket.get(img_id, {}): - bucket[img_id]["{}_Human".format(param)] = _size_fmt( - bucket[img_id][param] - ) + bucket[img_id][f"{param}_Human"] = _size_fmt(bucket[img_id][param]) context_data = __context__.get("docker.images", {}) ret = copy.deepcopy(context_data.get("tagged", {})) @@ -1922,7 +1917,7 @@ def inspect(name): raise raise CommandExecutionError( - "Error 404: No such image/container/volume/network: {}".format(name) + f"Error 404: No such image/container/volume/network: {name}" ) @@ -1978,7 +1973,7 @@ def inspect_image(name): ret = _client_wrapper("inspect_image", name) for param in ("Size", "VirtualSize"): if param in ret: - ret["{}_Human".format(param)] = _size_fmt(ret[param]) + ret[f"{param}_Human"] = _size_fmt(ret[param]) return ret @@ -2272,7 +2267,7 @@ def port(name, private_port=None): else: # Sanity checks if isinstance(private_port, int): - pattern = "{}/*".format(private_port) + pattern = f"{private_port}/*" else: err = ( "Invalid private_port '{}'. Must either be a port number, " @@ -2393,7 +2388,7 @@ def state(name): salt myminion docker.state mycontainer """ - contextkey = "docker.state.{}".format(name) + contextkey = f"docker.state.{name}" if contextkey in __context__: return __context__[contextkey] __context__[contextkey] = _get_state(inspect_container(name)) @@ -2433,9 +2428,7 @@ def search(name, official=False, trusted=False): """ response = _client_wrapper("search", name) if not response: - raise CommandExecutionError( - "No images matched the search string '{}'".format(name) - ) + raise CommandExecutionError(f"No images matched the search string '{name}'") key_map = { "description": "Description", @@ -2550,7 +2543,7 @@ def create( ignore_collisions=False, validate_ip_addrs=True, client_timeout=salt.utils.dockermod.CLIENT_TIMEOUT, - **kwargs + **kwargs, ): """ Create a new container @@ -3276,7 +3269,7 @@ def create( skip_translate=skip_translate, ignore_collisions=ignore_collisions, validate_ip_addrs=validate_ip_addrs, - **kwargs + **kwargs, ) if unused_kwargs: @@ -3288,7 +3281,7 @@ def create( log.debug( "docker.create: creating container %susing the following arguments: %s", - "with name '{}' ".format(name) if name is not None else "", + f"with name '{name}' " if name is not None else "", kwargs, ) time_started = time.time() @@ -3326,7 +3319,7 @@ def run_container( replace=False, force=False, networks=None, - **kwargs + **kwargs, ): """ .. versionadded:: 2018.3.0 @@ -3428,7 +3421,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 @@ -3453,7 +3446,7 @@ def run_container( log.debug( "docker.create: creating container %susing the following arguments: %s", - "with name '{}' ".format(name) if name is not None else "", + f"with name '{name}' " if name is not None else "", kwargs, ) @@ -3493,7 +3486,7 @@ def run_container( rm_(name) except CommandExecutionError as rm_exc: exc_info.setdefault("other_errors", []).append( - "Failed to auto_remove container: {}".format(rm_exc) + f"Failed to auto_remove container: {rm_exc}" ) # Raise original exception with additional info raise CommandExecutionError(exc.__str__(), info=exc_info) @@ -3588,7 +3581,7 @@ def copy_from(name, source, dest, overwrite=False, makedirs=False): """ c_state = state(name) if c_state != "running": - raise CommandExecutionError("Container '{}' is not running".format(name)) + raise CommandExecutionError(f"Container '{name}' is not running") # Destination file sanity checks if not os.path.isabs(dest): @@ -3614,9 +3607,7 @@ def copy_from(name, source, dest, overwrite=False, makedirs=False): ) ) else: - raise SaltInvocationError( - "Directory {} does not exist".format(dest_dir) - ) + raise SaltInvocationError(f"Directory {dest_dir} does not exist") if not overwrite and os.path.exists(dest): raise CommandExecutionError( "Destination path {} already exists. Use overwrite=True to " @@ -3627,19 +3618,14 @@ 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, "test -e {}".format(pipes.quote(source)), ignore_retcode=True) - == 0 - ): + if retcode(name, f"test -e {shlex.quote(source)}", ignore_retcode=True) == 0: if ( - retcode( - name, "test -f {}".format(pipes.quote(source)), ignore_retcode=True - ) + retcode(name, f"test -f {shlex.quote(source)}", ignore_retcode=True) != 0 ): raise SaltInvocationError("Source must be a regular file") else: - raise SaltInvocationError("Source file {} does not exist".format(source)) + raise SaltInvocationError(f"Source file {source} does not exist") # Before we try to replace the file, compare checksums. source_md5 = _get_md5(name, source) @@ -3652,7 +3638,7 @@ def copy_from(name, source, dest, overwrite=False, makedirs=False): try: src_path = ":".join((name, source)) except TypeError: - src_path = "{}:{}".format(name, source) + src_path = f"{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") @@ -3779,7 +3765,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 = "Path '{}' is not absolute".format(path) + err = f"Path '{path}' is not absolute" try: if not os.path.isabs(path): raise SaltInvocationError(err) @@ -3787,7 +3773,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("{} already exists".format(path)) + raise CommandExecutionError(f"{path} already exists") if compression is None: if path.endswith(".tar.gz") or path.endswith(".tgz"): @@ -3810,7 +3796,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("Invalid compression type '{}'".format(compression)) + raise SaltInvocationError(f"Invalid compression type '{compression}'") parent_dir = os.path.dirname(path) if not os.path.isdir(parent_dir): @@ -3823,16 +3809,14 @@ def export(name, path, overwrite=False, makedirs=False, compression=None, **kwar os.makedirs(parent_dir) except OSError as exc: raise CommandExecutionError( - "Unable to make parent dir {}: {}".format(parent_dir, exc) + f"Unable to make parent dir {parent_dir}: {exc}" ) if compression == "gzip": try: out = gzip.open(path, "wb") except OSError as exc: - raise CommandExecutionError( - "Unable to open {} for writing: {}".format(path, exc) - ) + raise CommandExecutionError(f"Unable to open {path} for writing: {exc}") elif compression == "bzip2": compressor = bz2.BZ2Compressor() elif compression == "xz": @@ -3870,9 +3854,7 @@ def export(name, path, overwrite=False, makedirs=False, compression=None, **kwar os.remove(path) except OSError: pass - raise CommandExecutionError( - "Error occurred during container export: {}".format(exc) - ) + raise CommandExecutionError(f"Error occurred during container export: {exc}") finally: out.close() ret = {"Time_Elapsed": time.time() - time_started} @@ -4103,7 +4085,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 = "{}:{}".format(repository, tag) if repository and tag else None + image_tag = f"{repository}:{tag}" if repository and tag else None time_started = time.time() response = _client_wrapper( @@ -4122,7 +4104,7 @@ def build( if not response: raise CommandExecutionError( - "Build failed for {}, no response returned from Docker API".format(path) + f"Build failed for {path}, no response returned from Docker API" ) stream_data = [] @@ -4145,7 +4127,7 @@ def build( if "Id" not in ret: # API returned information, but there was no confirmation of a # successful build. - msg = "Build failed for {}".format(path) + msg = f"Build failed for {path}" log.error(msg) log.error(stream_data) if errors: @@ -4156,7 +4138,7 @@ def build( if resolved_tag: ret["Image"] = resolved_tag else: - ret["Warning"] = "Failed to tag image as {}".format(image_tag) + ret["Warning"] = f"Failed to tag image as {image_tag}" if api_response: ret["API_Response"] = stream_data @@ -4363,7 +4345,7 @@ def import_(source, repository, tag="latest", api_response=False): if not response: raise CommandExecutionError( - "Import failed for {}, no response returned from Docker API".format(source) + f"Import failed for {source}, no response returned from Docker API" ) elif api_response: ret["API_Response"] = response @@ -4383,7 +4365,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 = "Import failed for {}".format(source) + msg = f"Import failed for {source}" if errors: msg += ". Error(s) follow:\n\n{}".format("\n\n".join(errors)) raise CommandExecutionError(msg) @@ -4458,7 +4440,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("Source file {} does not exist".format(path)) + raise CommandExecutionError(f"Source file {path} does not exist") pre = images(all=True) cmd = ["docker", "load", "-i", local_path] @@ -4468,7 +4450,7 @@ def load(path, repository=None, tag=None): _clear_context() post = images(all=True) if result["retcode"] != 0: - msg = "Failed to load image(s) from {}".format(path) + msg = f"Failed to load image(s) from {path}" if result["stderr"]: msg += ": {}".format(result["stderr"]) raise CommandExecutionError(msg) @@ -4489,7 +4471,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 = "{}:{}".format(repository, tag) + tagged_image = f"{repository}:{tag}" try: result = tag_(top_level_images[0], repository=repository, tag=tag) ret["Image"] = tagged_image @@ -4526,7 +4508,7 @@ def layers(name): ): ret.append(line) if not ret: - raise CommandExecutionError("Image '{}' not found".format(name)) + raise CommandExecutionError(f"Image '{name}' not found") return ret @@ -4597,7 +4579,7 @@ def pull( if not response: raise CommandExecutionError( - "Pull failed for {}, no response returned from Docker API".format(image) + f"Pull failed for {image}, no response returned from Docker API" ) elif api_response: ret["API_Response"] = response @@ -4610,7 +4592,7 @@ def pull( event = salt.utils.json.loads(event) except Exception as exc: # pylint: disable=broad-except raise CommandExecutionError( - "Unable to interpret API event: '{}'".format(event), + f"Unable to interpret API event: '{event}'", info={"Error": exc.__str__()}, ) try: @@ -4692,7 +4674,7 @@ def push( if not response: raise CommandExecutionError( - "Push failed for {}, no response returned from Docker API".format(image) + f"Push failed for {image}, no response returned from Docker API" ) elif api_response: ret["API_Response"] = response @@ -4704,7 +4686,7 @@ def push( event = salt.utils.json.loads(event) except Exception as exc: # pylint: disable=broad-except raise CommandExecutionError( - "Unable to interpret API event: '{}'".format(event), + f"Unable to interpret API event: '{event}'", info={"Error": exc.__str__()}, ) try: @@ -4784,9 +4766,7 @@ def rmi(*names, **kwargs): err += "image(s): {}".format(", ".join(deps["Images"])) errors.append(err) else: - errors.append( - "Error {}: {}".format(exc.response.status_code, exc.explanation) - ) + errors.append(f"Error {exc.response.status_code}: {exc.explanation}") _clear_context() ret = { @@ -4874,7 +4854,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 = "Path '{}' is not absolute".format(path) + err = f"Path '{path}' is not absolute" try: if not os.path.isabs(path): raise SaltInvocationError(err) @@ -4882,7 +4862,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("{} already exists".format(path)) + raise CommandExecutionError(f"{path} already exists") if compression is None: if path.endswith(".tar.gz") or path.endswith(".tgz"): @@ -4905,7 +4885,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("Invalid compression type '{}'".format(compression)) + raise SaltInvocationError(f"Invalid compression type '{compression}'") parent_dir = os.path.dirname(path) if not os.path.isdir(parent_dir): @@ -4927,7 +4907,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 = "Failed to save image(s) to {}".format(path) + err = f"Failed to save image(s) to {path}" if result["stderr"]: err += ": {}".format(result["stderr"]) raise CommandExecutionError(err) @@ -4937,9 +4917,7 @@ def save(name, path, overwrite=False, makedirs=False, compression=None, **kwargs try: out = gzip.open(path, "wb") except OSError as exc: - raise CommandExecutionError( - "Unable to open {} for writing: {}".format(path, exc) - ) + raise CommandExecutionError(f"Unable to open {path} for writing: {exc}") elif compression == "bzip2": compressor = bz2.BZ2Compressor() elif compression == "xz": @@ -4975,9 +4953,7 @@ def save(name, path, overwrite=False, makedirs=False, compression=None, **kwargs os.remove(path) except OSError: pass - raise CommandExecutionError( - "Error occurred during image save: {}".format(exc) - ) + raise CommandExecutionError(f"Error occurred during image save: {exc}") finally: try: # Clean up temp file @@ -5097,7 +5073,7 @@ def create_network( ignore_collisions=False, validate_ip_addrs=True, client_timeout=salt.utils.dockermod.CLIENT_TIMEOUT, - **kwargs + **kwargs, ): """ .. versionchanged:: 2018.3.0 @@ -5337,7 +5313,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: @@ -5669,7 +5645,7 @@ def pause(name): return { "result": False, "state": {"old": orig_state, "new": orig_state}, - "comment": "Container '{}' is stopped, cannot pause".format(name), + "comment": f"Container '{name}' is stopped, cannot pause", } return _change_state(name, "pause", "paused") @@ -5768,7 +5744,7 @@ def start_(name): return { "result": False, "state": {"old": orig_state, "new": orig_state}, - "comment": "Container '{}' is paused, cannot start".format(name), + "comment": f"Container '{name}' is paused, cannot start", } return _change_state(name, "start", "running") @@ -5873,7 +5849,7 @@ def unpause(name): return { "result": False, "state": {"old": orig_state, "new": orig_state}, - "comment": "Container '{}' is stopped, cannot unpause".format(name), + "comment": f"Container '{name}' is stopped, cannot unpause", } return _change_state(name, "unpause", "running") @@ -5922,7 +5898,7 @@ def wait(name, ignore_already_stopped=False, fail_on_exit_status=False): # Container doesn't exist anymore return { "result": ignore_already_stopped, - "comment": "Container '{}' absent".format(name), + "comment": f"Container '{name}' absent", } already_stopped = pre == "stopped" response = _client_wrapper("wait", name) @@ -5946,7 +5922,7 @@ def wait(name, ignore_already_stopped=False, fail_on_exit_status=False): "exit_status": response, } if already_stopped: - result["comment"] = "Container '{}' already stopped".format(name) + result["comment"] = f"Container '{name}' already stopped" if fail_on_exit_status and result["result"]: result["result"] = result["exit_status"] == 0 return result @@ -5959,7 +5935,7 @@ def prune( build=False, volumes=False, system=None, - **filters + **filters, ): """ .. versionadded:: 2019.2.0 @@ -6645,7 +6621,7 @@ def script_retcode( def _generate_tmp_path(): - return os.path.join("/tmp", "salt.docker.{}".format(uuid.uuid4().hex[:6])) + return os.path.join("/tmp", f"salt.docker.{uuid.uuid4().hex[:6]}") def _prepare_trans_tar(name, sls_opts, mods=None, pillar=None, extra_filerefs=""): @@ -6780,7 +6756,7 @@ def call(name, function, *args, **kwargs): ] + list(args) + [ - "{}={}".format(key, value) + f"{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 bea6445db98..444359bd216 100644 --- a/salt/modules/lxc.py +++ b/salt/modules/lxc.py @@ -12,9 +12,9 @@ import datetime import difflib import logging import os -import pipes import random import re +import shlex import shutil import string import tempfile @@ -119,7 +119,7 @@ def version(): ver = Version(cversion["stdout"]) if ver < Version("1.0"): raise CommandExecutionError("LXC should be at least 1.0") - __context__[k] = "{}".format(ver) + __context__[k] = f"{ver}" return __context__.get(k, None) @@ -141,7 +141,7 @@ def _ip_sort(ip): idx = "201" elif "::" in ip: idx = "100" - return "{}___{}".format(idx, ip) + return f"{idx}___{ip}" def search_lxc_bridges(): @@ -173,7 +173,7 @@ def search_lxc_bridges(): for ifc, ip in __grains__.get("ip_interfaces", {}).items(): if ifc in running_bridges: bridges.add(ifc) - elif os.path.exists("/sys/devices/virtual/net/{}/bridge".format(ifc)): + elif os.path.exists(f"/sys/devices/virtual/net/{ifc}/bridge"): bridges.add(ifc) bridges = list(bridges) # if we found interfaces that have lxc in their names @@ -186,7 +186,7 @@ def search_lxc_bridges(): pref = "a" elif "br0" == a: pref = "c" - return "{}_{}".format(pref, a) + return f"{pref}_{a}" bridges.sort(key=sort_bridges) __context__["lxc.bridges"] = bridges @@ -439,12 +439,12 @@ def cloud_init_interface(name, vm_=None, **kwargs): if ip: fullip = ip if netmask: - fullip += "/{}".format(netmask) + fullip += f"/{netmask}" eth0["ipv4"] = fullip if mac is not None: eth0["mac"] = mac for ix, iopts in enumerate(_cloud_get("additional_ips", [])): - ifh = "eth{}".format(ix + 1) + ifh = f"eth{ix + 1}" ethx = nic_opts.setdefault(ifh, {}) if gw is None: gw = iopts.get("gateway", ethx.get("gateway", None)) @@ -465,7 +465,7 @@ def cloud_init_interface(name, vm_=None, **kwargs): ethx["ipv4"] = aip nm = iopts.get("netmask", "") if nm: - ethx["ipv4"] += "/{}".format(nm) + ethx["ipv4"] += f"/{nm}" for i in ("mac", "hwaddr"): if i in iopts: ethx["mac"] = iopts[i] @@ -543,7 +543,7 @@ def _get_profile(key, name, **kwargs): profile_match = {} else: profile_match = __salt__["config.get"]( - "lxc.{1}:{0}".format(name, key), default=None, merge="recurse" + f"lxc.{key}:{name}", default=None, merge="recurse" ) if profile_match is None: # No matching profile, make the profile an empty dict so that @@ -551,7 +551,7 @@ def _get_profile(key, name, **kwargs): profile_match = {} if not isinstance(profile_match, dict): - raise CommandExecutionError("lxc.{} must be a dictionary".format(key)) + raise CommandExecutionError(f"lxc.{key} must be a dictionary") # Overlay the kwargs to override matched profile data overrides = salt.utils.args.clean_kwargs(**copy.deepcopy(kwargs)) @@ -669,7 +669,7 @@ def _rand_cpu_str(cpu): cpu = int(cpu) avail = __salt__["status.nproc"]() if cpu < avail: - return "0-{}".format(avail) + return f"0-{avail}" to_set = set() while len(to_set) < cpu: choice = random.randint(0, avail - 1) @@ -832,7 +832,7 @@ def _network_conf(conf_tuples=None, **kwargs): "ipv6", ]: continue - ret.append({"lxc.network.{}".format(key): val}) + ret.append({f"lxc.network.{key}": val}) # gateway (in automode) must be appended following network conf ! if not gateway: gateway = args.get("gateway", None) @@ -892,7 +892,7 @@ def _get_lxc_default_data(**kwargs): for k in ["utsname", "rootfs"]: val = kwargs.get(k, None) if val is not None: - ret["lxc.{}".format(k)] = val + ret[f"lxc.{k}"] = val autostart = kwargs.get("autostart") # autostart can have made in kwargs, but with the None # value which is invalid, we need an explicit boolean @@ -1115,7 +1115,7 @@ def _get_base(**kwargs): hash_ = salt.utils.hashutils.get_hash( img_tar, __salt__["config.get"]("hash_type") ) - name = "__base_{}_{}_{}".format(proto, img_name, hash_) + name = f"__base_{proto}_{img_name}_{hash_}" if not exists(name, path=path): create( name, template=template, image=image, path=path, vgname=vgname, **kwargs @@ -1125,11 +1125,11 @@ def _get_base(**kwargs): edit_conf( info(name, path=path)["config"], out_format="commented", - **{"lxc.rootfs": rootfs} + **{"lxc.rootfs": rootfs}, ) return name elif template: - name = "__base_{}".format(template) + name = f"__base_{template}" if not exists(name, path=path): create( name, template=template, image=image, path=path, vgname=vgname, **kwargs @@ -1139,7 +1139,7 @@ def _get_base(**kwargs): edit_conf( info(name, path=path)["config"], out_format="commented", - **{"lxc.rootfs": rootfs} + **{"lxc.rootfs": rootfs}, ) return name return "" @@ -1171,7 +1171,7 @@ def init( bootstrap_args=None, bootstrap_shell=None, bootstrap_url=None, - **kwargs + **kwargs, ): """ Initialize a new container. @@ -1499,7 +1499,7 @@ def init( try: stop(name, path=path) except (SaltInvocationError, CommandExecutionError) as exc: - ret["comment"] = "Unable to stop container: {}".format(exc) + ret["comment"] = f"Unable to stop container: {exc}" if changes: ret["changes"] = changes_dict return ret @@ -1507,7 +1507,7 @@ def init( try: start(name, path=path) except (SaltInvocationError, CommandExecutionError) as exc: - ret["comment"] = "Unable to stop container: {}".format(exc) + ret["comment"] = f"Unable to stop container: {exc}" if changes: ret["changes"] = changes_dict return ret @@ -1515,7 +1515,7 @@ def init( if remove_seed_marker: run( name, - "rm -f '{}'".format(SEED_MARKER), + f"rm -f '{SEED_MARKER}'", path=path, chroot_fallback=False, python_shell=False, @@ -1524,11 +1524,11 @@ def init( # set the default user/password, only the first time if ret.get("result", True) and password: gid = "/.lxc.initial_pass" - gids = [gid, "/lxc.initial_pass", "/.lxc.{}.initial_pass".format(name)] + gids = [gid, "/lxc.initial_pass", f"/.lxc.{name}.initial_pass"] if not any( retcode( name, - 'test -e "{}"'.format(x), + f'test -e "{x}"', chroot_fallback=True, path=path, ignore_retcode=True, @@ -1544,7 +1544,7 @@ def init( default_user not in users and retcode( name, - "id {}".format(default_user), + f"id {default_user}", python_shell=False, path=path, chroot_fallback=True, @@ -1563,7 +1563,7 @@ def init( encrypted=password_encrypted, ) except (SaltInvocationError, CommandExecutionError) as exc: - msg = "{}: Failed to set password".format(user) + exc.strerror + msg = f"{user}: Failed to set password" + exc.strerror # only hardfail in unrecoverable situation: # root cannot be setted up if user == "root": @@ -1591,11 +1591,11 @@ def init( if ret.get("result", True) and dnsservers: # retro compatibility, test also old markers gid = "/.lxc.initial_dns" - gids = [gid, "/lxc.initial_dns", "/lxc.{}.initial_dns".format(name)] + gids = [gid, "/lxc.initial_dns", f"/lxc.{name}.initial_dns"] if not any( retcode( name, - 'test -e "{}"'.format(x), + f'test -e "{x}"', chroot_fallback=True, path=path, ignore_retcode=True, @@ -1628,13 +1628,13 @@ def init( # retro compatibility, test also old markers if remove_seed_marker: - run(name, "rm -f '{}'".format(SEED_MARKER), path=path, python_shell=False) + run(name, f"rm -f '{SEED_MARKER}'", path=path, python_shell=False) gid = "/.lxc.initial_seed" gids = [gid, "/lxc.initial_seed"] if any( retcode( name, - "test -e {}".format(x), + f"test -e {x}", path=path, chroot_fallback=True, ignore_retcode=True, @@ -1703,7 +1703,7 @@ def init( try: stop(name, path=path) except (SaltInvocationError, CommandExecutionError) as exc: - ret["comment"] = "Unable to stop container: {}".format(exc) + ret["comment"] = f"Unable to stop container: {exc}" ret["result"] = False state_post = state(name, path=path) @@ -1711,7 +1711,7 @@ def init( changes.append({"state": {"old": state_pre, "new": state_post}}) if ret.get("result", True): - ret["comment"] = "Container '{}' successfully initialized".format(name) + ret["comment"] = f"Container '{name}' successfully initialized" ret["result"] = True if changes: ret["changes"] = changes_dict @@ -1834,8 +1834,8 @@ 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 += " -P {}".format(pipes.quote(path)) - cmd += " -n {}".format(name) + cmd += f" -P {shlex.quote(path)}" + cmd += f" -n {name}" __salt__["cmd.retcode"](cmd, python_shell=False) raise CommandExecutionError( "Container could not be created with cmd '{}': {}".format( @@ -1943,7 +1943,7 @@ def create( # Required params for 'download' template download_template_deps = ("dist", "release", "arch") - cmd = "lxc-create -n {}".format(name) + cmd = f"lxc-create -n {name}" profile = get_container_profile(copy.deepcopy(profile)) kw_overrides = copy.deepcopy(kwargs) @@ -1959,7 +1959,7 @@ def create( path = select("path") if exists(name, path=path): - raise CommandExecutionError("Container '{}' already exists".format(name)) + raise CommandExecutionError(f"Container '{name}' already exists") tvg = select("vgname") vgname = tvg if tvg else __salt__["config.get"]("lxc.vgname") @@ -1997,31 +1997,31 @@ def create( ) options["imgtar"] = img_tar if path: - cmd += " -P {}".format(pipes.quote(path)) + cmd += f" -P {shlex.quote(path)}" if not os.path.exists(path): os.makedirs(path) if config: - cmd += " -f {}".format(config) + cmd += f" -f {config}" if template: - cmd += " -t {}".format(template) + cmd += f" -t {template}" if backing: backing = backing.lower() - cmd += " -B {}".format(backing) + cmd += f" -B {backing}" if backing in ("zfs",): if zfsroot: - cmd += " --zfsroot {}".format(zfsroot) + cmd += f" --zfsroot {zfsroot}" if backing in ("lvm",): if lvname: - cmd += " --lvname {}".format(lvname) + cmd += f" --lvname {lvname}" if vgname: - cmd += " --vgname {}".format(vgname) + cmd += f" --vgname {vgname}" if thinpool: - cmd += " --thinpool {}".format(thinpool) + cmd += f" --thinpool {thinpool}" if backing not in ("dir", "overlayfs"): if fstype: - cmd += " --fstype {}".format(fstype) + cmd += f" --fstype {fstype}" if size: - cmd += " --fssize {}".format(size) + cmd += f" --fssize {size}" if options: if template == "download": @@ -2034,7 +2034,7 @@ def create( ) cmd += " --" for key, val in options.items(): - cmd += " --{} {}".format(key, val) + cmd += f" --{key} {val}" ret = __salt__["cmd.run_all"](cmd, python_shell=False) # please do not merge extra conflicting stuff @@ -2108,13 +2108,11 @@ def clone(name, orig, profile=None, network_profile=None, nic_opts=None, **kwarg path = select("path") if exists(name, path=path): - raise CommandExecutionError("Container '{}' already exists".format(name)) + raise CommandExecutionError(f"Container '{name}' already exists") _ensure_exists(orig, path=path) if state(orig, path=path) != "stopped": - raise CommandExecutionError( - "Container '{}' must be stopped to be cloned".format(orig) - ) + raise CommandExecutionError(f"Container '{orig}' must be stopped to be cloned") backing = select("backing") snapshot = select("snapshot") @@ -2132,21 +2130,21 @@ def clone(name, orig, profile=None, network_profile=None, nic_opts=None, **kwarg if Version(version()) >= Version("2.0"): # https://linuxcontainers.org/lxc/manpages//man1/lxc-copy.1.html cmd = "lxc-copy" - cmd += " {} -n {} -N {}".format(snapshot, orig, name) + cmd += f" {snapshot} -n {orig} -N {name}" else: # https://linuxcontainers.org/lxc/manpages//man1/lxc-clone.1.html cmd = "lxc-clone" - cmd += " {} -o {} -n {}".format(snapshot, orig, name) + cmd += f" {snapshot} -o {orig} -n {name}" if path: - cmd += " -P {}".format(pipes.quote(path)) + cmd += f" -P {shlex.quote(path)}" if not os.path.exists(path): os.makedirs(path) if backing: backing = backing.lower() - cmd += " -B {}".format(backing) + cmd += f" -B {backing}" if backing not in ("dir", "overlayfs"): if size: - cmd += " -L {}".format(size) + cmd += f" -L {size}" ret = __salt__["cmd.run_all"](cmd, python_shell=False) # please do not merge extra conflicting stuff # inside those two line (ret =, return) @@ -2177,7 +2175,7 @@ def ls_(active=None, cache=True, path=None): salt '*' lxc.ls salt '*' lxc.ls active=True """ - contextvar = "lxc.ls{}".format(path) + contextvar = f"lxc.ls{path}" if active: contextvar += ".active" if cache and (contextvar in __context__): @@ -2186,7 +2184,7 @@ def ls_(active=None, cache=True, path=None): ret = [] cmd = "lxc-ls" if path: - cmd += " -P {}".format(pipes.quote(path)) + cmd += f" -P {shlex.quote(path)}" if active: cmd += " --active" output = __salt__["cmd.run_stdout"](cmd, python_shell=False) @@ -2242,8 +2240,8 @@ def list_(extra=False, limit=None, path=None): for container in ctnrs: cmd = "lxc-info" if path: - cmd += " -P {}".format(pipes.quote(path)) - cmd += " -n {}".format(container) + cmd += f" -P {shlex.quote(path)}" + cmd += f" -n {container}" c_info = __salt__["cmd.run"](cmd, python_shell=False, output_loglevel="debug") c_state = None for line in c_info.splitlines(): @@ -2294,20 +2292,20 @@ def _change_state( return { "result": True, "state": {"old": expected, "new": expected}, - "comment": "Container '{}' already {}".format(name, expected), + "comment": f"Container '{name}' already {expected}", } if cmd == "lxc-destroy": # Kill the container first scmd = "lxc-stop" if path: - scmd += " -P {}".format(pipes.quote(path)) - scmd += " -k -n {}".format(name) + scmd += f" -P {shlex.quote(path)}" + scmd += f" -k -n {name}" __salt__["cmd.run"](scmd, python_shell=False) if path and " -P " not in cmd: - cmd += " -P {}".format(pipes.quote(path)) - cmd += " -n {}".format(name) + cmd += f" -P {shlex.quote(path)}" + cmd += f" -n {name}" # certain lxc commands need to be taken with care (lxc-start) # as te command itself mess with double forks; we must not @@ -2337,8 +2335,8 @@ def _change_state( # some commands do not wait, so we will rcmd = "lxc-wait" if path: - rcmd += " -P {}".format(pipes.quote(path)) - rcmd += " -n {} -s {}".format(name, expected.upper()) + rcmd += f" -P {shlex.quote(path)}" + rcmd += f" -n {name} -s {expected.upper()}" __salt__["cmd.run"](rcmd, python_shell=False, timeout=30) _clear_context() post = state(name, path=path) @@ -2351,7 +2349,7 @@ def _ensure_exists(name, path=None): Raise an exception if the container does not exist """ if not exists(name, path=path): - raise CommandExecutionError("Container '{}' does not exist".format(name)) + raise CommandExecutionError(f"Container '{name}' does not exist") def _ensure_running(name, no_start=False, path=None): @@ -2373,11 +2371,11 @@ def _ensure_running(name, no_start=False, path=None): return start(name, path=path) elif pre == "stopped": if no_start: - raise CommandExecutionError("Container '{}' is not running".format(name)) + raise CommandExecutionError(f"Container '{name}' is not running") return start(name, path=path) elif pre == "frozen": if no_start: - raise CommandExecutionError("Container '{}' is not running".format(name)) + raise CommandExecutionError(f"Container '{name}' is not running") return unfreeze(name, path=path) @@ -2459,13 +2457,11 @@ 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 {}".format(pipes.quote(lxc_config)) + cmd += f" -f {shlex.quote(lxc_config)}" cmd += " -d" _ensure_exists(name, path=path) if state(name, path=path) == "frozen": - raise CommandExecutionError( - "Container '{}' is frozen, use lxc.unfreeze".format(name) - ) + raise CommandExecutionError(f"Container '{name}' is frozen, use lxc.unfreeze") # lxc-start daemonize itself violently, we must not communicate with it use_vt = kwargs.get("use_vt", None) with_communicate = kwargs.get("with_communicate", False) @@ -2560,11 +2556,11 @@ def freeze(name, **kwargs): start_ = kwargs.get("start", False) if orig_state == "stopped": if not start_: - raise CommandExecutionError("Container '{}' is stopped".format(name)) + raise CommandExecutionError(f"Container '{name}' is stopped") start(name, path=path) cmd = "lxc-freeze" if path: - cmd += " -P {}".format(pipes.quote(path)) + cmd += f" -P {shlex.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 @@ -2596,10 +2592,10 @@ def unfreeze(name, path=None, use_vt=None): """ _ensure_exists(name, path=path) if state(name, path=path) == "stopped": - raise CommandExecutionError("Container '{}' is stopped".format(name)) + raise CommandExecutionError(f"Container '{name}' is stopped") cmd = "lxc-unfreeze" if path: - cmd += " -P {}".format(pipes.quote(path)) + cmd += f" -P {shlex.quote(path)}" return _change_state(cmd, name, "running", path=path, use_vt=use_vt) @@ -2635,7 +2631,7 @@ def destroy(name, stop=False, path=None): """ _ensure_exists(name, path=path) if not stop and state(name, path=path) != "stopped": - raise CommandExecutionError("Container '{}' is not stopped".format(name)) + raise CommandExecutionError(f"Container '{name}' is not stopped") return _change_state("lxc-destroy", name, None, path=path) @@ -2684,7 +2680,7 @@ def state(name, path=None): """ # Don't use _ensure_exists() here, it will mess with _change_state() - cachekey = "lxc.state.{}{}".format(name, path) + cachekey = f"lxc.state.{name}{path}" try: return __context__[cachekey] except KeyError: @@ -2693,13 +2689,13 @@ def state(name, path=None): else: cmd = "lxc-info" if path: - cmd += " -P {}".format(pipes.quote(path)) - cmd += " -n {}".format(name) + cmd += f" -P {shlex.quote(path)}" + cmd += f" -n {name}" ret = __salt__["cmd.run_all"](cmd, python_shell=False) if ret["retcode"] != 0: _clear_context() raise CommandExecutionError( - "Unable to get state of container '{}'".format(name) + f"Unable to get state of container '{name}'" ) c_infos = ret["stdout"].splitlines() c_state = None @@ -2731,13 +2727,11 @@ def get_parameter(name, parameter, path=None): _ensure_exists(name, path=path) cmd = "lxc-cgroup" if path: - cmd += " -P {}".format(pipes.quote(path)) - cmd += " -n {} {}".format(name, parameter) + cmd += f" -P {shlex.quote(path)}" + cmd += f" -n {name} {parameter}" ret = __salt__["cmd.run_all"](cmd, python_shell=False) if ret["retcode"] != 0: - raise CommandExecutionError( - "Unable to retrieve value for '{}'".format(parameter) - ) + raise CommandExecutionError(f"Unable to retrieve value for '{parameter}'") return ret["stdout"].strip() @@ -2762,8 +2756,8 @@ def set_parameter(name, parameter, value, path=None): cmd = "lxc-cgroup" if path: - cmd += " -P {}".format(pipes.quote(path)) - cmd += " -n {} {} {}".format(name, parameter, value) + cmd += f" -P {shlex.quote(path)}" + cmd += f" -n {name} {parameter} {value}" ret = __salt__["cmd.run_all"](cmd, python_shell=False) if ret["retcode"] != 0: return False @@ -2787,7 +2781,7 @@ def info(name, path=None): salt '*' lxc.info name """ - cachekey = "lxc.info.{}{}".format(name, path) + cachekey = f"lxc.info.{name}{path}" try: return __context__[cachekey] except KeyError: @@ -2799,9 +2793,7 @@ def info(name, path=None): conf_file = os.path.join(cpath, str(name), "config") if not os.path.isfile(conf_file): - raise CommandExecutionError( - "LXC config file {} does not exist".format(conf_file) - ) + raise CommandExecutionError(f"LXC config file {conf_file} does not exist") ret = {} config = [] @@ -3000,9 +2992,7 @@ def update_lxc_conf(name, lxc_conf, lxc_conf_unset, path=None): cpath = get_root_path(path) lxc_conf_p = os.path.join(cpath, name, "config") if not os.path.exists(lxc_conf_p): - raise SaltInvocationError( - "Configuration file {} does not exist".format(lxc_conf_p) - ) + raise SaltInvocationError(f"Configuration file {lxc_conf_p} does not exist") changes = {"edited": [], "added": [], "removed": []} ret = {"changes": changes, "result": True, "comment": ""} @@ -3054,17 +3044,15 @@ def update_lxc_conf(name, lxc_conf, lxc_conf_unset, path=None): conf = "" for key, val in dest_lxc_conf: if not val: - conf += "{}\n".format(key) + conf += f"{key}\n" else: - conf += "{} = {}\n".format(key.strip(), val.strip()) + conf += f"{key.strip()} = {val.strip()}\n" conf_changed = conf != orig_config chrono = datetime.datetime.now().strftime("%Y-%m-%d_%H-%M-%S") if conf_changed: # DO NOT USE salt.utils.files.fopen here, i got (kiorky) # problems with lxc configs which were wiped ! - with salt.utils.files.fopen( - "{}.{}".format(lxc_conf_p, chrono), "w" - ) as wfic: + with salt.utils.files.fopen(f"{lxc_conf_p}.{chrono}", "w") as wfic: wfic.write(salt.utils.stringutils.to_str(conf)) with salt.utils.files.fopen(lxc_conf_p, "w") as wfic: wfic.write(salt.utils.stringutils.to_str(conf)) @@ -3113,8 +3101,8 @@ def set_dns(name, dnsservers=None, searchdomains=None, path=None): searchdomains = searchdomains.split(",") except AttributeError: raise SaltInvocationError("Invalid input for 'searchdomains' parameter") - dns = ["nameserver {}".format(x) for x in dnsservers] - dns.extend(["search {}".format(x) for x in searchdomains]) + dns = [f"nameserver {x}" for x in dnsservers] + dns.extend([f"search {x}" for x in searchdomains]) dns = "\n".join(dns) + "\n" # we may be using resolvconf in the container # We need to handle that case with care: @@ -3129,7 +3117,7 @@ def set_dns(name, dnsservers=None, searchdomains=None, path=None): # - We finally also set /etc/resolv.conf in all cases rstr = __salt__["test.random_hash"]() # no tmp here, apparmor won't let us execute ! - script = "/sbin/{}_dns.sh".format(rstr) + script = f"/sbin/{rstr}_dns.sh" DNS_SCRIPT = "\n".join( [ # 'set -x', @@ -3153,7 +3141,7 @@ def set_dns(name, dnsservers=None, searchdomains=None, path=None): ] ) result = run_all( - name, "tee {}".format(script), path=path, stdin=DNS_SCRIPT, python_shell=True + name, f"tee {script}", path=path, stdin=DNS_SCRIPT, python_shell=True ) if result["retcode"] == 0: result = run_all( @@ -3170,7 +3158,7 @@ def set_dns(name, dnsservers=None, searchdomains=None, path=None): python_shell=True, ) if result["retcode"] != 0: - error = "Unable to write to /etc/resolv.conf in container '{}'".format(name) + error = f"Unable to write to /etc/resolv.conf in container '{name}'" if result["stderr"]: error += ": {}".format(result["stderr"]) raise CommandExecutionError(error) @@ -3193,12 +3181,12 @@ def running_systemd(name, cache=True, path=None): salt '*' lxc.running_systemd ubuntu """ - k = "lxc.systemd.test.{}{}".format(name, path) + k = f"lxc.systemd.test.{name}{path}" ret = __context__.get(k, None) if ret is None or not cache: rstr = __salt__["test.random_hash"]() # no tmp here, apparmor won't let us execute ! - script = "/sbin/{}_testsystemd.sh".format(rstr) + script = f"/sbin/{rstr}_testsystemd.sh" # ubuntu already had since trusty some bits of systemd but was # still using upstart ... # we need to be a bit more careful that just testing that systemd @@ -3227,7 +3215,7 @@ def running_systemd(name, cache=True, path=None): """ ) result = run_all( - name, "tee {}".format(script), path=path, stdin=_script, python_shell=True + name, f"tee {script}", path=path, stdin=_script, python_shell=True ) if result["retcode"] == 0: result = run_all( @@ -3237,9 +3225,7 @@ def running_systemd(name, cache=True, path=None): python_shell=True, ) else: - raise CommandExecutionError( - "lxc {} failed to copy initd tester".format(name) - ) + raise CommandExecutionError(f"lxc {name} failed to copy initd tester") run_all( name, 'sh -c \'if [ -f "{0}" ];then rm -f "{0}";fi\''.format(script), @@ -3361,9 +3347,9 @@ def wait_started(name, path=None, timeout=300): """ if not exists(name, path=path): - raise CommandExecutionError("Container {} does does exists".format(name)) + raise CommandExecutionError(f"Container {name} does does exists") if not state(name, path=path) == "running": - raise CommandExecutionError("Container {} is not running".format(name)) + raise CommandExecutionError(f"Container {name} is not running") ret = False if running_systemd(name, path=path): test_started = test_sd_started_state @@ -3520,7 +3506,7 @@ def bootstrap( seeded = ( retcode( name, - "test -e '{}'".format(SEED_MARKER), + f"test -e '{SEED_MARKER}'", path=path, chroot_fallback=True, ignore_retcode=True, @@ -3543,9 +3529,9 @@ def bootstrap( if needs_install or force_install or unconditional_install: if install: rstr = __salt__["test.random_hash"]() - configdir = "/var/tmp/.c_{}".format(rstr) + configdir = f"/var/tmp/.c_{rstr}" - cmd = "install -m 0700 -d {}".format(configdir) + cmd = f"install -m 0700 -d {configdir}" if run_all(name, cmd, path=path, python_shell=False)["retcode"] != 0: log.error("tmpdir %s creation failed %s", configdir, cmd) return False @@ -3553,11 +3539,11 @@ def bootstrap( bs_ = __salt__["config.gather_bootstrap_script"]( bootstrap=bootstrap_url ) - script = "/sbin/{}_bootstrap.sh".format(rstr) + script = f"/sbin/{rstr}_bootstrap.sh" copy_to(name, bs_, script, path=path) result = run_all( name, - 'sh -c "chmod +x {}"'.format(script), + f'sh -c "chmod +x {script}"', path=path, python_shell=True, ) @@ -3631,7 +3617,7 @@ def bootstrap( freeze(name, path=path) # mark seeded upon successful install if ret: - run(name, "touch '{}'".format(SEED_MARKER), path=path, python_shell=False) + run(name, f"touch '{SEED_MARKER}'", path=path, python_shell=False) return ret @@ -3652,7 +3638,7 @@ def attachable(name, path=None): salt 'minion' lxc.attachable ubuntu """ - cachekey = "lxc.attachable{}{}".format(name, path) + cachekey = f"lxc.attachable{name}{path}" try: return __context__[cachekey] except KeyError: @@ -3662,8 +3648,8 @@ def attachable(name, path=None): log.debug("Checking if LXC container %s is attachable", name) cmd = "lxc-attach" if path: - cmd += " -P {}".format(pipes.quote(path)) - cmd += " --clear-env -n {} -- /usr/bin/env".format(name) + cmd += f" -P {shlex.quote(path)}" + cmd += f" --clear-env -n {name} -- /usr/bin/env" result = ( __salt__["cmd.retcode"]( cmd, python_shell=False, output_loglevel="quiet", ignore_retcode=True @@ -3719,7 +3705,7 @@ def _run( ) else: if not chroot_fallback: - raise CommandExecutionError("{} is not attachable.".format(name)) + raise CommandExecutionError(f"{name} is not attachable.") rootfs = info(name, path=path).get("rootfs") # Set context var to make cmd.run_chroot run cmd.run instead of # cmd.run_all. @@ -4214,7 +4200,7 @@ def _get_md5(name, path): Get the MD5 checksum of a file from a container """ output = run_stdout( - name, 'md5sum "{}"'.format(path), chroot_fallback=True, ignore_retcode=True + name, f'md5sum "{path}"', chroot_fallback=True, ignore_retcode=True ) try: return output.split()[0] @@ -4381,7 +4367,7 @@ def write_conf(conf_file, conf): line[key], (str, (str,), (int,), float), ): - out_line = " = ".join((key, "{}".format(line[key]))) + out_line = " = ".join((key, f"{line[key]}")) elif isinstance(line[key], dict): out_line = " = ".join((key, line[key]["value"])) if "comment" in line[key]: @@ -4474,7 +4460,7 @@ def edit_conf( net_changes = _config_list( conf, only_net=True, - **{"network_profile": DEFAULT_NIC, "nic_opts": nic_opts} + **{"network_profile": DEFAULT_NIC, "nic_opts": nic_opts}, ) if net_changes: lxc_config.extend(net_changes) @@ -4524,20 +4510,20 @@ def reboot(name, path=None): salt 'minion' lxc.reboot myvm """ - ret = {"result": True, "changes": {}, "comment": "{} rebooted".format(name)} + ret = {"result": True, "changes": {}, "comment": f"{name} rebooted"} does_exist = exists(name, path=path) if does_exist and (state(name, path=path) == "running"): try: stop(name, path=path) except (SaltInvocationError, CommandExecutionError) as exc: - ret["comment"] = "Unable to stop container: {}".format(exc) + ret["comment"] = f"Unable to stop container: {exc}" ret["result"] = False return ret if does_exist and (state(name, path=path) != "running"): try: start(name, path=path) except (SaltInvocationError, CommandExecutionError) as exc: - ret["comment"] = "Unable to stop container: {}".format(exc) + ret["comment"] = f"Unable to stop container: {exc}" ret["result"] = False return ret ret["changes"][name] = "rebooted" @@ -4559,7 +4545,7 @@ def reconfigure( utsname=None, rootfs=None, path=None, - **kwargs + **kwargs, ): """ Reconfigure a container. @@ -4625,7 +4611,7 @@ def reconfigure( path = os.path.join(cpath, name, "config") ret = { "name": name, - "comment": "config for {} up to date".format(name), + "comment": f"config for {name} up to date", "result": True, "changes": changes, } @@ -4677,7 +4663,7 @@ def reconfigure( edit_conf(path, out_format="commented", lxc_config=new_cfg) chunks = read_conf(path, out_format="commented") if old_chunks != chunks: - ret["comment"] = "{} lxc config updated".format(name) + ret["comment"] = f"{name} lxc config updated" if state(name, path=path) == "running": cret = reboot(name, path=path) ret["result"] = cret["result"] @@ -4763,9 +4749,9 @@ def get_pid(name, path=None): """ if name not in list_(limit="running", path=path): raise CommandExecutionError( - "Container {} is not running, can't determine PID".format(name) + f"Container {name} is not running, can't determine PID" ) - info = __salt__["cmd.run"]("lxc-info -n {}".format(name)).split("\n") + info = __salt__["cmd.run"](f"lxc-info -n {name}").split("\n") pid = [ line.split(":")[1].strip() for line in info @@ -4812,21 +4798,19 @@ def add_veth(name, interface_name, bridge=None, path=None): raise CommandExecutionError( "Directory /var/run required for lxc.add_veth doesn't exists" ) - if not __salt__["file.file_exists"]("/proc/{}/ns/net".format(pid)): + if not __salt__["file.file_exists"](f"/proc/{pid}/ns/net"): raise CommandExecutionError( - "Proc file for container {} network namespace doesn't exists".format(name) + f"Proc file for container {name} network namespace doesn't exists" ) if not __salt__["file.directory_exists"]("/var/run/netns"): __salt__["file.mkdir"]("/var/run/netns") # Ensure that the symlink is up to date (change on container restart) - if __salt__["file.is_link"]("/var/run/netns/{}".format(name)): - __salt__["file.remove"]("/var/run/netns/{}".format(name)) + if __salt__["file.is_link"](f"/var/run/netns/{name}"): + __salt__["file.remove"](f"/var/run/netns/{name}") - __salt__["file.symlink"]( - "/proc/{}/ns/net".format(pid), "/var/run/netns/{}".format(name) - ) + __salt__["file.symlink"](f"/proc/{pid}/ns/net", f"/var/run/netns/{name}") # Ensure that interface doesn't exists interface_exists = 0 == __salt__["cmd.retcode"]( @@ -4851,12 +4835,10 @@ def add_veth(name, interface_name, bridge=None, path=None): ) != 0 ): + raise CommandExecutionError(f"Error while creating the veth pair {random_veth}") + if __salt__["cmd.retcode"](f"ip link set dev {random_veth} up") != 0: raise CommandExecutionError( - "Error while creating the veth pair {}".format(random_veth) - ) - if __salt__["cmd.retcode"]("ip link set dev {} up".format(random_veth)) != 0: - raise CommandExecutionError( - "Error while bringing up host-side veth {}".format(random_veth) + f"Error while bringing up host-side veth {random_veth}" ) # Attach it to the container @@ -4872,7 +4854,7 @@ def add_veth(name, interface_name, bridge=None, path=None): ) ) - __salt__["file.remove"]("/var/run/netns/{}".format(name)) + __salt__["file.remove"](f"/var/run/netns/{name}") if bridge is not None: __salt__["bridge.addif"](bridge, random_veth) diff --git a/salt/modules/mac_keychain.py b/salt/modules/mac_keychain.py index a823c428b76..7fdc162b9aa 100644 --- a/salt/modules/mac_keychain.py +++ b/salt/modules/mac_keychain.py @@ -11,20 +11,6 @@ import shlex 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" @@ -34,7 +20,7 @@ def __virtual__(): """ Only work on Mac OS """ - if salt.utils.platform.is_darwin() and _quote is not None: + if salt.utils.platform.is_darwin(): return __virtualname__ return (False, "Only available on Mac OS systems with pipes") @@ -82,7 +68,7 @@ def install( if keychain_password is not None: unlock_keychain(keychain, keychain_password) - cmd = "security import {} -P {} -k {}".format(cert, password, keychain) + cmd = f"security import {cert} -P {password} -k {keychain}" if allow_any: cmd += " -A" return __salt__["cmd.run"](cmd) @@ -117,7 +103,7 @@ def uninstall( if keychain_password is not None: unlock_keychain(keychain, keychain_password) - cmd = 'security delete-certificate -c "{}" {}'.format(cert_name, keychain) + cmd = f'security delete-certificate -c "{cert_name}" {keychain}' return __salt__["cmd.run"](cmd) @@ -137,7 +123,7 @@ def list_certs(keychain="/Library/Keychains/System.keychain"): """ cmd = ( 'security find-certificate -a {} | grep -o "alis".*\\" | ' - "grep -o '\\\"[-A-Za-z0-9.:() ]*\\\"'".format(_quote(keychain)) + "grep -o '\\\"[-A-Za-z0-9.:() ]*\\\"'".format(shlex.quote(keychain)) ) out = __salt__["cmd.run"](cmd, python_shell=True) return out.replace('"', "").split("\n") @@ -165,7 +151,7 @@ def get_friendly_name(cert, password): """ cmd = ( "openssl pkcs12 -in {} -passin pass:{} -info -nodes -nokeys 2> /dev/null | " - "grep friendlyName:".format(_quote(cert), _quote(password)) + "grep friendlyName:".format(shlex.quote(cert), shlex.quote(password)) ) out = __salt__["cmd.run"](cmd, python_shell=True) return out.replace("friendlyName: ", "").strip() @@ -187,7 +173,7 @@ def get_default_keychain(user=None, domain="user"): salt '*' keychain.get_default_keychain """ - cmd = "security default-keychain -d {}".format(domain) + cmd = f"security default-keychain -d {domain}" return __salt__["cmd.run"](cmd, runas=user) @@ -210,7 +196,7 @@ def set_default_keychain(keychain, domain="user", user=None): salt '*' keychain.set_keychain /Users/fred/Library/Keychains/login.keychain """ - cmd = "security default-keychain -d {} -s {}".format(domain, keychain) + cmd = f"security default-keychain -d {domain} -s {keychain}" return __salt__["cmd.run"](cmd, runas=user) @@ -233,7 +219,7 @@ def unlock_keychain(keychain, password): salt '*' keychain.unlock_keychain /tmp/test.p12 test123 """ - cmd = "security unlock-keychain -p {} {}".format(password, keychain) + cmd = f"security unlock-keychain -p {password} {keychain}" __salt__["cmd.run"](cmd) @@ -261,7 +247,7 @@ def get_hash(name, password=None): name, password ) else: - cmd = 'security find-certificate -c "{}" -m -p'.format(name) + cmd = f'security find-certificate -c "{name}" -m -p' out = __salt__["cmd.run"](cmd) matches = re.search( diff --git a/salt/modules/macpackage.py b/salt/modules/macpackage.py index faf5810d4fc..f9a6b7bb95c 100644 --- a/salt/modules/macpackage.py +++ b/salt/modules/macpackage.py @@ -9,31 +9,16 @@ import shlex import salt.utils.platform -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() and _quote is not None: + if salt.utils.platform.is_darwin(): return __virtualname__ return (False, "Only available on Mac OS systems with pipes") @@ -60,11 +45,11 @@ def install(pkg, target="LocalSystem", store=False, allow_untrusted=False): """ if "*." not in pkg: # If we use wildcards, we cannot use quotes - pkg = _quote(pkg) + pkg = shlex.quote(pkg) - target = _quote(target) + target = shlex.quote(target) - cmd = "installer -pkg {} -target {}".format(pkg, target) + cmd = f"installer -pkg {pkg} -target {target}" if store: cmd += " -store" if allow_untrusted: @@ -109,7 +94,7 @@ def install_app(app, target="/Applications/"): if not app[-1] == "/": app += "/" - cmd = 'rsync -a --delete "{}" "{}"'.format(app, target) + cmd = f'rsync -a --delete "{app}" "{target}"' return __salt__["cmd.run"](cmd) @@ -154,7 +139,7 @@ def mount(dmg): temp_dir = __salt__["temp.dir"](prefix="dmg-") - cmd = 'hdiutil attach -readonly -nobrowse -mountpoint {} "{}"'.format(temp_dir, dmg) + cmd = f'hdiutil attach -readonly -nobrowse -mountpoint {temp_dir} "{dmg}"' return __salt__["cmd.run"](cmd), temp_dir @@ -176,7 +161,7 @@ def unmount(mountpoint): salt '*' macpackage.unmount /dev/disk2 """ - cmd = 'hdiutil detach "{}"'.format(mountpoint) + cmd = f'hdiutil detach "{mountpoint}"' return __salt__["cmd.run"](cmd) @@ -216,7 +201,7 @@ def get_pkg_id(pkg): salt '*' macpackage.get_pkg_id /tmp/test.pkg """ - pkg = _quote(pkg) + pkg = shlex.quote(pkg) package_ids = [] # Create temp directory @@ -224,7 +209,7 @@ def get_pkg_id(pkg): try: # List all of the PackageInfo files - cmd = "xar -t -f {} | grep PackageInfo".format(pkg) + cmd = f"xar -t -f {pkg} | grep PackageInfo" out = __salt__["cmd.run"](cmd, python_shell=True, output_loglevel="quiet") files = out.split("\n") @@ -264,12 +249,12 @@ def get_mpkg_ids(mpkg): salt '*' macpackage.get_mpkg_ids /dev/disk2 """ - mpkg = _quote(mpkg) + mpkg = shlex.quote(mpkg) package_infos = [] base_path = os.path.dirname(mpkg) # List all of the .pkg files - cmd = "find {} -name *.pkg".format(base_path) + cmd = f"find {base_path} -name *.pkg" out = __salt__["cmd.run"](cmd, python_shell=True) pkg_files = out.split("\n") @@ -281,7 +266,7 @@ def get_mpkg_ids(mpkg): def _get_pkg_id_from_pkginfo(pkginfo): # Find our identifiers - pkginfo = _quote(pkginfo) + pkginfo = shlex.quote(pkginfo) cmd = "cat {} | grep -Eo 'identifier=\"[a-zA-Z.0-9\\-]*\"' | cut -c 13- | tr -d '\"'".format( pkginfo ) @@ -294,8 +279,8 @@ def _get_pkg_id_from_pkginfo(pkginfo): def _get_pkg_id_dir(path): - path = _quote(os.path.join(path, "Contents/Info.plist")) - cmd = '/usr/libexec/PlistBuddy -c "print :CFBundleIdentifier" {}'.format(path) + path = shlex.quote(os.path.join(path, "Contents/Info.plist")) + cmd = f'/usr/libexec/PlistBuddy -c "print :CFBundleIdentifier" {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 823afbf1c60..937c10da61a 100644 --- a/salt/modules/openstack_config.py +++ b/salt/modules/openstack_config.py @@ -13,28 +13,11 @@ import shlex 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 @@ -69,10 +52,10 @@ def set_(filename, section, parameter, value): salt-call openstack_config.set /etc/keystone/keystone.conf sql connection foo """ - filename = _quote(filename) - section = _quote(section) - parameter = _quote(parameter) - value = _quote(str(value)) + filename = shlex.quote(filename) + section = shlex.quote(section) + parameter = shlex.quote(parameter) + value = shlex.quote(str(value)) result = __salt__["cmd.run_all"]( "openstack-config --set {} {} {} {}".format( @@ -109,12 +92,12 @@ def get(filename, section, parameter): """ - filename = _quote(filename) - section = _quote(section) - parameter = _quote(parameter) + filename = shlex.quote(filename) + section = shlex.quote(section) + parameter = shlex.quote(parameter) result = __salt__["cmd.run_all"]( - "openstack-config --get {} {} {}".format(filename, section, parameter), + f"openstack-config --get {filename} {section} {parameter}", python_shell=False, ) @@ -145,12 +128,12 @@ def delete(filename, section, parameter): salt-call openstack_config.delete /etc/keystone/keystone.conf sql connection """ - filename = _quote(filename) - section = _quote(section) - parameter = _quote(parameter) + filename = shlex.quote(filename) + section = shlex.quote(section) + parameter = shlex.quote(parameter) result = __salt__["cmd.run_all"]( - "openstack-config --del {} {} {}".format(filename, section, parameter), + f"openstack-config --del {filename} {section} {parameter}", python_shell=False, ) diff --git a/salt/modules/postgres.py b/salt/modules/postgres.py index 25a72f1063c..f73959a92ed 100644 --- a/salt/modules/postgres.py +++ b/salt/modules/postgres.py @@ -46,8 +46,8 @@ import hmac 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, "{} was not found".format(util)) + return (False, f"{util} was not found") return True @@ -241,14 +241,14 @@ def _run_initdb( raise CommandExecutionError("initdb executable not found.") cmd = [ _INITDB_BIN, - "--pgdata={}".format(name), - "--username={}".format(user), - "--auth={}".format(auth), - "--encoding={}".format(encoding), + f"--pgdata={name}", + f"--username={user}", + f"--auth={auth}", + f"--encoding={encoding}", ] if locale is not None: - cmd.append("--locale={}".format(locale)) + cmd.append(f"--locale={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("{}".format(password))) + fp_.write(salt.utils.stringutils.to_str(f"{password}")) __salt__["file.chown"](pgpassfile, runas, "") - cmd.extend(["--pwfile={}".format(pgpassfile)]) + cmd.extend([f"--pwfile={pgpassfile}"]) kwargs = dict( runas=runas, @@ -273,7 +273,7 @@ def _run_initdb( "postgres.timeout", default=_DEFAULT_COMMAND_TIMEOUT_SECS ), ) - cmdstr = " ".join([pipes.quote(c) for c in cmd]) + cmdstr = " ".join([shlex.quote(c) for c in cmd]) ret = __salt__["cmd.run_all"](cmdstr, python_shell=False, **kwargs) if ret.get("retcode", 0) != 0: @@ -582,9 +582,7 @@ def _quote_ddl_value(value, quote="'"): if value is None: return None if quote in value: # detect trivial sqli - raise SaltInvocationError( - "Unsupported character {} in value: {}".format(quote, value) - ) + raise SaltInvocationError(f"Unsupported character {quote} in value: {value}") return "{quote}{value}{quote}".format(quote=quote, value=value) @@ -617,7 +615,7 @@ def db_create( """ # Base query to create a database - query = 'CREATE DATABASE "{}"'.format(name) + query = f'CREATE DATABASE "{name}"' # "With"-options to create a database with_args = salt.utils.odict.OrderedDict( @@ -685,11 +683,9 @@ def db_alter( else: queries = [] if owner: - queries.append('ALTER DATABASE "{}" OWNER TO "{}"'.format(name, owner)) + queries.append(f'ALTER DATABASE "{name}" OWNER TO "{owner}"') if tablespace: - queries.append( - 'ALTER DATABASE "{}" SET TABLESPACE "{}"'.format(name, tablespace) - ) + queries.append(f'ALTER DATABASE "{name}" SET TABLESPACE "{tablespace}"') for query in queries: ret = _psql_prepare_and_run( ["-c", query], @@ -726,10 +722,10 @@ def db_remove( salt '*' postgres.db_remove 'dbname' """ for query in [ - 'REVOKE CONNECT ON DATABASE "{db}" FROM public;'.format(db=name), + f'REVOKE CONNECT ON DATABASE "{name}" FROM public;', "SELECT pid, pg_terminate_backend(pid) FROM pg_stat_activity WHERE datname =" " '{db}' AND pid <> pg_backend_pid();".format(db=name), - 'DROP DATABASE "{db}";'.format(db=name), + f'DROP DATABASE "{name}";', ]: ret = _psql_prepare_and_run( ["-c", query], @@ -741,7 +737,7 @@ def db_remove( password=password, ) if ret["retcode"] != 0: - raise Exception("Failed: ret={}".format(ret)) + raise Exception(f"Failed: ret={ret}") return True @@ -846,10 +842,10 @@ def tablespace_create( owner_query = "" options_query = "" if owner: - owner_query = 'OWNER "{}"'.format(owner) + owner_query = f'OWNER "{owner}"' # should come out looking like: 'OWNER postgres' if options: - optionstext = ["{} = {}".format(k, v) for k, v in options.items()] + optionstext = [f"{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( @@ -902,9 +898,9 @@ def tablespace_alter( queries = [] if new_name: - queries.append('ALTER TABLESPACE "{}" RENAME TO "{}"'.format(name, new_name)) + queries.append(f'ALTER TABLESPACE "{name}" RENAME TO "{new_name}"') if new_owner: - queries.append('ALTER TABLESPACE "{}" OWNER TO "{}"'.format(name, new_owner)) + queries.append(f'ALTER TABLESPACE "{name}" OWNER TO "{new_owner}"') if set_option: queries.append( 'ALTER TABLESPACE "{}" SET ({} = {})'.format( @@ -912,7 +908,7 @@ def tablespace_alter( ) ) if reset_option: - queries.append('ALTER TABLESPACE "{}" RESET ({})'.format(name, reset_option)) + queries.append(f'ALTER TABLESPACE "{name}" RESET ({reset_option})') for query in queries: ret = _psql_prepare_and_run( @@ -950,7 +946,7 @@ def tablespace_remove( .. versionadded:: 2015.8.0 """ - query = 'DROP TABLESPACE "{}"'.format(name) + query = f'DROP TABLESPACE "{name}"' ret = _psql_prepare_and_run( ["-c", query], user=user, @@ -1158,11 +1154,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 = "{} {}".format(string, flag) + string = f"{string} {flag}" else: - string = "{0} {2}{1}".format(string, flag, prefix) + string = f"{string} {prefix}{flag}" if addtxt: - string = "{} {}".format(string, addtxt) + string = f"{string} {addtxt}" return string @@ -1224,7 +1220,7 @@ def _verify_password(role, password, verifier, method): def _md5_password(role, password): return "md5{}".format( hashlib.md5( # nosec - salt.utils.stringutils.to_bytes("{}{}".format(password, role)) + salt.utils.stringutils.to_bytes(f"{password}{role}") ).hexdigest() ) @@ -1343,7 +1339,7 @@ def _role_cmd_args( if isinstance(groups, list): groups = ",".join(groups) for group in groups.split(","): - sub_cmd = '{}; GRANT "{}" TO "{}"'.format(sub_cmd, group, name) + sub_cmd = f'{sub_cmd}; GRANT "{group}" TO "{name}"' return sub_cmd @@ -1380,7 +1376,7 @@ def _role_create( log.info("%s '%s' already exists", typ_.capitalize(), name) return False - sub_cmd = 'CREATE ROLE "{}" WITH'.format(name) + sub_cmd = f'CREATE ROLE "{name}" WITH' sub_cmd = "{} {}".format( sub_cmd, _role_cmd_args( @@ -1506,7 +1502,7 @@ def _role_update( log.info("%s '%s' could not be found", typ_.capitalize(), name) return False - sub_cmd = 'ALTER ROLE "{}" WITH'.format(name) + sub_cmd = f'ALTER ROLE "{name}" WITH' sub_cmd = "{} {}".format( sub_cmd, _role_cmd_args( @@ -1613,7 +1609,7 @@ def _role_remove( return False # user exists, proceed - sub_cmd = 'DROP ROLE "{}"'.format(name) + sub_cmd = f'DROP ROLE "{name}"' _psql_prepare_and_run( ["-c", sub_cmd], runas=runas, @@ -1995,14 +1991,14 @@ def create_extension( args = ["CREATE EXTENSION"] if if_not_exists: args.append("IF NOT EXISTS") - args.append('"{}"'.format(name)) + args.append(f'"{name}"') sargs = [] if schema: - sargs.append('SCHEMA "{}"'.format(schema)) + sargs.append(f'SCHEMA "{schema}"') if ext_version: - sargs.append("VERSION {}".format(ext_version)) + sargs.append(f"VERSION {ext_version}") if from_version: - sargs.append("FROM {}".format(from_version)) + sargs.append(f"FROM {from_version}") if sargs: args.append("WITH") args.extend(sargs) @@ -2011,13 +2007,9 @@ def create_extension( else: args = [] if schema and _EXTENSION_TO_MOVE in mtdata: - args.append( - 'ALTER EXTENSION "{}" SET SCHEMA "{}";'.format(name, schema) - ) + args.append(f'ALTER EXTENSION "{name}" SET SCHEMA "{schema}";') if ext_version and _EXTENSION_TO_UPGRADE in mtdata: - args.append( - 'ALTER EXTENSION "{}" UPDATE TO {};'.format(name, ext_version) - ) + args.append(f'ALTER EXTENSION "{name}" UPDATE TO {ext_version};') cmd = " ".join(args).strip() if cmd: _psql_prepare_and_run( @@ -2227,7 +2219,7 @@ def owner_to( sqlfile = tempfile.NamedTemporaryFile() sqlfile.write("begin;\n") - sqlfile.write('alter database "{}" owner to "{}";\n'.format(dbname, ownername)) + sqlfile.write(f'alter database "{dbname}" owner to "{ownername}";\n') queries = ( # schemas @@ -2335,9 +2327,9 @@ def schema_create( log.info("'%s' already exists in '%s'", name, dbname) return False - sub_cmd = 'CREATE SCHEMA "{}"'.format(name) + sub_cmd = f'CREATE SCHEMA "{name}"' if owner is not None: - sub_cmd = '{} AUTHORIZATION "{}"'.format(sub_cmd, owner) + sub_cmd = f'{sub_cmd} AUTHORIZATION "{owner}"' ret = _psql_prepare_and_run( ["-c", sub_cmd], @@ -2401,7 +2393,7 @@ def schema_remove( return False # schema exists, proceed - sub_cmd = 'DROP SCHEMA "{}"'.format(name) + sub_cmd = f'DROP SCHEMA "{name}"' _psql_prepare_and_run( ["-c", sub_cmd], runas=user, @@ -2721,7 +2713,7 @@ def language_create( log.info("Language %s already exists in %s", name, maintenance_db) return False - query = "CREATE LANGUAGE {}".format(name) + query = f"CREATE LANGUAGE {name}" ret = _psql_prepare_and_run( ["-c", query], @@ -2776,7 +2768,7 @@ def language_remove( log.info("Language %s does not exist in %s", name, maintenance_db) return False - query = "DROP LANGUAGE {}".format(name) + query = f"DROP LANGUAGE {name}" ret = _psql_prepare_and_run( ["-c", query], @@ -3035,9 +3027,7 @@ def _validate_privileges(object_type, privs, privileges): _perms.append("ALL") if object_type not in _PRIVILEGES_OBJECTS: - raise SaltInvocationError( - "Invalid object_type: {} provided".format(object_type) - ) + raise SaltInvocationError(f"Invalid object_type: {object_type} provided") if not set(privs).issubset(set(_perms)): raise SaltInvocationError( @@ -3145,9 +3135,7 @@ def privileges_list( query = _make_privileges_list_query(name, object_type, prepend) if object_type not in _PRIVILEGES_OBJECTS: - raise SaltInvocationError( - "Invalid object_type: {} provided".format(object_type) - ) + raise SaltInvocationError(f"Invalid object_type: {object_type} provided") rows = psql_query( query, @@ -3439,15 +3427,15 @@ def privileges_grant( _grants = ",".join(_privs) if object_type in ["table", "sequence"]: - on_part = '{}."{}"'.format(prepend, object_name) + on_part = f'{prepend}."{object_name}"' elif object_type == "function": - on_part = "{}".format(object_name) + on_part = f"{object_name}" else: - on_part = '"{}"'.format(object_name) + on_part = f'"{object_name}"' if grant_option: if object_type == "group": - query = 'GRANT {} TO "{}" WITH ADMIN OPTION'.format(object_name, name) + query = f'GRANT {object_name} TO "{name}" WITH ADMIN OPTION' 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 @@ -3458,7 +3446,7 @@ def privileges_grant( ) else: if object_type == "group": - query = 'GRANT {} TO "{}"'.format(object_name, name) + query = f'GRANT {object_name} TO "{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 @@ -3587,12 +3575,12 @@ def privileges_revoke( _grants = ",".join(_privs) if object_type in ["table", "sequence"]: - on_part = "{}.{}".format(prepend, object_name) + on_part = f"{prepend}.{object_name}" else: on_part = object_name if object_type == "group": - query = "REVOKE {} FROM {}".format(object_name, name) + query = f"REVOKE {object_name} FROM {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 841811dcdfe..a0843130593 100644 --- a/salt/utils/cloud.py +++ b/salt/utils/cloud.py @@ -10,8 +10,8 @@ import hashlib 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), - "{}@{}".format(ssh_gateway_user, ssh_gateway), + f"{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("{}.sh".format(os_)): + if os.path.isabs(f"{os_}.sh"): # The user provided an absolute path to the deploy script, although no # extension was provided. Let's use it anyway. - return __render_script("{}.sh".format(os_), vm_, opts, minion) + return __render_script(f"{os_}.sh", 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, "{}.sh".format(os_))): + if os.path.isfile(os.path.join(search_path, f"{os_}.sh")): return __render_script( - os.path.join(search_path, "{}.sh".format(os_)), vm_, opts, minion + os.path.join(search_path, f"{os_}.sh"), 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( - "The defined ssh_keyfile '{}' does not exist".format(key_filename) + f"The defined ssh_keyfile '{key_filename}' does not exist" ) 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 - "-oServerAliveInterval={}".format(server_alive_interval), - "-oServerAliveCountMax={}".format(server_alive_count_max), + f"-oServerAliveInterval={server_alive_interval}", + f"-oServerAliveCountMax={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 = "nc -z -w5 -q0 {} {}".format(host, port) + command = f"nc -z -w5 -q0 {host} {port}" # SSH command pcmd = "ssh {} {}@{} -p {} {}".format( " ".join(ssh_args), gateway["ssh_gateway_user"], ssh_gateway, ssh_gateway_port, - pipes.quote("date"), + shlex.quote("date"), ) cmd = "ssh {} {}@{} -p {} {}".format( " ".join(ssh_args), gateway["ssh_gateway_user"], ssh_gateway, ssh_gateway_port, - pipes.quote(command), + shlex.quote(command), ) log.debug("SSH command: '%s'", cmd) @@ -893,7 +893,7 @@ class Client: service_name=None, ): self.service_name = service_name - self._exe_file = "{}.exe".format(self.service_name) + self._exe_file = f"{self.service_name}.exe" self._client = PsExecClient(server, username, password, port, encrypt) self._client._service = ScmrService(self.service_name, self._client.session) @@ -943,7 +943,7 @@ class Client: # delete the PAExec executable smb_tree = TreeConnect( self._client.session, - r"\\{}\ADMIN$".format(self._client.connection.server_name), + rf"\\{self._client.connection.server_name}\ADMIN$", ) 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 = "-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) + 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}" 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 = "PS-Exec-{}".format(uuid.uuid4()) + service_name = f"PS-Exec-{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 = "winexe -U '{}%{}' //{} \"hostname\"".format(username, password, host) + cmd = f"winexe -U '{username}%{password}' //{host} \"hostname\"" 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("{}/conf/pki/minion".format(root_dir), conn=smb_conn) + salt.utils.smb.mkdirs(f"{root_dir}/conf/pki/minion", conn=smb_conn) root_dir = "ProgramData\\Salt Project\\Salt" if minion_pub: salt.utils.smb.put_str( minion_pub, - "{}\\conf\\pki\\minion\\minion.pub".format(root_dir), + f"{root_dir}\\conf\\pki\\minion\\minion.pub", conn=smb_conn, ) if minion_pem: salt.utils.smb.put_str( minion_pem, - "{}\\conf\\pki\\minion\\minion.pem".format(root_dir), + f"{root_dir}\\conf\\pki\\minion\\minion.pem", conn=smb_conn, ) @@ -1324,7 +1324,7 @@ def deploy_windows( try: salt.utils.smb.put_file( master_sign_pub_file, - "{}\\conf\\pki\\minion\\master_sign.pub".format(root_dir), + f"{root_dir}\\conf\\pki\\minion\\master_sign.pub", 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, - "salttemp\\{}".format(installer), + f"salttemp\\{installer}", "C$", conn=smb_conn, ) - cmd = "c:\\salttemp\\{}".format(installer) + cmd = f"c:\\salttemp\\{installer}" args = [ "/S", - "/master={}".format(_format_master_param(master)), - "/minion-name={}".format(name), + f"/master={_format_master_param(master)}", + f"/minion-name={name}", ] if use_winrm: @@ -1362,7 +1362,7 @@ def deploy_windows( ) if ret_code != 0: - raise Exception("Fail installer {}".format(ret_code)) + raise Exception(f"Fail installer {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"), - "{}\\conf\\grains".format(root_dir), + f"{root_dir}\\conf\\grains", 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"), - "{}\\conf\\minion".format(root_dir), + f"{root_dir}\\conf\\minion", 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( - "salttemp\\{}".format(installer), "C$", conn=smb_conn + f"salttemp\\{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", - "{} has been deployed at {}".format(name, host), - "salt/cloud/{}/deploy_windows".format(name), + f"{name} has been deployed at {host}", + f"salt/cloud/{name}/deploy_windows", 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( - "The defined key_filename '{}' does not exist".format(key_filename) + f"The defined key_filename '{key_filename}' does not exist" ) gateway = None @@ -1543,35 +1543,28 @@ def deploy_script( ssh_kwargs["password"] = password if root_cmd( - "test -e '{}'".format(tmp_dir), - tty, - sudo, - allow_failure=True, - **ssh_kwargs + f"test -e '{tmp_dir}'", tty, sudo, allow_failure=True, **ssh_kwargs ): ret = root_cmd( - "sh -c \"( mkdir -p -m 700 '{}' )\"".format(tmp_dir), + f"sh -c \"( mkdir -p -m 700 '{tmp_dir}' )\"", tty, sudo, - **ssh_kwargs + **ssh_kwargs, ) if ret: raise SaltCloudSystemExit( - "Can't create temporary directory in {} !".format(tmp_dir) + f"Can't create temporary directory in {tmp_dir} !" ) if sudo: comps = tmp_dir.lstrip("/").rstrip("/").split("/") if comps: if len(comps) > 1 or comps[0] != "tmp": ret = root_cmd( - 'chown {} "{}"'.format(username, tmp_dir), - tty, - sudo, - **ssh_kwargs + f'chown {username} "{tmp_dir}"', tty, sudo, **ssh_kwargs ) if ret: raise SaltCloudSystemExit( - "Cant set {} ownership on {}".format(username, tmp_dir) + f"Cant set {username} ownership on {tmp_dir}" ) if not isinstance(file_map, dict): @@ -1601,15 +1594,13 @@ def deploy_script( remote_dir = os.path.dirname(remote_file) if remote_dir not in remote_dirs: - root_cmd( - "mkdir -p '{}'".format(remote_dir), tty, sudo, **ssh_kwargs - ) + root_cmd(f"mkdir -p '{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) @@ -1617,21 +1608,21 @@ def deploy_script( # Minion configuration if minion_pem: - ssh_file(opts, "{}/minion.pem".format(tmp_dir), minion_pem, ssh_kwargs) + ssh_file(opts, f"{tmp_dir}/minion.pem", minion_pem, ssh_kwargs) ret = root_cmd( - "chmod 600 '{}/minion.pem'".format(tmp_dir), tty, sudo, **ssh_kwargs + f"chmod 600 '{tmp_dir}/minion.pem'", tty, sudo, **ssh_kwargs ) if ret: raise SaltCloudSystemExit( - "Can't set perms on {}/minion.pem".format(tmp_dir) + f"Can't set perms on {tmp_dir}/minion.pem" ) if minion_pub: - ssh_file(opts, "{}/minion.pub".format(tmp_dir), minion_pub, ssh_kwargs) + ssh_file(opts, f"{tmp_dir}/minion.pub", minion_pub, ssh_kwargs) if master_sign_pub_file: ssh_file( opts, - "{}/master_sign.pub".format(tmp_dir), + f"{tmp_dir}/master_sign.pub", kwargs=ssh_kwargs, local_file=master_sign_pub_file, ) @@ -1649,7 +1640,7 @@ def deploy_script( if minion_grains: ssh_file( opts, - "{}/grains".format(tmp_dir), + f"{tmp_dir}/grains", salt_config_to_yaml(minion_grains), ssh_kwargs, ) @@ -1657,24 +1648,22 @@ def deploy_script( minion_conf["grains"] = {"salt-cloud": cloud_grains} ssh_file( opts, - "{}/minion".format(tmp_dir), + f"{tmp_dir}/minion", salt_config_to_yaml(minion_conf), ssh_kwargs, ) # Master configuration if master_pem: - ssh_file(opts, "{}/master.pem".format(tmp_dir), master_pem, ssh_kwargs) + ssh_file(opts, f"{tmp_dir}/master.pem", master_pem, ssh_kwargs) ret = root_cmd( - "chmod 600 '{}/master.pem'".format(tmp_dir), tty, sudo, **ssh_kwargs + f"chmod 600 '{tmp_dir}/master.pem'", tty, sudo, **ssh_kwargs ) if ret: - raise SaltCloudSystemExit( - "Cant set perms on {}/master.pem".format(tmp_dir) - ) + raise SaltCloudSystemExit(f"Cant set perms on {tmp_dir}/master.pem") if master_pub: - ssh_file(opts, "{}/master.pub".format(tmp_dir), master_pub, ssh_kwargs) + ssh_file(opts, f"{tmp_dir}/master.pub", master_pub, ssh_kwargs) if master_conf: if not isinstance(master_conf, dict): @@ -1688,34 +1677,31 @@ def deploy_script( ssh_file( opts, - "{}/master".format(tmp_dir), + f"{tmp_dir}/master", salt_config_to_yaml(master_conf), ssh_kwargs, ) # XXX: We need to make these paths configurable - preseed_minion_keys_tempdir = "{}/preseed-minion-keys".format(tmp_dir) + preseed_minion_keys_tempdir = f"{tmp_dir}/preseed-minion-keys" if preseed_minion_keys is not None: # Create remote temp dir ret = root_cmd( - "mkdir '{}'".format(preseed_minion_keys_tempdir), - tty, - sudo, - **ssh_kwargs + f"mkdir '{preseed_minion_keys_tempdir}'", tty, sudo, **ssh_kwargs ) if ret: raise SaltCloudSystemExit( - "Cant create {}".format(preseed_minion_keys_tempdir) + f"Cant create {preseed_minion_keys_tempdir}" ) ret = root_cmd( - "chmod 700 '{}'".format(preseed_minion_keys_tempdir), + f"chmod 700 '{preseed_minion_keys_tempdir}'", tty, sudo, - **ssh_kwargs + **ssh_kwargs, ) if ret: raise SaltCloudSystemExit( - "Can't set perms on {}".format(preseed_minion_keys_tempdir) + f"Can't set perms on {preseed_minion_keys_tempdir}" ) if ssh_kwargs["username"] != "root": root_cmd( @@ -1724,7 +1710,7 @@ def deploy_script( ), tty, sudo, - **ssh_kwargs + **ssh_kwargs, ) # Copy pre-seed minion keys @@ -1734,10 +1720,10 @@ def deploy_script( if ssh_kwargs["username"] != "root": root_cmd( - "chown -R root '{}'".format(preseed_minion_keys_tempdir), + f"chown -R root '{preseed_minion_keys_tempdir}'", tty, sudo, - **ssh_kwargs + **ssh_kwargs, ) if ret: raise SaltCloudSystemExit( @@ -1751,25 +1737,21 @@ def deploy_script( for command in preflight_cmds: cmd_ret = root_cmd(command, tty, sudo, **ssh_kwargs) if cmd_ret: - raise SaltCloudSystemExit( - "Pre-flight command failed: '{}'".format(command) - ) + raise SaltCloudSystemExit(f"Pre-flight command failed: '{command}'") # The actual deploy script if script: # got strange escaping issues with sudoer, going onto a # subshell fixes that - ssh_file(opts, "{}/deploy.sh".format(tmp_dir), script, ssh_kwargs) + ssh_file(opts, f"{tmp_dir}/deploy.sh", script, ssh_kwargs) ret = root_cmd( - "sh -c \"( chmod +x '{}/deploy.sh' )\";exit $?".format(tmp_dir), + f"sh -c \"( chmod +x '{tmp_dir}/deploy.sh' )\";exit $?", tty, sudo, - **ssh_kwargs + **ssh_kwargs, ) if ret: - raise SaltCloudSystemExit( - "Can't set perms on {}/deploy.sh".format(tmp_dir) - ) + raise SaltCloudSystemExit(f"Can't set perms on {tmp_dir}/deploy.sh") time_used = time.mktime(time.localtime()) - time.mktime(starttime) newtimeout = timeout - time_used @@ -1785,7 +1767,7 @@ def deploy_script( kwargs=dict( name=name, sock_dir=sock_dir, timeout=newtimeout, queue=queue ), - name="DeployScriptCheckAuth({})".format(name), + name=f"DeployScriptCheckAuth({name})", ) log.debug("Starting new process to wait for salt-minion") process.start() @@ -1793,7 +1775,7 @@ def deploy_script( # Run the deploy script if script: if "bootstrap-salt" in script: - deploy_command += " -c '{}'".format(tmp_dir) + deploy_command += f" -c '{tmp_dir}'" if force_minion_config: deploy_command += " -F" if make_syndic is True: @@ -1805,9 +1787,9 @@ def deploy_script( if keep_tmp is True: deploy_command += " -K" if preseed_minion_keys is not None: - deploy_command += " -k '{}'".format(preseed_minion_keys_tempdir) + deploy_command += f" -k '{preseed_minion_keys_tempdir}'" if script_args: - deploy_command += " {}".format(script_args) + deploy_command += f" {script_args}" if script_env: if not isinstance(script_env, dict): @@ -1826,15 +1808,15 @@ def deploy_script( # Upload our environ setter wrapper ssh_file( opts, - "{}/environ-deploy-wrapper.sh".format(tmp_dir), + f"{tmp_dir}/environ-deploy-wrapper.sh", "\n".join(environ_script_contents), ssh_kwargs, ) root_cmd( - "chmod +x '{}/environ-deploy-wrapper.sh'".format(tmp_dir), + f"chmod +x '{tmp_dir}/environ-deploy-wrapper.sh'", tty, sudo, - **ssh_kwargs + **ssh_kwargs, ) # The deploy command is now our wrapper deploy_command = "'{}/environ-deploy-wrapper.sh'".format( @@ -1842,22 +1824,20 @@ def deploy_script( ) if root_cmd(deploy_command, tty, sudo, **ssh_kwargs) != 0: raise SaltCloudSystemExit( - "Executing the command '{}' failed".format(deploy_command) + f"Executing the command '{deploy_command}' failed" ) log.debug("Executed command '%s'", deploy_command) # Remove the deploy script if not keep_tmp: - root_cmd( - "rm -f '{}/deploy.sh'".format(tmp_dir), tty, sudo, **ssh_kwargs - ) + root_cmd(f"rm -f '{tmp_dir}/deploy.sh'", tty, sudo, **ssh_kwargs) log.debug("Removed %s/deploy.sh", tmp_dir) if script_env: root_cmd( - "rm -f '{}/environ-deploy-wrapper.sh'".format(tmp_dir), + f"rm -f '{tmp_dir}/environ-deploy-wrapper.sh'", tty, sudo, - **ssh_kwargs + **ssh_kwargs, ) log.debug("Removed %s/environ-deploy-wrapper.sh", tmp_dir) @@ -1866,57 +1846,40 @@ def deploy_script( else: # Remove minion configuration if minion_pub: - root_cmd( - "rm -f '{}/minion.pub'".format(tmp_dir), tty, sudo, **ssh_kwargs - ) + root_cmd(f"rm -f '{tmp_dir}/minion.pub'", tty, sudo, **ssh_kwargs) log.debug("Removed %s/minion.pub", tmp_dir) if minion_pem: - root_cmd( - "rm -f '{}/minion.pem'".format(tmp_dir), tty, sudo, **ssh_kwargs - ) + root_cmd(f"rm -f '{tmp_dir}/minion.pem'", tty, sudo, **ssh_kwargs) log.debug("Removed %s/minion.pem", tmp_dir) if minion_conf: - root_cmd( - "rm -f '{}/grains'".format(tmp_dir), tty, sudo, **ssh_kwargs - ) + root_cmd(f"rm -f '{tmp_dir}/grains'", tty, sudo, **ssh_kwargs) log.debug("Removed %s/grains", tmp_dir) - root_cmd( - "rm -f '{}/minion'".format(tmp_dir), tty, sudo, **ssh_kwargs - ) + root_cmd(f"rm -f '{tmp_dir}/minion'", tty, sudo, **ssh_kwargs) log.debug("Removed %s/minion", tmp_dir) if master_sign_pub_file: root_cmd( - "rm -f {}/master_sign.pub".format(tmp_dir), - tty, - sudo, - **ssh_kwargs + f"rm -f {tmp_dir}/master_sign.pub", tty, sudo, **ssh_kwargs ) log.debug("Removed %s/master_sign.pub", tmp_dir) # Remove master configuration if master_pub: - root_cmd( - "rm -f '{}/master.pub'".format(tmp_dir), tty, sudo, **ssh_kwargs - ) + root_cmd(f"rm -f '{tmp_dir}/master.pub'", tty, sudo, **ssh_kwargs) log.debug("Removed %s/master.pub", tmp_dir) if master_pem: - root_cmd( - "rm -f '{}/master.pem'".format(tmp_dir), tty, sudo, **ssh_kwargs - ) + root_cmd(f"rm -f '{tmp_dir}/master.pem'", tty, sudo, **ssh_kwargs) log.debug("Removed %s/master.pem", tmp_dir) if master_conf: - root_cmd( - "rm -f '{}/master'".format(tmp_dir), tty, sudo, **ssh_kwargs - ) + root_cmd(f"rm -f '{tmp_dir}/master'", 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( - "rm -rf '{}'".format(preseed_minion_keys_tempdir), + f"rm -rf '{preseed_minion_keys_tempdir}'", tty, sudo, - **ssh_kwargs + **ssh_kwargs, ) log.debug("Removed %s", preseed_minion_keys_tempdir) @@ -1931,15 +1894,13 @@ def deploy_script( # for line in output: # print(line) log.info("Executing %s on the salt-minion", start_action) - root_cmd( - "salt-call {}".format(start_action), tty, sudo, **ssh_kwargs - ) + root_cmd(f"salt-call {start_action}", tty, sudo, **ssh_kwargs) log.info("Finished executing %s on the salt-minion", start_action) # Fire deploy action fire_event( "event", - "{} has been deployed at {}".format(name, host), - "salt/cloud/{}/deploy_script".format(name), + f"{name} has been deployed at {host}", + f"salt/cloud/{name}/deploy_script", args={"name": name, "host": host}, sock_dir=opts.get( "sock_dir", os.path.join(__opts__["sock_dir"], "master") @@ -1972,7 +1933,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 @@ -2029,11 +1990,11 @@ def run_inline_script( # TODO: check edge cases (e.g. ssh gateways, salt deploy disabled, etc.) if ( root_cmd( - 'test -e \\"{}\\"'.format(tmp_dir), + f'test -e \\"{tmp_dir}\\"', tty, sudo, allow_failure=True, - **ssh_kwargs + **ssh_kwargs, ) and inline_script ): @@ -2041,11 +2002,11 @@ def run_inline_script( for cmd_line in inline_script: log.info("Executing inline command: %s", cmd_line) ret = root_cmd( - 'sh -c "( {} )"'.format(cmd_line), + f'sh -c "( {cmd_line} )"', tty, sudo, allow_failure=True, - **ssh_kwargs + **ssh_kwargs, ) if ret: log.info("[%s] Output: %s", cmd_line, ret) @@ -2149,7 +2110,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( - "Command '{}' failed. Exit code: {}".format(cmd, proc.exitstatus) + f"Command '{cmd}' failed. Exit code: {proc.exitstatus}" ) return proc.exitstatus except salt.utils.vt.TerminalException as err: @@ -2252,7 +2213,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: @@ -2370,7 +2331,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: @@ -2430,11 +2391,11 @@ def root_cmd(command, tty, sudo, allow_failure=False, **kwargs): if sudo: if sudo_password is None: - command = "sudo {}".format(command) + command = f"sudo {command}" logging_command = command else: - logging_command = 'sudo -S "XXX-REDACTED-XXX" {}'.format(command) - command = "sudo -S {}".format(command) + logging_command = f'sudo -S "XXX-REDACTED-XXX" {command}' + command = f"sudo -S {command}" log.debug("Using sudo to run command %s", logging_command) @@ -2453,9 +2414,9 @@ def root_cmd(command, tty, sudo, allow_failure=False, **kwargs): ssh_args.extend( [ # Don't add new hosts to the host key database - "-oStrictHostKeyChecking={}".format(host_key_checking), + f"-oStrictHostKeyChecking={host_key_checking}", # Set hosts key database path to /dev/null, i.e., non-existing - "-oUserKnownHostsFile={}".format(known_hosts_file), + f"-oUserKnownHostsFile={known_hosts_file}", # Don't re-use the SSH connection. Less failures. "-oControlPath=none", ] @@ -2488,12 +2449,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 + pipes.quote(command) + cmd = cmd + shlex.quote(command) hard_timeout = kwargs.get("hard_timeout") if hard_timeout is not None: - logging_command = "timeout {} {}".format(hard_timeout, logging_command) - cmd = "timeout {} {}".format(hard_timeout, cmd) + logging_command = f"timeout {hard_timeout} {logging_command}" + cmd = f"timeout {hard_timeout} {cmd}" log.debug("SSH command: '%s'", logging_command) @@ -2515,7 +2476,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"] == "salt/minion/{}/start".format(name): + if ret["tag"] == f"salt/minion/{name}/start": queue.put(name) newtimeout = 0 log.debug("Minion %s is ready to receive commands", name) @@ -2561,7 +2522,7 @@ def check_name(name, safe_chars): """ Check whether the specified name contains invalid characters """ - regexp = re.compile("[^{}]".format(safe_chars)) + regexp = re.compile(f"[^{safe_chars}]") if regexp.search(name): raise SaltCloudException( "{} contains characters not supported by this cloud provider. " @@ -2855,7 +2816,7 @@ def request_minion_cachedir( "provider": provider, } - fname = "{}.p".format(minion_id) + fname = f"{minion_id}.p" 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) @@ -2886,7 +2847,7 @@ def change_minion_cachedir( if base is None: base = __opts__["cachedir"] - fname = "{}.p".format(minion_id) + fname = f"{minion_id}.p" path = os.path.join(base, cachedir, fname) with salt.utils.files.fopen(path, "r") as fh_: @@ -2909,7 +2870,7 @@ def activate_minion_cachedir(minion_id, base=None): if base is None: base = __opts__["cachedir"] - fname = "{}.p".format(minion_id) + fname = f"{minion_id}.p" src = os.path.join(base, "requested", fname) dst = os.path.join(base, "active") shutil.move(src, dst) @@ -2931,7 +2892,7 @@ def delete_minion_cachedir(minion_id, provider, opts, base=None): base = __opts__["cachedir"] driver = next(iter(__opts__["providers"][provider].keys())) - fname = "{}.p".format(minion_id) + fname = f"{minion_id}.p" for cachedir in "requested", "active": path = os.path.join(base, cachedir, driver, provider, fname) log.debug("path: %s", path) @@ -3024,7 +2985,7 @@ def update_bootstrap(config, url=None): # in last case, assuming we got a script content else: script_content = url - script_name = "{}.sh".format(hashlib.sha1(script_content).hexdigest()) + script_name = f"{hashlib.sha1(script_content).hexdigest()}.sh" if not script_content: raise ValueError("No content in bootstrap script !") @@ -3118,7 +3079,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, "{}.p".format(node)) + path = os.path.join(prov_dir, f"{node}.p") with salt.utils.files.fopen(path, "wb") as fh_: salt.utils.msgpack.dump(nodes[node], fh_, encoding=MSGPACK_ENCODING) @@ -3173,7 +3134,7 @@ def missing_node_cache(prov_dir, node_list, provider, opts): fire_event( "event", "cached node missing from provider", - "salt/cloud/{}/cache_node_missing".format(node), + f"salt/cloud/{node}/cache_node_missing", args={"missing node": node}, sock_dir=opts.get( "sock_dir", os.path.join(__opts__["sock_dir"], "master") @@ -3201,7 +3162,7 @@ def diff_node_cache(prov_dir, node, new_data, opts): if node is None: return - path = "{}.p".format(os.path.join(prov_dir, node)) + path = f"{os.path.join(prov_dir, node)}.p" if not os.path.exists(path): event_data = _strip_cache_events(new_data, opts) @@ -3209,7 +3170,7 @@ def diff_node_cache(prov_dir, node, new_data, opts): fire_event( "event", "new node found", - "salt/cloud/{}/cache_node_new".format(node), + f"salt/cloud/{node}/cache_node_new", args={"new_data": event_data}, sock_dir=opts.get("sock_dir", os.path.join(__opts__["sock_dir"], "master")), transport=opts.get("transport", "zeromq"), @@ -3233,7 +3194,7 @@ def diff_node_cache(prov_dir, node, new_data, opts): fire_event( "event", "node data differs", - "salt/cloud/{}/cache_node_diff".format(node), + f"salt/cloud/{node}/cache_node_diff", args={ "new_data": _strip_cache_events(new_data, opts), "cache_data": _strip_cache_events(cache_data, opts), @@ -3277,7 +3238,7 @@ def _salt_cloud_force_ascii(exc): errors. """ if not isinstance(exc, (UnicodeEncodeError, UnicodeTranslateError)): - raise TypeError("Can't handle {}".format(exc)) + raise TypeError(f"Can't handle {exc}") unicode_trans = { # Convert non-breaking space to space @@ -3337,7 +3298,7 @@ def store_password_in_keyring(credential_id, username, password=None): # pylint: enable=import-error if password is None: - prompt = "Please enter password for {}: ".format(credential_id) + prompt = f"Please enter password for {credential_id}: " try: password = getpass.getpass(prompt) except EOFError: diff --git a/salt/utils/jinja.py b/salt/utils/jinja.py index a6a8a279605..d90957a0087 100644 --- a/salt/utils/jinja.py +++ b/salt/utils/jinja.py @@ -2,13 +2,12 @@ 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 @@ -242,11 +241,11 @@ class PrintableDict(OrderedDict): if isinstance(value, str): # keeps quotes around strings # pylint: disable=repr-flag-used-in-string - output.append("{!r}: {!r}".format(key, value)) + output.append(f"{key!r}: {value!r}") # pylint: enable=repr-flag-used-in-string else: # let default output - output.append("{!r}: {!s}".format(key, value)) + output.append(f"{key!r}: {value!s}") return "{" + ", ".join(output) + "}" def __repr__(self): # pylint: disable=W0221 @@ -255,7 +254,7 @@ class PrintableDict(OrderedDict): # Raw string formatter required here because this is a repr # function. # pylint: disable=repr-flag-used-in-string - output.append("{!r}: {!r}".format(key, value)) + output.append(f"{key!r}: {value!r}") # pylint: enable=repr-flag-used-in-string return "{" + ", ".join(output) + "}" @@ -441,7 +440,7 @@ def quote(txt): 'my_text' """ - return pipes.quote(txt) + return shlex.quote(txt) @jinja_filter() @@ -1095,13 +1094,13 @@ class SerializerExtension(Extension): # to the stringified version of the exception. msg += str(exc) else: - msg += "{}\n".format(problem) + msg += f"{problem}\n" msg += salt.utils.stringutils.get_context( buf, line, marker=" <======================" ) raise TemplateRuntimeError(msg) except AttributeError: - raise TemplateRuntimeError("Unable to load yaml from {}".format(value)) + raise TemplateRuntimeError(f"Unable to load yaml from {value}") def load_json(self, value): if isinstance(value, TemplateModule): @@ -1109,7 +1108,7 @@ class SerializerExtension(Extension): try: return salt.utils.json.loads(value) except (ValueError, TypeError, AttributeError): - raise TemplateRuntimeError("Unable to load json from {}".format(value)) + raise TemplateRuntimeError(f"Unable to load json from {value}") def load_text(self, value): if isinstance(value, TemplateModule): @@ -1144,7 +1143,7 @@ class SerializerExtension(Extension): return self._parse_profile_block(parser, label, "profile block", body, lineno) def _create_profile_id(self, parser): - return "_salt_profile_{}".format(parser.free_identifier().name) + return f"_salt_profile_{parser.free_identifier().name}" def _profile_start(self, label, source): return (label, source, time.time()) @@ -1186,7 +1185,7 @@ class SerializerExtension(Extension): filter_name = parser.stream.current.value lineno = next(parser.stream).lineno if filter_name not in self.environment.filters: - parser.fail("Unable to parse {}".format(filter_name), lineno) + parser.fail(f"Unable to parse {filter_name}", lineno) parser.stream.expect("name:as") target = parser.parse_assign_target() @@ -1225,7 +1224,7 @@ class SerializerExtension(Extension): nodes.Name(target, "store").set_lineno(lineno), nodes.Filter( nodes.Name(target, "load").set_lineno(lineno), - "load_{}".format(converter), + f"load_{converter}", [], [], None, @@ -1234,7 +1233,7 @@ class SerializerExtension(Extension): ).set_lineno(lineno), ] return self._parse_profile_block( - parser, import_node.template, "import_{}".format(converter), body, lineno + parser, import_node.template, f"import_{converter}", body, lineno ) def dict_to_sls_yaml_params(self, value, flow_style=False): From 7b9957209595f26df25cadd5a74b72c7b4acd243 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Wed, 22 Feb 2023 16:57:55 +0000 Subject: [PATCH 045/393] Stop using the deprecated `imp` module Signed-off-by: Pedro Algarvio --- tests/unit/test_loader.py | 51 +++++++++++++++-------------------- tests/unit/utils/test_path.py | 11 ++++---- 2 files changed, 26 insertions(+), 36 deletions(-) diff --git a/tests/unit/test_loader.py b/tests/unit/test_loader.py index cf339033200..067130620b3 100644 --- a/tests/unit/test_loader.py +++ b/tests/unit/test_loader.py @@ -8,7 +8,6 @@ import collections import compileall import copy -import imp import inspect import logging import os @@ -35,15 +34,15 @@ log = logging.getLogger(__name__) def remove_bytecode(module_path): paths = [module_path + "c"] - 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()), - ) + 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", ) + ) for path in paths: if os.path.exists(path): os.unlink(path) @@ -84,9 +83,7 @@ class LazyLoaderTest(TestCase): # 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, "{}.py".format(self.module_name) - ) + self.module_file = os.path.join(self.module_dir, f"{self.module_name}.py") with salt.utils.files.fopen(self.module_file, "w") as fh: fh.write(salt.utils.stringutils.to_str(loader_template)) fh.flush() @@ -163,16 +160,14 @@ class LazyLoaderUtilsTest(TestCase): def setUp(self): # Setup the module self.module_dir = tempfile.mkdtemp(dir=RUNTIME_VARS.TMP) - self.module_file = os.path.join( - self.module_dir, "{}.py".format(self.module_name) - ) + self.module_file = os.path.join(self.module_dir, f"{self.module_name}.py") 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, "{}.py".format(self.utils_name)) + self.utils_file = os.path.join(self.utils_dir, f"{self.utils_name}.py") with salt.utils.files.fopen(self.utils_file, "w") as fh: fh.write(salt.utils.stringutils.to_str(loader_template_utils)) fh.flush() @@ -516,7 +511,7 @@ class LazyLoaderSingleItem(TestCase): Checks that a KeyError is raised when the function key does not contain a '.' """ key = "testing_no_dot" - expected = "The key '{}' should contain a '.'".format(key) + expected = f"The key '{key}' should contain a '.'" with self.assertRaises(KeyError) as err: inspect.isfunction(self.loader["testing_no_dot"]) @@ -619,7 +614,7 @@ class LazyLoaderReloadingTest(TestCase): @property def module_path(self): - return os.path.join(self.tmp_dir, "{}.py".format(self.module_name)) + return os.path.join(self.tmp_dir, f"{self.module_name}.py") @pytest.mark.slow_test def test_alias(self): @@ -630,17 +625,15 @@ class LazyLoaderReloadingTest(TestCase): self.assertNotIn(self.module_key, self.loader) self.update_module() - self.assertNotIn("{}.test_alias".format(self.module_name), self.loader) + self.assertNotIn(f"{self.module_name}.test_alias", self.loader) self.assertTrue( isinstance( - self.loader["{}.working_alias".format(self.module_name)], + self.loader[f"{self.module_name}.working_alias"], salt.loader.lazy.LoadedFunc, ) ) self.assertTrue( - inspect.isfunction( - self.loader["{}.working_alias".format(self.module_name)].func - ) + inspect.isfunction(self.loader[f"{self.module_name}.working_alias"].func) ) @pytest.mark.slow_test @@ -802,7 +795,7 @@ class LazyLoaderVirtualAliasTest(TestCase): @property def module_path(self): - return os.path.join(self.tmp_dir, "{}.py".format(self.module_name)) + return os.path.join(self.tmp_dir, f"{self.module_name}.py") @pytest.mark.slow_test def test_virtual_alias(self): @@ -1199,7 +1192,7 @@ class LazyLoaderDeepSubmodReloadingTest(TestCase): "__salt__": self.minion_mods, }, ) - self.assertIn("{}.top".format(self.module_name), self.loader) + self.assertIn(f"{self.module_name}.top", self.loader) def tearDown(self): del self.tmp_dir @@ -1241,7 +1234,7 @@ class LazyLoaderDeepSubmodReloadingTest(TestCase): @pytest.mark.slow_test def test_basic(self): - self.assertIn("{}.top".format(self.module_name), self.loader) + self.assertIn(f"{self.module_name}.top", self.loader) def _verify_libs(self): for lib in self.libs: @@ -1549,9 +1542,7 @@ class LazyLoaderOptimizationOrderTest(TestCase): # 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, "{}.py".format(self.module_name) - ) + self.module_file = os.path.join(self.module_dir, f"{self.module_name}.py") def tearDown(self): try: @@ -1585,7 +1576,7 @@ class LazyLoaderOptimizationOrderTest(TestCase): return "lazyloadertest.cpython-{}{}{}.pyc".format( sys.version_info[0], sys.version_info[1], - "" if not optimize else ".opt-{}".format(optimize), + "" if not optimize else f".opt-{optimize}", ) def _write_module_file(self): diff --git a/tests/unit/utils/test_path.py b/tests/unit/utils/test_path.py index bebb9ce284a..47a108a2f4e 100644 --- a/tests/unit/utils/test_path.py +++ b/tests/unit/utils/test_path.py @@ -4,6 +4,7 @@ import platform import posixpath import sys import tempfile +import types import pytest @@ -40,14 +41,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 "{}: {}".format(idx, path) == "{}: {}".format(idx, expected) + assert f"{idx}: {path}" == f"{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 "{}: {}".format(idx, path) == "{}: {}".format(idx, expected) + assert f"{idx}: {path}" == f"{idx}: {expected}" @pytest.mark.skip(reason="Skipped until properly mocked") @pytest.mark.skip_on_windows @@ -57,7 +58,7 @@ class PathJoinTestCase(TestCase): try: for idx, (parts, expected) in enumerate(self.WIN_PATHS): path = salt.utils.path.join(*parts) - assert "{}: {}".format(idx, path) == "{}: {}".format(idx, expected) + assert f"{idx}: {path}" == f"{idx}: {expected}" finally: self.__unpatch_path() @@ -79,14 +80,12 @@ class PathJoinTestCase(TestCase): 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 = imp.new_module("nt") + module = types.ModuleType("nt") exec(code, module.__dict__) sys.modules["nt"] = module From e4876d2e494d15c006410a8115c634e842c62885 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Wed, 14 Jun 2023 15:50:25 +0100 Subject: [PATCH 046/393] Don't hardcode the python version in the test. Signed-off-by: Pedro Algarvio --- pkg/tests/integration/test_salt_user.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/tests/integration/test_salt_user.py b/pkg/tests/integration/test_salt_user.py index d1c8d504fa0..74ec8bb0093 100644 --- a/pkg/tests/integration/test_salt_user.py +++ b/pkg/tests/integration/test_salt_user.py @@ -1,5 +1,6 @@ import pathlib import subprocess +import sys import psutil import pytest @@ -61,7 +62,9 @@ def test_salt_cloud_dirs(install_salt): Test the correct user is running the Salt Master """ paths = [ - "/opt/saltstack/salt/lib/python3.10/site-packages/salt/cloud/deploy", + "/opt/saltstack/salt/lib/python{}.{}/site-packages/salt/cloud/deploy".format( + *sys.version_info + ), "/etc/salt/cloud.deploy.d", ] for name in paths: From fb9f0bc54ade2cfa477e86b239015f0f43372558 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Fri, 16 Jun 2023 06:42:56 +0100 Subject: [PATCH 047/393] Don't hardcode the python version on `pkg/debian/salt-cloud.postinst` Signed-off-by: Pedro Algarvio --- pkg/debian/salt-cloud.postinst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/debian/salt-cloud.postinst b/pkg/debian/salt-cloud.postinst index 12a955b9349..a92551161da 100644 --- a/pkg/debian/salt-cloud.postinst +++ b/pkg/debian/salt-cloud.postinst @@ -1,5 +1,6 @@ case "$1" in configure) - chown -R salt:salt /etc/salt/cloud.deploy.d /opt/saltstack/salt/lib/python3.10/site-packages/salt/cloud/deploy + 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 ;; esac From ba733b3a6396402241239ad0d9b90c1cbe497f6d Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Wed, 14 Jun 2023 06:50:35 +0100 Subject: [PATCH 048/393] Don't hide output Signed-off-by: Pedro Algarvio --- 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 b4ef1656bc4..be179b7b166 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} >/dev/null 2>&1 - export RELENV_FETCH_VERSION=${RELENV_VERSION} + pip install relenv==${RELENV_VERSION} else - pip install relenv >/dev/null 2>&1 + pip install relenv 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 >/dev/null 2>&1 + relenv fetch --python=$PY_VERSION if [ -f "$RELENV_DIR/build/$PY_VERSION-x86_64-macos.tar.xz" ]; then _success else From 57e0156e64532e7e46245130d795a1cdfb45310b Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Tue, 27 Jun 2023 13:01:35 +0100 Subject: [PATCH 049/393] Add change log files Signed-off-by: Pedro Algarvio --- changelog/64553.changed.md | 1 + changelog/64553.removed.md | 6 ++++++ 2 files changed, 7 insertions(+) create mode 100644 changelog/64553.changed.md create mode 100644 changelog/64553.removed.md diff --git a/changelog/64553.changed.md b/changelog/64553.changed.md new file mode 100644 index 00000000000..568560cb532 --- /dev/null +++ b/changelog/64553.changed.md @@ -0,0 +1 @@ +Don't hardcode the python version on the Salt Package tests and on the `pkg/debian/salt-cloud.postinst` file diff --git a/changelog/64553.removed.md b/changelog/64553.removed.md new file mode 100644 index 00000000000..cd826073f04 --- /dev/null +++ b/changelog/64553.removed.md @@ -0,0 +1,6 @@ +Handle deprecation warnings: + +* Switch to `FullArgSpec` since Py 3.11 no longer has `ArgSpec`, deprecated since Py 3.0 +* Stop using the deprecated `cgi` module +* Stop using the deprecated `pipes` module +* Stop using the deprecated `imp` module From b6a9599a706439d855b66898581d46f67339fcde Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Tue, 27 Jun 2023 22:13:37 +0100 Subject: [PATCH 050/393] Just confirm that the expected error messages is in `stderr` Signed-off-by: Pedro Algarvio --- tests/pytests/integration/ssh/test_deploy.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/pytests/integration/ssh/test_deploy.py b/tests/pytests/integration/ssh/test_deploy.py index 8512813f6e6..c95bb40a311 100644 --- a/tests/pytests/integration/ssh/test_deploy.py +++ b/tests/pytests/integration/ssh/test_deploy.py @@ -108,7 +108,7 @@ def test_retcode_exe_run_fail(salt_ssh_cli): ret = salt_ssh_cli.run("file.touch", "/tmp/non/ex/is/tent") assert ret.returncode == EX_AGGREGATE assert isinstance(ret.data, dict) - assert ret.data["stderr"] == "Error running 'file.touch': No such file or directory" + assert "Error running 'file.touch': No such file or directory" in ret.data["stderr"] assert ret.data["retcode"] == 1 From 58174eb8e13cba3034aa381a3fb35cba70358943 Mon Sep 17 00:00:00 2001 From: MKLeb Date: Tue, 27 Jun 2023 16:56:17 -0400 Subject: [PATCH 051/393] Hash the noxfile when calculating part of the cache key for our testing steps, they could be conditionally installing extra dependencies, etc... --- .github/workflows/test-action-macos.yml | 4 ++-- .github/workflows/test-action.yml | 4 ++-- .github/workflows/test-package-downloads-action-linux.yml | 4 ++-- .github/workflows/test-package-downloads-action-macos.yml | 4 ++-- .github/workflows/test-package-downloads-action-windows.yml | 4 ++-- .github/workflows/test-packages-action-macos.yml | 4 ++-- .github/workflows/test-packages-action.yml | 4 ++-- 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/.github/workflows/test-action-macos.yml b/.github/workflows/test-action-macos.yml index 3d1edefdf96..fdede59b807 100644 --- a/.github/workflows/test-action-macos.yml +++ b/.github/workflows/test-action-macos.yml @@ -108,7 +108,7 @@ jobs: uses: actions/cache@v3 with: path: nox.${{ inputs.distro-slug }}.tar.* - key: ${{ inputs.cache-prefix }}|testrun-deps|${{ inputs.distro-slug }}|${{ inputs.nox-session }}|${{ matrix.transport }}|${{ inputs.python-version }}|${{ hashFiles('requirements/**/*.txt') }} + key: ${{ inputs.cache-prefix }}|testrun-deps|${{ inputs.distro-slug }}|${{ inputs.nox-session }}|${{ matrix.transport }}|${{ inputs.python-version }}|${{ hashFiles('requirements/**/*.txt', 'noxfile.py') }} - name: Download Onedir Tarball as an Artifact if: steps.nox-dependencies-cache.outputs.cache-hit != 'true' @@ -221,7 +221,7 @@ jobs: uses: actions/cache@v3 with: path: nox.${{ inputs.distro-slug }}.tar.* - key: ${{ inputs.cache-prefix }}|testrun-deps|${{ inputs.distro-slug }}|${{ inputs.nox-session }}|${{ matrix.transport }}|${{ inputs.python-version }}|${{ hashFiles('requirements/**/*.txt') }} + key: ${{ inputs.cache-prefix }}|testrun-deps|${{ inputs.distro-slug }}|${{ inputs.nox-session }}|${{ matrix.transport }}|${{ inputs.python-version }}|${{ hashFiles('requirements/**/*.txt', 'noxfile.py') }} # If we get a cache miss here it means the dependencies step failed to save the cache fail-on-cache-miss: true diff --git a/.github/workflows/test-action.yml b/.github/workflows/test-action.yml index 49d75dcd86b..d3de4b9258e 100644 --- a/.github/workflows/test-action.yml +++ b/.github/workflows/test-action.yml @@ -111,7 +111,7 @@ jobs: uses: actions/cache@v3 with: path: nox.${{ inputs.distro-slug }}.tar.* - key: ${{ inputs.cache-prefix }}|testrun-deps|${{ inputs.distro-slug }}|${{ inputs.nox-session }}|${{ matrix.transport }}|${{ hashFiles('requirements/**/*.txt', 'cicd/golden-images.json') }} + key: ${{ inputs.cache-prefix }}|testrun-deps|${{ inputs.distro-slug }}|${{ inputs.nox-session }}|${{ matrix.transport }}|${{ hashFiles('requirements/**/*.txt', 'cicd/golden-images.json', 'noxfile.py') }} - name: Download Onedir Tarball as an Artifact if: steps.nox-dependencies-cache.outputs.cache-hit != 'true' @@ -242,7 +242,7 @@ jobs: uses: actions/cache@v3 with: path: nox.${{ inputs.distro-slug }}.tar.* - key: ${{ inputs.cache-prefix }}|testrun-deps|${{ inputs.distro-slug }}|${{ inputs.nox-session }}|${{ matrix.transport }}|${{ hashFiles('requirements/**/*.txt', 'cicd/golden-images.json') }} + key: ${{ inputs.cache-prefix }}|testrun-deps|${{ inputs.distro-slug }}|${{ inputs.nox-session }}|${{ matrix.transport }}|${{ hashFiles('requirements/**/*.txt', 'cicd/golden-images.json', 'noxfile.py') }} # If we get a cache miss here it means the dependencies step failed to save the cache fail-on-cache-miss: true diff --git a/.github/workflows/test-package-downloads-action-linux.yml b/.github/workflows/test-package-downloads-action-linux.yml index 7aa5f65c04a..0481c1c0594 100644 --- a/.github/workflows/test-package-downloads-action-linux.yml +++ b/.github/workflows/test-package-downloads-action-linux.yml @@ -78,7 +78,7 @@ jobs: uses: actions/cache@v3 with: path: nox.${{ inputs.distro-slug }}.tar.* - key: ${{ inputs.cache-prefix }}|test-pkg-download-deps|${{ inputs.arch }}|${{ inputs.distro-slug }}|${{ inputs.nox-session }}|${{ hashFiles('requirements/**/*.txt', 'cicd/golden-images.json') }} + key: ${{ inputs.cache-prefix }}|test-pkg-download-deps|${{ inputs.arch }}|${{ inputs.distro-slug }}|${{ inputs.nox-session }}|${{ hashFiles('requirements/**/*.txt', 'cicd/golden-images.json', 'noxfile.py') }} - name: Download Onedir Tarball as an Artifact uses: actions/download-artifact@v3 @@ -184,7 +184,7 @@ jobs: uses: actions/cache@v3 with: path: nox.${{ inputs.distro-slug }}.tar.* - key: ${{ inputs.cache-prefix }}|test-pkg-download-deps|${{ inputs.arch }}|${{ inputs.distro-slug }}|${{ inputs.nox-session }}|${{ hashFiles('requirements/**/*.txt', 'cicd/golden-images.json') }} + key: ${{ inputs.cache-prefix }}|test-pkg-download-deps|${{ inputs.arch }}|${{ inputs.distro-slug }}|${{ inputs.nox-session }}|${{ hashFiles('requirements/**/*.txt', 'cicd/golden-images.json', 'noxfile.py') }} # If we get a cache miss here it means the dependencies step failed to save the cache fail-on-cache-miss: true diff --git a/.github/workflows/test-package-downloads-action-macos.yml b/.github/workflows/test-package-downloads-action-macos.yml index fdd1ce63991..e24ffbeed8e 100644 --- a/.github/workflows/test-package-downloads-action-macos.yml +++ b/.github/workflows/test-package-downloads-action-macos.yml @@ -80,7 +80,7 @@ jobs: uses: actions/cache@v3 with: path: nox.${{ inputs.distro-slug }}.tar.* - key: ${{ inputs.cache-prefix }}|test-pkg-download-deps|${{ inputs.arch }}|${{ inputs.distro-slug }}|${{ inputs.nox-session }}|${{ hashFiles('requirements/**/*.txt', 'cicd/golden-images.json') }} + key: ${{ inputs.cache-prefix }}|test-pkg-download-deps|${{ inputs.arch }}|${{ inputs.distro-slug }}|${{ inputs.nox-session }}|${{ hashFiles('requirements/**/*.txt', 'cicd/golden-images.json', 'noxfile.py') }} - name: Download Onedir Tarball as an Artifact uses: actions/download-artifact@v3 @@ -184,7 +184,7 @@ jobs: uses: actions/cache@v3 with: path: nox.${{ inputs.distro-slug }}.tar.* - key: ${{ inputs.cache-prefix }}|test-pkg-download-deps|${{ inputs.arch }}|${{ inputs.distro-slug }}|${{ inputs.nox-session }}|${{ hashFiles('requirements/**/*.txt', 'cicd/golden-images.json') }} + key: ${{ inputs.cache-prefix }}|test-pkg-download-deps|${{ inputs.arch }}|${{ inputs.distro-slug }}|${{ inputs.nox-session }}|${{ hashFiles('requirements/**/*.txt', 'cicd/golden-images.json', 'noxfile.py') }} # If we get a cache miss here it means the dependencies step failed to save the cache fail-on-cache-miss: true diff --git a/.github/workflows/test-package-downloads-action-windows.yml b/.github/workflows/test-package-downloads-action-windows.yml index 0e585f97e70..29ed67fe827 100644 --- a/.github/workflows/test-package-downloads-action-windows.yml +++ b/.github/workflows/test-package-downloads-action-windows.yml @@ -83,7 +83,7 @@ jobs: uses: actions/cache@v3 with: path: nox.${{ inputs.distro-slug }}.tar.* - key: ${{ inputs.cache-prefix }}|test-pkg-download-deps|${{ inputs.arch }}|${{ inputs.distro-slug }}|${{ inputs.nox-session }}|${{ hashFiles('requirements/**/*.txt', 'cicd/golden-images.json') }} + key: ${{ inputs.cache-prefix }}|test-pkg-download-deps|${{ inputs.arch }}|${{ inputs.distro-slug }}|${{ inputs.nox-session }}|${{ hashFiles('requirements/**/*.txt', 'cicd/golden-images.json', 'noxfile.py') }} - name: Download Onedir Tarball as an Artifact uses: actions/download-artifact@v3 @@ -189,7 +189,7 @@ jobs: uses: actions/cache@v3 with: path: nox.${{ inputs.distro-slug }}.tar.* - key: ${{ inputs.cache-prefix }}|test-pkg-download-deps|${{ inputs.arch }}|${{ inputs.distro-slug }}|${{ inputs.nox-session }}|${{ hashFiles('requirements/**/*.txt', 'cicd/golden-images.json') }} + key: ${{ inputs.cache-prefix }}|test-pkg-download-deps|${{ inputs.arch }}|${{ inputs.distro-slug }}|${{ inputs.nox-session }}|${{ hashFiles('requirements/**/*.txt', 'cicd/golden-images.json', 'noxfile.py') }} # If we get a cache miss here it means the dependencies step failed to save the cache fail-on-cache-miss: true diff --git a/.github/workflows/test-packages-action-macos.yml b/.github/workflows/test-packages-action-macos.yml index b7de16fb5ac..2ef20904a26 100644 --- a/.github/workflows/test-packages-action-macos.yml +++ b/.github/workflows/test-packages-action-macos.yml @@ -96,7 +96,7 @@ jobs: uses: actions/cache@v3 with: path: nox.${{ inputs.distro-slug }}.tar.* - key: ${{ inputs.cache-prefix }}|testrun-deps|${{ inputs.distro-slug }}|${{ inputs.nox-session }}|${{ hashFiles('requirements/**/*.txt', 'cicd/golden-images.json') }} + key: ${{ inputs.cache-prefix }}|testrun-deps|${{ inputs.distro-slug }}|${{ inputs.nox-session }}|${{ hashFiles('requirements/**/*.txt', 'cicd/golden-images.json', 'noxfile.py') }} - name: Download Onedir Tarball as an Artifact if: steps.nox-dependencies-cache.outputs.cache-hit != 'true' @@ -213,7 +213,7 @@ jobs: uses: actions/cache@v3 with: path: nox.${{ inputs.distro-slug }}.tar.* - key: ${{ inputs.cache-prefix }}|testrun-deps|${{ inputs.distro-slug }}|${{ inputs.nox-session }}|${{ hashFiles('requirements/**/*.txt', 'cicd/golden-images.json') }} + key: ${{ inputs.cache-prefix }}|testrun-deps|${{ inputs.distro-slug }}|${{ inputs.nox-session }}|${{ hashFiles('requirements/**/*.txt', 'cicd/golden-images.json', 'noxfile.py') }} # If we get a cache miss here it means the dependencies step failed to save the cache fail-on-cache-miss: true diff --git a/.github/workflows/test-packages-action.yml b/.github/workflows/test-packages-action.yml index 71affc00877..cadaa2e834a 100644 --- a/.github/workflows/test-packages-action.yml +++ b/.github/workflows/test-packages-action.yml @@ -97,7 +97,7 @@ jobs: uses: actions/cache@v3 with: path: nox.${{ inputs.distro-slug }}.tar.* - key: ${{ inputs.cache-prefix }}|testrun-deps|${{ inputs.distro-slug }}|${{ inputs.nox-session }}|${{ hashFiles('requirements/**/*.txt', 'cicd/golden-images.json') }} + key: ${{ inputs.cache-prefix }}|testrun-deps|${{ inputs.distro-slug }}|${{ inputs.nox-session }}|${{ hashFiles('requirements/**/*.txt', 'cicd/golden-images.json', 'noxfile.py') }} - name: Download Onedir Tarball as an Artifact if: steps.nox-dependencies-cache.outputs.cache-hit != 'true' @@ -227,7 +227,7 @@ jobs: uses: actions/cache@v3 with: path: nox.${{ inputs.distro-slug }}.tar.* - key: ${{ inputs.cache-prefix }}|testrun-deps|${{ inputs.distro-slug }}|${{ inputs.nox-session }}|${{ hashFiles('requirements/**/*.txt', 'cicd/golden-images.json') }} + key: ${{ inputs.cache-prefix }}|testrun-deps|${{ inputs.distro-slug }}|${{ inputs.nox-session }}|${{ hashFiles('requirements/**/*.txt', 'cicd/golden-images.json', 'noxfile.py') }} # If we get a cache miss here it means the dependencies step failed to save the cache fail-on-cache-miss: true From 6c772d4d64e6acceb62bfd988355c418af4bc2d9 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Wed, 28 Jun 2023 07:41:56 +0100 Subject: [PATCH 052/393] Only try to get pull-request labels on pull-requests Signed-off-by: Pedro Algarvio --- .github/workflows/ci.yml | 1 + .github/workflows/nightly.yml | 1 + .github/workflows/scheduled.yml | 1 + .github/workflows/staging.yml | 1 + .github/workflows/templates/layout.yml.jinja | 1 + 5 files changed, 5 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 05284621f9f..62169d623d6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -148,6 +148,7 @@ jobs: - name: Get Pull Request Test Labels id: get-pull-labels + if: ${{ github.event_name == 'pull_request'}} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 0bde1d78e3c..21698717927 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -194,6 +194,7 @@ jobs: - name: Get Pull Request Test Labels id: get-pull-labels + if: ${{ github.event_name == 'pull_request'}} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | diff --git a/.github/workflows/scheduled.yml b/.github/workflows/scheduled.yml index 603f2d4c579..2dd28b76e10 100644 --- a/.github/workflows/scheduled.yml +++ b/.github/workflows/scheduled.yml @@ -184,6 +184,7 @@ jobs: - name: Get Pull Request Test Labels id: get-pull-labels + if: ${{ github.event_name == 'pull_request'}} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | diff --git a/.github/workflows/staging.yml b/.github/workflows/staging.yml index 7eab1044545..318f801d9c0 100644 --- a/.github/workflows/staging.yml +++ b/.github/workflows/staging.yml @@ -174,6 +174,7 @@ jobs: - name: Get Pull Request Test Labels id: get-pull-labels + if: ${{ github.event_name == 'pull_request'}} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | diff --git a/.github/workflows/templates/layout.yml.jinja b/.github/workflows/templates/layout.yml.jinja index ea52a8df37a..426fae6a3d9 100644 --- a/.github/workflows/templates/layout.yml.jinja +++ b/.github/workflows/templates/layout.yml.jinja @@ -193,6 +193,7 @@ jobs: - name: Get Pull Request Test Labels id: get-pull-labels + if: ${{ github.event_name == 'pull_request'}} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | From 31475e74e867dffbc581556d56d56aa0009ead1a Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Wed, 28 Jun 2023 11:56:47 +0100 Subject: [PATCH 053/393] Run `pypugrade` against the files changed in the merge-forward Signed-off-by: Pedro Algarvio --- pkg/tests/integration/test_multi_minion.py | 30 ++++++++----------- salt/runner.py | 8 ++--- .../pytests/functional/cli/test_salt_run_.py | 2 +- tests/pytests/functional/states/test_user.py | 4 +-- 4 files changed, 19 insertions(+), 25 deletions(-) diff --git a/pkg/tests/integration/test_multi_minion.py b/pkg/tests/integration/test_multi_minion.py index 13d64f31f6e..ba69ab2b5ea 100644 --- a/pkg/tests/integration/test_multi_minion.py +++ b/pkg/tests/integration/test_multi_minion.py @@ -20,10 +20,9 @@ def mm_conf(mm_script): yield pathlib.Path(os.getenv("LocalAppData"), "Salt Project", "Salt", "conf") subprocess.run( ["powershell", str(mm_script).replace(" ", "' '"), "-d"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, + capture_output=True, check=False, - universal_newlines=True, + text=True, ) @@ -41,10 +40,9 @@ def test_install(mm_script, mm_conf): """ ret = subprocess.run( ["powershell", str(mm_script).replace(" ", "' '")], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, + capture_output=True, check=False, - universal_newlines=True, + text=True, ) assert ret.returncode == 0, ret.stderr conf_file = mm_conf / "minion" @@ -58,10 +56,9 @@ def test_install_master(mm_script, mm_conf): """ ret = subprocess.run( ["powershell", str(mm_script).replace(" ", "' '"), "-m", "spongebob"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, + capture_output=True, check=False, - universal_newlines=True, + text=True, ) assert ret.returncode == 0, ret.stderr conf_file = mm_conf / "minion" @@ -75,10 +72,9 @@ def test_install_prefix(mm_script, mm_conf): """ ret = subprocess.run( ["powershell", str(mm_script).replace(" ", "' '"), "-p", "squarepants"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, + capture_output=True, check=False, - universal_newlines=True, + text=True, ) assert ret.returncode == 0, ret.stderr conf_file = mm_conf / "minion" @@ -92,10 +88,9 @@ def test_install_log_level(mm_script, mm_conf): """ ret = subprocess.run( ["powershell", str(mm_script).replace(" ", "' '"), "-l", "debug"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, + capture_output=True, check=False, - universal_newlines=True, + text=True, ) assert ret.returncode == 0, ret.stderr conf_file = mm_conf / "minion" @@ -109,10 +104,9 @@ def test_install_start(mm_script, mm_conf): """ ret = subprocess.run( ["powershell", str(mm_script).replace(" ", "' '"), "-s"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, + capture_output=True, check=False, - universal_newlines=True, + text=True, ) assert ret.returncode == 0, ret.stderr conf_file = mm_conf / "minion" diff --git a/salt/runner.py b/salt/runner.py index 2a19636b8ed..d3501b8f919 100644 --- a/salt/runner.py +++ b/salt/runner.py @@ -203,7 +203,7 @@ class Runner(RunnerClient): arg = self.opts.get("fun", None) docs = super().get_docs(arg) for fun in sorted(docs): - display_output("{}:".format(fun), "text", self.opts) + display_output(f"{fun}:", "text", self.opts) print(docs[fun]) # TODO: move to mixin whenever we want a salt-wheel cli @@ -313,13 +313,13 @@ class Runner(RunnerClient): evt.fire_event( { "success": False, - "return": "{}".format(exc), + "return": f"{exc}", "retcode": 254, "fun": self.opts["fun"], "fun_args": fun_args, "jid": self.jid, }, - tag="salt/run/{}/ret".format(self.jid), + tag=f"salt/run/{self.jid}/ret", ) # Attempt to grab documentation if "fun" in low: @@ -330,7 +330,7 @@ class Runner(RunnerClient): # If we didn't get docs returned then # return the `not availble` message. if not ret: - ret = "{}".format(exc) + ret = f"{exc}" if not self.opts.get("quiet", False): display_output(ret, "nested", self.opts) else: diff --git a/tests/pytests/functional/cli/test_salt_run_.py b/tests/pytests/functional/cli/test_salt_run_.py index 66c28fc3aae..efc02e38da4 100644 --- a/tests/pytests/functional/cli/test_salt_run_.py +++ b/tests/pytests/functional/cli/test_salt_run_.py @@ -47,7 +47,7 @@ def test_versions_report(salt_run_cli): ret_lines = [line.strip() for line in ret_lines] for header in expected: - assert "{}:".format(header) in ret_lines + assert f"{header}:" in ret_lines ret_dict = {} expected_keys = set() diff --git a/tests/pytests/functional/states/test_user.py b/tests/pytests/functional/states/test_user.py index 96b1ec55c88..43ae8513012 100644 --- a/tests/pytests/functional/states/test_user.py +++ b/tests/pytests/functional/states/test_user.py @@ -348,7 +348,7 @@ def test_user_present_change_gid_but_keep_group( @pytest.mark.skip_unless_on_windows def test_user_present_existing(states, username): - win_profile = "C:\\User\\{}".format(username) + win_profile = f"C:\\User\\{username}" win_logonscript = "C:\\logon.vbs" win_description = "Test User Account" ret = states.user.present( @@ -360,7 +360,7 @@ def test_user_present_existing(states, username): ) assert ret.result is True - win_profile = "C:\\Users\\{}".format(username) + win_profile = f"C:\\Users\\{username}" win_description = "Temporary Account" ret = states.user.present( name=username, From aacdfc9b98fa7fec96b6a3d281fdccb4a64ba443 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Wed, 28 Jun 2023 11:04:46 +0100 Subject: [PATCH 054/393] Stop using the deprecated `locale.getdefaultlocale()` function Signed-off-by: Pedro Algarvio --- changelog/64565.changed.md | 1 + salt/__init__.py | 10 +++++----- salt/client/ssh/ssh_py_shim.py | 10 +++++----- salt/grains/core.py | 4 +--- 4 files changed, 12 insertions(+), 13 deletions(-) create mode 100644 changelog/64565.changed.md diff --git a/changelog/64565.changed.md b/changelog/64565.changed.md new file mode 100644 index 00000000000..1faa9c42991 --- /dev/null +++ b/changelog/64565.changed.md @@ -0,0 +1 @@ +Stop using the deprecated `locale.getdefaultlocale()` function diff --git a/salt/__init__.py b/salt/__init__.py index 6649fdf5683..30880b10acc 100644 --- a/salt/__init__.py +++ b/salt/__init__.py @@ -93,14 +93,14 @@ def __define_global_system_encoding_variable__(): import locale try: - encoding = locale.getdefaultlocale()[-1] - except ValueError: - # A bad locale setting was most likely found: - # https://github.com/saltstack/salt/issues/26063 - pass + encoding = locale.getencoding() + except AttributeError: + # Python < 3.11 + encoding = locale.getpreferredencoding(do_setlocale=True) # 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/client/ssh/ssh_py_shim.py b/salt/client/ssh/ssh_py_shim.py index b77749f4953..9b8f9e0f658 100644 --- a/salt/client/ssh/ssh_py_shim.py +++ b/salt/client/ssh/ssh_py_shim.py @@ -67,14 +67,14 @@ def get_system_encoding(): import locale try: - encoding = locale.getdefaultlocale()[-1] - except ValueError: - # A bad locale setting was most likely found: - # https://github.com/saltstack/salt/issues/26063 - pass + encoding = locale.getencoding() + except AttributeError: + # Python < 3.11 + encoding = locale.getpreferredencoding(do_setlocale=True) # 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 710c57f28fb..7dd350a3453 100644 --- a/salt/grains/core.py +++ b/salt/grains/core.py @@ -2698,10 +2698,8 @@ def locale_info(): ( grains["locale_info"]["defaultlanguage"], grains["locale_info"]["defaultencoding"], - ) = locale.getdefaultlocale() + ) = locale.getlocale() except Exception: # pylint: disable=broad-except - # locale.getdefaultlocale can ValueError!! Catch anything else it - # might do, per #2205 grains["locale_info"]["defaultlanguage"] = "unknown" grains["locale_info"]["defaultencoding"] = "unknown" grains["locale_info"]["detectedencoding"] = __salt_system_encoding__ From f4eea349844bab892e88ad787cb37a7ddc83fd48 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Wed, 28 Jun 2023 11:38:04 +0100 Subject: [PATCH 055/393] Stop accessing deprecated attributes Signed-off-by: Pedro Algarvio --- changelog/64565.changed.md | 5 ++++- .../modules/state/test_state_pillar_errors.py | 14 +++++++------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/changelog/64565.changed.md b/changelog/64565.changed.md index 1faa9c42991..e400920c5c5 100644 --- a/changelog/64565.changed.md +++ b/changelog/64565.changed.md @@ -1 +1,4 @@ -Stop using the deprecated `locale.getdefaultlocale()` function +Some more deprecated code fixes: + +* Stop using the deprecated `locale.getdefaultlocale()` function +* Stop accessing deprecated attributes diff --git a/tests/pytests/integration/modules/state/test_state_pillar_errors.py b/tests/pytests/integration/modules/state/test_state_pillar_errors.py index 99dd5f175d0..26812cb71b5 100644 --- a/tests/pytests/integration/modules/state/test_state_pillar_errors.py +++ b/tests/pytests/integration/modules/state/test_state_pillar_errors.py @@ -16,8 +16,8 @@ def reset_pillar(salt_call_cli): finally: # Refresh pillar once all tests are done. ret = salt_call_cli.run("saltutil.refresh_pillar", wait=True) - assert ret.exitcode == 0 - assert ret.json is True + assert ret.returncode == 0 + assert ret.data is True @pytest.fixture @@ -77,8 +77,8 @@ def test_state_apply_aborts_on_pillar_error( shell_result = salt_cli.run( "state.apply", "sls-id-test", minion_tgt=salt_minion.id ) - assert shell_result.exitcode == 1 - assert shell_result.json == expected_comment + assert shell_result.returncode == 1 + assert shell_result.data == expected_comment @pytest.mark.usefixtures("testfile_path", "reset_pillar") @@ -117,7 +117,7 @@ def test_state_apply_continues_after_pillar_error_is_fixed( shell_result = salt_cli.run( "saltutil.refresh_pillar", minion_tgt=salt_minion.id ) - assert shell_result.exitcode == 0 + assert shell_result.returncode == 0 # run state.apply with fixed pillar render error with pytest.helpers.temp_file( @@ -128,7 +128,7 @@ def test_state_apply_continues_after_pillar_error_is_fixed( shell_result = salt_cli.run( "state.apply", "sls-id-test", minion_tgt=salt_minion.id ) - assert shell_result.exitcode == 0 - state_result = StateResult(shell_result.json) + assert shell_result.returncode == 0 + state_result = StateResult(shell_result.data) assert state_result.result is True assert state_result.changes == {"diff": "New file", "mode": "0644"} From 34f13a7632b2aedb42522f0f0bae3a499e325827 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Wed, 28 Jun 2023 11:43:23 +0100 Subject: [PATCH 056/393] `pathlib.Path.__enter__()` usage is deprecated and not required, a no-op Signed-off-by: Pedro Algarvio --- changelog/64565.changed.md | 1 + tests/pytests/integration/runners/test_saltutil.py | 4 ++-- tests/pytests/integration/states/test_file.py | 6 +++--- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/changelog/64565.changed.md b/changelog/64565.changed.md index e400920c5c5..1933f94cb30 100644 --- a/changelog/64565.changed.md +++ b/changelog/64565.changed.md @@ -2,3 +2,4 @@ Some more deprecated code fixes: * Stop using the deprecated `locale.getdefaultlocale()` function * Stop accessing deprecated attributes +* `pathlib.Path.__enter__()` usage is deprecated and not required, a no-op diff --git a/tests/pytests/integration/runners/test_saltutil.py b/tests/pytests/integration/runners/test_saltutil.py index 179d1b7bf6a..22ae12285ac 100644 --- a/tests/pytests/integration/runners/test_saltutil.py +++ b/tests/pytests/integration/runners/test_saltutil.py @@ -85,13 +85,13 @@ def world(): return "world" """ - test_moduledir = salt_master.state_tree.base.paths[0] / "_{}".format(module_type) + test_moduledir = salt_master.state_tree.base.write_path / "_{}".format(module_type) test_moduledir.mkdir(parents=True, exist_ok=True) module_tempfile = salt_master.state_tree.base.temp_file( "_{}/{}.py".format(module_type, module_name), module_contents ) - with module_tempfile, test_moduledir: + with module_tempfile: salt_cmd = "saltutil.sync_{}".format(module_sync_functions[module_type]) ret = salt_run_cli.run(salt_cmd) assert ret.returncode == 0 diff --git a/tests/pytests/integration/states/test_file.py b/tests/pytests/integration/states/test_file.py index 01e9da69902..ec8aafb299d 100644 --- a/tests/pytests/integration/states/test_file.py +++ b/tests/pytests/integration/states/test_file.py @@ -1070,7 +1070,7 @@ def test_recurse( "{}.sls".format(sls_name), sls_contents ) - with sls_tempfile, test_tempdir: + with sls_tempfile: for _dir in "test1", "test2", "test3": test_tempdir.joinpath(_dir).mkdir(parents=True, exist_ok=True) @@ -1117,7 +1117,7 @@ def test_recurse_keep_symlinks_in_fileserver_root( "{}.sls".format(sls_name), sls_contents ) - with sls_tempfile, test_tempdir: + with sls_tempfile: for _dir in "test1", "test2", "test3": test_tempdir.joinpath(_dir).mkdir(parents=True, exist_ok=True) @@ -1169,7 +1169,7 @@ def test_recurse_keep_symlinks_outside_fileserver_root( "{}.sls".format(sls_name), sls_contents ) - with sls_tempfile, test_tempdir: + with sls_tempfile: for _dir in "test1", "test2", "test3": test_tempdir.joinpath(_dir).mkdir(parents=True, exist_ok=True) From c463c94b8d29ba4ebfeb45c36b7d7b6653e9711f Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Wed, 28 Jun 2023 11:57:23 +0100 Subject: [PATCH 057/393] Stop using the deprecated `locale.getdefaultlocale()` function Signed-off-by: Pedro Algarvio --- changelog/64457.changed.md | 1 - salt/__init__.py | 51 ++++++---------------------------- salt/client/ssh/ssh_py_shim.py | 10 +++---- salt/grains/core.py | 5 ++-- salt/utils/locales.py | 37 ------------------------ 5 files changed, 15 insertions(+), 89 deletions(-) diff --git a/changelog/64457.changed.md b/changelog/64457.changed.md index 3360eb9c0cc..8e3364743f9 100644 --- a/changelog/64457.changed.md +++ b/changelog/64457.changed.md @@ -3,5 +3,4 @@ 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/salt/__init__.py b/salt/__init__.py index 32a73d568e7..4407a7d06f7 100644 --- a/salt/__init__.py +++ b/salt/__init__.py @@ -39,44 +39,6 @@ warnings.filterwarnings( ) -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,13 +57,16 @@ 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] - except ValueError: - # A bad locale setting was most likely found: - # https://github.com/saltstack/salt/issues/26063 - pass + encoding = locale.getencoding() + except AttributeError: + # Python < 3.11 + encoding = locale.getpreferredencoding(do_setlocale=True) + + # This is now garbage collectable + del locale if not encoding: # This is most likely ascii which is not the best but we were diff --git a/salt/client/ssh/ssh_py_shim.py b/salt/client/ssh/ssh_py_shim.py index b77749f4953..9b8f9e0f658 100644 --- a/salt/client/ssh/ssh_py_shim.py +++ b/salt/client/ssh/ssh_py_shim.py @@ -67,14 +67,14 @@ def get_system_encoding(): import locale try: - encoding = locale.getdefaultlocale()[-1] - except ValueError: - # A bad locale setting was most likely found: - # https://github.com/saltstack/salt/issues/26063 - pass + encoding = locale.getencoding() + except AttributeError: + # Python < 3.11 + encoding = locale.getpreferredencoding(do_setlocale=True) # 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 afaa5389e39..920194be1ee 100644 --- a/salt/grains/core.py +++ b/salt/grains/core.py @@ -11,6 +11,7 @@ as those returned here import datetime import hashlib +import locale import logging import os import platform @@ -2688,10 +2689,8 @@ def locale_info(): ( grains["locale_info"]["defaultlanguage"], grains["locale_info"]["defaultencoding"], - ) = salt.utils.locales.getdefaultlocale() + ) = locale.getlocale() except Exception: # pylint: disable=broad-except - # locale.getdefaultlocale can ValueError!! Catch anything else it - # might do, per #2205 grains["locale_info"]["defaultlanguage"] = "unknown" grains["locale_info"]["defaultencoding"] = "unknown" grains["locale_info"]["detectedencoding"] = __salt_system_encoding__ diff --git a/salt/utils/locales.py b/salt/utils/locales.py index a380ddbe7a2..43c0f1c68d7 100644 --- a/salt/utils/locales.py +++ b/salt/utils/locales.py @@ -1,7 +1,6 @@ """ the locale utils used by salt """ -import locale import sys from salt.utils.decorators import memoize as real_memoize @@ -82,39 +81,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 a1a414813bbbcadc24f28dc3fde1a21fa76af53b Mon Sep 17 00:00:00 2001 From: cmcmarrow Date: Tue, 30 May 2023 11:13:19 -0500 Subject: [PATCH 058/393] stop double test_labels --- tests/conftest.py | 21 ++++++++++--------- .../modules/state/requisites/test_mixed.py | 1 - .../modules/state/requisites/test_require.py | 1 - .../modules/state/requisites/test_watch.py | 1 - .../functional/modules/state/test_state.py | 4 ---- tests/pytests/integration/cli/test_salt.py | 1 - tests/pytests/integration/cli/test_salt_cp.py | 1 - .../integration/cli/test_salt_deltaproxy.py | 2 -- .../pytests/unit/state/test_state_compiler.py | 1 - .../unit/state/test_state_format_slots.py | 9 -------- 10 files changed, 11 insertions(+), 31 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index a7777c2cea6..2a158df7b2a 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -577,6 +577,12 @@ def pytest_runtest_setup(item): ): item._skipped_by_mark = True pytest.skip(PRE_PYTEST_SKIP_REASON) + test_group_count = sum( + bool(item.get_closest_marker(group)) + for group in ("core_test", "slow_test", "flaky_jail") + ) + if test_group_count > 1: + raise pytest.UsageError("Tests can only be in one test group.") if item.get_closest_marker("core_test"): if not item.config.getoption("--core-tests"): @@ -596,16 +602,11 @@ def pytest_runtest_setup(item): "flaky jail tests are disabled, pass '--flaky-jail' to enable them.", _use_item_location=True, ) - if ( - not item.get_closest_marker("slow_test") - and not item.get_closest_marker("core_test") - and not item.get_closest_marker("flaky_jail") - ): - if not item.config.getoption("--no-fast-tests"): - raise pytest.skip.Exception( - "Fast tests are disabled, dont pass '--no-fast-tests' to enable them.", - _use_item_location=True, - ) + if test_group_count == 0 and not item.config.getoption("--no-fast-tests"): + raise pytest.skip.Exception( + "Fast tests are disabled, dont pass '--no-fast-tests' to enable them.", + _use_item_location=True, + ) requires_sshd_server_marker = item.get_closest_marker("requires_sshd_server") if requires_sshd_server_marker is not None: diff --git a/tests/pytests/functional/modules/state/requisites/test_mixed.py b/tests/pytests/functional/modules/state/requisites/test_mixed.py index 622e73b986e..64db52c2e63 100644 --- a/tests/pytests/functional/modules/state/requisites/test_mixed.py +++ b/tests/pytests/functional/modules/state/requisites/test_mixed.py @@ -322,7 +322,6 @@ def test_issue_46762_prereqs_on_a_state_with_unfulfilled_requirements( @pytest.mark.skip_on_darwin(reason="Test is broken on macosx") -@pytest.mark.slow_test def test_issue_30161_unless_and_onlyif_together(state, state_tree, tmp_path): """ test cmd.run using multiple unless options where the first cmd in the diff --git a/tests/pytests/functional/modules/state/requisites/test_require.py b/tests/pytests/functional/modules/state/requisites/test_require.py index 2fa84704519..b20d9f151ab 100644 --- a/tests/pytests/functional/modules/state/requisites/test_require.py +++ b/tests/pytests/functional/modules/state/requisites/test_require.py @@ -571,7 +571,6 @@ def test_issue_38683_require_order_failhard_combination(state, state_tree): assert ret[state_id].comment == "Failure!" -@pytest.mark.slow_test @pytest.mark.skip_on_windows def test_parallel_state_with_requires(state, state_tree): """ diff --git a/tests/pytests/functional/modules/state/requisites/test_watch.py b/tests/pytests/functional/modules/state/requisites/test_watch.py index 15eb9e8aa53..4b3bd645fa5 100644 --- a/tests/pytests/functional/modules/state/requisites/test_watch.py +++ b/tests/pytests/functional/modules/state/requisites/test_watch.py @@ -57,7 +57,6 @@ def test_watch_in_failure(state, state_tree): ) -@pytest.mark.slow_test def test_requisites_watch_any(state, state_tree): """ Call sls file containing several require_in and require. diff --git a/tests/pytests/functional/modules/state/test_state.py b/tests/pytests/functional/modules/state/test_state.py index 7640afaa882..f049a53c3b3 100644 --- a/tests/pytests/functional/modules/state/test_state.py +++ b/tests/pytests/functional/modules/state/test_state.py @@ -650,7 +650,6 @@ def test_issues_7905_and_8174_sls_syntax_error(state, state_tree): assert ret.errors == ["State 'C' in SLS 'badlist2' is not formed as a list"] -@pytest.mark.slow_test def test_retry_option(state, state_tree): """ test the retry option on a simple state with defaults @@ -752,7 +751,6 @@ def test_retry_option_success_parallel(state, state_tree, tmp_path): assert "Attempt 2" not in state_return.comment -@pytest.mark.slow_test def test_retry_option_eventual_success(state, state_tree, tmp_path): """ test a state with the retry option that should return True, eventually @@ -800,7 +798,6 @@ def test_retry_option_eventual_success(state, state_tree, tmp_path): @pytest.mark.skip_on_windows( reason="Skipped until parallel states can be fixed on Windows" ) -@pytest.mark.slow_test def test_retry_option_eventual_success_parallel(state, state_tree, tmp_path): """ test a state with the retry option that should return True, eventually @@ -849,7 +846,6 @@ def test_retry_option_eventual_success_parallel(state, state_tree, tmp_path): assert "Attempt 5" not in state_return.comment -@pytest.mark.slow_test def test_state_non_base_environment(state, state_tree_prod, tmp_path): """ test state.sls with saltenv using a nonbase environment diff --git a/tests/pytests/integration/cli/test_salt.py b/tests/pytests/integration/cli/test_salt.py index b9ddc6f23f1..8e360682e84 100644 --- a/tests/pytests/integration/cli/test_salt.py +++ b/tests/pytests/integration/cli/test_salt.py @@ -132,7 +132,6 @@ def test_exit_status_correct_usage(salt_cli, salt_minion): assert ret.returncode == salt.defaults.exitcodes.EX_OK, ret -@pytest.mark.slow_test @pytest.mark.skip_on_windows(reason="Windows does not support SIGINT") @pytest.mark.skip_initial_onedir_failure def test_interrupt_on_long_running_job(salt_cli, salt_master, salt_minion): diff --git a/tests/pytests/integration/cli/test_salt_cp.py b/tests/pytests/integration/cli/test_salt_cp.py index db4a1519d66..9c303e7c9b4 100644 --- a/tests/pytests/integration/cli/test_salt_cp.py +++ b/tests/pytests/integration/cli/test_salt_cp.py @@ -32,7 +32,6 @@ def dest_testfile(): dst.unlink() -@pytest.mark.slow_test @pytest.mark.windows_whitelisted @pytest.mark.core_test def test_cp_testfile(salt_minion, salt_cp_cli, source_testfile, dest_testfile): diff --git a/tests/pytests/integration/cli/test_salt_deltaproxy.py b/tests/pytests/integration/cli/test_salt_deltaproxy.py index 85c7aeb7dcc..59071a2d6fa 100644 --- a/tests/pytests/integration/cli/test_salt_deltaproxy.py +++ b/tests/pytests/integration/cli/test_salt_deltaproxy.py @@ -51,7 +51,6 @@ def clear_proxy_minions(salt_master, proxy_minion_id): os.unlink(cachefile) -@pytest.mark.slow_test def test_exit_status_no_proxyid(salt_master, proxy_minion_id): """ Ensure correct exit status when --proxyid argument is missing. @@ -93,7 +92,6 @@ def test_exit_status_unknown_user(salt_master, proxy_minion_id): assert "The user is not available." in exc.value.process_result.stderr -@pytest.mark.slow_test def test_exit_status_unknown_argument(salt_master, proxy_minion_id): """ Ensure correct exit status when an unknown argument is passed to diff --git a/tests/pytests/unit/state/test_state_compiler.py b/tests/pytests/unit/state/test_state_compiler.py index bc96dc9e173..40933183089 100644 --- a/tests/pytests/unit/state/test_state_compiler.py +++ b/tests/pytests/unit/state/test_state_compiler.py @@ -38,7 +38,6 @@ def test_format_log_non_ascii_character(): salt.state.format_log(ret) -@pytest.mark.slow_test def test_render_error_on_invalid_requisite(minion_opts): """ Test that the state compiler correctly deliver a rendering diff --git a/tests/pytests/unit/state/test_state_format_slots.py b/tests/pytests/unit/state/test_state_format_slots.py index 1254994f34b..360f36c88d9 100644 --- a/tests/pytests/unit/state/test_state_format_slots.py +++ b/tests/pytests/unit/state/test_state_format_slots.py @@ -35,7 +35,6 @@ def test_format_slots_no_slots(state_obj): assert cdata == {"args": ["arg"], "kwargs": {"key": "val"}} -@pytest.mark.slow_test def test_format_slots_arg(state_obj): """ Test the format slots is calling a slot specified in args with corresponding arguments. @@ -51,7 +50,6 @@ def test_format_slots_arg(state_obj): assert cdata == {"args": ["fun_return"], "kwargs": {"key": "val"}} -@pytest.mark.slow_test def test_format_slots_dict_arg(state_obj): """ Test the format slots is calling a slot specified in dict arg. @@ -67,7 +65,6 @@ def test_format_slots_dict_arg(state_obj): assert cdata == {"args": [{"subarg": "fun_return"}], "kwargs": {"key": "val"}} -@pytest.mark.slow_test def test_format_slots_listdict_arg(state_obj): """ Test the format slots is calling a slot specified in list containing a dict. @@ -83,7 +80,6 @@ def test_format_slots_listdict_arg(state_obj): assert cdata == {"args": [[{"subarg": "fun_return"}]], "kwargs": {"key": "val"}} -@pytest.mark.slow_test def test_format_slots_liststr_arg(state_obj): """ Test the format slots is calling a slot specified in list containing a dict. @@ -99,7 +95,6 @@ def test_format_slots_liststr_arg(state_obj): assert cdata == {"args": [["fun_return"]], "kwargs": {"key": "val"}} -@pytest.mark.slow_test def test_format_slots_kwarg(state_obj): """ Test the format slots is calling a slot specified in kwargs with corresponding arguments. @@ -115,7 +110,6 @@ def test_format_slots_kwarg(state_obj): assert cdata == {"args": ["arg"], "kwargs": {"key": "fun_return"}} -@pytest.mark.slow_test def test_format_slots_multi(state_obj): """ Test the format slots is calling all slots with corresponding arguments when multiple slots @@ -155,7 +149,6 @@ def test_format_slots_multi(state_obj): } -@pytest.mark.slow_test def test_format_slots_malformed(state_obj): """ Test the format slots keeps malformed slots untouched. @@ -186,7 +179,6 @@ def test_format_slots_malformed(state_obj): assert cdata == sls_data -@pytest.mark.slow_test def test_slot_traverse_dict(state_obj): """ Test the slot parsing of dict response. @@ -203,7 +195,6 @@ def test_slot_traverse_dict(state_obj): assert cdata == {"args": ["arg"], "kwargs": {"key": "value1"}} -@pytest.mark.slow_test def test_slot_append(state_obj): """ Test the slot parsing of dict response. From 115f3f6d6c76cdf5d129060bf1875b07f583cb3b Mon Sep 17 00:00:00 2001 From: Charles McMarrow Date: Tue, 20 Jun 2023 16:38:10 -0500 Subject: [PATCH 059/393] Update conftest.py error msg --- tests/conftest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/conftest.py b/tests/conftest.py index 2a158df7b2a..c7c49f51e49 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -582,7 +582,7 @@ def pytest_runtest_setup(item): for group in ("core_test", "slow_test", "flaky_jail") ) if test_group_count > 1: - raise pytest.UsageError("Tests can only be in one test group.") + raise pytest.UsageError("Tests can only be in one test group. ('core_test', 'slow_test', 'flaky_jail')") if item.get_closest_marker("core_test"): if not item.config.getoption("--core-tests"): From ffa67b257ce5da9e5cf215434a4e35886a58e683 Mon Sep 17 00:00:00 2001 From: Charles McMarrow Date: Tue, 20 Jun 2023 17:06:25 -0500 Subject: [PATCH 060/393] Update conftest.py --- tests/conftest.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/conftest.py b/tests/conftest.py index c7c49f51e49..cda06ae995d 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -582,7 +582,9 @@ def pytest_runtest_setup(item): for group in ("core_test", "slow_test", "flaky_jail") ) if test_group_count > 1: - raise pytest.UsageError("Tests can only be in one test group. ('core_test', 'slow_test', 'flaky_jail')") + raise pytest.UsageError( + "Tests can only be in one test group. ('core_test', 'slow_test', 'flaky_jail')" + ) if item.get_closest_marker("core_test"): if not item.config.getoption("--core-tests"): From 1f8dc3c510d8d40c4e9d9afd369db685202d5182 Mon Sep 17 00:00:00 2001 From: cmcmarrow Date: Tue, 27 Jun 2023 23:12:11 -0500 Subject: [PATCH 061/393] allow flaky to double group --- tests/conftest.py | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index cda06ae995d..a00dd3cd0fd 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -578,37 +578,37 @@ def pytest_runtest_setup(item): item._skipped_by_mark = True pytest.skip(PRE_PYTEST_SKIP_REASON) test_group_count = sum( - bool(item.get_closest_marker(group)) - for group in ("core_test", "slow_test", "flaky_jail") + bool(item.get_closest_marker(group)) for group in ("core_test", "slow_test") ) - if test_group_count > 1: + if item.get_closest_marker("core_test") and item.get_closest_marker("slow_test"): raise pytest.UsageError( - "Tests can only be in one test group. ('core_test', 'slow_test', 'flaky_jail')" + "Tests can only be in one test group. ('core_test', 'slow_test')" ) - if item.get_closest_marker("core_test"): - if not item.config.getoption("--core-tests"): - raise pytest.skip.Exception( - "Core tests are disabled, pass '--core-tests' to enable them.", - _use_item_location=True, - ) - if item.get_closest_marker("slow_test"): - if not item.config.getoption("--slow-tests"): - raise pytest.skip.Exception( - "Slow tests are disabled, pass '--run-slow' to enable them.", - _use_item_location=True, - ) if item.get_closest_marker("flaky_jail"): if not item.config.getoption("--flaky-jail"): raise pytest.skip.Exception( "flaky jail tests are disabled, pass '--flaky-jail' to enable them.", _use_item_location=True, ) - if test_group_count == 0 and not item.config.getoption("--no-fast-tests"): - raise pytest.skip.Exception( - "Fast tests are disabled, dont pass '--no-fast-tests' to enable them.", - _use_item_location=True, - ) + else: + if item.get_closest_marker("core_test"): + if not item.config.getoption("--core-tests"): + raise pytest.skip.Exception( + "Core tests are disabled, pass '--core-tests' to enable them.", + _use_item_location=True, + ) + if item.get_closest_marker("slow_test"): + if not item.config.getoption("--slow-tests"): + raise pytest.skip.Exception( + "Slow tests are disabled, pass '--run-slow' to enable them.", + _use_item_location=True, + ) + if test_group_count == 0 and not item.config.getoption("--no-fast-tests"): + raise pytest.skip.Exception( + "Fast tests have been disabled by '--no-fast-tests'.", + _use_item_location=True, + ) requires_sshd_server_marker = item.get_closest_marker("requires_sshd_server") if requires_sshd_server_marker is not None: From a7b178beca324fc00e8ea380041447c7777a612f Mon Sep 17 00:00:00 2001 From: Charles McMarrow Date: Wed, 28 Jun 2023 11:13:45 -0500 Subject: [PATCH 062/393] Fix Fast Tests --- tests/conftest.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index a00dd3cd0fd..7f8d171478d 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -578,7 +578,7 @@ def pytest_runtest_setup(item): item._skipped_by_mark = True pytest.skip(PRE_PYTEST_SKIP_REASON) test_group_count = sum( - bool(item.get_closest_marker(group)) for group in ("core_test", "slow_test") + bool(item.get_closest_marker(group)) for group in ("core_test", "slow_test", "flaky_jail") ) if item.get_closest_marker("core_test") and item.get_closest_marker("slow_test"): raise pytest.UsageError( @@ -604,7 +604,7 @@ def pytest_runtest_setup(item): "Slow tests are disabled, pass '--run-slow' to enable them.", _use_item_location=True, ) - if test_group_count == 0 and not item.config.getoption("--no-fast-tests"): + if test_group_count == 0 and item.config.getoption("--no-fast-tests"): raise pytest.skip.Exception( "Fast tests have been disabled by '--no-fast-tests'.", _use_item_location=True, From 8869972f075ca409e96a6fd4369c1447866c168d Mon Sep 17 00:00:00 2001 From: Charles McMarrow Date: Wed, 28 Jun 2023 14:01:54 -0500 Subject: [PATCH 063/393] fix pre --- tests/conftest.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/conftest.py b/tests/conftest.py index 7f8d171478d..1bb55aabee3 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -578,7 +578,8 @@ def pytest_runtest_setup(item): item._skipped_by_mark = True pytest.skip(PRE_PYTEST_SKIP_REASON) test_group_count = sum( - bool(item.get_closest_marker(group)) for group in ("core_test", "slow_test", "flaky_jail") + bool(item.get_closest_marker(group)) + for group in ("core_test", "slow_test", "flaky_jail") ) if item.get_closest_marker("core_test") and item.get_closest_marker("slow_test"): raise pytest.UsageError( From 2e962677b74be461c31606459a43bafd2d15e69b Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Thu, 29 Jun 2023 09:41:56 +0100 Subject: [PATCH 064/393] Run `pyupgrade` against the changes from the merge-forward Signed-off-by: Pedro Algarvio --- .../modules/state/requisites/test_mixed.py | 12 ++-- .../modules/state/requisites/test_require.py | 2 +- .../modules/state/requisites/test_watch.py | 32 +++++------ .../functional/modules/state/test_state.py | 6 +- tests/pytests/integration/cli/test_salt.py | 2 +- .../integration/cli/test_salt_deltaproxy.py | 24 ++++---- tests/pytests/integration/states/test_file.py | 55 ++++++++----------- .../pytests/unit/state/test_state_compiler.py | 4 +- 8 files changed, 62 insertions(+), 75 deletions(-) diff --git a/tests/pytests/functional/modules/state/requisites/test_mixed.py b/tests/pytests/functional/modules/state/requisites/test_mixed.py index 64db52c2e63..20bc6662496 100644 --- a/tests/pytests/functional/modules/state/requisites/test_mixed.py +++ b/tests/pytests/functional/modules/state/requisites/test_mixed.py @@ -369,21 +369,21 @@ def test_issue_30161_unless_and_onlyif_together(state, state_tree, tmp_path): # then the unless state run bailed out after the first unless command succeeded, # which is the bug we're regression testing for. _expected = { - "file_|-unless_false_onlyif_false_|-{}_|-managed".format(test_txt_path): { + f"file_|-unless_false_onlyif_false_|-{test_txt_path}_|-managed": { "comment": "onlyif condition is false\nunless condition is false", - "name": "{}".format(test_txt_path), + "name": f"{test_txt_path}", "skip_watch": True, "changes": {}, "result": True, }, - "file_|-unless_false_onlyif_true_|-{}_|-managed".format(test_txt_path): { + f"file_|-unless_false_onlyif_true_|-{test_txt_path}_|-managed": { "comment": "Empty file", "name": str(test_txt_path), "start_time": "18:10:20.341753", "result": True, - "changes": {"new": "file {} created".format(test_txt_path)}, + "changes": {"new": f"file {test_txt_path} created"}, }, - "file_|-unless_true_onlyif_false_|-{}_|-managed".format(test_txt_path): { + f"file_|-unless_true_onlyif_false_|-{test_txt_path}_|-managed": { "comment": "onlyif condition is false\nunless condition is true", "name": str(test_txt_path), "start_time": "18:10:22.936446", @@ -391,7 +391,7 @@ def test_issue_30161_unless_and_onlyif_together(state, state_tree, tmp_path): "changes": {}, "result": True, }, - "file_|-unless_true_onlyif_true_|-{}_|-managed".format(test_txt_path): { + f"file_|-unless_true_onlyif_true_|-{test_txt_path}_|-managed": { "comment": "onlyif condition is true\nunless condition is true", "name": str(test_txt_path), "skip_watch": True, diff --git a/tests/pytests/functional/modules/state/requisites/test_require.py b/tests/pytests/functional/modules/state/requisites/test_require.py index b20d9f151ab..5c041630573 100644 --- a/tests/pytests/functional/modules/state/requisites/test_require.py +++ b/tests/pytests/functional/modules/state/requisites/test_require.py @@ -609,7 +609,7 @@ def test_parallel_state_with_requires(state, state_tree): assert (end_time - start_time) < 30 for item in range(1, 10): - _id = "cmd_|-blah-{}_|-sleep 2_|-run".format(item) + _id = f"cmd_|-blah-{item}_|-sleep 2_|-run" assert "__parallel__" in ret[_id] diff --git a/tests/pytests/functional/modules/state/requisites/test_watch.py b/tests/pytests/functional/modules/state/requisites/test_watch.py index 4b3bd645fa5..c1151599498 100644 --- a/tests/pytests/functional/modules/state/requisites/test_watch.py +++ b/tests/pytests/functional/modules/state/requisites/test_watch.py @@ -113,51 +113,51 @@ def test_requisites_watch_any(state, state_tree): cmd_true=cmd_true, cmd_false=cmd_false ) expected_result = { - "cmd_|-A_|-{}_|-wait".format(cmd_true): { + f"cmd_|-A_|-{cmd_true}_|-wait": { "__run_num__": 4, - "comment": 'Command "{}" run'.format(cmd_true), + "comment": f'Command "{cmd_true}" run', "result": True, "changes": True, }, - "cmd_|-B_|-{}_|-run".format(cmd_true): { + f"cmd_|-B_|-{cmd_true}_|-run": { "__run_num__": 0, - "comment": 'Command "{}" run'.format(cmd_true), + "comment": f'Command "{cmd_true}" run', "result": True, "changes": True, }, - "cmd_|-C_|-{}_|-run".format(cmd_false): { + f"cmd_|-C_|-{cmd_false}_|-run": { "__run_num__": 1, - "comment": 'Command "{}" run'.format(cmd_false), + "comment": f'Command "{cmd_false}" run', "result": False, "changes": True, }, - "cmd_|-D_|-{}_|-run".format(cmd_true): { + f"cmd_|-D_|-{cmd_true}_|-run": { "__run_num__": 2, - "comment": 'Command "{}" run'.format(cmd_true), + "comment": f'Command "{cmd_true}" run', "result": True, "changes": True, }, - "cmd_|-E_|-{}_|-wait".format(cmd_true): { + f"cmd_|-E_|-{cmd_true}_|-wait": { "__run_num__": 9, - "comment": 'Command "{}" run'.format(cmd_true), + "comment": f'Command "{cmd_true}" run', "result": True, "changes": True, }, - "cmd_|-F_|-{}_|-run".format(cmd_true): { + f"cmd_|-F_|-{cmd_true}_|-run": { "__run_num__": 5, - "comment": 'Command "{}" run'.format(cmd_true), + "comment": f'Command "{cmd_true}" run', "result": True, "changes": True, }, - "cmd_|-G_|-{}_|-run".format(cmd_false): { + f"cmd_|-G_|-{cmd_false}_|-run": { "__run_num__": 6, - "comment": 'Command "{}" run'.format(cmd_false), + "comment": f'Command "{cmd_false}" run', "result": False, "changes": True, }, - "cmd_|-H_|-{}_|-run".format(cmd_false): { + f"cmd_|-H_|-{cmd_false}_|-run": { "__run_num__": 7, - "comment": 'Command "{}" run'.format(cmd_false), + "comment": f'Command "{cmd_false}" run', "result": False, "changes": True, }, diff --git a/tests/pytests/functional/modules/state/test_state.py b/tests/pytests/functional/modules/state/test_state.py index f049a53c3b3..42a5ad2fd3e 100644 --- a/tests/pytests/functional/modules/state/test_state.py +++ b/tests/pytests/functional/modules/state/test_state.py @@ -904,10 +904,8 @@ def test_parallel_state_with_long_tag(state, state_tree): ) comments = sorted(x.comment for x in ret) - expected = sorted( - 'Command "{}" run'.format(x) for x in (short_command, long_command) - ) - assert comments == expected, "{} != {}".format(comments, expected) + expected = sorted(f'Command "{x}" run' for x in (short_command, long_command)) + assert comments == expected, f"{comments} != {expected}" @pytest.mark.skip_on_darwin(reason="Test is broken on macosx") diff --git a/tests/pytests/integration/cli/test_salt.py b/tests/pytests/integration/cli/test_salt.py index 8e360682e84..fa28e3bce3d 100644 --- a/tests/pytests/integration/cli/test_salt.py +++ b/tests/pytests/integration/cli/test_salt.py @@ -155,7 +155,7 @@ def test_interrupt_on_long_running_job(salt_cli, salt_master, salt_minion): cmdline = [ sys.executable, salt_cli.get_script_path(), - "--config-dir={}".format(salt_master.config_dir), + f"--config-dir={salt_master.config_dir}", salt_minion.id, "test.sleep", "30", diff --git a/tests/pytests/integration/cli/test_salt_deltaproxy.py b/tests/pytests/integration/cli/test_salt_deltaproxy.py index 59071a2d6fa..6ada4437595 100644 --- a/tests/pytests/integration/cli/test_salt_deltaproxy.py +++ b/tests/pytests/integration/cli/test_salt_deltaproxy.py @@ -44,9 +44,7 @@ def clear_proxy_minions(salt_master, proxy_minion_id): for proxy in [proxy_minion_id, "dummy_proxy_one", "dummy_proxy_two"]: pytest.helpers.remove_stale_minion_key(salt_master, proxy) - cachefile = os.path.join( - salt_master.config["cachedir"], "{}.cache".format(proxy) - ) + cachefile = os.path.join(salt_master.config["cachedir"], f"{proxy}.cache") if os.path.exists(cachefile): os.unlink(cachefile) @@ -181,11 +179,11 @@ def test_exit_status_correct_usage( "controlproxy.sls", controlproxy_pillar_file ) dummy_proxy_one_tempfile = salt_master.pillar_tree.base.temp_file( - "{}.sls".format(proxy_one), + f"{proxy_one}.sls", dummy_proxy_one_pillar_file, ) dummy_proxy_two_tempfile = salt_master.pillar_tree.base.temp_file( - "{}.sls".format(proxy_two), + f"{proxy_two}.sls", dummy_proxy_two_pillar_file, ) with top_tempfile, controlproxy_tempfile, dummy_proxy_one_tempfile, dummy_proxy_two_tempfile: @@ -288,7 +286,7 @@ def test_missing_pillar_file( "controlproxy.sls", controlproxy_pillar_file ) dummy_proxy_one_tempfile = salt_master.pillar_tree.base.temp_file( - "{}.sls".format(proxy_one), + f"{proxy_one}.sls", dummy_proxy_one_pillar_file, ) with top_tempfile, controlproxy_tempfile, dummy_proxy_one_tempfile: @@ -406,14 +404,14 @@ def test_invalid_connection( "controlproxy.sls", controlproxy_pillar_file ) dummy_proxy_one_tempfile = salt_master.pillar_tree.base.temp_file( - "{}.sls".format(proxy_one), + f"{proxy_one}.sls", dummy_proxy_one_pillar_file, ) broken_proxy_one_tempfile = salt_master.pillar_tree.base.temp_file( - "{}.sls".format(broken_proxy_one), broken_proxy_one_pillar_file + f"{broken_proxy_one}.sls", broken_proxy_one_pillar_file ) broken_proxy_two_tempfile = salt_master.pillar_tree.base.temp_file( - "{}.sls".format(broken_proxy_two), broken_proxy_two_pillar_file + f"{broken_proxy_two}.sls", broken_proxy_two_pillar_file ) with top_tempfile, controlproxy_tempfile, dummy_proxy_one_tempfile, broken_proxy_one_tempfile, broken_proxy_two_tempfile: factory = salt_master.salt_proxy_minion_daemon( @@ -534,11 +532,11 @@ def ping(): "controlproxy.sls", controlproxy_pillar_file ) dummy_proxy_one_tempfile = salt_master.pillar_tree.base.temp_file( - "{}.sls".format(proxy_one), + f"{proxy_one}.sls", dummy_proxy_one_pillar_file, ) dummy_proxy_two_tempfile = salt_master.pillar_tree.base.temp_file( - "{}.sls".format(proxy_two), + f"{proxy_two}.sls", dummy_proxy_two_pillar_file, ) @@ -668,11 +666,11 @@ def ping(): "controlproxy.sls", controlproxy_pillar_file ) dummy_proxy_one_tempfile = salt_master.pillar_tree.base.temp_file( - "{}.sls".format(proxy_one), + f"{proxy_one}.sls", dummy_proxy_one_pillar_file, ) dummy_proxy_two_tempfile = salt_master.pillar_tree.base.temp_file( - "{}.sls".format(proxy_two), + f"{proxy_two}.sls", dummy_proxy_two_pillar_file, ) diff --git a/tests/pytests/integration/states/test_file.py b/tests/pytests/integration/states/test_file.py index ec8aafb299d..a84d2f4797e 100644 --- a/tests/pytests/integration/states/test_file.py +++ b/tests/pytests/integration/states/test_file.py @@ -293,7 +293,7 @@ def test_contents_pillar_with_pillar_list(salt_master, salt_call_cli, tmp_path): target_path ) sls_tempfile = salt_master.state_tree.base.temp_file( - "{}.sls".format(sls_name), sls_contents + f"{sls_name}.sls", sls_contents ) with sls_tempfile: ret = salt_call_cli.run("state.sls", sls_name) @@ -315,7 +315,7 @@ def test_managed_file_with_pillar_sls(salt_master, salt_call_cli, tmp_path): assert ret.returncode == 0 assert ret.data - target_path = tmp_path / "file-pillar-{}-target.txt".format(ret.data) + target_path = tmp_path / f"file-pillar-{ret.data}-target.txt" sls_name = "file-pillar-get" sls_contents = ( """ @@ -329,7 +329,7 @@ def test_managed_file_with_pillar_sls(salt_master, salt_call_cli, tmp_path): """ ) sls_tempfile = salt_master.state_tree.base.temp_file( - "{}.sls".format(sls_name), sls_contents + f"{sls_name}.sls", sls_contents ) with sls_tempfile: ret = salt_call_cli.run("state.sls", sls_name) @@ -358,7 +358,7 @@ def test_issue_50221( - contents_pillar: issue-50221 """ sls_tempfile = salt_master.state_tree.base.temp_file( - "{}.sls".format(sls_name), sls_contents + f"{sls_name}.sls", sls_contents ) issue_50221_ext_pillar_tempfile = pytest.helpers.temp_file( "issue-50221", @@ -421,11 +421,11 @@ def test_issue_60426( ) sls_tempfile = salt_master.state_tree.base.temp_file( - "{}.sls".format(sls_name), sls_contents + f"{sls_name}.sls", sls_contents ) jinja_tempfile = salt_master.state_tree.base.temp_file( - "{}.jinja".format(jinja_name), jinja_contents + f"{jinja_name}.jinja", jinja_contents ) with sls_tempfile, jinja_tempfile: @@ -462,11 +462,11 @@ def test_issue_60426( ) sls_tempfile = salt_master.state_tree.base.temp_file( - "{}.sls".format(sls_name), sls_contents + f"{sls_name}.sls", sls_contents ) jinja_tempfile = salt_master.state_tree.base.temp_file( - "{}.jinja".format(jinja_name), jinja_contents + f"{jinja_name}.jinja", jinja_contents ) with sls_tempfile, jinja_tempfile: @@ -700,9 +700,10 @@ def test_patch_saltenv(salt_call_cli, content, math_patch_file, salt_master, tmp # Check to make sure the patch was applied okay state_run = next(iter(ret.data.values())) assert state_run["result"] is False - assert state_run[ - "comment" - ] == "Source file {} not found in saltenv 'prod'".format(math_patch_file) + assert ( + state_run["comment"] + == f"Source file {math_patch_file} not found in saltenv 'prod'" + ) @pytest.mark.skip_unless_on_windows @@ -774,9 +775,7 @@ def test_patch_single_file_failure( state_run = next(iter(ret.data.values())) assert "Patch would not apply cleanly" in state_run["comment"] assert ( - re.match( - state_run["comment"], "saving rejects to (file )?{}".format(reject_file) - ) + re.match(state_run["comment"], f"saving rejects to (file )?{reject_file}") is None ) @@ -849,9 +848,7 @@ def test_patch_directory_failure( state_run = next(iter(ret.data.values())) assert "Patch would not apply cleanly" in state_run["comment"] assert ( - re.match( - state_run["comment"], "saving rejects to (file )?{}".format(reject_file) - ) + re.match(state_run["comment"], f"saving rejects to (file )?{reject_file}") is None ) @@ -1067,7 +1064,7 @@ def test_recurse( test_tempdir = salt_master.state_tree.base.write_path / "tmp_dir" test_tempdir.mkdir(parents=True, exist_ok=True) sls_tempfile = salt_master.state_tree.base.temp_file( - "{}.sls".format(sls_name), sls_contents + f"{sls_name}.sls", sls_contents ) with sls_tempfile: @@ -1114,7 +1111,7 @@ def test_recurse_keep_symlinks_in_fileserver_root( test_tempdir = salt_master.state_tree.base.write_path / "tmp_dir" test_tempdir.mkdir(parents=True, exist_ok=True) sls_tempfile = salt_master.state_tree.base.temp_file( - "{}.sls".format(sls_name), sls_contents + f"{sls_name}.sls", sls_contents ) with sls_tempfile: @@ -1166,7 +1163,7 @@ def test_recurse_keep_symlinks_outside_fileserver_root( test_tempdir = salt_secondary_master.state_tree.base.write_path / "tmp_dir" test_tempdir.mkdir(parents=True, exist_ok=True) sls_tempfile = salt_secondary_master.state_tree.base.temp_file( - "{}.sls".format(sls_name), sls_contents + f"{sls_name}.sls", sls_contents ) with sls_tempfile: @@ -1218,17 +1215,13 @@ def test_issue_62117( - name: pwd """ - yaml_tempfile = salt_master.state_tree.base.temp_file( - "{}.yaml".format(name), yaml_contents - ) + yaml_tempfile = salt_master.state_tree.base.temp_file(f"{name}.yaml", yaml_contents) jinja_tempfile = salt_master.state_tree.base.temp_file( - "{}.jinja".format(name), jinja_contents + f"{name}.jinja", jinja_contents ) - sls_tempfile = salt_master.state_tree.base.temp_file( - "{}.sls".format(name), sls_contents - ) + sls_tempfile = salt_master.state_tree.base.temp_file(f"{name}.sls", sls_contents) with yaml_tempfile, jinja_tempfile, sls_tempfile: ret = salt_call_cli.run("--local", "state.apply", name.replace("/", ".")) @@ -1264,12 +1257,10 @@ def test_issue_62611( ) jinja_tempfile = salt_master.state_tree.base.temp_file( - "{}.jinja".format(name), jinja_contents + f"{name}.jinja", jinja_contents ) - sls_tempfile = salt_master.state_tree.base.temp_file( - "{}.sls".format(name), sls_contents - ) + sls_tempfile = salt_master.state_tree.base.temp_file(f"{name}.sls", sls_contents) with jinja_tempfile, sls_tempfile: ret = salt_call_cli.run("--local", "state.apply", name.replace("/", ".")) @@ -1296,7 +1287,7 @@ def test_contents_file(salt_master, salt_call_cli, tmp_path): target_path ) sls_tempfile = salt_master.state_tree.base.temp_file( - "{}.sls".format(sls_name), sls_contents + f"{sls_name}.sls", sls_contents ) with sls_tempfile: for i in range(1, 4): diff --git a/tests/pytests/unit/state/test_state_compiler.py b/tests/pytests/unit/state/test_state_compiler.py index 40933183089..eedfda718b5 100644 --- a/tests/pytests/unit/state/test_state_compiler.py +++ b/tests/pytests/unit/state/test_state_compiler.py @@ -530,7 +530,7 @@ def test_verify_onlyif_parse_slots(tmp_path, minion_opts): "onlyif": [ { "fun": "file.search", - "args": ["__slot__:salt:test.echo({})".format(_expand_win_path(name))], + "args": [f"__slot__:salt:test.echo({_expand_win_path(name)})"], "pattern": "__slot__:salt:test.echo(file-contents)", } ], @@ -632,7 +632,7 @@ def test_verify_unless_parse_slots(tmp_path, minion_opts): "unless": [ { "fun": "file.search", - "args": ["__slot__:salt:test.echo({})".format(_expand_win_path(name))], + "args": [f"__slot__:salt:test.echo({_expand_win_path(name)})"], "pattern": "__slot__:salt:test.echo(file-contents)", } ], From 5289a2d50a85591fb8b4f8f86e723317a9cd960f Mon Sep 17 00:00:00 2001 From: MKLeb Date: Thu, 15 Jun 2023 17:43:16 -0400 Subject: [PATCH 065/393] Add `get-latest-release` command so we can dynamically get the previous versions to test upgrades and downgrades for --- tools/ci.py | 67 ++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 66 insertions(+), 1 deletion(-) diff --git a/tools/ci.py b/tools/ci.py index 60df792d25fb..599108c795a 100644 --- a/tools/ci.py +++ b/tools/ci.py @@ -12,6 +12,7 @@ import sys import time from typing import TYPE_CHECKING, Any +import requests from ptscripts import Context, command_group import tools.utils @@ -674,7 +675,7 @@ def pkg_matrix(ctx: Context, distro_slug: str, pkg_type: str): and pkg_type != "MSI" ): # These OS's never had arm64 packages built for them - # with the tiamate onedir packages. + # with the tiamat onedir packages. # we will need to ensure when we release 3006.0 # we allow for 3006.0 jobs to run, because then # we will have arm64 onedir packages to upgrade from @@ -840,3 +841,67 @@ def _filter_test_labels(labels: list[dict[str, Any]]) -> list[tuple[str, str]]: for label in labels if label["name"].startswith("test:") ] + + +@ci.command( + name="get-latest-releases", + arguments={ + "salt_version": { + "help": "The version of salt being tested against", + }, + "repository": { + "help": "The repository to query for releases, e.g. saltstack/salt", + }, + }, +) +def get_latest_releases( + ctx: Context, salt_version: str, repository: str = "saltstack/salt" +): + """ + Get a list of releases to use for the upgrade and downgrade tests. + """ + github_output = os.environ.get("GITHUB_OUTPUT") + if github_output is None: + ctx.exit(1, "The 'GITHUB_OUTPUT' variable is not set.") + else: + # We aren't testing upgrades from anything before 3006.0 except the latest 3005.x + threshold_major = 3006 + parsed_salt_version = tools.utils.Version(salt_version) + releases = tools.utils.get_salt_releases(ctx, repository) + # We want the latest 4 major versions, removing the oldest if this version is a new major + num_major_versions = 4 + if parsed_salt_version.minor == 0: + num_major_versions = 3 + majors = sorted( + list( + { + version.major + for version in releases + if version.major >= threshold_major + } + ) + )[-num_major_versions:] + latest_releases = [] + # Append the latest minor for each major + for major in majors: + minors_of_major = [ + version for version in releases if version.major == major + ] + latest_releases.append(minors_of_major[-1]) + + # TODO: Remove this block when we reach version 3009.0 + # Append the latest minor version of 3005 if we don't have enough major versions to test against + if len(latest_releases) != num_major_versions: + url = "https://repo.saltproject.io/salt/onedir/repo.json" + ret = requests.get(url) + repo_data = ret.json() + latest = list(repo_data["latest"].keys())[0] + version = repo_data["latest"][latest]["version"] + latest_releases = [version] + latest_releases + + str_releases = [str(version) for version in latest_releases] + + with open(github_output, "a", encoding="utf-8") as wfh: + wfh.write(f"latest-releases={json.dumps(str_releases)}\n") + + ctx.exit(0) From 350c9982ff744d8824c83fd3832683bca59fbff6 Mon Sep 17 00:00:00 2001 From: MKLeb Date: Fri, 16 Jun 2023 09:50:44 -0400 Subject: [PATCH 066/393] Use `ctx.web` for requests and require the `--salt-version` kwarg --- tools/ci.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/ci.py b/tools/ci.py index 599108c795a..b31876123f4 100644 --- a/tools/ci.py +++ b/tools/ci.py @@ -12,7 +12,6 @@ import sys import time from typing import TYPE_CHECKING, Any -import requests from ptscripts import Context, command_group import tools.utils @@ -848,6 +847,7 @@ def _filter_test_labels(labels: list[dict[str, Any]]) -> list[tuple[str, str]]: arguments={ "salt_version": { "help": "The version of salt being tested against", + "required": True, }, "repository": { "help": "The repository to query for releases, e.g. saltstack/salt", @@ -855,7 +855,7 @@ def _filter_test_labels(labels: list[dict[str, Any]]) -> list[tuple[str, str]]: }, ) def get_latest_releases( - ctx: Context, salt_version: str, repository: str = "saltstack/salt" + ctx: Context, salt_version: str = None, repository: str = "saltstack/salt" ): """ Get a list of releases to use for the upgrade and downgrade tests. @@ -893,7 +893,7 @@ def get_latest_releases( # Append the latest minor version of 3005 if we don't have enough major versions to test against if len(latest_releases) != num_major_versions: url = "https://repo.saltproject.io/salt/onedir/repo.json" - ret = requests.get(url) + ret = ctx.web.get(url) repo_data = ret.json() latest = list(repo_data["latest"].keys())[0] version = repo_data["latest"][latest]["version"] From 6b55d991544664a53cae9e7f59ab86dbabf324e2 Mon Sep 17 00:00:00 2001 From: MKLeb Date: Tue, 20 Jun 2023 14:31:10 -0400 Subject: [PATCH 067/393] Pass the list of Salt releases from the prior step that queried the GH API --- .github/workflows/ci.yml | 9 +++++++++ .github/workflows/nightly.yml | 9 +++++++++ .github/workflows/scheduled.yml | 9 +++++++++ .github/workflows/staging.yml | 9 +++++++++ .github/workflows/templates/layout.yml.jinja | 9 +++++++++ tools/ci.py | 12 +++++++----- 6 files changed, 52 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 62169d623d6..b0213ff9b74 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -46,6 +46,7 @@ jobs: cache-seed: ${{ steps.set-cache-seed.outputs.cache-seed }} latest-release: ${{ steps.get-salt-releases.outputs.latest-release }} releases: ${{ steps.get-salt-releases.outputs.releases }} + test-releases: ${{ steps.get-latest-releases.outputs.latest-releases }} steps: - uses: actions/checkout@v3 with: @@ -198,10 +199,18 @@ jobs: run: | tools ci get-releases + - name: Get Latest Salt Releases for Testing + id: get-latest-releases + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + tools ci get-latest-releases ${{ fromJSON(steps.get-salt-releases.outputs.releases) }} --salt-version ${{ steps.setup-salt-version.outputs.salt-version }} + - name: Check Salt Releases run: | echo '${{ steps.get-salt-releases.outputs.latest-release }}' | jq -C '.' echo '${{ steps.get-salt-releases.outputs.releases }}' | jq -C '.' + echo '${{ steps.get-latest-releases.outputs.latest-releases }}' | jq -C '.' - name: Define Testrun id: define-testrun diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 21698717927..80225eedafe 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -92,6 +92,7 @@ jobs: cache-seed: ${{ steps.set-cache-seed.outputs.cache-seed }} latest-release: ${{ steps.get-salt-releases.outputs.latest-release }} releases: ${{ steps.get-salt-releases.outputs.releases }} + test-releases: ${{ steps.get-latest-releases.outputs.latest-releases }} steps: - uses: actions/checkout@v3 with: @@ -244,10 +245,18 @@ jobs: run: | tools ci get-releases + - name: Get Latest Salt Releases for Testing + id: get-latest-releases + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + tools ci get-latest-releases ${{ fromJSON(steps.get-salt-releases.outputs.releases) }} --salt-version ${{ steps.setup-salt-version.outputs.salt-version }} + - name: Check Salt Releases run: | echo '${{ steps.get-salt-releases.outputs.latest-release }}' | jq -C '.' echo '${{ steps.get-salt-releases.outputs.releases }}' | jq -C '.' + echo '${{ steps.get-latest-releases.outputs.latest-releases }}' | jq -C '.' - name: Define Testrun id: define-testrun diff --git a/.github/workflows/scheduled.yml b/.github/workflows/scheduled.yml index 2dd28b76e10..4e88c0bd5c9 100644 --- a/.github/workflows/scheduled.yml +++ b/.github/workflows/scheduled.yml @@ -82,6 +82,7 @@ jobs: cache-seed: ${{ steps.set-cache-seed.outputs.cache-seed }} latest-release: ${{ steps.get-salt-releases.outputs.latest-release }} releases: ${{ steps.get-salt-releases.outputs.releases }} + test-releases: ${{ steps.get-latest-releases.outputs.latest-releases }} steps: - uses: actions/checkout@v3 with: @@ -234,10 +235,18 @@ jobs: run: | tools ci get-releases + - name: Get Latest Salt Releases for Testing + id: get-latest-releases + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + tools ci get-latest-releases ${{ fromJSON(steps.get-salt-releases.outputs.releases) }} --salt-version ${{ steps.setup-salt-version.outputs.salt-version }} + - name: Check Salt Releases run: | echo '${{ steps.get-salt-releases.outputs.latest-release }}' | jq -C '.' echo '${{ steps.get-salt-releases.outputs.releases }}' | jq -C '.' + echo '${{ steps.get-latest-releases.outputs.latest-releases }}' | jq -C '.' - name: Define Testrun id: define-testrun diff --git a/.github/workflows/staging.yml b/.github/workflows/staging.yml index 318f801d9c0..54a65321bb0 100644 --- a/.github/workflows/staging.yml +++ b/.github/workflows/staging.yml @@ -72,6 +72,7 @@ jobs: cache-seed: ${{ steps.set-cache-seed.outputs.cache-seed }} latest-release: ${{ steps.get-salt-releases.outputs.latest-release }} releases: ${{ steps.get-salt-releases.outputs.releases }} + test-releases: ${{ steps.get-latest-releases.outputs.latest-releases }} steps: - uses: actions/checkout@v3 with: @@ -230,10 +231,18 @@ jobs: run: | tools ci get-releases + - name: Get Latest Salt Releases for Testing + id: get-latest-releases + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + tools ci get-latest-releases ${{ fromJSON(steps.get-salt-releases.outputs.releases) }} --salt-version ${{ steps.setup-salt-version.outputs.salt-version }} + - name: Check Salt Releases run: | echo '${{ steps.get-salt-releases.outputs.latest-release }}' | jq -C '.' echo '${{ steps.get-salt-releases.outputs.releases }}' | jq -C '.' + echo '${{ steps.get-latest-releases.outputs.latest-releases }}' | jq -C '.' - name: Define Testrun id: define-testrun diff --git a/.github/workflows/templates/layout.yml.jinja b/.github/workflows/templates/layout.yml.jinja index 426fae6a3d9..a01b1528719 100644 --- a/.github/workflows/templates/layout.yml.jinja +++ b/.github/workflows/templates/layout.yml.jinja @@ -91,6 +91,7 @@ jobs: cache-seed: ${{ steps.set-cache-seed.outputs.cache-seed }} latest-release: ${{ steps.get-salt-releases.outputs.latest-release }} releases: ${{ steps.get-salt-releases.outputs.releases }} + test-releases: ${{ steps.get-latest-releases.outputs.latest-releases }} steps: - uses: actions/checkout@v3 with: @@ -255,10 +256,18 @@ jobs: run: | tools ci get-releases + - name: Get Latest Salt Releases for Testing + id: get-latest-releases + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + tools ci get-latest-releases ${{ fromJSON(steps.get-salt-releases.outputs.releases) }} --salt-version ${{ steps.setup-salt-version.outputs.salt-version }} + - name: Check Salt Releases run: | echo '${{ steps.get-salt-releases.outputs.latest-release }}' | jq -C '.' echo '${{ steps.get-salt-releases.outputs.releases }}' | jq -C '.' + echo '${{ steps.get-latest-releases.outputs.latest-releases }}' | jq -C '.' - name: Define Testrun id: define-testrun diff --git a/tools/ci.py b/tools/ci.py index b31876123f4..c0d2faa90ce 100644 --- a/tools/ci.py +++ b/tools/ci.py @@ -845,17 +845,20 @@ def _filter_test_labels(labels: list[dict[str, Any]]) -> list[tuple[str, str]]: @ci.command( name="get-latest-releases", arguments={ + "releases": { + "help": "The list of releases of salt", + "nargs": "*", + }, "salt_version": { "help": "The version of salt being tested against", "required": True, }, - "repository": { - "help": "The repository to query for releases, e.g. saltstack/salt", - }, }, ) def get_latest_releases( - ctx: Context, salt_version: str = None, repository: str = "saltstack/salt" + ctx: Context, + releases: list[tools.utils.Version], + salt_version: str = None, ): """ Get a list of releases to use for the upgrade and downgrade tests. @@ -867,7 +870,6 @@ def get_latest_releases( # We aren't testing upgrades from anything before 3006.0 except the latest 3005.x threshold_major = 3006 parsed_salt_version = tools.utils.Version(salt_version) - releases = tools.utils.get_salt_releases(ctx, repository) # We want the latest 4 major versions, removing the oldest if this version is a new major num_major_versions = 4 if parsed_salt_version.minor == 0: From d4312c6acf69c913994c457eb90b0d566d6c4a4a Mon Sep 17 00:00:00 2001 From: MKLeb Date: Tue, 20 Jun 2023 14:37:29 -0400 Subject: [PATCH 068/393] Join the Array with spaces for use in the tools command --- .github/workflows/ci.yml | 2 +- .github/workflows/nightly.yml | 2 +- .github/workflows/scheduled.yml | 2 +- .github/workflows/staging.yml | 2 +- .github/workflows/templates/layout.yml.jinja | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b0213ff9b74..d182435b579 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -204,7 +204,7 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - tools ci get-latest-releases ${{ fromJSON(steps.get-salt-releases.outputs.releases) }} --salt-version ${{ steps.setup-salt-version.outputs.salt-version }} + tools ci get-latest-releases ${{ join(fromJSON(steps.get-salt-releases.outputs.releases), ' ') }} --salt-version ${{ steps.setup-salt-version.outputs.salt-version }} - name: Check Salt Releases run: | diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 80225eedafe..c52f83fb328 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -250,7 +250,7 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - tools ci get-latest-releases ${{ fromJSON(steps.get-salt-releases.outputs.releases) }} --salt-version ${{ steps.setup-salt-version.outputs.salt-version }} + tools ci get-latest-releases ${{ join(fromJSON(steps.get-salt-releases.outputs.releases), ' ') }} --salt-version ${{ steps.setup-salt-version.outputs.salt-version }} - name: Check Salt Releases run: | diff --git a/.github/workflows/scheduled.yml b/.github/workflows/scheduled.yml index 4e88c0bd5c9..d207791ec7b 100644 --- a/.github/workflows/scheduled.yml +++ b/.github/workflows/scheduled.yml @@ -240,7 +240,7 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - tools ci get-latest-releases ${{ fromJSON(steps.get-salt-releases.outputs.releases) }} --salt-version ${{ steps.setup-salt-version.outputs.salt-version }} + tools ci get-latest-releases ${{ join(fromJSON(steps.get-salt-releases.outputs.releases), ' ') }} --salt-version ${{ steps.setup-salt-version.outputs.salt-version }} - name: Check Salt Releases run: | diff --git a/.github/workflows/staging.yml b/.github/workflows/staging.yml index 54a65321bb0..611e96a3738 100644 --- a/.github/workflows/staging.yml +++ b/.github/workflows/staging.yml @@ -236,7 +236,7 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - tools ci get-latest-releases ${{ fromJSON(steps.get-salt-releases.outputs.releases) }} --salt-version ${{ steps.setup-salt-version.outputs.salt-version }} + tools ci get-latest-releases ${{ join(fromJSON(steps.get-salt-releases.outputs.releases), ' ') }} --salt-version ${{ steps.setup-salt-version.outputs.salt-version }} - name: Check Salt Releases run: | diff --git a/.github/workflows/templates/layout.yml.jinja b/.github/workflows/templates/layout.yml.jinja index a01b1528719..1ecde1dd4e8 100644 --- a/.github/workflows/templates/layout.yml.jinja +++ b/.github/workflows/templates/layout.yml.jinja @@ -261,7 +261,7 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - tools ci get-latest-releases ${{ fromJSON(steps.get-salt-releases.outputs.releases) }} --salt-version ${{ steps.setup-salt-version.outputs.salt-version }} + tools ci get-latest-releases ${{ join(fromJSON(steps.get-salt-releases.outputs.releases), ' ') }} --salt-version ${{ steps.setup-salt-version.outputs.salt-version }} - name: Check Salt Releases run: | From f670b637e4b0b637c4f799f8e8966515d4c4d285 Mon Sep 17 00:00:00 2001 From: MKLeb Date: Tue, 20 Jun 2023 15:43:57 -0400 Subject: [PATCH 069/393] Propogate the now `testing-releases` through to the package tests --- .github/workflows/ci.yml | 28 ++++++++++++++++--- .github/workflows/nightly.yml | 28 ++++++++++++++++--- .github/workflows/scheduled.yml | 28 ++++++++++++++++--- .github/workflows/staging.yml | 28 ++++++++++++++++--- .github/workflows/templates/layout.yml.jinja | 8 +++--- .../templates/test-salt-pkg.yml.jinja | 3 ++ .../workflows/test-packages-action-macos.yml | 4 +++ .github/workflows/test-packages-action.yml | 4 +++ tools/ci.py | 16 +++++------ 9 files changed, 119 insertions(+), 28 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d182435b579..7fcf1a49409 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -46,7 +46,7 @@ jobs: cache-seed: ${{ steps.set-cache-seed.outputs.cache-seed }} latest-release: ${{ steps.get-salt-releases.outputs.latest-release }} releases: ${{ steps.get-salt-releases.outputs.releases }} - test-releases: ${{ steps.get-latest-releases.outputs.latest-releases }} + testing-releases: ${{ steps.get-testing-releases.outputs.testing-releases }} steps: - uses: actions/checkout@v3 with: @@ -200,17 +200,17 @@ jobs: tools ci get-releases - name: Get Latest Salt Releases for Testing - id: get-latest-releases + id: get-testing-releases env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - tools ci get-latest-releases ${{ join(fromJSON(steps.get-salt-releases.outputs.releases), ' ') }} --salt-version ${{ steps.setup-salt-version.outputs.salt-version }} + tools ci get-testing-releases ${{ join(fromJSON(steps.get-salt-releases.outputs.releases), ' ') }} --salt-version ${{ steps.setup-salt-version.outputs.salt-version }} - name: Check Salt Releases run: | echo '${{ steps.get-salt-releases.outputs.latest-release }}' | jq -C '.' echo '${{ steps.get-salt-releases.outputs.releases }}' | jq -C '.' - echo '${{ steps.get-latest-releases.outputs.latest-releases }}' | jq -C '.' + echo '${{ steps.get-testing-releases.outputs.testing-releases }}' | jq -C '.' - name: Define Testrun id: define-testrun @@ -525,6 +525,7 @@ jobs: cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} + testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} centos-7-pkg-tests: name: CentOS 7 Package Tests @@ -542,6 +543,7 @@ jobs: cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} + testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} centosstream-8-pkg-tests: name: CentOS Stream 8 Package Tests @@ -559,6 +561,7 @@ jobs: cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} + testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} centosstream-9-pkg-tests: name: CentOS Stream 9 Package Tests @@ -576,6 +579,7 @@ jobs: cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} + testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} debian-10-pkg-tests: name: Debian 10 Package Tests @@ -593,6 +597,7 @@ jobs: cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} + testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} debian-11-pkg-tests: name: Debian 11 Package Tests @@ -610,6 +615,7 @@ jobs: cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} + testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} debian-11-arm64-pkg-tests: name: Debian 11 Arm64 Package Tests @@ -627,6 +633,7 @@ jobs: cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} + testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} photonos-3-pkg-tests: name: Photon OS 3 Package Tests @@ -644,6 +651,7 @@ jobs: cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} + testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} photonos-4-pkg-tests: name: Photon OS 4 Package Tests @@ -661,6 +669,7 @@ jobs: cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} + testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} ubuntu-2004-pkg-tests: name: Ubuntu 20.04 Package Tests @@ -678,6 +687,7 @@ jobs: cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} + testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} ubuntu-2004-arm64-pkg-tests: name: Ubuntu 20.04 Arm64 Package Tests @@ -695,6 +705,7 @@ jobs: cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} + testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} ubuntu-2204-pkg-tests: name: Ubuntu 22.04 Package Tests @@ -712,6 +723,7 @@ jobs: cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} + testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} ubuntu-2204-arm64-pkg-tests: name: Ubuntu 22.04 Arm64 Package Tests @@ -729,6 +741,7 @@ jobs: cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} + testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} macos-12-pkg-tests: name: macOS 12 Package Tests @@ -746,6 +759,7 @@ jobs: cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} + testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} windows-2016-nsis-pkg-tests: name: Windows 2016 NSIS Package Tests @@ -763,6 +777,7 @@ jobs: cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} + testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} windows-2016-msi-pkg-tests: name: Windows 2016 MSI Package Tests @@ -780,6 +795,7 @@ jobs: cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} + testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} windows-2019-nsis-pkg-tests: name: Windows 2019 NSIS Package Tests @@ -797,6 +813,7 @@ jobs: cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} + testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} windows-2019-msi-pkg-tests: name: Windows 2019 MSI Package Tests @@ -814,6 +831,7 @@ jobs: cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} + testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} windows-2022-nsis-pkg-tests: name: Windows 2022 NSIS Package Tests @@ -831,6 +849,7 @@ jobs: cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} + testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} windows-2022-msi-pkg-tests: name: Windows 2022 MSI Package Tests @@ -848,6 +867,7 @@ jobs: cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} + testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} windows-2016: name: Windows 2016 diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index c52f83fb328..0760d097246 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -92,7 +92,7 @@ jobs: cache-seed: ${{ steps.set-cache-seed.outputs.cache-seed }} latest-release: ${{ steps.get-salt-releases.outputs.latest-release }} releases: ${{ steps.get-salt-releases.outputs.releases }} - test-releases: ${{ steps.get-latest-releases.outputs.latest-releases }} + testing-releases: ${{ steps.get-testing-releases.outputs.testing-releases }} steps: - uses: actions/checkout@v3 with: @@ -246,17 +246,17 @@ jobs: tools ci get-releases - name: Get Latest Salt Releases for Testing - id: get-latest-releases + id: get-testing-releases env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - tools ci get-latest-releases ${{ join(fromJSON(steps.get-salt-releases.outputs.releases), ' ') }} --salt-version ${{ steps.setup-salt-version.outputs.salt-version }} + tools ci get-testing-releases ${{ join(fromJSON(steps.get-salt-releases.outputs.releases), ' ') }} --salt-version ${{ steps.setup-salt-version.outputs.salt-version }} - name: Check Salt Releases run: | echo '${{ steps.get-salt-releases.outputs.latest-release }}' | jq -C '.' echo '${{ steps.get-salt-releases.outputs.releases }}' | jq -C '.' - echo '${{ steps.get-latest-releases.outputs.latest-releases }}' | jq -C '.' + echo '${{ steps.get-testing-releases.outputs.testing-releases }}' | jq -C '.' - name: Define Testrun id: define-testrun @@ -582,6 +582,7 @@ jobs: cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: false skip-junit-reports: false + testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} centos-7-pkg-tests: name: CentOS 7 Package Tests @@ -599,6 +600,7 @@ jobs: cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: false skip-junit-reports: false + testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} centosstream-8-pkg-tests: name: CentOS Stream 8 Package Tests @@ -616,6 +618,7 @@ jobs: cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: false skip-junit-reports: false + testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} centosstream-9-pkg-tests: name: CentOS Stream 9 Package Tests @@ -633,6 +636,7 @@ jobs: cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: false skip-junit-reports: false + testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} debian-10-pkg-tests: name: Debian 10 Package Tests @@ -650,6 +654,7 @@ jobs: cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: false skip-junit-reports: false + testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} debian-11-pkg-tests: name: Debian 11 Package Tests @@ -667,6 +672,7 @@ jobs: cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: false skip-junit-reports: false + testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} debian-11-arm64-pkg-tests: name: Debian 11 Arm64 Package Tests @@ -684,6 +690,7 @@ jobs: cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: false skip-junit-reports: false + testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} photonos-3-pkg-tests: name: Photon OS 3 Package Tests @@ -701,6 +708,7 @@ jobs: cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: false skip-junit-reports: false + testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} photonos-4-pkg-tests: name: Photon OS 4 Package Tests @@ -718,6 +726,7 @@ jobs: cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: false skip-junit-reports: false + testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} ubuntu-2004-pkg-tests: name: Ubuntu 20.04 Package Tests @@ -735,6 +744,7 @@ jobs: cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: false skip-junit-reports: false + testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} ubuntu-2004-arm64-pkg-tests: name: Ubuntu 20.04 Arm64 Package Tests @@ -752,6 +762,7 @@ jobs: cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: false skip-junit-reports: false + testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} ubuntu-2204-pkg-tests: name: Ubuntu 22.04 Package Tests @@ -769,6 +780,7 @@ jobs: cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: false skip-junit-reports: false + testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} ubuntu-2204-arm64-pkg-tests: name: Ubuntu 22.04 Arm64 Package Tests @@ -786,6 +798,7 @@ jobs: cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: false skip-junit-reports: false + testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} macos-12-pkg-tests: name: macOS 12 Package Tests @@ -803,6 +816,7 @@ jobs: cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: false skip-junit-reports: false + testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} windows-2016-nsis-pkg-tests: name: Windows 2016 NSIS Package Tests @@ -820,6 +834,7 @@ jobs: cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: false skip-junit-reports: false + testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} windows-2016-msi-pkg-tests: name: Windows 2016 MSI Package Tests @@ -837,6 +852,7 @@ jobs: cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: false skip-junit-reports: false + testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} windows-2019-nsis-pkg-tests: name: Windows 2019 NSIS Package Tests @@ -854,6 +870,7 @@ jobs: cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: false skip-junit-reports: false + testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} windows-2019-msi-pkg-tests: name: Windows 2019 MSI Package Tests @@ -871,6 +888,7 @@ jobs: cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: false skip-junit-reports: false + testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} windows-2022-nsis-pkg-tests: name: Windows 2022 NSIS Package Tests @@ -888,6 +906,7 @@ jobs: cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: false skip-junit-reports: false + testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} windows-2022-msi-pkg-tests: name: Windows 2022 MSI Package Tests @@ -905,6 +924,7 @@ jobs: cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: false skip-junit-reports: false + testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} windows-2016: name: Windows 2016 diff --git a/.github/workflows/scheduled.yml b/.github/workflows/scheduled.yml index d207791ec7b..2703a6421ad 100644 --- a/.github/workflows/scheduled.yml +++ b/.github/workflows/scheduled.yml @@ -82,7 +82,7 @@ jobs: cache-seed: ${{ steps.set-cache-seed.outputs.cache-seed }} latest-release: ${{ steps.get-salt-releases.outputs.latest-release }} releases: ${{ steps.get-salt-releases.outputs.releases }} - test-releases: ${{ steps.get-latest-releases.outputs.latest-releases }} + testing-releases: ${{ steps.get-testing-releases.outputs.testing-releases }} steps: - uses: actions/checkout@v3 with: @@ -236,17 +236,17 @@ jobs: tools ci get-releases - name: Get Latest Salt Releases for Testing - id: get-latest-releases + id: get-testing-releases env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - tools ci get-latest-releases ${{ join(fromJSON(steps.get-salt-releases.outputs.releases), ' ') }} --salt-version ${{ steps.setup-salt-version.outputs.salt-version }} + tools ci get-testing-releases ${{ join(fromJSON(steps.get-salt-releases.outputs.releases), ' ') }} --salt-version ${{ steps.setup-salt-version.outputs.salt-version }} - name: Check Salt Releases run: | echo '${{ steps.get-salt-releases.outputs.latest-release }}' | jq -C '.' echo '${{ steps.get-salt-releases.outputs.releases }}' | jq -C '.' - echo '${{ steps.get-latest-releases.outputs.latest-releases }}' | jq -C '.' + echo '${{ steps.get-testing-releases.outputs.testing-releases }}' | jq -C '.' - name: Define Testrun id: define-testrun @@ -561,6 +561,7 @@ jobs: cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: false skip-junit-reports: false + testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} centos-7-pkg-tests: name: CentOS 7 Package Tests @@ -578,6 +579,7 @@ jobs: cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: false skip-junit-reports: false + testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} centosstream-8-pkg-tests: name: CentOS Stream 8 Package Tests @@ -595,6 +597,7 @@ jobs: cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: false skip-junit-reports: false + testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} centosstream-9-pkg-tests: name: CentOS Stream 9 Package Tests @@ -612,6 +615,7 @@ jobs: cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: false skip-junit-reports: false + testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} debian-10-pkg-tests: name: Debian 10 Package Tests @@ -629,6 +633,7 @@ jobs: cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: false skip-junit-reports: false + testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} debian-11-pkg-tests: name: Debian 11 Package Tests @@ -646,6 +651,7 @@ jobs: cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: false skip-junit-reports: false + testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} debian-11-arm64-pkg-tests: name: Debian 11 Arm64 Package Tests @@ -663,6 +669,7 @@ jobs: cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: false skip-junit-reports: false + testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} photonos-3-pkg-tests: name: Photon OS 3 Package Tests @@ -680,6 +687,7 @@ jobs: cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: false skip-junit-reports: false + testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} photonos-4-pkg-tests: name: Photon OS 4 Package Tests @@ -697,6 +705,7 @@ jobs: cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: false skip-junit-reports: false + testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} ubuntu-2004-pkg-tests: name: Ubuntu 20.04 Package Tests @@ -714,6 +723,7 @@ jobs: cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: false skip-junit-reports: false + testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} ubuntu-2004-arm64-pkg-tests: name: Ubuntu 20.04 Arm64 Package Tests @@ -731,6 +741,7 @@ jobs: cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: false skip-junit-reports: false + testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} ubuntu-2204-pkg-tests: name: Ubuntu 22.04 Package Tests @@ -748,6 +759,7 @@ jobs: cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: false skip-junit-reports: false + testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} ubuntu-2204-arm64-pkg-tests: name: Ubuntu 22.04 Arm64 Package Tests @@ -765,6 +777,7 @@ jobs: cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: false skip-junit-reports: false + testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} macos-12-pkg-tests: name: macOS 12 Package Tests @@ -782,6 +795,7 @@ jobs: cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: false skip-junit-reports: false + testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} windows-2016-nsis-pkg-tests: name: Windows 2016 NSIS Package Tests @@ -799,6 +813,7 @@ jobs: cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: false skip-junit-reports: false + testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} windows-2016-msi-pkg-tests: name: Windows 2016 MSI Package Tests @@ -816,6 +831,7 @@ jobs: cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: false skip-junit-reports: false + testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} windows-2019-nsis-pkg-tests: name: Windows 2019 NSIS Package Tests @@ -833,6 +849,7 @@ jobs: cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: false skip-junit-reports: false + testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} windows-2019-msi-pkg-tests: name: Windows 2019 MSI Package Tests @@ -850,6 +867,7 @@ jobs: cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: false skip-junit-reports: false + testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} windows-2022-nsis-pkg-tests: name: Windows 2022 NSIS Package Tests @@ -867,6 +885,7 @@ jobs: cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: false skip-junit-reports: false + testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} windows-2022-msi-pkg-tests: name: Windows 2022 MSI Package Tests @@ -884,6 +903,7 @@ jobs: cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: false skip-junit-reports: false + testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} windows-2016: name: Windows 2016 diff --git a/.github/workflows/staging.yml b/.github/workflows/staging.yml index 611e96a3738..e0dd006dd17 100644 --- a/.github/workflows/staging.yml +++ b/.github/workflows/staging.yml @@ -72,7 +72,7 @@ jobs: cache-seed: ${{ steps.set-cache-seed.outputs.cache-seed }} latest-release: ${{ steps.get-salt-releases.outputs.latest-release }} releases: ${{ steps.get-salt-releases.outputs.releases }} - test-releases: ${{ steps.get-latest-releases.outputs.latest-releases }} + testing-releases: ${{ steps.get-testing-releases.outputs.testing-releases }} steps: - uses: actions/checkout@v3 with: @@ -232,17 +232,17 @@ jobs: tools ci get-releases - name: Get Latest Salt Releases for Testing - id: get-latest-releases + id: get-testing-releases env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - tools ci get-latest-releases ${{ join(fromJSON(steps.get-salt-releases.outputs.releases), ' ') }} --salt-version ${{ steps.setup-salt-version.outputs.salt-version }} + tools ci get-testing-releases ${{ join(fromJSON(steps.get-salt-releases.outputs.releases), ' ') }} --salt-version ${{ steps.setup-salt-version.outputs.salt-version }} - name: Check Salt Releases run: | echo '${{ steps.get-salt-releases.outputs.latest-release }}' | jq -C '.' echo '${{ steps.get-salt-releases.outputs.releases }}' | jq -C '.' - echo '${{ steps.get-latest-releases.outputs.latest-releases }}' | jq -C '.' + echo '${{ steps.get-testing-releases.outputs.testing-releases }}' | jq -C '.' - name: Define Testrun id: define-testrun @@ -567,6 +567,7 @@ jobs: cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: true skip-junit-reports: true + testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} centos-7-pkg-tests: name: CentOS 7 Package Tests @@ -584,6 +585,7 @@ jobs: cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: true skip-junit-reports: true + testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} centosstream-8-pkg-tests: name: CentOS Stream 8 Package Tests @@ -601,6 +603,7 @@ jobs: cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: true skip-junit-reports: true + testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} centosstream-9-pkg-tests: name: CentOS Stream 9 Package Tests @@ -618,6 +621,7 @@ jobs: cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: true skip-junit-reports: true + testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} debian-10-pkg-tests: name: Debian 10 Package Tests @@ -635,6 +639,7 @@ jobs: cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: true skip-junit-reports: true + testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} debian-11-pkg-tests: name: Debian 11 Package Tests @@ -652,6 +657,7 @@ jobs: cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: true skip-junit-reports: true + testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} debian-11-arm64-pkg-tests: name: Debian 11 Arm64 Package Tests @@ -669,6 +675,7 @@ jobs: cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: true skip-junit-reports: true + testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} photonos-3-pkg-tests: name: Photon OS 3 Package Tests @@ -686,6 +693,7 @@ jobs: cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: true skip-junit-reports: true + testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} photonos-4-pkg-tests: name: Photon OS 4 Package Tests @@ -703,6 +711,7 @@ jobs: cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: true skip-junit-reports: true + testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} ubuntu-2004-pkg-tests: name: Ubuntu 20.04 Package Tests @@ -720,6 +729,7 @@ jobs: cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: true skip-junit-reports: true + testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} ubuntu-2004-arm64-pkg-tests: name: Ubuntu 20.04 Arm64 Package Tests @@ -737,6 +747,7 @@ jobs: cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: true skip-junit-reports: true + testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} ubuntu-2204-pkg-tests: name: Ubuntu 22.04 Package Tests @@ -754,6 +765,7 @@ jobs: cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: true skip-junit-reports: true + testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} ubuntu-2204-arm64-pkg-tests: name: Ubuntu 22.04 Arm64 Package Tests @@ -771,6 +783,7 @@ jobs: cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: true skip-junit-reports: true + testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} macos-12-pkg-tests: name: macOS 12 Package Tests @@ -788,6 +801,7 @@ jobs: cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: true skip-junit-reports: true + testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} windows-2016-nsis-pkg-tests: name: Windows 2016 NSIS Package Tests @@ -805,6 +819,7 @@ jobs: cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: true skip-junit-reports: true + testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} windows-2016-msi-pkg-tests: name: Windows 2016 MSI Package Tests @@ -822,6 +837,7 @@ jobs: cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: true skip-junit-reports: true + testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} windows-2019-nsis-pkg-tests: name: Windows 2019 NSIS Package Tests @@ -839,6 +855,7 @@ jobs: cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: true skip-junit-reports: true + testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} windows-2019-msi-pkg-tests: name: Windows 2019 MSI Package Tests @@ -856,6 +873,7 @@ jobs: cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: true skip-junit-reports: true + testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} windows-2022-nsis-pkg-tests: name: Windows 2022 NSIS Package Tests @@ -873,6 +891,7 @@ jobs: cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: true skip-junit-reports: true + testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} windows-2022-msi-pkg-tests: name: Windows 2022 MSI Package Tests @@ -890,6 +909,7 @@ jobs: cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 skip-code-coverage: true skip-junit-reports: true + testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} windows-2016: name: Windows 2016 diff --git a/.github/workflows/templates/layout.yml.jinja b/.github/workflows/templates/layout.yml.jinja index 1ecde1dd4e8..f33531c32d4 100644 --- a/.github/workflows/templates/layout.yml.jinja +++ b/.github/workflows/templates/layout.yml.jinja @@ -91,7 +91,7 @@ jobs: cache-seed: ${{ steps.set-cache-seed.outputs.cache-seed }} latest-release: ${{ steps.get-salt-releases.outputs.latest-release }} releases: ${{ steps.get-salt-releases.outputs.releases }} - test-releases: ${{ steps.get-latest-releases.outputs.latest-releases }} + testing-releases: ${{ steps.get-testing-releases.outputs.testing-releases }} steps: - uses: actions/checkout@v3 with: @@ -257,17 +257,17 @@ jobs: tools ci get-releases - name: Get Latest Salt Releases for Testing - id: get-latest-releases + id: get-testing-releases env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - tools ci get-latest-releases ${{ join(fromJSON(steps.get-salt-releases.outputs.releases), ' ') }} --salt-version ${{ steps.setup-salt-version.outputs.salt-version }} + tools ci get-testing-releases ${{ join(fromJSON(steps.get-salt-releases.outputs.releases), ' ') }} --salt-version ${{ steps.setup-salt-version.outputs.salt-version }} - name: Check Salt Releases run: | echo '${{ steps.get-salt-releases.outputs.latest-release }}' | jq -C '.' echo '${{ steps.get-salt-releases.outputs.releases }}' | jq -C '.' - echo '${{ steps.get-latest-releases.outputs.latest-releases }}' | jq -C '.' + echo '${{ steps.get-testing-releases.outputs.testing-releases }}' | jq -C '.' - name: Define Testrun id: define-testrun diff --git a/.github/workflows/templates/test-salt-pkg.yml.jinja b/.github/workflows/templates/test-salt-pkg.yml.jinja index 0d1d97b5457..bc0cd8afaf7 100644 --- a/.github/workflows/templates/test-salt-pkg.yml.jinja +++ b/.github/workflows/templates/test-salt-pkg.yml.jinja @@ -53,6 +53,7 @@ cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|<{ python_version }> skip-code-coverage: <{ skip_test_coverage_check }> skip-junit-reports: <{ skip_junit_reports_check }> + testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} <%- endfor %> @@ -78,6 +79,7 @@ cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|<{ python_version }> skip-code-coverage: <{ skip_test_coverage_check }> skip-junit-reports: <{ skip_junit_reports_check }> + testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} <%- endfor %> @@ -105,6 +107,7 @@ cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|<{ python_version }> skip-code-coverage: <{ skip_test_coverage_check }> skip-junit-reports: <{ skip_junit_reports_check }> + testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} <%- endfor %> <%- endfor %> diff --git a/.github/workflows/test-packages-action-macos.yml b/.github/workflows/test-packages-action-macos.yml index 2ef20904a26..178fb4c1a15 100644 --- a/.github/workflows/test-packages-action-macos.yml +++ b/.github/workflows/test-packages-action-macos.yml @@ -27,6 +27,10 @@ on: required: true type: string description: Seed used to invalidate caches + testing-releases: + required: true + type: string + description: A JSON list of releases to test upgrades against python-version: required: false type: string diff --git a/.github/workflows/test-packages-action.yml b/.github/workflows/test-packages-action.yml index cadaa2e834a..39fd1bf3aa1 100644 --- a/.github/workflows/test-packages-action.yml +++ b/.github/workflows/test-packages-action.yml @@ -27,6 +27,10 @@ on: required: true type: string description: Seed used to invalidate caches + testing-releases: + required: true + type: string + description: A JSON list of releases to test upgrades against package-name: required: false type: string diff --git a/tools/ci.py b/tools/ci.py index c0d2faa90ce..3a479035b5e 100644 --- a/tools/ci.py +++ b/tools/ci.py @@ -843,7 +843,7 @@ def _filter_test_labels(labels: list[dict[str, Any]]) -> list[tuple[str, str]]: @ci.command( - name="get-latest-releases", + name="get-testing-releases", arguments={ "releases": { "help": "The list of releases of salt", @@ -855,7 +855,7 @@ def _filter_test_labels(labels: list[dict[str, Any]]) -> list[tuple[str, str]]: }, }, ) -def get_latest_releases( +def get_testing_releases( ctx: Context, releases: list[tools.utils.Version], salt_version: str = None, @@ -883,27 +883,27 @@ def get_latest_releases( } ) )[-num_major_versions:] - latest_releases = [] + testing_releases = [] # Append the latest minor for each major for major in majors: minors_of_major = [ version for version in releases if version.major == major ] - latest_releases.append(minors_of_major[-1]) + testing_releases.append(minors_of_major[-1]) # TODO: Remove this block when we reach version 3009.0 # Append the latest minor version of 3005 if we don't have enough major versions to test against - if len(latest_releases) != num_major_versions: + if len(testing_releases) != num_major_versions: url = "https://repo.saltproject.io/salt/onedir/repo.json" ret = ctx.web.get(url) repo_data = ret.json() latest = list(repo_data["latest"].keys())[0] version = repo_data["latest"][latest]["version"] - latest_releases = [version] + latest_releases + testing_releases = [version] + testing_releases - str_releases = [str(version) for version in latest_releases] + str_releases = [str(version) for version in testing_releases] with open(github_output, "a", encoding="utf-8") as wfh: - wfh.write(f"latest-releases={json.dumps(str_releases)}\n") + wfh.write(f"testing-releases={json.dumps(str_releases)}\n") ctx.exit(0) From 296ec76a341af476b3af118fc04a31653c6592de Mon Sep 17 00:00:00 2001 From: MKLeb Date: Tue, 20 Jun 2023 16:27:37 -0400 Subject: [PATCH 070/393] Generate the pkg test matrix and include the versions to test upgrades against within it --- .../workflows/test-packages-action-macos.yml | 2 +- .github/workflows/test-packages-action.yml | 2 +- tools/ci.py | 39 +++++++++++++++---- tools/utils.py | 11 ++++-- 4 files changed, 40 insertions(+), 14 deletions(-) diff --git a/.github/workflows/test-packages-action-macos.yml b/.github/workflows/test-packages-action-macos.yml index 178fb4c1a15..d523e752e6d 100644 --- a/.github/workflows/test-packages-action-macos.yml +++ b/.github/workflows/test-packages-action-macos.yml @@ -83,7 +83,7 @@ jobs: - name: Generate Package Test Matrix id: generate-pkg-matrix run: | - tools ci pkg-matrix ${{ inputs.distro-slug }} ${{ inputs.pkg-type }} + tools ci pkg-matrix ${{ inputs.distro-slug }} ${{ inputs.pkg-type }} --testing-releases ${{ join(fromJSON(inputs.testing-releases), ' ') }} dependencies: name: Setup Test Dependencies diff --git a/.github/workflows/test-packages-action.yml b/.github/workflows/test-packages-action.yml index 39fd1bf3aa1..225009299ba 100644 --- a/.github/workflows/test-packages-action.yml +++ b/.github/workflows/test-packages-action.yml @@ -81,7 +81,7 @@ jobs: - name: Generate Package Test Matrix id: generate-pkg-matrix run: | - tools ci pkg-matrix ${{ inputs.distro-slug }} ${{ inputs.pkg-type }} + tools ci pkg-matrix ${{ inputs.distro-slug }} ${{ inputs.pkg-type }} --testing-releases ${{ join(fromJSON(inputs.testing-releases), ' ') }} dependencies: name: Setup Test Dependencies diff --git a/tools/ci.py b/tools/ci.py index 3a479035b5e..566a1f388f6 100644 --- a/tools/ci.py +++ b/tools/ci.py @@ -646,18 +646,29 @@ def transport_matrix(ctx: Context, distro_slug: str): "help": "The distribution slug to generate the matrix for", }, "pkg_type": { - "help": "The distribution slug to generate the matrix for", + "help": "The type of package we are testing against", + }, + "testing_releases": { + "help": "The salt releases to test upgrades against", + "nargs": "+", + "required": True, }, }, ) -def pkg_matrix(ctx: Context, distro_slug: str, pkg_type: str): +def pkg_matrix( + ctx: Context, + distro_slug: str, + pkg_type: str, + testing_releases: list[tools.utils.Version] = None, +): """ Generate the test matrix. """ github_output = os.environ.get("GITHUB_OUTPUT") if github_output is None: ctx.warn("The 'GITHUB_OUTPUT' variable is not set.") - + if TYPE_CHECKING: + assert testing_releases matrix = [] sessions = [ "install", @@ -679,6 +690,7 @@ def pkg_matrix(ctx: Context, distro_slug: str, pkg_type: str): # we allow for 3006.0 jobs to run, because then # we will have arm64 onedir packages to upgrade from sessions.append("upgrade") + # TODO: Remove this block when we reach version 3009.0, we will no longer be testing upgrades from classic packages if ( distro_slug not in [ @@ -694,11 +706,22 @@ def pkg_matrix(ctx: Context, distro_slug: str, pkg_type: str): sessions.append("upgrade-classic") for session in sessions: - matrix.append( - { - "test-chunk": session, - } - ) + versions: list[str | None] = [None] + if session == "upgrade": + versions = [str(version) for version in testing_releases] + elif session == "upgrade-classic": + versions = [ + str(version) + for version in testing_releases + if version < tools.utils.Version("3006.0") + ] + for version in versions: + matrix.append( + { + "test-chunk": session, + "version": version, + } + ) ctx.info("Generated matrix:") ctx.print(matrix, soft_wrap=True) diff --git a/tools/utils.py b/tools/utils.py index 28a79745844..64d19bc4290 100644 --- a/tools/utils.py +++ b/tools/utils.py @@ -132,6 +132,9 @@ class Version(packaging.version.Version): other = self.__class__(other) return super().__ne__(other) + def __str__(self): + return super().__str__().replace(".post", "-") + def __hash__(self): return hash(str(self)) @@ -177,12 +180,12 @@ def get_salt_releases(ctx: Context, repository: str) -> list[Version]: name = release["name"] if name.startswith("v"): name = name[1:] - if name and "-" not in name and "docs" not in name: - # We're not going to parse dash or docs releases + if name and "docs" not in name: + # We're not going to parse docs releases versions.add(Version(name)) name = release["tag_name"] - if "-" not in name and "docs" not in name: - # We're not going to parse dash or docs releases + if "docs" not in name: + # We're not going to parse docs releases versions.add(Version(name)) return sorted(versions) From 7aadeaf7920f5c825a7b703e0daef36e5f715045 Mon Sep 17 00:00:00 2001 From: MKLeb Date: Tue, 20 Jun 2023 17:12:19 -0400 Subject: [PATCH 071/393] Account for upgrades from new relenv-based repos --- .../workflows/test-packages-action-macos.yml | 6 ++-- .github/workflows/test-packages-action.yml | 6 ++-- pkg/tests/support/helpers.py | 35 +++++++++++++++---- 3 files changed, 36 insertions(+), 11 deletions(-) diff --git a/.github/workflows/test-packages-action-macos.yml b/.github/workflows/test-packages-action-macos.yml index d523e752e6d..b517c53745c 100644 --- a/.github/workflows/test-packages-action-macos.yml +++ b/.github/workflows/test-packages-action-macos.yml @@ -234,7 +234,8 @@ jobs: GITHUB_ACTIONS_PIPELINE: "1" SKIP_INITIAL_GH_ACTIONS_FAILURES: "1" run: | - sudo -E nox --force-color -e ${{ inputs.nox-session }} -- ${{ matrix.test-chunk }} + sudo -E nox --force-color -e ${{ inputs.nox-session }} -- ${{ matrix.test-chunk }} \ + ${{ contains(matrix.test-chunk, 'upgrade') && format('--prev-version {0}', matrix.version) || ''}} - name: Run Package Tests env: @@ -246,7 +247,8 @@ jobs: GITHUB_ACTIONS_PIPELINE: "1" SKIP_INITIAL_GH_ACTIONS_FAILURES: "1" run: | - sudo -E nox --force-color -e ${{ inputs.nox-session }} -- ${{ matrix.test-chunk }} + sudo -E nox --force-color -e ${{ inputs.nox-session }} -- ${{ matrix.test-chunk }} \ + ${{ contains(matrix.test-chunk, 'upgrade') && format('--prev-version {0}', matrix.version) || ''}} - name: Fix file ownership run: | diff --git a/.github/workflows/test-packages-action.yml b/.github/workflows/test-packages-action.yml index 225009299ba..3b4017bcb81 100644 --- a/.github/workflows/test-packages-action.yml +++ b/.github/workflows/test-packages-action.yml @@ -264,12 +264,14 @@ jobs: - name: Show System Info & Test Plan run: | tools --timestamps --timeout-secs=1800 vm testplan --skip-requirements-install \ - --nox-session=${{ inputs.nox-session }} ${{ inputs.distro-slug }} -- ${{ matrix.test-chunk }} + --nox-session=${{ inputs.nox-session }} ${{ inputs.distro-slug }} -- ${{ matrix.test-chunk }} \ + ${{ contains(matrix.test-chunk, 'upgrade') && format('--prev-version {0}', matrix.version) || ''}} - name: Run Package Tests run: | tools --timestamps --no-output-timeout-secs=1800 --timeout-secs=14400 vm test --skip-requirements-install\ - --nox-session=${{ inputs.nox-session }} --rerun-failures ${{ inputs.distro-slug }} -- ${{ matrix.test-chunk }} + --nox-session=${{ inputs.nox-session }} --rerun-failures ${{ inputs.distro-slug }} -- ${{ matrix.test-chunk }} \ + ${{ contains(matrix.test-chunk, 'upgrade') && format('--prev-version {0}', matrix.version) || ''}} - name: Download Test Run Artifacts id: download-artifacts-from-vm diff --git a/pkg/tests/support/helpers.py b/pkg/tests/support/helpers.py index 9853c441870..2e476065b0b 100644 --- a/pkg/tests/support/helpers.py +++ b/pkg/tests/support/helpers.py @@ -661,6 +661,7 @@ class SaltPkgInstall: minor_ver = self.minor pkg_version = self.pkg_version full_version = f"{self.major}.{self.minor}-{pkg_version}" + relenv = major_ver >= 3006 min_ver = f"{major_ver}" distro_name = self.distro_name @@ -676,6 +677,9 @@ class SaltPkgInstall: gpg_key = "SALTSTACK-GPG-KEY.pub" if self.distro_version == "9": gpg_key = "SALTSTACK-GPG-KEY2.pub" + if relenv: + gpg_key = "SALT-PROJECT-GPG-PUBKEY-2023.pub" + if platform.is_aarch64(): arch = "aarch64" else: @@ -713,15 +717,20 @@ class SaltPkgInstall: else: arch = "amd64" pathlib.Path("/etc/apt/keyrings").mkdir(parents=True, exist_ok=True) + gpg_dest = "salt-archive-keyring.gpg" + gpg_key = gpg_dest + if relenv: + gpg_key = "SALT-PROJECT-GPG-PUBKEY-2023.gpg" + download_file( - f"https://repo.saltproject.io/{root_url}{distro_name}/{self.distro_version}/{arch}/{major_ver}/salt-archive-keyring.gpg", - "/etc/apt/keyrings/salt-archive-keyring.gpg", + f"https://repo.saltproject.io/{root_url}{distro_name}/{self.distro_version}/{arch}/{major_ver}/{gpg_key}", + f"/etc/apt/keyrings/{gpg_dest}", ) with open( pathlib.Path("/etc", "apt", "sources.list.d", "salt.list"), "w" ) as fp: fp.write( - f"deb [signed-by=/etc/apt/keyrings/salt-archive-keyring.gpg arch={arch}] " + f"deb [signed-by=/etc/apt/keyrings/{gpg_dest} arch={arch}] " f"https://repo.saltproject.io/{root_url}{distro_name}/{self.distro_version}/{arch}/{major_ver} {self.distro_codename} main" ) ret = self.proc.run(self.pkg_mngr, "update") @@ -744,8 +753,15 @@ class SaltPkgInstall: self.ssm_bin = self.install_dir / "ssm.exe" if not self.classic: - win_pkg = f"salt-{full_version}-windows-amd64.{self.file_ext}" - win_pkg_url = f"https://repo.saltproject.io/salt/py3/windows/{full_version}/{win_pkg}" + if not relenv: + win_pkg = f"salt-{full_version}-windows-amd64.{self.file_ext}" + win_pkg_url = f"https://repo.saltproject.io/salt/py3/windows/{full_version}/{win_pkg}" + else: + if self.file_ext == "msi": + win_pkg = f"Salt-Minion-{self.prev_version}-1-Py3-AMD64.{self.file_ext}" + elif self.file_ext == "exe": + win_pkg = f"Salt-Minion-{self.prev_version}-1-Py3-AMD64-Setup.{self.file_ext}" + win_pkg_url = f"https://repo.saltproject.io/salt/py3/windows/{major_ver}/{win_pkg}" else: if self.file_ext == "msi": win_pkg = f"Salt-Minion-{min_ver}-1-Py3-AMD64.{self.file_ext}" @@ -785,8 +801,13 @@ class SaltPkgInstall: mac_pkg = f"salt-{min_ver}.{minor_ver}-1-py3-x86_64.pkg" mac_pkg_url = f"https://repo.saltproject.io/osx/{mac_pkg}" else: - mac_pkg = f"salt-{min_ver}.{minor_ver}-1-macos-x86_64.pkg" - mac_pkg_url = f"https://repo.saltproject.io/salt/py3/macos/{major_ver}.{minor_ver}-1/{mac_pkg}" + if not relenv: + mac_pkg = f"salt-{min_ver}.{minor_ver}-1-macos-x86_64.pkg" + mac_pkg_url = f"https://repo.saltproject.io/salt/py3/macos/{major_ver}.{minor_ver}-1/{mac_pkg}" + else: + mac_pkg = f"salt-{self.prev_verison}-x86_64.pkg" + mac_pkg_url = f"https://repo.saltproject.io/salt/py3/macos/{major_ver}/{mac_pkg}" + mac_pkg_path = f"/tmp/{mac_pkg}" if not os.path.exists(mac_pkg_path): download_file( From 5c7269aee6a4d0382d69b2af193cc3df363b2630 Mon Sep 17 00:00:00 2001 From: MKLeb Date: Wed, 21 Jun 2023 10:24:33 -0400 Subject: [PATCH 072/393] The slash needs to be separate from the command --- .github/workflows/test-packages-action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-packages-action.yml b/.github/workflows/test-packages-action.yml index 3b4017bcb81..3e31045c6f7 100644 --- a/.github/workflows/test-packages-action.yml +++ b/.github/workflows/test-packages-action.yml @@ -269,7 +269,7 @@ jobs: - name: Run Package Tests run: | - tools --timestamps --no-output-timeout-secs=1800 --timeout-secs=14400 vm test --skip-requirements-install\ + tools --timestamps --no-output-timeout-secs=1800 --timeout-secs=14400 vm test --skip-requirements-install \ --nox-session=${{ inputs.nox-session }} --rerun-failures ${{ inputs.distro-slug }} -- ${{ matrix.test-chunk }} \ ${{ contains(matrix.test-chunk, 'upgrade') && format('--prev-version {0}', matrix.version) || ''}} From 9a4e026d592484f283688800194b5d4cee9cd01e Mon Sep 17 00:00:00 2001 From: MKLeb Date: Wed, 21 Jun 2023 11:27:14 -0400 Subject: [PATCH 073/393] The major version needs to be cast to an int for comparison --- pkg/tests/support/helpers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/tests/support/helpers.py b/pkg/tests/support/helpers.py index 2e476065b0b..0bc2f8dd0d7 100644 --- a/pkg/tests/support/helpers.py +++ b/pkg/tests/support/helpers.py @@ -661,7 +661,7 @@ class SaltPkgInstall: minor_ver = self.minor pkg_version = self.pkg_version full_version = f"{self.major}.{self.minor}-{pkg_version}" - relenv = major_ver >= 3006 + relenv = int(major_ver) >= 3006 min_ver = f"{major_ver}" distro_name = self.distro_name From 0ec60c70d2c311db12d504ce45fd0877888ccabe Mon Sep 17 00:00:00 2001 From: MKLeb Date: Wed, 21 Jun 2023 13:13:02 -0400 Subject: [PATCH 074/393] Fix mac upgrade test urls --- pkg/tests/support/helpers.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/tests/support/helpers.py b/pkg/tests/support/helpers.py index 0bc2f8dd0d7..4708356e50e 100644 --- a/pkg/tests/support/helpers.py +++ b/pkg/tests/support/helpers.py @@ -798,14 +798,14 @@ class SaltPkgInstall: elif platform.is_darwin(): if self.classic: - mac_pkg = f"salt-{min_ver}.{minor_ver}-1-py3-x86_64.pkg" + mac_pkg = f"salt-{self.prev_version}-py3-x86_64.pkg" mac_pkg_url = f"https://repo.saltproject.io/osx/{mac_pkg}" else: if not relenv: - mac_pkg = f"salt-{min_ver}.{minor_ver}-1-macos-x86_64.pkg" - mac_pkg_url = f"https://repo.saltproject.io/salt/py3/macos/{major_ver}.{minor_ver}-1/{mac_pkg}" + mac_pkg = f"salt-{self.prev_version}-macos-x86_64.pkg" + mac_pkg_url = f"https://repo.saltproject.io/salt/py3/macos/{self.prev_version}/{mac_pkg}" else: - mac_pkg = f"salt-{self.prev_verison}-x86_64.pkg" + mac_pkg = f"salt-{self.prev_version}-x86_64.pkg" mac_pkg_url = f"https://repo.saltproject.io/salt/py3/macos/{major_ver}/{mac_pkg}" mac_pkg_path = f"/tmp/{mac_pkg}" From f952418e90b50bc3da3104049fa457d9000b4fe5 Mon Sep 17 00:00:00 2001 From: MKLeb Date: Wed, 21 Jun 2023 16:01:28 -0400 Subject: [PATCH 075/393] Use `download_file` for the windows packages as well --- pkg/tests/support/helpers.py | 4 +--- tools/utils.py | 3 --- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/pkg/tests/support/helpers.py b/pkg/tests/support/helpers.py index 4708356e50e..1b627ba5d1e 100644 --- a/pkg/tests/support/helpers.py +++ b/pkg/tests/support/helpers.py @@ -770,10 +770,8 @@ class SaltPkgInstall: win_pkg_url = f"https://repo.saltproject.io/windows/{win_pkg}" pkg_path = pathlib.Path(r"C:\TEMP", win_pkg) pkg_path.parent.mkdir(exist_ok=True) - ret = requests.get(win_pkg_url) + download_file(win_pkg_url, pkg_path) - with open(pkg_path, "wb") as fp: - fp.write(ret.content) if self.file_ext == "msi": # Write a batch file to run the installer. It is impossible to # perform escaping of the START_MINION property that the MSI diff --git a/tools/utils.py b/tools/utils.py index 64d19bc4290..48dc4a17314 100644 --- a/tools/utils.py +++ b/tools/utils.py @@ -161,9 +161,6 @@ def get_salt_releases(ctx: Context, repository: str) -> list[Version]: name = tag["name"] if name.startswith("v"): name = name[1:] - if "-" in name: - # We're not going to parse dash tags - continue if "docs" in name: # We're not going to consider doc tags continue From 0d622479b28f86f7569944b670b9a07d44720a6a Mon Sep 17 00:00:00 2001 From: MKLeb Date: Wed, 21 Jun 2023 18:35:42 -0400 Subject: [PATCH 076/393] Additional fixes for mac and windows upgrade tests --- pkg/tests/support/helpers.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pkg/tests/support/helpers.py b/pkg/tests/support/helpers.py index 1b627ba5d1e..e27237e408d 100644 --- a/pkg/tests/support/helpers.py +++ b/pkg/tests/support/helpers.py @@ -758,9 +758,11 @@ class SaltPkgInstall: win_pkg_url = f"https://repo.saltproject.io/salt/py3/windows/{full_version}/{win_pkg}" else: if self.file_ext == "msi": - win_pkg = f"Salt-Minion-{self.prev_version}-1-Py3-AMD64.{self.file_ext}" + win_pkg = ( + f"Salt-Minion-{self.prev_version}-Py3-AMD64.{self.file_ext}" + ) elif self.file_ext == "exe": - win_pkg = f"Salt-Minion-{self.prev_version}-1-Py3-AMD64-Setup.{self.file_ext}" + win_pkg = f"Salt-Minion-{self.prev_version}-Py3-AMD64-Setup.{self.file_ext}" win_pkg_url = f"https://repo.saltproject.io/salt/py3/windows/{major_ver}/{win_pkg}" else: if self.file_ext == "msi": @@ -803,7 +805,7 @@ class SaltPkgInstall: mac_pkg = f"salt-{self.prev_version}-macos-x86_64.pkg" mac_pkg_url = f"https://repo.saltproject.io/salt/py3/macos/{self.prev_version}/{mac_pkg}" else: - mac_pkg = f"salt-{self.prev_version}-x86_64.pkg" + mac_pkg = f"salt-{self.prev_version}-py3-x86_64.pkg" mac_pkg_url = f"https://repo.saltproject.io/salt/py3/macos/{major_ver}/{mac_pkg}" mac_pkg_path = f"/tmp/{mac_pkg}" From d007ebd8d9015e401f52642596d73327fc6daef2 Mon Sep 17 00:00:00 2001 From: MKLeb Date: Tue, 27 Jun 2023 14:19:26 -0400 Subject: [PATCH 077/393] Some more fixes for the NSIS package tests --- pkg/tests/support/helpers.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/tests/support/helpers.py b/pkg/tests/support/helpers.py index e27237e408d..11bfdb6185b 100644 --- a/pkg/tests/support/helpers.py +++ b/pkg/tests/support/helpers.py @@ -749,13 +749,13 @@ class SaltPkgInstall: self.bin_dir = self.install_dir / "bin" self.run_root = self.bin_dir / f"salt.exe" self.ssm_bin = self.bin_dir / "ssm.exe" - if self.file_ext == "msi": + if self.file_ext == "msi" or relenv: self.ssm_bin = self.install_dir / "ssm.exe" if not self.classic: if not relenv: - win_pkg = f"salt-{full_version}-windows-amd64.{self.file_ext}" - win_pkg_url = f"https://repo.saltproject.io/salt/py3/windows/{full_version}/{win_pkg}" + win_pkg = f"salt-{self.prev_version}-windows-amd64.{self.file_ext}" + win_pkg_url = f"https://repo.saltproject.io/salt/py3/windows/{self.prev_version}/{win_pkg}" else: if self.file_ext == "msi": win_pkg = ( From e11d6a478a17576a9026ba565947f966a2b97d39 Mon Sep 17 00:00:00 2001 From: MKLeb Date: Wed, 28 Jun 2023 16:45:19 -0400 Subject: [PATCH 078/393] More fixes for upgrades of NSIS packages from relenv-based previous versions --- pkg/tests/conftest.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/tests/conftest.py b/pkg/tests/conftest.py index 0bcf2252227..5eba84bb4aa 100644 --- a/pkg/tests/conftest.py +++ b/pkg/tests/conftest.py @@ -363,6 +363,8 @@ def salt_master(salt_factories, install_salt, state_tree, pillar_tree): master_script = True # this check will need to be changed to install_salt.relenv # once the package version returns 3006 and not 3005 on master + if install_salt.relenv: + master_script = True elif not install_salt.upgrade: master_script = True @@ -375,6 +377,8 @@ def salt_master(salt_factories, install_salt, state_tree, pillar_tree): python_executable = install_salt.bin_dir / "Scripts" / "python.exe" if install_salt.classic: python_executable = install_salt.bin_dir / "python.exe" + if install_salt.relenv: + python_executable = install_salt.install_dir / "Scripts" / "python.exe" factory = salt_factories.salt_master_daemon( random_string("master-"), defaults=config_defaults, From 89e41f31558dccf67dc493871f385c9d6075c470 Mon Sep 17 00:00:00 2001 From: cmcmarrow Date: Thu, 29 Jun 2023 18:38:01 -0500 Subject: [PATCH 079/393] unflip no-fast --- tests/conftest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/conftest.py b/tests/conftest.py index 1bb55aabee3..b90346ed558 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -605,7 +605,7 @@ def pytest_runtest_setup(item): "Slow tests are disabled, pass '--run-slow' to enable them.", _use_item_location=True, ) - if test_group_count == 0 and item.config.getoption("--no-fast-tests"): + if test_group_count == 0 and not item.config.getoption("--no-fast-tests"): raise pytest.skip.Exception( "Fast tests have been disabled by '--no-fast-tests'.", _use_item_location=True, From 9eac9cdef51bebd3f7aa9788a80f4f469259f78e Mon Sep 17 00:00:00 2001 From: cmcmarrow Date: Thu, 29 Jun 2023 18:56:31 -0500 Subject: [PATCH 080/393] flip default on --no-fast --- tests/conftest.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index b90346ed558..361076e0e17 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -171,8 +171,8 @@ def pytest_addoption(parser): "--no-fast", "--no-fast-tests", dest="fast", - action="store_false", - default=True, + action="store_true", + default=False, help="Don't run salt-fast tests. Default: %(default)s", ) test_selection_group.addoption( @@ -605,7 +605,7 @@ def pytest_runtest_setup(item): "Slow tests are disabled, pass '--run-slow' to enable them.", _use_item_location=True, ) - if test_group_count == 0 and not item.config.getoption("--no-fast-tests"): + if test_group_count == 0 and item.config.getoption("--no-fast-tests"): raise pytest.skip.Exception( "Fast tests have been disabled by '--no-fast-tests'.", _use_item_location=True, From 2efc71ad12a59ed40fd15a8f7e7dc7b1e06ee198 Mon Sep 17 00:00:00 2001 From: "Gareth J. Greenaway" Date: Wed, 28 Jun 2023 11:12:39 -0700 Subject: [PATCH 081/393] Adding a new decorator to indicate when a module is deprecated in favor of a Salt extension --- salt/loader/lazy.py | 32 +++++++++++-------- .../utils/test_extension_deprecation.py | 28 ++++++++++++++++ 2 files changed, 47 insertions(+), 13 deletions(-) create mode 100644 tests/pytests/functional/utils/test_extension_deprecation.py diff --git a/salt/loader/lazy.py b/salt/loader/lazy.py index 8b5a61e5245..6f882cd6107 100644 --- a/salt/loader/lazy.py +++ b/salt/loader/lazy.py @@ -34,6 +34,7 @@ import salt.utils.platform import salt.utils.stringutils import salt.utils.versions from salt.utils.decorators import Depends +from salt.utils.decorators.extension_deprecation import extension_deprecation_message try: # Try the stdlib C extension first @@ -149,7 +150,7 @@ class LoadedFunc: return self.loader.run(run_func, *args, **kwargs) def __repr__(self): - return "<{} name={!r}>".format(self.__class__.__name__, self.name) + return f"<{self.__class__.__name__} name={self.name!r}>" class LoadedMod: @@ -172,10 +173,10 @@ class LoadedMod: Run the wrapped function in the loader's context. """ try: - return self.loader["{}.{}".format(self.mod, name)] + return self.loader[f"{self.mod}.{name}"] except KeyError: raise AttributeError( - "No attribute by the name of {} was found on {}".format(name, self.mod) + f"No attribute by the name of {name} was found on {self.mod}" ) def __repr__(self): @@ -311,10 +312,10 @@ class LazyLoader(salt.utils.lazy.LazyDict): super().__init__() # late init the lazy loader # create all of the import namespaces - _generate_module("{}.int".format(self.loaded_base_name)) - _generate_module("{}.int.{}".format(self.loaded_base_name, tag)) - _generate_module("{}.ext".format(self.loaded_base_name)) - _generate_module("{}.ext.{}".format(self.loaded_base_name, tag)) + _generate_module(f"{self.loaded_base_name}.int") + _generate_module(f"{self.loaded_base_name}.int.{tag}") + _generate_module(f"{self.loaded_base_name}.ext") + _generate_module(f"{self.loaded_base_name}.ext.{tag}") def clean_modules(self): """ @@ -372,19 +373,19 @@ class LazyLoader(salt.utils.lazy.LazyDict): """ mod_name = function_name.split(".")[0] if mod_name in self.loaded_modules: - return "'{}' is not available.".format(function_name) + return f"'{function_name}' is not available." else: try: reason = self.missing_modules[mod_name] except KeyError: - return "'{}' is not available.".format(function_name) + return f"'{function_name}' is not available." else: if reason is not None: return "'{}' __virtual__ returned False: {}".format( mod_name, reason ) else: - return "'{}' __virtual__ returned False".format(mod_name) + return f"'{mod_name}' __virtual__ returned False" def _refresh_file_mapping(self): """ @@ -497,7 +498,7 @@ class LazyLoader(salt.utils.lazy.LazyDict): for suffix in self.suffix_order: if "" == suffix: continue # Next suffix (__init__ must have a suffix) - init_file = "__init__{}".format(suffix) + init_file = f"__init__{suffix}" if init_file in subfiles: break else: @@ -978,6 +979,11 @@ class LazyLoader(salt.utils.lazy.LazyDict): # functions defined(or namespaced) on the loaded module. continue + # When the module is deprecated wrap functions in deprecation + # warning. + if hasattr(mod, "__deprecated__"): + func = extension_deprecation_message(*mod.__deprecated__)(func) + # Let's get the function name. # If the module has the __func_alias__ attribute, it must be a # dictionary mapping in the form of(key -> value): @@ -990,7 +996,7 @@ class LazyLoader(salt.utils.lazy.LazyDict): try: full_funcname = ".".join((tgt_mod, funcname)) except TypeError: - full_funcname = "{}.{}".format(tgt_mod, funcname) + full_funcname = f"{tgt_mod}.{funcname}" # Save many references for lookups # Careful not to overwrite existing (higher priority) functions if full_funcname not in self._dict: @@ -1017,7 +1023,7 @@ class LazyLoader(salt.utils.lazy.LazyDict): if not isinstance(key, str): raise KeyError("The key must be a string.") if "." not in key: - raise KeyError("The key '{}' should contain a '.'".format(key)) + raise KeyError(f"The key '{key}' should contain a '.'") mod_name, _ = key.split(".", 1) with self._lock: # It is possible that the key is in the dictionary after diff --git a/tests/pytests/functional/utils/test_extension_deprecation.py b/tests/pytests/functional/utils/test_extension_deprecation.py new file mode 100644 index 00000000000..71db317c4e5 --- /dev/null +++ b/tests/pytests/functional/utils/test_extension_deprecation.py @@ -0,0 +1,28 @@ +import warnings + +from salt.utils.decorators.extension_deprecation import extension_deprecation_message + + +@extension_deprecation_message(3009, "salt_mod", "http://www.example.com") +def salt_func(): + return True + + +def test_extension_deprecation(): + """ + this tests for a condition where an included jinja template + is removed from the salt filesystem, but is still loaded from + the cache. + """ + expected_deprecation_message = ( + "The 'salt_mod' functionality in Salt has been deprecated and " + "its functionality will be removed in version 3009.0 (Potassium) " + "in favor of the saltext.salt_mod Salt Extension. (http://www.example.com)" + ) + with warnings.catch_warnings(record=True) as catch_warnings: + ret = salt_func() + assert ret + + assert len(catch_warnings) == 1 + assert issubclass(catch_warnings[-1].category, FutureWarning) + assert str(catch_warnings[-1].message) == expected_deprecation_message From 405fd406343c7180cf2dbb16eef2564d8bc2ebb6 Mon Sep 17 00:00:00 2001 From: "Gareth J. Greenaway" Date: Wed, 28 Jun 2023 11:15:11 -0700 Subject: [PATCH 082/393] Adding changelog. --- changelog/64569.added.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog/64569.added.md diff --git a/changelog/64569.added.md b/changelog/64569.added.md new file mode 100644 index 00000000000..1ee4c96b146 --- /dev/null +++ b/changelog/64569.added.md @@ -0,0 +1 @@ +Adding a new decorator to indicate when a module is deprecated in favor of a Salt extension. From 9a2102a0e852004f5bbe18ad857b97d5af96cea2 Mon Sep 17 00:00:00 2001 From: "Gareth J. Greenaway" Date: Wed, 28 Jun 2023 11:23:26 -0700 Subject: [PATCH 083/393] Adding salt/utils/decorators/extension_deprecation.py --- .../utils/decorators/extension_deprecation.py | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 salt/utils/decorators/extension_deprecation.py diff --git a/salt/utils/decorators/extension_deprecation.py b/salt/utils/decorators/extension_deprecation.py new file mode 100644 index 00000000000..3b5c680803d --- /dev/null +++ b/salt/utils/decorators/extension_deprecation.py @@ -0,0 +1,33 @@ +""" +Decorators for deprecation of modules to Salt extensions +""" +import logging +from functools import wraps + +import salt.utils.args +import salt.utils.versions + +log = logging.getLogger(__name__) + + +def extension_deprecation_message(version, extension_name, extension_repo): + """ + Decorator wrapper to warn about deprecation + """ + + def decorator(function): + @wraps(function) + def wrapper(*args, **kwargs): + salt.utils.versions.warn_until( + version, + f"The '{extension_name}' functionality in Salt has been deprecated and its " + "functionality will be removed in version {version} in favor of the " + f"saltext.{extension_name} Salt Extension. " + f"({extension_repo})", + category=FutureWarning, + ) + return function(*args, **salt.utils.args.clean_kwargs(**kwargs)) + + return wrapper + + return decorator From 055277d101d01b17db4ed9962098de430f0b2e16 Mon Sep 17 00:00:00 2001 From: "Gareth J. Greenaway" Date: Wed, 28 Jun 2023 12:47:53 -0700 Subject: [PATCH 084/393] Adding documentation for salt-extension. --- doc/topics/development/salt_extensions.rst | 74 ++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 doc/topics/development/salt_extensions.rst diff --git a/doc/topics/development/salt_extensions.rst b/doc/topics/development/salt_extensions.rst new file mode 100644 index 00000000000..85b6d538127 --- /dev/null +++ b/doc/topics/development/salt_extensions.rst @@ -0,0 +1,74 @@ +.. _salt_extensions: + +=============== +Salt Extensions +=============== + +Salt modules can be distributed as Salt Extensions. + +The existing Salt modules will be carved up into one of three categories. Each category will be +implemented in the following way: + +## Core Modules + +Core Modules will be kept inside the main Salt codebase, and development will be tied to the +Salt release cycle. + +## Supported Modules + +Supported modules will be moved to their own repositories within the SaltStack Github +organization where they can be maintained separately from the Salt codebase. + +## Community Modules + +Remaining modules will be deprecated from the Salt Core codebase and community members +will be able to continue independent maintainership if they are interested. Some plugins are +almost exclusively maintained by external corporations – if these corporations wish for formal +documentation outlining transfer of ownership it can be handled on a case-by-case basis. The +community modules can be hosted either in individual or corporate source control systems, +alternatively they can also be hosted in the community run Salt Extensions Github organization, +that will operate like the the Salt Formulas Github organization. +The criteria to determine which category to place modules in will follow these rules. + +## Core Modules + +1. Required Salt Functionality + a. Modules such as state, sys, peer, grains, pillar, etc. +2. Modules critical to Salt’s Multi OS support + a. Modules that function across multiple operating systems like cmd and file. + +## Supported Modules + +1. Modules to support specific operating systems traditionally maintained by the core team +– such as RedHat, MacOS, Windows, Solaris, etc. +2. Modules to support specific but critical applications, such as Apache, MySQL, etc. +3. Modules created and maintained as part of VMware backed support agreements and +contracts. + +## Community Extension Modules + +1. Modules to support specific operating systems traditionally maintained by the OS vendor +– such as SUSE, openBSD, NetBSD, etc. +2. Modules to support cloud interfaces, such as AWS, Azure, etc. +3. Modules no longer maintained, or which we suspect are also no longer used or +maintained, such as moosefs, qemu_img, etc. + + +.. _deprecate-modules: + +How do I deprecate a Salt module to a Salt extension +---------------------------------------------------- + +To indicate that a Salt module is being deprecated in favor of a Salt extension, +for each Salt module include ``__deprecated__`` tuple in the module. The tuple +should include the version of Salt that the module will be removed, the name of the +collection of modules that are being deprecated, and the URL where the source for +the new extension can be found. + +.. code-block: python + + __deprecated__ = ( + 3009, + "boto", + "https://github.com/salt-extensions/saltext-boto", + ) From 25ad52234468f671ff283021b124c48fc306cb36 Mon Sep 17 00:00:00 2001 From: "Gareth J. Greenaway" Date: Wed, 28 Jun 2023 13:03:12 -0700 Subject: [PATCH 085/393] Clarify what version numbers to include in the deprecation decorator. --- doc/topics/development/salt_extensions.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/topics/development/salt_extensions.rst b/doc/topics/development/salt_extensions.rst index 85b6d538127..f1d878ad9f2 100644 --- a/doc/topics/development/salt_extensions.rst +++ b/doc/topics/development/salt_extensions.rst @@ -63,7 +63,9 @@ To indicate that a Salt module is being deprecated in favor of a Salt extension, for each Salt module include ``__deprecated__`` tuple in the module. The tuple should include the version of Salt that the module will be removed, the name of the collection of modules that are being deprecated, and the URL where the source for -the new extension can be found. +the new extension can be found. The version should be 2 major versions from the +next major release. For example, the next major release of Salt is 3100, the +deprecation version should be set to 3102. .. code-block: python From ebe00a73d6dc9aed1c81f2a1eb4ac40cf16d63ad Mon Sep 17 00:00:00 2001 From: "Gareth J. Greenaway" Date: Wed, 28 Jun 2023 13:16:14 -0700 Subject: [PATCH 086/393] fix lists --- doc/topics/development/salt_extensions.rst | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/doc/topics/development/salt_extensions.rst b/doc/topics/development/salt_extensions.rst index f1d878ad9f2..daa9282a6c0 100644 --- a/doc/topics/development/salt_extensions.rst +++ b/doc/topics/development/salt_extensions.rst @@ -33,15 +33,20 @@ The criteria to determine which category to place modules in will follow these r ## Core Modules 1. Required Salt Functionality + a. Modules such as state, sys, peer, grains, pillar, etc. + 2. Modules critical to Salt’s Multi OS support + a. Modules that function across multiple operating systems like cmd and file. ## Supported Modules 1. Modules to support specific operating systems traditionally maintained by the core team – such as RedHat, MacOS, Windows, Solaris, etc. + 2. Modules to support specific but critical applications, such as Apache, MySQL, etc. + 3. Modules created and maintained as part of VMware backed support agreements and contracts. @@ -49,7 +54,9 @@ contracts. 1. Modules to support specific operating systems traditionally maintained by the OS vendor – such as SUSE, openBSD, NetBSD, etc. + 2. Modules to support cloud interfaces, such as AWS, Azure, etc. + 3. Modules no longer maintained, or which we suspect are also no longer used or maintained, such as moosefs, qemu_img, etc. From 2ccda334e66a363a5eec6e3c1ae5aa5127792233 Mon Sep 17 00:00:00 2001 From: "Gareth J. Greenaway" Date: Wed, 28 Jun 2023 14:21:05 -0700 Subject: [PATCH 087/393] suggested fixes --- doc/topics/development/salt_extensions.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/topics/development/salt_extensions.rst b/doc/topics/development/salt_extensions.rst index daa9282a6c0..360f80a903d 100644 --- a/doc/topics/development/salt_extensions.rst +++ b/doc/topics/development/salt_extensions.rst @@ -28,7 +28,7 @@ documentation outlining transfer of ownership it can be handled on a case-by-cas community modules can be hosted either in individual or corporate source control systems, alternatively they can also be hosted in the community run Salt Extensions Github organization, that will operate like the the Salt Formulas Github organization. -The criteria to determine which category to place modules in will follow these rules. +The criteria to determine which category to place modules in will follow these rules: ## Core Modules @@ -71,7 +71,7 @@ for each Salt module include ``__deprecated__`` tuple in the module. The tuple should include the version of Salt that the module will be removed, the name of the collection of modules that are being deprecated, and the URL where the source for the new extension can be found. The version should be 2 major versions from the -next major release. For example, the next major release of Salt is 3100, the +next major release. For example, if the next major release of Salt is 3100, the deprecation version should be set to 3102. .. code-block: python From 60a97b62367b76e81319bf231b27808d7a5e3cfa Mon Sep 17 00:00:00 2001 From: "Gareth J. Greenaway" Date: Wed, 28 Jun 2023 14:42:57 -0700 Subject: [PATCH 088/393] Using DeprecationWarning instead of FutureWarning. --- salt/utils/decorators/extension_deprecation.py | 2 +- tests/pytests/functional/utils/test_extension_deprecation.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/salt/utils/decorators/extension_deprecation.py b/salt/utils/decorators/extension_deprecation.py index 3b5c680803d..dd416d9b37f 100644 --- a/salt/utils/decorators/extension_deprecation.py +++ b/salt/utils/decorators/extension_deprecation.py @@ -24,7 +24,7 @@ def extension_deprecation_message(version, extension_name, extension_repo): "functionality will be removed in version {version} in favor of the " f"saltext.{extension_name} Salt Extension. " f"({extension_repo})", - category=FutureWarning, + category=DeprecationWarning, ) return function(*args, **salt.utils.args.clean_kwargs(**kwargs)) diff --git a/tests/pytests/functional/utils/test_extension_deprecation.py b/tests/pytests/functional/utils/test_extension_deprecation.py index 71db317c4e5..51b21b99353 100644 --- a/tests/pytests/functional/utils/test_extension_deprecation.py +++ b/tests/pytests/functional/utils/test_extension_deprecation.py @@ -24,5 +24,5 @@ def test_extension_deprecation(): assert ret assert len(catch_warnings) == 1 - assert issubclass(catch_warnings[-1].category, FutureWarning) + assert issubclass(catch_warnings[-1].category, DeprecationWarning) assert str(catch_warnings[-1].message) == expected_deprecation_message From f0933cf408db0b51f34dcc5d4a37daf1b10219e2 Mon Sep 17 00:00:00 2001 From: "Gareth J. Greenaway" Date: Thu, 29 Jun 2023 07:42:34 -0700 Subject: [PATCH 089/393] Adding ignore_list argument to the decorator to filter out functions in a module that should not have the deprecation warning applied. --- .../utils/decorators/extension_deprecation.py | 21 +++++++++++-------- .../utils/test_extension_deprecation.py | 17 ++++++++++++--- 2 files changed, 26 insertions(+), 12 deletions(-) diff --git a/salt/utils/decorators/extension_deprecation.py b/salt/utils/decorators/extension_deprecation.py index dd416d9b37f..aff4d205835 100644 --- a/salt/utils/decorators/extension_deprecation.py +++ b/salt/utils/decorators/extension_deprecation.py @@ -10,7 +10,9 @@ import salt.utils.versions log = logging.getLogger(__name__) -def extension_deprecation_message(version, extension_name, extension_repo): +def extension_deprecation_message( + version, extension_name, extension_repo, ignore_list=None +): """ Decorator wrapper to warn about deprecation """ @@ -18,14 +20,15 @@ def extension_deprecation_message(version, extension_name, extension_repo): def decorator(function): @wraps(function) def wrapper(*args, **kwargs): - salt.utils.versions.warn_until( - version, - f"The '{extension_name}' functionality in Salt has been deprecated and its " - "functionality will be removed in version {version} in favor of the " - f"saltext.{extension_name} Salt Extension. " - f"({extension_repo})", - category=DeprecationWarning, - ) + if not ignore_list or function.__name__ not in ignore_list: + salt.utils.versions.warn_until( + version, + f"The '{extension_name}' functionality in Salt has been deprecated and its " + "functionality will be removed in version {version} in favor of the " + f"saltext.{extension_name} Salt Extension. " + f"({extension_repo})", + category=DeprecationWarning, + ) return function(*args, **salt.utils.args.clean_kwargs(**kwargs)) return wrapper diff --git a/tests/pytests/functional/utils/test_extension_deprecation.py b/tests/pytests/functional/utils/test_extension_deprecation.py index 51b21b99353..ce48f9ee57a 100644 --- a/tests/pytests/functional/utils/test_extension_deprecation.py +++ b/tests/pytests/functional/utils/test_extension_deprecation.py @@ -4,7 +4,14 @@ from salt.utils.decorators.extension_deprecation import extension_deprecation_me @extension_deprecation_message(3009, "salt_mod", "http://www.example.com") -def salt_func(): +def salt_func_one(): + return True + + +@extension_deprecation_message( + 3009, "salt_mod", "http://www.example.com", ignore_list=["salt_func_two"] +) +def salt_func_two(): return True @@ -20,9 +27,13 @@ def test_extension_deprecation(): "in favor of the saltext.salt_mod Salt Extension. (http://www.example.com)" ) with warnings.catch_warnings(record=True) as catch_warnings: - ret = salt_func() + ret = salt_func_one() assert ret - assert len(catch_warnings) == 1 assert issubclass(catch_warnings[-1].category, DeprecationWarning) assert str(catch_warnings[-1].message) == expected_deprecation_message + + with warnings.catch_warnings(record=True) as catch_warnings: + ret = salt_func_two() + assert ret + assert len(catch_warnings) == 0 From 3e189252891aee78e0a1f1fc09c0894667509d7c Mon Sep 17 00:00:00 2001 From: "Gareth J. Greenaway" Date: Thu, 29 Jun 2023 08:38:05 -0700 Subject: [PATCH 090/393] update documentation to include ignore_list --- doc/topics/development/salt_extensions.rst | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/doc/topics/development/salt_extensions.rst b/doc/topics/development/salt_extensions.rst index 360f80a903d..91641ca330c 100644 --- a/doc/topics/development/salt_extensions.rst +++ b/doc/topics/development/salt_extensions.rst @@ -69,10 +69,11 @@ How do I deprecate a Salt module to a Salt extension To indicate that a Salt module is being deprecated in favor of a Salt extension, for each Salt module include ``__deprecated__`` tuple in the module. The tuple should include the version of Salt that the module will be removed, the name of the -collection of modules that are being deprecated, and the URL where the source for -the new extension can be found. The version should be 2 major versions from the -next major release. For example, if the next major release of Salt is 3100, the -deprecation version should be set to 3102. +collection of modules that are being deprecated, the URL where the source for +the new extension can be found, and optionally any functions within the module that +should be ignored when applying the warning. The version should be 2 major versions +from the next major release. For example, if the next major release of Salt is 3100, +the deprecation version should be set to 3102. .. code-block: python @@ -81,3 +82,10 @@ deprecation version should be set to 3102. "boto", "https://github.com/salt-extensions/saltext-boto", ) + + __deprecated__ = ( + 3009, + "boto", + "https://github.com/salt-extensions/saltext-boto", + ignore_list=["get_all_eip_addresses"], + ) From 8744762580f127baca457f17673f19cd15a3b7f7 Mon Sep 17 00:00:00 2001 From: "Gareth J. Greenaway" Date: Thu, 29 Jun 2023 10:21:15 -0700 Subject: [PATCH 091/393] remove ignore_list --- doc/topics/development/salt_extensions.rst | 16 ++++------------ salt/utils/decorators/extension_deprecation.py | 10 ++++++++-- .../utils/test_extension_deprecation.py | 12 +++++------- 3 files changed, 17 insertions(+), 21 deletions(-) diff --git a/doc/topics/development/salt_extensions.rst b/doc/topics/development/salt_extensions.rst index 91641ca330c..865cfd96411 100644 --- a/doc/topics/development/salt_extensions.rst +++ b/doc/topics/development/salt_extensions.rst @@ -69,11 +69,10 @@ How do I deprecate a Salt module to a Salt extension To indicate that a Salt module is being deprecated in favor of a Salt extension, for each Salt module include ``__deprecated__`` tuple in the module. The tuple should include the version of Salt that the module will be removed, the name of the -collection of modules that are being deprecated, the URL where the source for -the new extension can be found, and optionally any functions within the module that -should be ignored when applying the warning. The version should be 2 major versions -from the next major release. For example, if the next major release of Salt is 3100, -the deprecation version should be set to 3102. +collection of modules that are being deprecated, and the URL where the source for +the new extension can be found should be ignored when applying the warning. +The version should be 2 major versions from the next major release. For example, +if the next major release of Salt is 3100, the deprecation version should be set to 3102. .. code-block: python @@ -82,10 +81,3 @@ the deprecation version should be set to 3102. "boto", "https://github.com/salt-extensions/saltext-boto", ) - - __deprecated__ = ( - 3009, - "boto", - "https://github.com/salt-extensions/saltext-boto", - ignore_list=["get_all_eip_addresses"], - ) diff --git a/salt/utils/decorators/extension_deprecation.py b/salt/utils/decorators/extension_deprecation.py index aff4d205835..a540eb0825f 100644 --- a/salt/utils/decorators/extension_deprecation.py +++ b/salt/utils/decorators/extension_deprecation.py @@ -11,7 +11,9 @@ log = logging.getLogger(__name__) def extension_deprecation_message( - version, extension_name, extension_repo, ignore_list=None + version, + extension_name, + extension_repo, ): """ Decorator wrapper to warn about deprecation @@ -20,7 +22,11 @@ def extension_deprecation_message( def decorator(function): @wraps(function) def wrapper(*args, **kwargs): - if not ignore_list or function.__name__ not in ignore_list: + # Any functions that should not be decorated + # as they're used when attempting when determining + # what modules to load, eg. Salt Cloud + ignore_list = ("get_configured_provider",) + if function.__name__ not in ignore_list: salt.utils.versions.warn_until( version, f"The '{extension_name}' functionality in Salt has been deprecated and its " diff --git a/tests/pytests/functional/utils/test_extension_deprecation.py b/tests/pytests/functional/utils/test_extension_deprecation.py index ce48f9ee57a..70c1fe8b562 100644 --- a/tests/pytests/functional/utils/test_extension_deprecation.py +++ b/tests/pytests/functional/utils/test_extension_deprecation.py @@ -4,14 +4,12 @@ from salt.utils.decorators.extension_deprecation import extension_deprecation_me @extension_deprecation_message(3009, "salt_mod", "http://www.example.com") -def salt_func_one(): +def salt_func(): return True -@extension_deprecation_message( - 3009, "salt_mod", "http://www.example.com", ignore_list=["salt_func_two"] -) -def salt_func_two(): +@extension_deprecation_message(3009, "salt_mod", "http://www.example.com") +def get_configured_provider(): return True @@ -27,13 +25,13 @@ def test_extension_deprecation(): "in favor of the saltext.salt_mod Salt Extension. (http://www.example.com)" ) with warnings.catch_warnings(record=True) as catch_warnings: - ret = salt_func_one() + ret = salt_func() assert ret assert len(catch_warnings) == 1 assert issubclass(catch_warnings[-1].category, DeprecationWarning) assert str(catch_warnings[-1].message) == expected_deprecation_message with warnings.catch_warnings(record=True) as catch_warnings: - ret = salt_func_two() + ret = get_configured_provider() assert ret assert len(catch_warnings) == 0 From f83d414280beb7891475c01c8b457e8aceccea67 Mon Sep 17 00:00:00 2001 From: "Gareth J. Greenaway" Date: Thu, 29 Jun 2023 10:29:51 -0700 Subject: [PATCH 092/393] remove ignore_list --- .../pytests/functional/utils/test_extension_deprecation.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/pytests/functional/utils/test_extension_deprecation.py b/tests/pytests/functional/utils/test_extension_deprecation.py index 70c1fe8b562..218541d7b75 100644 --- a/tests/pytests/functional/utils/test_extension_deprecation.py +++ b/tests/pytests/functional/utils/test_extension_deprecation.py @@ -15,9 +15,9 @@ def get_configured_provider(): def test_extension_deprecation(): """ - this tests for a condition where an included jinja template - is removed from the salt filesystem, but is still loaded from - the cache. + this tests the extension_deprecation_message decorator to + ensure that the warning is raised when a decorated function + is called. """ expected_deprecation_message = ( "The 'salt_mod' functionality in Salt has been deprecated and " From f97b3f4419a580f401da03965eeed01fe467c32a Mon Sep 17 00:00:00 2001 From: "Gareth J. Greenaway" Date: Thu, 29 Jun 2023 11:11:37 -0700 Subject: [PATCH 093/393] removing text left from previous commit. --- doc/topics/development/salt_extensions.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/topics/development/salt_extensions.rst b/doc/topics/development/salt_extensions.rst index 865cfd96411..360f80a903d 100644 --- a/doc/topics/development/salt_extensions.rst +++ b/doc/topics/development/salt_extensions.rst @@ -70,9 +70,9 @@ To indicate that a Salt module is being deprecated in favor of a Salt extension, for each Salt module include ``__deprecated__`` tuple in the module. The tuple should include the version of Salt that the module will be removed, the name of the collection of modules that are being deprecated, and the URL where the source for -the new extension can be found should be ignored when applying the warning. -The version should be 2 major versions from the next major release. For example, -if the next major release of Salt is 3100, the deprecation version should be set to 3102. +the new extension can be found. The version should be 2 major versions from the +next major release. For example, if the next major release of Salt is 3100, the +deprecation version should be set to 3102. .. code-block: python From 1ef02f5e1ddca5e8c80a3b7e378d035c125ba836 Mon Sep 17 00:00:00 2001 From: Salt Project Packaging Date: Thu, 29 Jun 2023 21:41:11 +0000 Subject: [PATCH 094/393] Update the bootstrap script to v2023.06.28 --- salt/cloud/deploy/bootstrap-salt.sh | 124 ++++++++++++++++++++++------ 1 file changed, 97 insertions(+), 27 deletions(-) diff --git a/salt/cloud/deploy/bootstrap-salt.sh b/salt/cloud/deploy/bootstrap-salt.sh index 6d69bf69213..1cf46c774df 100644 --- a/salt/cloud/deploy/bootstrap-salt.sh +++ b/salt/cloud/deploy/bootstrap-salt.sh @@ -23,7 +23,7 @@ #====================================================================================================================== set -o nounset # Treat unset variables as an error -__ScriptVersion="2023.04.26" +__ScriptVersion="2023.06.28" __ScriptName="bootstrap-salt.sh" __ScriptFullName="$0" @@ -224,7 +224,6 @@ _KEEP_TEMP_FILES=${BS_KEEP_TEMP_FILES:-$BS_FALSE} _TEMP_CONFIG_DIR="null" _SALTSTACK_REPO_URL="https://github.com/saltstack/salt.git" _SALT_REPO_URL=${_SALTSTACK_REPO_URL} -_DOWNSTREAM_PKG_REPO=$BS_FALSE _TEMP_KEYS_DIR="null" _SLEEP="${__DEFAULT_SLEEP}" _INSTALL_MASTER=$BS_FALSE @@ -311,21 +310,31 @@ __usage() { - onedir_rc Install latest onedir RC release. - onedir_rc [version] Install a specific version. Only supported for onedir RC packages available at repo.saltproject.io + - old-stable Install latest old stable release. + - old-stable [branch] Install latest version on a branch. Only supported + for packages available at repo.saltproject.io + - old-stable [version] Install a specific version. Only supported for + packages available at repo.saltproject.io + To pin a 3xxx minor version, specify it as 3xxx.0 Examples: - ${__ScriptName} - ${__ScriptName} stable - - ${__ScriptName} stable 2017.7 - - ${__ScriptName} stable 2017.7.2 + - ${__ScriptName} stable 3006 + - ${__ScriptName} stable 3006.1 - ${__ScriptName} testing - ${__ScriptName} git - ${__ScriptName} git 2017.7 - ${__ScriptName} git v2017.7.2 - ${__ScriptName} git 06f249901a2e2f1ed310d58ea3921a129f214358 - ${__ScriptName} onedir - - ${__ScriptName} onedir 3005 + - ${__ScriptName} onedir 3006 - ${__ScriptName} onedir_rc - - ${__ScriptName} onedir_rc 3005 + - ${__ScriptName} onedir_rc 3006 + - ${__ScriptName} old-stable + - ${__ScriptName} old-stable 3005 + - ${__ScriptName} old-stable 3005.1 + Options: -a Pip install all Python pkg dependencies for Salt. Requires -V to install @@ -401,9 +410,6 @@ __usage() { -v Display script version -V Install Salt into virtualenv (only available for Ubuntu based distributions) - -w Install packages from downstream package repository rather than - upstream, saltstack package repository. This is currently only - implemented for SUSE. -x Changes the Python version used to install Salt. For CentOS 6 git installations python2.7 is supported. Fedora git installation, CentOS 7, Ubuntu 18.04 support python3. @@ -420,7 +426,7 @@ EOT } # ---------- end of function __usage ---------- -while getopts ':hvnDc:g:Gyx:wk:s:MSNXCPFUKIA:i:Lp:dH:bflV:J:j:rR:aq' opt +while getopts ':hvnDc:g:Gyx:k:s:MSNXCPFUKIA:i:Lp:dH:bflV:J:j:rR:aq' opt do case "${opt}" in @@ -436,7 +442,6 @@ do echowarn "No need to provide this option anymore, now it is a default behavior." ;; - w ) _DOWNSTREAM_PKG_REPO=$BS_TRUE ;; k ) _TEMP_KEYS_DIR="$OPTARG" ;; s ) _SLEEP=$OPTARG ;; M ) _INSTALL_MASTER=$BS_TRUE ;; @@ -595,7 +600,7 @@ if [ "$#" -gt 0 ];then fi # Check installation type -if [ "$(echo "$ITYPE" | grep -E '(stable|testing|git|onedir|onedir_rc)')" = "" ]; then +if [ "$(echo "$ITYPE" | grep -E '(stable|testing|git|onedir|onedir_rc|old-stable)')" = "" ]; then echoerror "Installation type \"$ITYPE\" is not known..." exit 1 fi @@ -619,28 +624,41 @@ elif [ "$ITYPE" = "stable" ]; then _ONEDIR_REV="latest" ITYPE="onedir" else - if [ "$(echo "$1" | grep -E '^(nightly|latest|3006)$')" != "" ]; then + if [ "$(echo "$1" | grep -E '^(nightly|latest|3005|3006)$')" != "" ]; then ONEDIR_REV="$1" _ONEDIR_REV="$1" ITYPE="onedir" shift - elif [ "$(echo "$1" | grep -E '^(3003|3004|3005)$')" != "" ]; then - STABLE_REV="$1" - shift - elif [ "$(echo "$1" | grep -E '^([3-9][0-5]{2}[6-9](\.[0-9]*)?)')" != "" ]; then + elif [ "$(echo "$1" | grep -E '^([3-9][0-5]{2}[5-9](\.[0-9]*)?)')" != "" ]; then ONEDIR_REV="minor/$1" _ONEDIR_REV="$1" ITYPE="onedir" shift + else + echo "Unknown stable version: $1 (valid: 3005, 3006, latest)" + exit 1 + fi + fi + +# If doing old-stable install, check if version specified +elif [ "$ITYPE" = "old-stable" ]; then + if [ "$#" -eq 0 ];then + ITYPE="stable" + else + if [ "$(echo "$1" | grep -E '^(3003|3004|3005)$')" != "" ]; then + STABLE_REV="$1" + ITYPE="stable" + shift elif [ "$(echo "$1" | grep -E '^([3-9][0-5]{3}(\.[0-9]*)?)$')" != "" ]; then # Handle the 3xxx.0 version as 3xxx archive (pin to minor) and strip the fake ".0" suffix + ITYPE="stable" STABLE_REV=$(echo "$1" | sed -E 's/^([3-9][0-9]{3})\.0$/\1/') if [ "$(uname)" != "Darwin" ]; then STABLE_REV="archive/$STABLE_REV" fi shift else - echo "Unknown stable version: $1 (valid: 3003, 3004, 3005, 3006, latest)" + echo "Unknown old stable version: $1 (valid: 3003, 3004, 3005)" exit 1 fi fi @@ -4573,6 +4591,12 @@ install_fedora_onedir_post() { # CentOS Install Functions # __install_saltstack_rhel_repository() { + if [ "${DISTRO_MAJOR_VERSION}" -ge 9 ]; then + echoerror "Old stable repository unavailable on RH variants greater than or equal to 9" + echoerror "Use the stable install type." + exit 1 + fi + if [ "$ITYPE" = "stable" ]; then repo_rev="$STABLE_REV" else @@ -4827,7 +4851,6 @@ install_centos_git_deps() { # Set ONEDIR_REV to STABLE_REV in case we # end up calling install_centos_onedir_deps ONEDIR_REV=${STABLE_REV} - install_centos_stable_deps || \ install_centos_onedir_deps || \ return 1 @@ -7698,13 +7721,8 @@ __set_suse_pkg_repo() { DISTRO_REPO="SLE_${DISTRO_MAJOR_VERSION}_SP${SUSE_PATCHLEVEL}" fi - if [ "$_DOWNSTREAM_PKG_REPO" -eq $BS_TRUE ]; then - suse_pkg_url_base="https://download.opensuse.org/repositories/systemsmanagement:/saltstack" - suse_pkg_url_path="${DISTRO_REPO}/systemsmanagement:saltstack.repo" - else - suse_pkg_url_base="${HTTP_VAL}://repo.saltproject.io/opensuse" - suse_pkg_url_path="${DISTRO_REPO}/systemsmanagement:saltstack:products.repo" - fi + suse_pkg_url_base="https://download.opensuse.org/repositories/systemsmanagement:/saltstack" + suse_pkg_url_path="${DISTRO_REPO}/systemsmanagement:saltstack.repo" SUSE_PKG_URL="$suse_pkg_url_base/$suse_pkg_url_path" } @@ -7724,7 +7742,7 @@ __version_lte() { zypper --non-interactive install --auto-agree-with-licenses python || return 1 fi - if [ "$(python -c 'import sys; V1=tuple([int(i) for i in sys.argv[1].split(".")]); V2=tuple([int(i) for i in sys.argv[2].split(".")]); print V1<=V2' "$1" "$2")" = "True" ]; then + if [ "$(${_PY_EXE} -c 'import sys; V1=tuple([int(i) for i in sys.argv[1].split(".")]); V2=tuple([int(i) for i in sys.argv[2].split(".")]); print(V1<=V2)' "$1" "$2")" = "True" ]; then __ZYPPER_REQUIRES_REPLACE_FILES=${BS_TRUE} else __ZYPPER_REQUIRES_REPLACE_FILES=${BS_FALSE} @@ -8130,6 +8148,11 @@ install_opensuse_15_git() { return 0 } +install_opensuse_15_onedir_deps() { + __opensuse_prep_install || return 1 + return 0 +} + # # End of openSUSE Leap 15 # @@ -8159,6 +8182,13 @@ install_suse_15_git_deps() { return 0 } +install_suse_15_onedir_deps() { + __opensuse_prep_install || return 1 + install_opensuse_15_onedir_deps || return 1 + + return 0 +} + install_suse_15_stable() { install_opensuse_stable || return 1 return 0 @@ -8169,6 +8199,11 @@ install_suse_15_git() { return 0 } +install_suse_15_onedir() { + install_opensuse_stable || return 1 + return 0 +} + install_suse_15_stable_post() { install_opensuse_stable_post || return 1 return 0 @@ -8179,6 +8214,11 @@ install_suse_15_git_post() { return 0 } +install_suse_15_onedir_post() { + install_opensuse_stable_post || return 1 + return 0 +} + install_suse_15_restart_daemons() { install_opensuse_restart_daemons || return 1 return 0 @@ -8261,6 +8301,11 @@ install_suse_12_git_deps() { return 0 } +install_suse_12_onedir_deps() { + install_suse_12_stable_deps || return 1 + return 0 +} + install_suse_12_stable() { install_opensuse_stable || return 1 return 0 @@ -8271,6 +8316,11 @@ install_suse_12_git() { return 0 } +install_suse_12_onedir() { + install_opensuse_stable || return 1 + return 0 +} + install_suse_12_stable_post() { install_opensuse_stable_post || return 1 return 0 @@ -8281,6 +8331,11 @@ install_suse_12_git_post() { return 0 } +install_suse_12_onedir_post() { + install_opensuse_stable_post || return 1 + return 0 +} + install_suse_12_restart_daemons() { install_opensuse_restart_daemons || return 1 return 0 @@ -8357,6 +8412,11 @@ install_suse_11_git_deps() { return 0 } +install_suse_11_onedir_deps() { + install_suse_11_stable_deps || return 1 + return 0 +} + install_suse_11_stable() { install_opensuse_stable || return 1 return 0 @@ -8367,6 +8427,11 @@ install_suse_11_git() { return 0 } +install_suse_11_onedir() { + install_opensuse_stable || return 1 + return 0 +} + install_suse_11_stable_post() { install_opensuse_stable_post || return 1 return 0 @@ -8377,6 +8442,11 @@ install_suse_11_git_post() { return 0 } +install_suse_11_onedir_post() { + install_opensuse_stable_post || return 1 + return 0 +} + install_suse_11_restart_daemons() { install_opensuse_restart_daemons || return 1 return 0 From 2fa96841694ea88a4806c299166c37ed6fdf2ac2 Mon Sep 17 00:00:00 2001 From: twangboy Date: Wed, 28 Jun 2023 21:37:21 -0600 Subject: [PATCH 095/393] Fix an issue caching the installer when version=latest --- changelog/64519.fixed.md | 3 + salt/modules/win_pkg.py | 159 +++++++++----------- tests/pytests/unit/modules/test_win_pkg.py | 164 ++++++++++++++++----- 3 files changed, 194 insertions(+), 132 deletions(-) create mode 100644 changelog/64519.fixed.md diff --git a/changelog/64519.fixed.md b/changelog/64519.fixed.md new file mode 100644 index 00000000000..062109f6227 --- /dev/null +++ b/changelog/64519.fixed.md @@ -0,0 +1,3 @@ +`win_pkg` Fixes an issue runing `pkg.install` with `version=latest` where the +new installer would not be cached if there was already an installer present +with the same name. diff --git a/salt/modules/win_pkg.py b/salt/modules/win_pkg.py index e80dd193221..e8fdf22e419 100644 --- a/salt/modules/win_pkg.py +++ b/salt/modules/win_pkg.py @@ -215,7 +215,7 @@ def upgrade_available(name, **kwargs): refresh = salt.utils.data.is_true(kwargs.get("refresh", True)) # if latest_version returns blank, the latest version is already installed or - # their is no package definition. This is a salt standard which could be improved. + # there is no package definition. This is a salt standard which could be improved. return latest_version(name, saltenv=saltenv, refresh=refresh) != "" @@ -1315,7 +1315,7 @@ def _get_source_sum(source_hash, file_path, saltenv, verify_ssl=True): # The source_hash is a file on a server try: cached_hash_file = __salt__["cp.cache_file"]( - source_hash, saltenv=saltenv, verify_ssl=verify_ssl + source_hash, saltenv=saltenv, verify_ssl=verify_ssl, use_etag=True ) except MinionError as exc: log.exception("Failed to cache %s", source_hash, exc_info=exc) @@ -1640,6 +1640,13 @@ def install(name=None, refresh=False, pkgs=None, **kwargs): ret[pkg_name] = {"no installer": version_num} continue + # Hash the installer source after verifying it was defined + installer_hash = __salt__["cp.hash_file"](installer, saltenv) + if isinstance(installer_hash, dict): + installer_hash = installer_hash["hsum"] + else: + installer_hash = None + # Is the installer in a location that requires caching if __salt__["config.valid_fileproto"](installer): @@ -1649,6 +1656,7 @@ def install(name=None, refresh=False, pkgs=None, **kwargs): # single files if cache_dir and installer.startswith("salt:"): path, _ = os.path.split(installer) + log.debug(f"PKG: Caching directory: {path}") try: __salt__["cp.cache_dir"]( path=path, @@ -1664,51 +1672,45 @@ def install(name=None, refresh=False, pkgs=None, **kwargs): # Check to see if the cache_file is cached... if passed if cache_file and cache_file.startswith("salt:"): + cache_file_hash = __salt__["cp.hash_file"](cache_file, saltenv) + log.debug(f"PKG: Caching file: {cache_file}") + try: + cached_file = __salt__["cp.cache_file"]( + cache_file, + saltenv=saltenv, + source_hash=cache_file_hash, + verify_ssl=kwargs.get("verify_ssl", True), + ) + except MinionError as exc: + msg = "Failed to cache {}".format(cache_file) + log.exception(msg, exc_info=exc) + return "{}\n{}".format(msg, exc) - # Check to see if the file is cached - cached_file = __salt__["cp.is_cached"](cache_file, saltenv) + # Check if the cache_file was cached successfully if not cached_file: - try: - cached_file = __salt__["cp.cache_file"]( - cache_file, - saltenv=saltenv, - verify_ssl=kwargs.get("verify_ssl", True), - ) - except MinionError as exc: - msg = "Failed to cache {}".format(cache_file) - log.exception(msg, exc_info=exc) - return "{}\n{}".format(msg, exc) + log.error("Unable to cache %s", cache_file) + ret[pkg_name] = {"failed to cache cache_file": cache_file} + continue - # Make sure the cached file is the same as the source - if __salt__["cp.hash_file"](cache_file, saltenv) != __salt__[ - "cp.hash_file" - ](cached_file): - try: - cached_file = __salt__["cp.cache_file"]( - cache_file, - saltenv=saltenv, - verify_ssl=kwargs.get("verify_ssl", True), - ) - except MinionError as exc: - msg = "Failed to cache {}".format(cache_file) - log.exception(msg, exc_info=exc) - return "{}\n{}".format(msg, exc) + # If version is "latest" we always cache because "cp.is_cached" only + # checks that the file exists, not that is has changed + cached_pkg = False + if version_num != "latest" and not installer.startswith("salt:"): + cached_pkg = __salt__["cp.is_cached"](installer, saltenv) - # Check if the cache_file was cached successfully - if not cached_file: - log.error("Unable to cache %s", cache_file) - ret[pkg_name] = {"failed to cache cache_file": cache_file} - continue - - # Check to see if the installer is cached - cached_pkg = __salt__["cp.is_cached"](installer, saltenv) if not cached_pkg: - # It's not cached. Cache it, mate. + # Since we're passing "installer_hash", it should only cache the + # file if the source_hash doesn't match, which only works on + # files hosted on "salt://". If the http/https url supports + # etag, it should also verify that information before caching + log.debug(f"PKG: Caching file: {installer}") try: cached_pkg = __salt__["cp.cache_file"]( installer, saltenv=saltenv, + source_hash=installer_hash, verify_ssl=kwargs.get("verify_ssl", True), + use_etag=True, ) except MinionError as exc: msg = "Failed to cache {}".format(installer) @@ -1722,29 +1724,6 @@ def install(name=None, refresh=False, pkgs=None, **kwargs): ) ret[pkg_name] = {"unable to cache": installer} continue - - # Compare the hash of the cached installer to the source only if the - # file is hosted on salt: - if installer.startswith("salt:"): - if __salt__["cp.hash_file"](installer, saltenv) != __salt__[ - "cp.hash_file" - ](cached_pkg): - try: - cached_pkg = __salt__["cp.cache_file"]( - installer, - saltenv=saltenv, - verify_ssl=kwargs.get("verify_ssl", True), - ) - except MinionError as exc: - msg = "Failed to cache {}".format(installer) - log.exception(msg, exc_info=exc) - return "{}\n{}".format(msg, exc) - - # Check if the installer was cached successfully - if not cached_pkg: - log.error("Unable to cache %s", installer) - ret[pkg_name] = {"unable to cache": installer} - continue else: # Run the installer directly (not hosted on salt:, https:, etc.) cached_pkg = installer @@ -1786,7 +1765,6 @@ def install(name=None, refresh=False, pkgs=None, **kwargs): log.debug("pkg.install: Source hash matches package hash.") # Get install flags - install_flags = pkginfo[version_num].get("install_flags", "") if options and options.get("extra_install_flags"): install_flags = "{} {}".format( @@ -2063,7 +2041,7 @@ def remove(name=None, pkgs=None, **kwargs): removal_targets.append(ver_install) else: if version_num in pkginfo: - # we known how to remove this version + # we know how to remove this version if version_num in old[pkgname]: removal_targets.append(version_num) else: @@ -2107,8 +2085,15 @@ def remove(name=None, pkgs=None, **kwargs): ret[pkgname] = {"no uninstaller defined": target} continue - # Where is the uninstaller - if uninstaller.startswith(("salt:", "http:", "https:", "ftp:")): + # Hash the uninstaller source after verifying it was defined + uninstaller_hash = __salt__["cp.hash_file"](uninstaller, saltenv) + if isinstance(uninstaller_hash, dict): + uninstaller_hash = uninstaller_hash["hsum"] + else: + uninstaller_hash = None + + # Is the uninstaller in a location that requires caching + if __salt__["config.valid_fileproto"](uninstaller): # Check for the 'cache_dir' parameter in the .sls file # If true, the entire directory will be cached instead of the @@ -2117,24 +2102,38 @@ def remove(name=None, pkgs=None, **kwargs): if cache_dir and uninstaller.startswith("salt:"): path, _ = os.path.split(uninstaller) + log.debug(f"PKG: Caching dir: {path}") try: __salt__["cp.cache_dir"]( - path, saltenv, False, None, "E@init.sls$" + path=path, + saltenv=saltenv, + include_empty=False, + include_pat=None, + exclude_pat="E@init.sls$", ) except MinionError as exc: msg = "Failed to cache {}".format(path) log.exception(msg, exc_info=exc) return "{}\n{}".format(msg, exc) - # Check to see if the uninstaller is cached + # Check to see if the uninstaller is cached. We don't want to + # check for latest here like we do for "pkg.install" because we + # only want to uninstall the version that has been installed cached_pkg = __salt__["cp.is_cached"](uninstaller, saltenv) if not cached_pkg: - # It's not cached. Cache it, mate. + # Since we're passing "uninstaller_hash", it should only + # cache the file if the source_hash doesn't match, which + # only works on files hosted on "salt://". If the http/https + # url supports etag, it should also verify that information + # before caching + log.debug(f"PKG: Caching file: {uninstaller}") try: cached_pkg = __salt__["cp.cache_file"]( uninstaller, saltenv=saltenv, + source_hash=uninstaller_hash, verify_ssl=kwargs.get("verify_ssl", True), + use_etag=True, ) except MinionError as exc: msg = "Failed to cache {}".format(uninstaller) @@ -2147,32 +2146,8 @@ def remove(name=None, pkgs=None, **kwargs): ret[pkgname] = {"unable to cache": uninstaller} continue - # Compare the hash of the cached installer to the source only if - # the file is hosted on salt: - # TODO cp.cache_file does cache and hash checking? So why do it again? - if uninstaller.startswith("salt:"): - if __salt__["cp.hash_file"](uninstaller, saltenv) != __salt__[ - "cp.hash_file" - ](cached_pkg): - try: - cached_pkg = __salt__["cp.cache_file"]( - uninstaller, - saltenv=saltenv, - verify_ssl=kwargs.get("verify_ssl", True), - ) - except MinionError as exc: - msg = "Failed to cache {}".format(uninstaller) - log.exception(msg, exc_info=exc) - return "{}\n{}".format(msg, exc) - - # Check if the installer was cached successfully - if not cached_pkg: - log.error("Unable to cache %s", uninstaller) - ret[pkgname] = {"unable to cache": uninstaller} - continue else: - # Run the uninstaller directly - # (not hosted on salt:, https:, etc.) + # Run the uninstaller directly (not hosted on salt:, https:, etc.) cached_pkg = os.path.expandvars(uninstaller) # Fix non-windows slashes diff --git a/tests/pytests/unit/modules/test_win_pkg.py b/tests/pytests/unit/modules/test_win_pkg.py index 6d435f00a54..9ef693a21f7 100644 --- a/tests/pytests/unit/modules/test_win_pkg.py +++ b/tests/pytests/unit/modules/test_win_pkg.py @@ -6,6 +6,7 @@ import logging import pytest import salt.modules.config as config +import salt.modules.cp as cp import salt.modules.pkg_resource as pkg_resource import salt.modules.win_pkg as win_pkg import salt.utils.data @@ -21,8 +22,17 @@ pytestmark = [ @pytest.fixture -def configure_loader_modules(): +def configure_loader_modules(minion_opts): pkg_info = { + "latest": { + "full_name": "Nullsoft Install System", + "installer": "http://download.sourceforge.net/project/nsis/nsis-setup.exe", + "install_flags": "/S", + "uninstaller": "%PROGRAMFILES(x86)%\\NSIS\\uninst-nsis.exe", + "uninstall_flags": "/S", + "msiexec": False, + "reboot": False, + }, "3.03": { "full_name": "Nullsoft Install System", "installer": "http://download.sourceforge.net/project/nsis/NSIS%203/3.03/nsis-3.03-setup.exe", @@ -43,16 +53,20 @@ def configure_loader_modules(): }, } + opts = minion_opts + opts["master_uri"] = "localhost" return { + cp: {"__opts__": opts}, win_pkg: { "_get_latest_package_version": MagicMock(return_value="3.03"), "_get_package_info": MagicMock(return_value=pkg_info), "__salt__": { + "config.valid_fileproto": config.valid_fileproto, + "cp.hash_file": cp.hash_file, "pkg_resource.add_pkg": pkg_resource.add_pkg, "pkg_resource.parse_targets": pkg_resource.parse_targets, "pkg_resource.sort_pkglist": pkg_resource.sort_pkglist, "pkg_resource.stringify": pkg_resource.stringify, - "config.valid_fileproto": config.valid_fileproto, }, "__utils__": { "reg.key_exists": win_reg.key_exists, @@ -164,19 +178,81 @@ def test_pkg_install_existing(): se_list_pkgs = {"nsis": ["3.03"]} with patch.object(win_pkg, "list_pkgs", return_value=se_list_pkgs), patch.object( win_pkg, "_get_reg_software", return_value=ret_reg - ), patch.dict( - win_pkg.__salt__, {"cp.is_cached": MagicMock(return_value=False)} ), patch.dict( win_pkg.__salt__, - {"cp.cache_file": MagicMock(return_value="C:\\fake\\path.exe")}, - ), patch.dict( - win_pkg.__salt__, {"cmd.run_all": MagicMock(return_value={"retcode": 0})} + { + "cmd.run_all": MagicMock(return_value={"retcode": 0}), + "cp.cache_file": MagicMock(return_value="C:\\fake\\path.exe"), + "cp.is_cached": MagicMock(return_value=True), + }, ): expected = {} result = win_pkg.install(name="nsis") assert expected == result +def test_pkg_install_latest(): + """ + test pkg.install when the package is already installed + no version passed + """ + ret_reg = {"Nullsoft Install System": "3.03"} + # The 2nd time it's run, pkg.list_pkgs uses with stringify + se_list_pkgs = [{"nsis": ["3.03"]}, {"nsis": "3.04"}] + mock_cache_file = MagicMock(return_value="C:\\fake\\path.exe") + with patch.object(win_pkg, "list_pkgs", side_effect=se_list_pkgs), patch.object( + win_pkg, "_get_reg_software", return_value=ret_reg + ), patch.dict( + win_pkg.__salt__, + { + "cmd.run_all": MagicMock(return_value={"retcode": 0}), + "cp.cache_file": mock_cache_file, + "cp.is_cached": MagicMock(return_value=False), + }, + ): + expected = {"nsis": {"new": "3.04", "old": "3.03"}} + result = win_pkg.install(name="nsis", version="latest") + assert expected == result + mock_cache_file.assert_called_once_with( + "http://download.sourceforge.net/project/nsis/nsis-setup.exe", + saltenv="base", + source_hash=None, + verify_ssl=True, + use_etag=True, + ) + + +def test_pkg_install_latest_is_cached(): + """ + test pkg.install when the package is already installed + no version passed + """ + ret_reg = {"Nullsoft Install System": "3.03"} + # The 2nd time it's run, pkg.list_pkgs uses with stringify + se_list_pkgs = [{"nsis": ["3.03"]}, {"nsis": "3.04"}] + mock_cache_file = MagicMock(return_value="C:\\fake\\path.exe") + with patch.object(win_pkg, "list_pkgs", side_effect=se_list_pkgs), patch.object( + win_pkg, "_get_reg_software", return_value=ret_reg + ), patch.dict( + win_pkg.__salt__, + { + "cmd.run_all": MagicMock(return_value={"retcode": 0}), + "cp.cache_file": mock_cache_file, + "cp.is_cached": MagicMock(return_value=True), + }, + ): + expected = {"nsis": {"new": "3.04", "old": "3.03"}} + result = win_pkg.install(name="nsis", version="latest") + assert expected == result + mock_cache_file.assert_called_once_with( + "http://download.sourceforge.net/project/nsis/nsis-setup.exe", + saltenv="base", + source_hash=None, + verify_ssl=True, + use_etag=True, + ) + + def test_pkg_install_existing_with_version(): """ test pkg.install when the package is already installed @@ -187,13 +263,13 @@ def test_pkg_install_existing_with_version(): se_list_pkgs = {"nsis": ["3.03"]} with patch.object(win_pkg, "list_pkgs", return_value=se_list_pkgs), patch.object( win_pkg, "_get_reg_software", return_value=ret_reg - ), patch.dict( - win_pkg.__salt__, {"cp.is_cached": MagicMock(return_value=False)} ), patch.dict( win_pkg.__salt__, - {"cp.cache_file": MagicMock(return_value="C:\\fake\\path.exe")}, - ), patch.dict( - win_pkg.__salt__, {"cmd.run_all": MagicMock(return_value={"retcode": 0})} + { + "cmd.run_all": MagicMock(return_value={"retcode": 0}), + "cp.cache_file": MagicMock(return_value="C:\\fake\\path.exe"), + "cp.is_cached": MagicMock(return_value=False), + }, ): expected = {} result = win_pkg.install(name="nsis", version="3.03") @@ -233,7 +309,7 @@ def test_pkg_install_name(): "cmd.run_all": mock_cmd_run_all, }, ): - ret = win_pkg.install( + win_pkg.install( name="firebox", version="3.03", extra_install_flags="-e True -test_flag True", @@ -248,22 +324,26 @@ def test_pkg_install_verify_ssl_false(): ret_reg = {"Nullsoft Install System": "3.03"} # The 2nd time it's run, pkg.list_pkgs uses with stringify se_list_pkgs = [{"nsis": ["3.03"]}, {"nsis": "3.02"}] - mock_cp = MagicMock(return_value="C:\\fake\\path.exe") + mock_cache_file = MagicMock(return_value="C:\\fake\\path.exe") with patch.object(win_pkg, "list_pkgs", side_effect=se_list_pkgs), patch.object( win_pkg, "_get_reg_software", return_value=ret_reg ), patch.dict( - win_pkg.__salt__, {"cp.is_cached": MagicMock(return_value=False)} - ), patch.dict( - win_pkg.__salt__, {"cp.cache_file": mock_cp} - ), patch.dict( - win_pkg.__salt__, {"cmd.run_all": MagicMock(return_value={"retcode": 0})} + win_pkg.__salt__, + { + "cmd.run_all": MagicMock(return_value={"retcode": 0}), + "cp.cache_file": mock_cache_file, + "cp.is_cached": MagicMock(return_value=False), + "cp.hash_file": MagicMock(return_value={"hsum": "abc123"}), + }, ): expected = {"nsis": {"new": "3.02", "old": "3.03"}} result = win_pkg.install(name="nsis", version="3.02", verify_ssl=False) - mock_cp.assert_called_once_with( + mock_cache_file.assert_called_once_with( "http://download.sourceforge.net/project/nsis/NSIS%203/3.02/nsis-3.02-setup.exe", saltenv="base", + source_hash="abc123", verify_ssl=False, + use_etag=True, ) assert expected == result @@ -300,7 +380,7 @@ def test_pkg_install_single_pkg(): "cmd.run_all": mock_cmd_run_all, }, ): - ret = win_pkg.install( + win_pkg.install( pkgs=["firebox"], version="3.03", extra_install_flags="-e True -test_flag True", @@ -387,7 +467,7 @@ def test_pkg_install_multiple_pkgs(): "cmd.run_all": mock_cmd_run_all, }, ): - ret = win_pkg.install( + win_pkg.install( pkgs=["firebox", "got"], extra_install_flags="-e True -test_flag True" ) assert "-e True -test_flag True" not in str(mock_cmd_run_all.call_args[0]) @@ -429,7 +509,7 @@ def test_pkg_install_minion_error_https(): "cp.cache_file": mock_minion_error, }, ): - ret = win_pkg.install( + result = win_pkg.install( name="firebox", version="3.03", ) @@ -438,7 +518,7 @@ def test_pkg_install_minion_error_https(): " getaddrinfo failed reading https://repo.test.com/runme.exe" ) - assert ret == expected + assert result == expected def test_pkg_install_minion_error_salt(): @@ -469,12 +549,13 @@ def test_pkg_install_minion_error_salt(): ), patch.dict( win_pkg.__salt__, { - "pkg_resource.parse_targets": mock_parse, - "cp.is_cached": mock_none, "cp.cache_file": mock_minion_error, + "cp.is_cached": mock_none, + "cp.hash_file": MagicMock(return_value={"hsum": "abc123"}), + "pkg_resource.parse_targets": mock_parse, }, ): - ret = win_pkg.install( + result = win_pkg.install( name="firebox", version="3.03", ) @@ -483,7 +564,7 @@ def test_pkg_install_minion_error_salt(): "Error: [Errno 1] failed reading salt://software/runme.exe" ) - assert ret == expected + assert result == expected def test_pkg_install_minion_error_salt_cache_dir(): @@ -505,18 +586,19 @@ def test_pkg_install_minion_error_salt_cache_dir(): } err_msg = "Error: [Errno 1] failed reading salt://software" - mock_none = MagicMock(return_value=None) mock_minion_error = MagicMock(side_effect=MinionError(err_msg)) - mock_parse = MagicMock(return_value=[{"firebox": "3.03"}, None]) with patch.object( salt.utils.data, "is_true", MagicMock(return_value=True) ), patch.object( win_pkg, "_get_package_info", MagicMock(return_value=ret__get_package_info) ), patch.dict( win_pkg.__salt__, - {"cp.cache_dir": mock_minion_error}, + { + "cp.cache_dir": mock_minion_error, + "cp.hash_file": MagicMock(return_value={"hsum": "abc123"}), + }, ): - ret = win_pkg.install( + result = win_pkg.install( name="firebox", version="3.03", ) @@ -525,7 +607,7 @@ def test_pkg_install_minion_error_salt_cache_dir(): "Error: [Errno 1] failed reading salt://software" ) - assert ret == expected + assert result == expected def test_pkg_remove_log_message(caplog): @@ -602,17 +684,18 @@ def test_pkg_remove_minion_error_salt_cache_dir(): ), patch.dict( win_pkg.__salt__, { - "pkg_resource.parse_targets": mock_parse, "cp.cache_dir": mock_minion_error, + "cp.hash_file": MagicMock(return_value={"hsum": "abc123"}), + "pkg_resource.parse_targets": mock_parse, }, ): - ret = win_pkg.remove(name="firebox") + result = win_pkg.remove(name="firebox") expected = ( "Failed to cache salt://software\n" "Error: [Errno 1] failed reading salt://software" ) - assert ret == expected + assert result == expected def test_pkg_remove_minion_error_salt(): @@ -644,18 +727,19 @@ def test_pkg_remove_minion_error_salt(): ), patch.dict( win_pkg.__salt__, { - "pkg_resource.parse_targets": mock_parse, - "cp.is_cached": mock_none, "cp.cache_file": mock_minion_error, + "cp.hash_file": MagicMock(return_value={"hsum": "abc123"}), + "cp.is_cached": mock_none, + "pkg_resource.parse_targets": mock_parse, }, ): - ret = win_pkg.remove(name="firebox") + result = win_pkg.remove(name="firebox") expected = ( "Failed to cache salt://software/runme.exe\n" "Error: [Errno 1] failed reading salt://software/runme.exe" ) - assert ret == expected + assert result == expected @pytest.mark.parametrize( From e6abf4b2d5285a9ef5d98d9eeb80947da82be2df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20Su=C3=A1rez=20Hern=C3=A1ndez?= Date: Mon, 26 Jun 2023 13:23:28 +0100 Subject: [PATCH 096/393] Fix detection of Salt codename by salt_version module --- salt/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/salt/version.py b/salt/version.py index 43cb5f86f75..7d608fd14d9 100644 --- a/salt/version.py +++ b/salt/version.py @@ -78,7 +78,7 @@ class SaltVersionsInfo(type): ALUMINIUM = SaltVersion("Aluminium" , info=3003, released=True) SILICON = SaltVersion("Silicon" , info=3004, released=True) PHOSPHORUS = SaltVersion("Phosphorus" , info=3005, released=True) - SULFUR = SaltVersion("Sulfur" , info=(3006, 0), released=True) + SULFUR = SaltVersion("Sulfur" , info=3006, released=True) CHLORINE = SaltVersion("Chlorine" , info=(3007, 0)) ARGON = SaltVersion("Argon" , info=(3008, 0)) POTASSIUM = SaltVersion("Potassium" , info=(3009, 0)) From f5861ccb10bbe602f052a5f0d1da58b52f271b91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20Su=C3=A1rez=20Hern=C3=A1ndez?= Date: Tue, 27 Jun 2023 11:59:06 +0100 Subject: [PATCH 097/393] Fix mess with version detection bad version definition --- salt/version.py | 208 ++++++++++++++++++++++++------------------------ 1 file changed, 103 insertions(+), 105 deletions(-) diff --git a/salt/version.py b/salt/version.py index 7d608fd14d9..22ba1905c4b 100644 --- a/salt/version.py +++ b/salt/version.py @@ -79,108 +79,108 @@ class SaltVersionsInfo(type): SILICON = SaltVersion("Silicon" , info=3004, released=True) PHOSPHORUS = SaltVersion("Phosphorus" , info=3005, released=True) SULFUR = SaltVersion("Sulfur" , info=3006, released=True) - CHLORINE = SaltVersion("Chlorine" , info=(3007, 0)) - ARGON = SaltVersion("Argon" , info=(3008, 0)) - POTASSIUM = SaltVersion("Potassium" , info=(3009, 0)) - CALCIUM = SaltVersion("Calcium" , info=(3010, 0)) - SCANDIUM = SaltVersion("Scandium" , info=(3011, 0)) - TITANIUM = SaltVersion("Titanium" , info=(3012, 0)) - VANADIUM = SaltVersion("Vanadium" , info=(3013, 0)) - CHROMIUM = SaltVersion("Chromium" , info=(3014, 0)) - MANGANESE = SaltVersion("Manganese" , info=(3015, 0)) - IRON = SaltVersion("Iron" , info=(3016, 0)) - COBALT = SaltVersion("Cobalt" , info=(3017, 0)) - NICKEL = SaltVersion("Nickel" , info=(3018, 0)) - COPPER = SaltVersion("Copper" , info=(3019, 0)) - ZINC = SaltVersion("Zinc" , info=(3020, 0)) - GALLIUM = SaltVersion("Gallium" , info=(3021, 0)) - GERMANIUM = SaltVersion("Germanium" , info=(3022, 0)) - ARSENIC = SaltVersion("Arsenic" , info=(3023, 0)) - SELENIUM = SaltVersion("Selenium" , info=(3024, 0)) - BROMINE = SaltVersion("Bromine" , info=(3025, 0)) - KRYPTON = SaltVersion("Krypton" , info=(3026, 0)) - RUBIDIUM = SaltVersion("Rubidium" , info=(3027, 0)) - STRONTIUM = SaltVersion("Strontium" , info=(3028, 0)) - YTTRIUM = SaltVersion("Yttrium" , info=(3029, 0)) - ZIRCONIUM = SaltVersion("Zirconium" , info=(3030, 0)) - NIOBIUM = SaltVersion("Niobium" , info=(3031, 0)) - MOLYBDENUM = SaltVersion("Molybdenum" , info=(3032, 0)) - TECHNETIUM = SaltVersion("Technetium" , info=(3033, 0)) - RUTHENIUM = SaltVersion("Ruthenium" , info=(3034, 0)) - RHODIUM = SaltVersion("Rhodium" , info=(3035, 0)) - PALLADIUM = SaltVersion("Palladium" , info=(3036, 0)) - SILVER = SaltVersion("Silver" , info=(3037, 0)) - CADMIUM = SaltVersion("Cadmium" , info=(3038, 0)) - INDIUM = SaltVersion("Indium" , info=(3039, 0)) - TIN = SaltVersion("Tin" , info=(3040, 0)) - ANTIMONY = SaltVersion("Antimony" , info=(3041, 0)) - TELLURIUM = SaltVersion("Tellurium" , info=(3042, 0)) - IODINE = SaltVersion("Iodine" , info=(3043, 0)) - XENON = SaltVersion("Xenon" , info=(3044, 0)) - CESIUM = SaltVersion("Cesium" , info=(3045, 0)) - BARIUM = SaltVersion("Barium" , info=(3046, 0)) - LANTHANUM = SaltVersion("Lanthanum" , info=(3047, 0)) - CERIUM = SaltVersion("Cerium" , info=(3048, 0)) - PRASEODYMIUM = SaltVersion("Praseodymium" , info=(3049, 0)) - NEODYMIUM = SaltVersion("Neodymium" , info=(3050, 0)) - PROMETHIUM = SaltVersion("Promethium" , info=(3051, 0)) - SAMARIUM = SaltVersion("Samarium" , info=(3052, 0)) - EUROPIUM = SaltVersion("Europium" , info=(3053, 0)) - GADOLINIUM = SaltVersion("Gadolinium" , info=(3054, 0)) - TERBIUM = SaltVersion("Terbium" , info=(3055, 0)) - DYSPROSIUM = SaltVersion("Dysprosium" , info=(3056, 0)) - HOLMIUM = SaltVersion("Holmium" , info=(3057, 0)) - ERBIUM = SaltVersion("Erbium" , info=(3058, 0)) - THULIUM = SaltVersion("Thulium" , info=(3059, 0)) - YTTERBIUM = SaltVersion("Ytterbium" , info=(3060, 0)) - LUTETIUM = SaltVersion("Lutetium" , info=(3061, 0)) - HAFNIUM = SaltVersion("Hafnium" , info=(3062, 0)) - TANTALUM = SaltVersion("Tantalum" , info=(3063, 0)) - TUNGSTEN = SaltVersion("Tungsten" , info=(3064, 0)) - RHENIUM = SaltVersion("Rhenium" , info=(3065, 0)) - OSMIUM = SaltVersion("Osmium" , info=(3066, 0)) - IRIDIUM = SaltVersion("Iridium" , info=(3067, 0)) - PLATINUM = SaltVersion("Platinum" , info=(3068, 0)) - GOLD = SaltVersion("Gold" , info=(3069, 0)) - MERCURY = SaltVersion("Mercury" , info=(3070, 0)) - THALLIUM = SaltVersion("Thallium" , info=(3071, 0)) - LEAD = SaltVersion("Lead" , info=(3072, 0)) - BISMUTH = SaltVersion("Bismuth" , info=(3073, 0)) - POLONIUM = SaltVersion("Polonium" , info=(3074, 0)) - ASTATINE = SaltVersion("Astatine" , info=(3075, 0)) - RADON = SaltVersion("Radon" , info=(3076, 0)) - FRANCIUM = SaltVersion("Francium" , info=(3077, 0)) - RADIUM = SaltVersion("Radium" , info=(3078, 0)) - ACTINIUM = SaltVersion("Actinium" , info=(3079, 0)) - THORIUM = SaltVersion("Thorium" , info=(3080, 0)) - PROTACTINIUM = SaltVersion("Protactinium" , info=(3081, 0)) - URANIUM = SaltVersion("Uranium" , info=(3082, 0)) - NEPTUNIUM = SaltVersion("Neptunium" , info=(3083, 0)) - PLUTONIUM = SaltVersion("Plutonium" , info=(3084, 0)) - AMERICIUM = SaltVersion("Americium" , info=(3085, 0)) - CURIUM = SaltVersion("Curium" , info=(3086, 0)) - BERKELIUM = SaltVersion("Berkelium" , info=(3087, 0)) - CALIFORNIUM = SaltVersion("Californium" , info=(3088, 0)) - EINSTEINIUM = SaltVersion("Einsteinium" , info=(3089, 0)) - FERMIUM = SaltVersion("Fermium" , info=(3090, 0)) - MENDELEVIUM = SaltVersion("Mendelevium" , info=(3091, 0)) - NOBELIUM = SaltVersion("Nobelium" , info=(3092, 0)) - LAWRENCIUM = SaltVersion("Lawrencium" , info=(3093, 0)) - RUTHERFORDIUM = SaltVersion("Rutherfordium", info=(3094, 0)) - DUBNIUM = SaltVersion("Dubnium" , info=(3095, 0)) - SEABORGIUM = SaltVersion("Seaborgium" , info=(3096, 0)) - BOHRIUM = SaltVersion("Bohrium" , info=(3097, 0)) - HASSIUM = SaltVersion("Hassium" , info=(3098, 0)) - MEITNERIUM = SaltVersion("Meitnerium" , info=(3099, 0)) - DARMSTADTIUM = SaltVersion("Darmstadtium" , info=(3100, 0)) - ROENTGENIUM = SaltVersion("Roentgenium" , info=(3101, 0)) - COPERNICIUM = SaltVersion("Copernicium" , info=(3102, 0)) - NIHONIUM = SaltVersion("Nihonium" , info=(3103, 0)) - FLEROVIUM = SaltVersion("Flerovium" , info=(3104, 0)) - MOSCOVIUM = SaltVersion("Moscovium" , info=(3105, 0)) - LIVERMORIUM = SaltVersion("Livermorium" , info=(3106, 0)) - TENNESSINE = SaltVersion("Tennessine" , info=(3107, 0)) - OGANESSON = SaltVersion("Oganesson" , info=(3108, 0)) + CHLORINE = SaltVersion("Chlorine" , info=3007) + ARGON = SaltVersion("Argon" , info=3008) + POTASSIUM = SaltVersion("Potassium" , info=3009) + CALCIUM = SaltVersion("Calcium" , info=3010) + SCANDIUM = SaltVersion("Scandium" , info=3011) + TITANIUM = SaltVersion("Titanium" , info=3012) + VANADIUM = SaltVersion("Vanadium" , info=3013) + CHROMIUM = SaltVersion("Chromium" , info=3014) + MANGANESE = SaltVersion("Manganese" , info=3015) + IRON = SaltVersion("Iron" , info=3016) + COBALT = SaltVersion("Cobalt" , info=3017) + NICKEL = SaltVersion("Nickel" , info=3018) + COPPER = SaltVersion("Copper" , info=3019) + ZINC = SaltVersion("Zinc" , info=3020) + GALLIUM = SaltVersion("Gallium" , info=3021) + GERMANIUM = SaltVersion("Germanium" , info=3022) + ARSENIC = SaltVersion("Arsenic" , info=3023) + SELENIUM = SaltVersion("Selenium" , info=3024) + BROMINE = SaltVersion("Bromine" , info=3025) + KRYPTON = SaltVersion("Krypton" , info=3026) + RUBIDIUM = SaltVersion("Rubidium" , info=3027) + STRONTIUM = SaltVersion("Strontium" , info=3028) + YTTRIUM = SaltVersion("Yttrium" , info=3029) + ZIRCONIUM = SaltVersion("Zirconium" , info=3030) + NIOBIUM = SaltVersion("Niobium" , info=3031) + MOLYBDENUM = SaltVersion("Molybdenum" , info=3032) + TECHNETIUM = SaltVersion("Technetium" , info=3033) + RUTHENIUM = SaltVersion("Ruthenium" , info=3034) + RHODIUM = SaltVersion("Rhodium" , info=3035) + PALLADIUM = SaltVersion("Palladium" , info=3036) + SILVER = SaltVersion("Silver" , info=3037) + CADMIUM = SaltVersion("Cadmium" , info=3038) + INDIUM = SaltVersion("Indium" , info=3039) + TIN = SaltVersion("Tin" , info=3040) + ANTIMONY = SaltVersion("Antimony" , info=3041) + TELLURIUM = SaltVersion("Tellurium" , info=3042) + IODINE = SaltVersion("Iodine" , info=3043) + XENON = SaltVersion("Xenon" , info=3044) + CESIUM = SaltVersion("Cesium" , info=3045) + BARIUM = SaltVersion("Barium" , info=3046) + LANTHANUM = SaltVersion("Lanthanum" , info=3047) + CERIUM = SaltVersion("Cerium" , info=3048) + PRASEODYMIUM = SaltVersion("Praseodymium" , info=3049) + NEODYMIUM = SaltVersion("Neodymium" , info=3050) + PROMETHIUM = SaltVersion("Promethium" , info=3051) + SAMARIUM = SaltVersion("Samarium" , info=3052) + EUROPIUM = SaltVersion("Europium" , info=3053) + GADOLINIUM = SaltVersion("Gadolinium" , info=3054) + TERBIUM = SaltVersion("Terbium" , info=3055) + DYSPROSIUM = SaltVersion("Dysprosium" , info=3056) + HOLMIUM = SaltVersion("Holmium" , info=3057) + ERBIUM = SaltVersion("Erbium" , info=3058) + THULIUM = SaltVersion("Thulium" , info=3059) + YTTERBIUM = SaltVersion("Ytterbium" , info=3060) + LUTETIUM = SaltVersion("Lutetium" , info=3061) + HAFNIUM = SaltVersion("Hafnium" , info=3062) + TANTALUM = SaltVersion("Tantalum" , info=3063) + TUNGSTEN = SaltVersion("Tungsten" , info=3064) + RHENIUM = SaltVersion("Rhenium" , info=3065) + OSMIUM = SaltVersion("Osmium" , info=3066) + IRIDIUM = SaltVersion("Iridium" , info=3067) + PLATINUM = SaltVersion("Platinum" , info=3068) + GOLD = SaltVersion("Gold" , info=3069) + MERCURY = SaltVersion("Mercury" , info=3070) + THALLIUM = SaltVersion("Thallium" , info=3071) + LEAD = SaltVersion("Lead" , info=3072) + BISMUTH = SaltVersion("Bismuth" , info=3073) + POLONIUM = SaltVersion("Polonium" , info=3074) + ASTATINE = SaltVersion("Astatine" , info=3075) + RADON = SaltVersion("Radon" , info=3076) + FRANCIUM = SaltVersion("Francium" , info=3077) + RADIUM = SaltVersion("Radium" , info=3078) + ACTINIUM = SaltVersion("Actinium" , info=3079) + THORIUM = SaltVersion("Thorium" , info=3080) + PROTACTINIUM = SaltVersion("Protactinium" , info=3081) + URANIUM = SaltVersion("Uranium" , info=3082) + NEPTUNIUM = SaltVersion("Neptunium" , info=3083) + PLUTONIUM = SaltVersion("Plutonium" , info=3084) + AMERICIUM = SaltVersion("Americium" , info=3085) + CURIUM = SaltVersion("Curium" , info=3086) + BERKELIUM = SaltVersion("Berkelium" , info=3087) + CALIFORNIUM = SaltVersion("Californium" , info=3088) + EINSTEINIUM = SaltVersion("Einsteinium" , info=3089) + FERMIUM = SaltVersion("Fermium" , info=3090) + MENDELEVIUM = SaltVersion("Mendelevium" , info=3091) + NOBELIUM = SaltVersion("Nobelium" , info=3092) + LAWRENCIUM = SaltVersion("Lawrencium" , info=3093) + RUTHERFORDIUM = SaltVersion("Rutherfordium", info=3094) + DUBNIUM = SaltVersion("Dubnium" , info=3095) + SEABORGIUM = SaltVersion("Seaborgium" , info=3096) + BOHRIUM = SaltVersion("Bohrium" , info=3097) + HASSIUM = SaltVersion("Hassium" , info=3098) + MEITNERIUM = SaltVersion("Meitnerium" , info=3099) + DARMSTADTIUM = SaltVersion("Darmstadtium" , info=3100) + ROENTGENIUM = SaltVersion("Roentgenium" , info=3101) + COPERNICIUM = SaltVersion("Copernicium" , info=3102) + NIHONIUM = SaltVersion("Nihonium" , info=3103) + FLEROVIUM = SaltVersion("Flerovium" , info=3104) + MOSCOVIUM = SaltVersion("Moscovium" , info=3105) + LIVERMORIUM = SaltVersion("Livermorium" , info=3106) + TENNESSINE = SaltVersion("Tennessine" , info=3107) + OGANESSON = SaltVersion("Oganesson" , info=3108) # <---- Please refrain from fixing whitespace ----------------------------------- # The idea is to keep this readable. # ------------------------------------------------------------------------------- @@ -324,9 +324,7 @@ class SaltStackVersion: self.mbugfix = mbugfix self.pre_type = pre_type self.pre_num = pre_num - if self.can_have_dot_zero(major): - vnames_key = (major, 0) - elif self.new_version(major): + if self.new_version(major): vnames_key = (major,) else: vnames_key = (major, minor) From 767303a3dc97b0590e2dcdb61eb5a975066f98d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20Su=C3=A1rez=20Hern=C3=A1ndez?= Date: Tue, 27 Jun 2023 11:59:41 +0100 Subject: [PATCH 098/393] Add changes suggested by pre-commit --- salt/version.py | 42 ++++++++++++++++++++---------------------- 1 file changed, 20 insertions(+), 22 deletions(-) diff --git a/salt/version.py b/salt/version.py index 22ba1905c4b..c99ef9414e7 100644 --- a/salt/version.py +++ b/salt/version.py @@ -355,15 +355,13 @@ class SaltStackVersion: ) match = cls.git_describe_regex.match(vstr) if not match: - raise ValueError( - "Unable to parse version string: '{}'".format(version_string) - ) + raise ValueError(f"Unable to parse version string: '{version_string}'") return cls(*match.groups()) @classmethod def from_name(cls, name): if name.lower() not in cls.LNAMES: - raise ValueError("Named version '{}' is not known".format(name)) + raise ValueError(f"Named version '{name}' is not known") return cls(*cls.LNAMES[name.lower()]) @classmethod @@ -446,22 +444,22 @@ class SaltStackVersion: @property def string(self): if self.new_version(self.major): - version_string = "{}".format(self.major) + version_string = f"{self.major}" if self.minor: - version_string = "{}.{}".format(self.major, self.minor) + version_string = f"{self.major}.{self.minor}" if not self.minor and self.can_have_dot_zero(self.major): - version_string = "{}.{}".format(self.major, self.minor) + version_string = f"{self.major}.{self.minor}" else: - version_string = "{}.{}.{}".format(self.major, self.minor, self.bugfix) + version_string = f"{self.major}.{self.minor}.{self.bugfix}" if self.mbugfix: - version_string += ".{}".format(self.mbugfix) + version_string += f".{self.mbugfix}" if self.pre_type: - version_string += "{}{}".format(self.pre_type, self.pre_num) + version_string += f"{self.pre_type}{self.pre_num}" if self.noc and self.sha: noc = self.noc if noc < 0: noc = "0na" - version_string += "+{}.{}".format(noc, self.sha) + version_string += f"+{noc}.{self.sha}" return version_string @property @@ -476,7 +474,7 @@ class SaltStackVersion: if self.sse: version_string += " Enterprise" if (self.major, self.minor) in self.RMATCH: - version_string += " ({})".format(self.RMATCH[(self.major, self.minor)]) + version_string += f" ({self.RMATCH[(self.major, self.minor)]})" return version_string @property @@ -500,7 +498,7 @@ class SaltStackVersion: other = SaltStackVersion(*other) else: raise ValueError( - "Cannot instantiate Version from type '{}'".format(type(other)) + f"Cannot instantiate Version from type '{type(other)}'" ) pre_type = self.pre_index other_pre_type = other.pre_index @@ -549,24 +547,24 @@ class SaltStackVersion: def __repr__(self): parts = [] if self.name: - parts.append("name='{}'".format(self.name)) - parts.extend(["major={}".format(self.major), "minor={}".format(self.minor)]) + parts.append(f"name='{self.name}'") + parts.extend([f"major={self.major}", f"minor={self.minor}"]) if self.new_version(self.major): if not self.can_have_dot_zero(self.major) and not self.minor: parts.remove("".join([x for x in parts if re.search("^minor*", x)])) else: - parts.extend(["bugfix={}".format(self.bugfix)]) + parts.extend([f"bugfix={self.bugfix}"]) if self.mbugfix: - parts.append("minor-bugfix={}".format(self.mbugfix)) + parts.append(f"minor-bugfix={self.mbugfix}") if self.pre_type: - parts.append("{}={}".format(self.pre_type, self.pre_num)) + parts.append(f"{self.pre_type}={self.pre_num}") noc = self.noc if noc == -1: noc = "0na" if noc and self.sha: - parts.extend(["noc={}".format(noc), "sha={}".format(self.sha)]) + parts.extend([f"noc={noc}", f"sha={self.sha}"]) return "<{} {}>".format(self.__class__.__name__, " ".join(parts)) @@ -613,7 +611,7 @@ def __discover_version(saltstack_version): "v[0-9]*", "--always", ], - **kwargs + **kwargs, ) out, err = process.communicate() @@ -808,7 +806,7 @@ def system_information(): # ie: R2 if re.match(r"^R\d+$", item): release = item - release = "{}Server{}".format(version, release) + release = f"{version}Server{release}" else: for item in product_name.split(" "): # If it's a number, decimal number, Thin or Vista, then it's the @@ -908,7 +906,7 @@ def versions_report(include_salt_cloud=False, include_extensions=True): if ver_type == "Salt Extensions" and ver_type not in ver_info: # No salt Extensions to report continue - info.append("{}:".format(ver_type)) + info.append(f"{ver_type}:") # List dependencies in alphabetical, case insensitive order for name in sorted(ver_info[ver_type], key=lambda x: x.lower()): ver = fmt.format( From 69696e6fd74bf470524fcc7d67e8c5e1dad890c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20Su=C3=A1rez=20Hern=C3=A1ndez?= Date: Tue, 27 Jun 2023 12:20:50 +0100 Subject: [PATCH 099/393] Add some new and fix unit tests --- .../pytests/unit/modules/test_salt_version.py | 43 ++++++++++++++++++- tests/pytests/unit/test_version.py | 10 +++-- 2 files changed, 48 insertions(+), 5 deletions(-) diff --git a/tests/pytests/unit/modules/test_salt_version.py b/tests/pytests/unit/modules/test_salt_version.py index 6d734f6a764..f6c25630e03 100644 --- a/tests/pytests/unit/modules/test_salt_version.py +++ b/tests/pytests/unit/modules/test_salt_version.py @@ -21,7 +21,7 @@ def test_mocked_objects(): for k, v in salt.version.SaltStackVersion.LNAMES.items(): assert k == k.lower() assert isinstance(v, tuple) - if sv.new_version(major=v[0]) and not sv.can_have_dot_zero(major=v[0]): + if sv.new_version(major=v[0]): assert len(v) == 1 else: assert len(v) == 2 @@ -64,6 +64,13 @@ def test_get_release_number_success_new_version(): assert salt_version.get_release_number("Neon") == "3000" +def test_get_release_number_success_new_version_with_dot(): + """ + Test that a version is returned for new versioning (3006) + """ + assert salt_version.get_release_number("Sulfur") == "3006" + + def test_equal_success(): """ Test that the current version is equal to the codename @@ -83,6 +90,16 @@ def test_equal_success_new_version(): assert salt_version.equal("foo") is True +def test_equal_success_new_version_with_dot(): + """ + Test that the current version is equal to the codename + while using the new versioning + """ + with patch("salt.version.SaltStackVersion", MagicMock(return_value="3006.1")): + with patch("salt.version.SaltStackVersion.LNAMES", {"foo": (3006,)}): + assert salt_version.equal("foo") is True + + def test_equal_older_codename(): """ Test that when an older codename is passed in, the function returns False. @@ -142,6 +159,17 @@ def test_greater_than_success_new_version(): assert salt_version.greater_than("Nitrogen") is True +def test_greater_than_success_new_version_with_dot(): + """ + Test that the current version is newer than the codename + """ + with patch( + "salt.modules.salt_version.get_release_number", MagicMock(return_value="3000") + ): + with patch("salt.version.SaltStackVersion", MagicMock(return_value="3006.0")): + assert salt_version.greater_than("Neon") is True + + def test_greater_than_with_equal_codename(): """ Test that when an equal codename is passed in, the function returns False. @@ -200,6 +228,19 @@ def test_less_than_success_new_version(): assert salt_version.less_than("Fluorine") is True +def test_less_than_success_new_version_with_dot(): + """ + Test that when a newer codename is passed in, the function returns True + using new version + """ + with patch("salt.version.SaltStackVersion", MagicMock(return_value="2018.3.2")): + with patch( + "salt.modules.salt_version.get_release_number", + MagicMock(return_value="3006"), + ): + assert salt_version.less_than("Fluorine") is True + + def test_less_than_with_equal_codename(): """ Test that when an equal codename is passed in, the function returns False. diff --git a/tests/pytests/unit/test_version.py b/tests/pytests/unit/test_version.py index 73befea4cf4..1cb94c619ca 100644 --- a/tests/pytests/unit/test_version.py +++ b/tests/pytests/unit/test_version.py @@ -187,7 +187,7 @@ def test_string_new_version_minor(): ver = SaltStackVersion(major=maj_ver, minor=min_ver) assert ver.minor == min_ver assert not ver.bugfix - assert ver.string == "{}.{}".format(maj_ver, min_ver) + assert ver.string == f"{maj_ver}.{min_ver}" def test_string_new_version_minor_as_string(): @@ -201,13 +201,13 @@ def test_string_new_version_minor_as_string(): ver = SaltStackVersion(major=maj_ver, minor=min_ver) assert ver.minor == int(min_ver) assert not ver.bugfix - assert ver.string == "{}.{}".format(maj_ver, min_ver) + assert ver.string == f"{maj_ver}.{min_ver}" # This only seems to happen on a cloned repo without its tags maj_ver = "3000" min_ver = "" ver = SaltStackVersion(major=maj_ver, minor=min_ver) - assert ver.minor is None, "{!r} is not {!r}".format(ver.minor, min_ver) + assert ver.minor is None, f"{ver.minor!r} is not {min_ver!r}" assert not ver.bugfix assert ver.string == maj_ver @@ -222,7 +222,7 @@ def test_string_old_version(): min_ver = "2" ver = SaltStackVersion(major=maj_ver, minor=min_ver) assert ver.bugfix == 0 - assert ver.string == "{}.{}.0".format(maj_ver, min_ver) + assert ver.string == f"{maj_ver}.{min_ver}.0" @pytest.mark.parametrize( @@ -537,6 +537,8 @@ def test_versions_report_no_extensions_available(): ("3000.1", "3000.1", "Neon"), ("3005", "3005", "Phosphorus"), ("3006", "3006.0", "Sulfur"), + ("3006.0", "3006.0", "Sulfur"), + ("3006.1", "3006.1", "Sulfur"), ("3015.1", "3015.1", "Manganese"), ("3109.3", "3109.3", None), ], From 4cd8fe14d422be14d22c0f9a41d08b3b45648191 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20Su=C3=A1rez=20Hern=C3=A1ndez?= Date: Tue, 27 Jun 2023 13:10:05 +0100 Subject: [PATCH 100/393] Add changelog file --- changelog/64554.fixed.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog/64554.fixed.md diff --git a/changelog/64554.fixed.md b/changelog/64554.fixed.md new file mode 100644 index 00000000000..56d03053a2c --- /dev/null +++ b/changelog/64554.fixed.md @@ -0,0 +1 @@ +Fix detection of Salt codename by "salt_version" execution module From a2abb1a4506fd8fab29570592e1b97d5874752c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20Su=C3=A1rez=20Hern=C3=A1ndez?= Date: Wed, 28 Jun 2023 12:38:51 +0100 Subject: [PATCH 101/393] Fix SaltStackVersion string for new versions format --- salt/version.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/salt/version.py b/salt/version.py index c99ef9414e7..e174d8bfb1f 100644 --- a/salt/version.py +++ b/salt/version.py @@ -473,8 +473,12 @@ class SaltStackVersion: version_string = self.string if self.sse: version_string += " Enterprise" - if (self.major, self.minor) in self.RMATCH: - version_string += f" ({self.RMATCH[(self.major, self.minor)]})" + if self.new_version(self.major): + rmatch_key = (self.major,) + else: + rmatch_key = (self.major, self.minor) + if rmatch_key in self.RMATCH: + version_string += f" ({self.RMATCH[rmatch_key]})" return version_string @property From 8540a3fdd43d43d672e8c8a89188ba19c5f7eea6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20Su=C3=A1rez=20Hern=C3=A1ndez?= Date: Wed, 28 Jun 2023 13:24:20 +0100 Subject: [PATCH 102/393] Rename changelog file according to bug report --- changelog/{64554.fixed.md => 64306.fixed.md} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename changelog/{64554.fixed.md => 64306.fixed.md} (100%) diff --git a/changelog/64554.fixed.md b/changelog/64306.fixed.md similarity index 100% rename from changelog/64554.fixed.md rename to changelog/64306.fixed.md From 3693a0db427a72019076e728fc55e24320356502 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20Su=C3=A1rez=20Hern=C3=A1ndez?= Date: Wed, 28 Jun 2023 14:11:46 +0100 Subject: [PATCH 103/393] Do not crash when passing numbers to 'salt_version.get_release_number' --- salt/modules/salt_version.py | 4 ++++ tests/pytests/unit/modules/test_salt_version.py | 12 ++++++++++++ 2 files changed, 16 insertions(+) diff --git a/salt/modules/salt_version.py b/salt/modules/salt_version.py index 1b5421fee4a..3c6b475c840 100644 --- a/salt/modules/salt_version.py +++ b/salt/modules/salt_version.py @@ -35,6 +35,7 @@ import logging import salt.utils.versions import salt.version +from salt.exceptions import CommandExecutionError log = logging.getLogger(__name__) @@ -66,6 +67,9 @@ def get_release_number(name): salt '*' salt_version.get_release_number 'Oxygen' """ + if not isinstance(name, str): + raise CommandExecutionError("'name' argument must be a string") + name = name.lower() version_map = salt.version.SaltStackVersion.LNAMES version = version_map.get(name) diff --git a/tests/pytests/unit/modules/test_salt_version.py b/tests/pytests/unit/modules/test_salt_version.py index f6c25630e03..4b7a7cd0731 100644 --- a/tests/pytests/unit/modules/test_salt_version.py +++ b/tests/pytests/unit/modules/test_salt_version.py @@ -2,8 +2,11 @@ Unit tests for salt/modules/salt_version.py """ +import pytest + import salt.modules.salt_version as salt_version import salt.version +from salt.exceptions import CommandExecutionError from tests.support.mock import MagicMock, patch @@ -241,6 +244,15 @@ def test_less_than_success_new_version_with_dot(): assert salt_version.less_than("Fluorine") is True +def test_less_than_do_not_crash_when_input_is_a_number(): + """ + Test that less_than do not crash when unexpected inputs + """ + with patch("salt.version.SaltStackVersion", MagicMock(return_value="2018.3.2")): + with pytest.raises(CommandExecutionError): + salt_version.less_than(1234) + + def test_less_than_with_equal_codename(): """ Test that when an equal codename is passed in, the function returns False. From a92ddf5a415d0856dd92be28cbb320e508deef89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20Su=C3=A1rez=20Hern=C3=A1ndez?= Date: Thu, 29 Jun 2023 09:51:07 +0100 Subject: [PATCH 104/393] Fix salt_version execution module documentation --- salt/modules/salt_version.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/salt/modules/salt_version.py b/salt/modules/salt_version.py index 3c6b475c840..99dae5f61a5 100644 --- a/salt/modules/salt_version.py +++ b/salt/modules/salt_version.py @@ -20,7 +20,7 @@ A simple example might be something like the following: .. code-block:: jinja {# a boolean check #} - {% set option_deprecated = salt['salt_version.less_than']("3001") %} + {% set option_deprecated = salt['salt_version.less_than']("Sodium") %} {% if option_deprecated %} @@ -52,7 +52,7 @@ def __virtual__(): def get_release_number(name): """ Returns the release number of a given release code name in a - ``MAJOR.PATCH`` format. + ``MAJOR.PATCH`` format (for Salt versions < 3000) or ``MAJOR`` for newer Salt versions. If the release name has not been given an assigned release number, the function returns a string. If the release cannot be found, it returns From db5a9a1b4aac2e0d0841ff3cffac0af3e9564556 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20Su=C3=A1rez=20Hern=C3=A1ndez?= Date: Fri, 30 Jun 2023 12:47:05 +0100 Subject: [PATCH 105/393] Fix test to get proper formatted version --- tests/pytests/functional/cli/test_salt_run_.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/pytests/functional/cli/test_salt_run_.py b/tests/pytests/functional/cli/test_salt_run_.py index efc02e38da4..6c4b138843b 100644 --- a/tests/pytests/functional/cli/test_salt_run_.py +++ b/tests/pytests/functional/cli/test_salt_run_.py @@ -80,6 +80,6 @@ def test_versions_report(salt_run_cli): def test_salt_run_version(salt_run_cli): - expected = salt.version.__version__ + expected = salt.version.__saltstack_version__.formatted_version ret = salt_run_cli.run("--version") assert f"cli_salt_run.py {expected}\n" == ret.stdout From d91988fa1c4ce9e97c8b1069b32f326cc3ab4c7f Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Mon, 3 Jul 2023 07:58:32 +0100 Subject: [PATCH 106/393] Bump to `pytest-shell-utilities==1.8.0` which officially support Py3.11 Signed-off-by: Pedro Algarvio --- requirements/static/ci/py3.10/darwin.txt | 2 +- requirements/static/ci/py3.10/freebsd.txt | 2 +- requirements/static/ci/py3.10/linux.txt | 2 +- requirements/static/ci/py3.10/windows.txt | 2 +- requirements/static/ci/py3.11/darwin.txt | 2 +- requirements/static/ci/py3.11/freebsd.txt | 2 +- requirements/static/ci/py3.11/linux.txt | 2 +- requirements/static/ci/py3.11/windows.txt | 2 +- requirements/static/ci/py3.8/freebsd.txt | 2 +- requirements/static/ci/py3.8/linux.txt | 2 +- requirements/static/ci/py3.8/windows.txt | 2 +- requirements/static/ci/py3.9/darwin.txt | 2 +- requirements/static/ci/py3.9/freebsd.txt | 2 +- requirements/static/ci/py3.9/linux.txt | 2 +- requirements/static/ci/py3.9/windows.txt | 2 +- 15 files changed, 15 insertions(+), 15 deletions(-) diff --git a/requirements/static/ci/py3.10/darwin.txt b/requirements/static/ci/py3.10/darwin.txt index 983c9dbbb2f..d98273f9c11 100644 --- a/requirements/static/ci/py3.10/darwin.txt +++ b/requirements/static/ci/py3.10/darwin.txt @@ -359,7 +359,7 @@ pytest-httpserver==1.0.8 # via -r requirements/pytest.txt pytest-salt-factories==1.0.0rc21 # via -r requirements/pytest.txt -pytest-shell-utilities==1.7.0 +pytest-shell-utilities==1.8.0 # via pytest-salt-factories pytest-skip-markers==1.4.0 # via diff --git a/requirements/static/ci/py3.10/freebsd.txt b/requirements/static/ci/py3.10/freebsd.txt index bcee1446be4..f8fbb28746b 100644 --- a/requirements/static/ci/py3.10/freebsd.txt +++ b/requirements/static/ci/py3.10/freebsd.txt @@ -354,7 +354,7 @@ pytest-httpserver==1.0.8 # via -r requirements/pytest.txt pytest-salt-factories==1.0.0rc21 # via -r requirements/pytest.txt -pytest-shell-utilities==1.7.0 +pytest-shell-utilities==1.8.0 # via pytest-salt-factories pytest-skip-markers==1.4.0 # via diff --git a/requirements/static/ci/py3.10/linux.txt b/requirements/static/ci/py3.10/linux.txt index fd25f4d579c..ed5813e4522 100644 --- a/requirements/static/ci/py3.10/linux.txt +++ b/requirements/static/ci/py3.10/linux.txt @@ -387,7 +387,7 @@ pytest-httpserver==1.0.8 # via -r requirements/pytest.txt pytest-salt-factories==1.0.0rc21 # via -r requirements/pytest.txt -pytest-shell-utilities==1.7.0 +pytest-shell-utilities==1.8.0 # via pytest-salt-factories pytest-skip-markers==1.4.0 # via diff --git a/requirements/static/ci/py3.10/windows.txt b/requirements/static/ci/py3.10/windows.txt index c4b391b7020..1960ea708b7 100644 --- a/requirements/static/ci/py3.10/windows.txt +++ b/requirements/static/ci/py3.10/windows.txt @@ -313,7 +313,7 @@ pytest-httpserver==1.0.8 # via -r requirements/pytest.txt pytest-salt-factories==1.0.0rc21 # via -r requirements/pytest.txt -pytest-shell-utilities==1.7.0 +pytest-shell-utilities==1.8.0 # via pytest-salt-factories pytest-skip-markers==1.4.0 # via diff --git a/requirements/static/ci/py3.11/darwin.txt b/requirements/static/ci/py3.11/darwin.txt index d88dec62efc..03ddaf187f7 100644 --- a/requirements/static/ci/py3.11/darwin.txt +++ b/requirements/static/ci/py3.11/darwin.txt @@ -357,7 +357,7 @@ pytest-httpserver==1.0.8 # via -r requirements/pytest.txt pytest-salt-factories==1.0.0rc21 # via -r requirements/pytest.txt -pytest-shell-utilities==1.7.0 +pytest-shell-utilities==1.8.0 # via pytest-salt-factories pytest-skip-markers==1.4.0 # via diff --git a/requirements/static/ci/py3.11/freebsd.txt b/requirements/static/ci/py3.11/freebsd.txt index 51681dda3ec..0d213e324b1 100644 --- a/requirements/static/ci/py3.11/freebsd.txt +++ b/requirements/static/ci/py3.11/freebsd.txt @@ -352,7 +352,7 @@ pytest-httpserver==1.0.8 # via -r requirements/pytest.txt pytest-salt-factories==1.0.0rc21 # via -r requirements/pytest.txt -pytest-shell-utilities==1.7.0 +pytest-shell-utilities==1.8.0 # via pytest-salt-factories pytest-skip-markers==1.4.0 # via diff --git a/requirements/static/ci/py3.11/linux.txt b/requirements/static/ci/py3.11/linux.txt index 53c10b5ed49..bad5d3833d5 100644 --- a/requirements/static/ci/py3.11/linux.txt +++ b/requirements/static/ci/py3.11/linux.txt @@ -383,7 +383,7 @@ pytest-httpserver==1.0.8 # via -r requirements/pytest.txt pytest-salt-factories==1.0.0rc21 # via -r requirements/pytest.txt -pytest-shell-utilities==1.7.0 +pytest-shell-utilities==1.8.0 # via pytest-salt-factories pytest-skip-markers==1.4.0 # via diff --git a/requirements/static/ci/py3.11/windows.txt b/requirements/static/ci/py3.11/windows.txt index 637429d2498..efe267454b8 100644 --- a/requirements/static/ci/py3.11/windows.txt +++ b/requirements/static/ci/py3.11/windows.txt @@ -311,7 +311,7 @@ pytest-httpserver==1.0.8 # via -r requirements/pytest.txt pytest-salt-factories==1.0.0rc21 # via -r requirements/pytest.txt -pytest-shell-utilities==1.7.0 +pytest-shell-utilities==1.8.0 # via pytest-salt-factories pytest-skip-markers==1.4.0 # via diff --git a/requirements/static/ci/py3.8/freebsd.txt b/requirements/static/ci/py3.8/freebsd.txt index cb18369f212..99f71703ac4 100644 --- a/requirements/static/ci/py3.8/freebsd.txt +++ b/requirements/static/ci/py3.8/freebsd.txt @@ -357,7 +357,7 @@ pytest-httpserver==1.0.8 # via -r requirements/pytest.txt pytest-salt-factories==1.0.0rc21 # via -r requirements/pytest.txt -pytest-shell-utilities==1.7.0 +pytest-shell-utilities==1.8.0 # via pytest-salt-factories pytest-skip-markers==1.4.0 # via diff --git a/requirements/static/ci/py3.8/linux.txt b/requirements/static/ci/py3.8/linux.txt index ef1e6baf603..183f8e08020 100644 --- a/requirements/static/ci/py3.8/linux.txt +++ b/requirements/static/ci/py3.8/linux.txt @@ -391,7 +391,7 @@ pytest-httpserver==1.0.8 # via -r requirements/pytest.txt pytest-salt-factories==1.0.0rc21 # via -r requirements/pytest.txt -pytest-shell-utilities==1.7.0 +pytest-shell-utilities==1.8.0 # via pytest-salt-factories pytest-skip-markers==1.4.0 # via diff --git a/requirements/static/ci/py3.8/windows.txt b/requirements/static/ci/py3.8/windows.txt index cbb93988641..dcc52446907 100644 --- a/requirements/static/ci/py3.8/windows.txt +++ b/requirements/static/ci/py3.8/windows.txt @@ -317,7 +317,7 @@ pytest-httpserver==1.0.8 # via -r requirements/pytest.txt pytest-salt-factories==1.0.0rc21 # via -r requirements/pytest.txt -pytest-shell-utilities==1.7.0 +pytest-shell-utilities==1.8.0 # via pytest-salt-factories pytest-skip-markers==1.4.0 # via diff --git a/requirements/static/ci/py3.9/darwin.txt b/requirements/static/ci/py3.9/darwin.txt index 370cd6697c0..31b13a4d98e 100644 --- a/requirements/static/ci/py3.9/darwin.txt +++ b/requirements/static/ci/py3.9/darwin.txt @@ -359,7 +359,7 @@ pytest-httpserver==1.0.8 # via -r requirements/pytest.txt pytest-salt-factories==1.0.0rc21 # via -r requirements/pytest.txt -pytest-shell-utilities==1.7.0 +pytest-shell-utilities==1.8.0 # via pytest-salt-factories pytest-skip-markers==1.4.0 # via diff --git a/requirements/static/ci/py3.9/freebsd.txt b/requirements/static/ci/py3.9/freebsd.txt index 9b77df43aa6..c367c3a7016 100644 --- a/requirements/static/ci/py3.9/freebsd.txt +++ b/requirements/static/ci/py3.9/freebsd.txt @@ -354,7 +354,7 @@ pytest-httpserver==1.0.8 # via -r requirements/pytest.txt pytest-salt-factories==1.0.0rc21 # via -r requirements/pytest.txt -pytest-shell-utilities==1.7.0 +pytest-shell-utilities==1.8.0 # via pytest-salt-factories pytest-skip-markers==1.4.0 # via diff --git a/requirements/static/ci/py3.9/linux.txt b/requirements/static/ci/py3.9/linux.txt index 76dcbb6d204..b8efa819014 100644 --- a/requirements/static/ci/py3.9/linux.txt +++ b/requirements/static/ci/py3.9/linux.txt @@ -389,7 +389,7 @@ pytest-httpserver==1.0.8 # via -r requirements/pytest.txt pytest-salt-factories==1.0.0rc21 # via -r requirements/pytest.txt -pytest-shell-utilities==1.7.0 +pytest-shell-utilities==1.8.0 # via pytest-salt-factories pytest-skip-markers==1.4.0 # via diff --git a/requirements/static/ci/py3.9/windows.txt b/requirements/static/ci/py3.9/windows.txt index 6f141bb2b5a..fdee7fa5a56 100644 --- a/requirements/static/ci/py3.9/windows.txt +++ b/requirements/static/ci/py3.9/windows.txt @@ -313,7 +313,7 @@ pytest-httpserver==1.0.8 # via -r requirements/pytest.txt pytest-salt-factories==1.0.0rc21 # via -r requirements/pytest.txt -pytest-shell-utilities==1.7.0 +pytest-shell-utilities==1.8.0 # via pytest-salt-factories pytest-skip-markers==1.4.0 # via From 51e9fb6e71fcb76e809222c68c4710dbf54135ac Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Thu, 29 Jun 2023 09:37:25 +0100 Subject: [PATCH 107/393] Revert to Py3.10 Signed-off-by: Pedro Algarvio --- .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 d7e16ce4f6d..e0561450cdb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -464,7 +464,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 @@ -480,7 +480,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 @@ -492,7 +492,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 @@ -504,7 +504,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 @@ -516,7 +516,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 @@ -528,7 +528,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 @@ -543,7 +543,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: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -561,7 +561,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: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -579,7 +579,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: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -597,7 +597,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: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -615,7 +615,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: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -633,7 +633,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: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -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: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -669,7 +669,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: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -687,7 +687,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: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -705,7 +705,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: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -723,7 +723,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: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -741,7 +741,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: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -759,7 +759,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: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -777,7 +777,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: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -795,7 +795,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: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -813,7 +813,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: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -831,7 +831,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: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -849,7 +849,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: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -867,7 +867,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: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -885,7 +885,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: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -904,7 +904,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 skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} @@ -922,7 +922,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 skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} @@ -940,7 +940,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 skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} @@ -958,7 +958,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 skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} @@ -976,7 +976,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 skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} @@ -994,7 +994,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 skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} @@ -1012,7 +1012,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 skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} @@ -1030,7 +1030,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 skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} @@ -1048,7 +1048,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 skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} @@ -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 skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} @@ -1084,7 +1084,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 skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} @@ -1102,7 +1102,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 skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} @@ -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 skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} @@ -1138,7 +1138,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 skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} 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 skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} @@ -1174,7 +1174,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 skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} @@ -1192,7 +1192,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 skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} @@ -1210,7 +1210,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 skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} @@ -1228,7 +1228,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 skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} @@ -1246,7 +1246,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 skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} @@ -1264,7 +1264,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 skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} @@ -1282,7 +1282,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 skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} @@ -1300,7 +1300,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 skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 0594529ed13..dd9b705668c 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -510,7 +510,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 @@ -526,7 +526,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 @@ -538,7 +538,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 @@ -550,7 +550,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 @@ -562,7 +562,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 @@ -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" environment: nightly sign-packages: true secrets: inherit @@ -595,7 +595,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 testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -613,7 +613,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 testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -631,7 +631,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 testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -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: false skip-junit-reports: false testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -667,7 +667,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 testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -685,7 +685,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 testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -703,7 +703,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 testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -721,7 +721,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 testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -739,7 +739,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 testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -757,7 +757,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 testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -775,7 +775,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 testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -793,7 +793,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 testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -811,7 +811,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 testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -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 testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -847,7 +847,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 testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -865,7 +865,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 testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -883,7 +883,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 testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -901,7 +901,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 testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -919,7 +919,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 testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -937,7 +937,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 testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -956,7 +956,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 skip-code-coverage: false skip-junit-reports: false @@ -974,7 +974,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 skip-code-coverage: false skip-junit-reports: false @@ -992,7 +992,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 skip-code-coverage: false skip-junit-reports: false @@ -1010,7 +1010,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 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 skip-code-coverage: false skip-junit-reports: false @@ -1046,7 +1046,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 skip-code-coverage: false skip-junit-reports: false @@ -1064,7 +1064,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 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 skip-code-coverage: false skip-junit-reports: false @@ -1100,7 +1100,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 skip-code-coverage: false skip-junit-reports: false @@ -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 skip-code-coverage: false skip-junit-reports: false @@ -1136,7 +1136,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 skip-code-coverage: false skip-junit-reports: false @@ -1154,7 +1154,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 skip-code-coverage: false skip-junit-reports: false @@ -1172,7 +1172,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 skip-code-coverage: false skip-junit-reports: false @@ -1190,7 +1190,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 skip-code-coverage: false skip-junit-reports: false @@ -1208,7 +1208,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 skip-code-coverage: false skip-junit-reports: false @@ -1226,7 +1226,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 skip-code-coverage: false skip-junit-reports: false @@ -1244,7 +1244,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 skip-code-coverage: false skip-junit-reports: false @@ -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 skip-code-coverage: false skip-junit-reports: false @@ -1280,7 +1280,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 skip-code-coverage: false skip-junit-reports: false @@ -1298,7 +1298,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 skip-code-coverage: false skip-junit-reports: false @@ -1316,7 +1316,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 skip-code-coverage: false skip-junit-reports: false @@ -1334,7 +1334,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 skip-code-coverage: false skip-junit-reports: false @@ -1352,7 +1352,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 skip-code-coverage: false skip-junit-reports: false diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ded139e597f..fa0a019a496 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 f6bdf2a577a..757e688056e 100644 --- a/.github/workflows/scheduled.yml +++ b/.github/workflows/scheduled.yml @@ -500,7 +500,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 @@ -516,7 +516,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 @@ -528,7 +528,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 @@ -540,7 +540,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 @@ -552,7 +552,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 @@ -564,7 +564,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 @@ -579,7 +579,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 testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -597,7 +597,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 testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -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: false skip-junit-reports: false testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -633,7 +633,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 testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -651,7 +651,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 testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -669,7 +669,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 testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -687,7 +687,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 testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -705,7 +705,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 testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -723,7 +723,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 testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -741,7 +741,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 testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -759,7 +759,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 testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -777,7 +777,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 testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -795,7 +795,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 testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -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 testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -831,7 +831,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 testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -849,7 +849,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 testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -867,7 +867,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 testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -885,7 +885,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 testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -903,7 +903,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 testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -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: false skip-junit-reports: false testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -940,7 +940,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 skip-code-coverage: false skip-junit-reports: false @@ -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 skip-code-coverage: false skip-junit-reports: false @@ -976,7 +976,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 skip-code-coverage: false skip-junit-reports: false @@ -994,7 +994,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 skip-code-coverage: false skip-junit-reports: false @@ -1012,7 +1012,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 skip-code-coverage: false skip-junit-reports: false @@ -1030,7 +1030,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 skip-code-coverage: false skip-junit-reports: false @@ -1048,7 +1048,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 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 skip-code-coverage: false skip-junit-reports: false @@ -1084,7 +1084,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 skip-code-coverage: false skip-junit-reports: false @@ -1102,7 +1102,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 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 skip-code-coverage: false skip-junit-reports: false @@ -1138,7 +1138,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 skip-code-coverage: false skip-junit-reports: false @@ -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 skip-code-coverage: false skip-junit-reports: false @@ -1174,7 +1174,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 skip-code-coverage: false skip-junit-reports: false @@ -1192,7 +1192,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 skip-code-coverage: false skip-junit-reports: false @@ -1210,7 +1210,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 skip-code-coverage: false skip-junit-reports: false @@ -1228,7 +1228,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 skip-code-coverage: false skip-junit-reports: false @@ -1246,7 +1246,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 skip-code-coverage: false skip-junit-reports: false @@ -1264,7 +1264,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 skip-code-coverage: false skip-junit-reports: false @@ -1282,7 +1282,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 skip-code-coverage: false skip-junit-reports: false @@ -1300,7 +1300,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 skip-code-coverage: false skip-junit-reports: false @@ -1318,7 +1318,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 skip-code-coverage: false skip-junit-reports: false @@ -1336,7 +1336,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 skip-code-coverage: false skip-junit-reports: false diff --git a/.github/workflows/staging.yml b/.github/workflows/staging.yml index b68d73fa1e3..12ea1b823b4 100644 --- a/.github/workflows/staging.yml +++ b/.github/workflows/staging.yml @@ -500,7 +500,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 @@ -516,7 +516,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 @@ -528,7 +528,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 @@ -540,7 +540,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 @@ -552,7 +552,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 @@ -567,7 +567,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 @@ -585,7 +585,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 testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -603,7 +603,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 testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -621,7 +621,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 testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -639,7 +639,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 testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -657,7 +657,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 testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -675,7 +675,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 testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -693,7 +693,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 testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -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: true skip-junit-reports: true testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -729,7 +729,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 testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -747,7 +747,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 testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -765,7 +765,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 testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -783,7 +783,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 testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -801,7 +801,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 testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -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 testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -837,7 +837,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 testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -855,7 +855,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 testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -873,7 +873,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 testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -891,7 +891,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 testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -909,7 +909,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 testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -927,7 +927,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 testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -946,7 +946,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 skip-code-coverage: true skip-junit-reports: true @@ -964,7 +964,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 skip-code-coverage: true skip-junit-reports: true @@ -982,7 +982,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 skip-code-coverage: true skip-junit-reports: true @@ -1000,7 +1000,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 skip-code-coverage: true skip-junit-reports: true @@ -1018,7 +1018,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 skip-code-coverage: true skip-junit-reports: true @@ -1036,7 +1036,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 skip-code-coverage: true skip-junit-reports: true @@ -1054,7 +1054,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 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 skip-code-coverage: true skip-junit-reports: true @@ -1090,7 +1090,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 skip-code-coverage: true skip-junit-reports: true @@ -1108,7 +1108,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 skip-code-coverage: true skip-junit-reports: true @@ -1126,7 +1126,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 skip-code-coverage: true skip-junit-reports: true @@ -1144,7 +1144,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 skip-code-coverage: true skip-junit-reports: true @@ -1162,7 +1162,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 skip-code-coverage: true skip-junit-reports: true @@ -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 skip-code-coverage: true skip-junit-reports: true @@ -1198,7 +1198,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 skip-code-coverage: true skip-junit-reports: true @@ -1216,7 +1216,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 skip-code-coverage: true skip-junit-reports: true @@ -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 skip-code-coverage: true skip-junit-reports: true @@ -1252,7 +1252,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 skip-code-coverage: true skip-junit-reports: true @@ -1270,7 +1270,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 skip-code-coverage: true skip-junit-reports: true @@ -1288,7 +1288,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 skip-code-coverage: true skip-junit-reports: true @@ -1306,7 +1306,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 skip-code-coverage: true skip-junit-reports: true @@ -1324,7 +1324,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 skip-code-coverage: true skip-junit-reports: true @@ -1342,7 +1342,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 skip-code-coverage: true skip-junit-reports: true @@ -2104,7 +2104,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 @@ -2123,7 +2123,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 @@ -2142,7 +2142,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 @@ -2161,7 +2161,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 @@ -2180,7 +2180,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 @@ -2199,7 +2199,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 @@ -2218,7 +2218,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 @@ -2237,7 +2237,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 @@ -2256,7 +2256,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 @@ -2275,7 +2275,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 @@ -2294,7 +2294,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 @@ -2313,7 +2313,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 @@ -2332,7 +2332,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 @@ -2351,7 +2351,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 @@ -2370,7 +2370,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 @@ -2389,7 +2389,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 @@ -2408,7 +2408,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 @@ -2427,7 +2427,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 @@ -2446,7 +2446,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 @@ -2465,7 +2465,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 @@ -2484,7 +2484,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 @@ -2503,7 +2503,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 @@ -2522,7 +2522,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 @@ -2541,7 +2541,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 @@ -2560,7 +2560,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 @@ -2579,7 +2579,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 @@ -2598,7 +2598,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 @@ -2617,7 +2617,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 @@ -2636,7 +2636,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 @@ -2656,7 +2656,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 @@ -2675,7 +2675,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 @@ -2694,7 +2694,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 a8a4c456da0..2e07c02a506 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 e235b82912143ae628e69b65deccae84edfe8b2e Mon Sep 17 00:00:00 2001 From: Salt Project Packaging Date: Thu, 29 Jun 2023 21:41:11 +0000 Subject: [PATCH 108/393] Update the bootstrap script to v2023.06.28 (cherry picked from commit 1ef02f5e1ddca5e8c80a3b7e378d035c125ba836) --- salt/cloud/deploy/bootstrap-salt.sh | 124 ++++++++++++++++++++++------ 1 file changed, 97 insertions(+), 27 deletions(-) diff --git a/salt/cloud/deploy/bootstrap-salt.sh b/salt/cloud/deploy/bootstrap-salt.sh index 6d69bf69213..1cf46c774df 100644 --- a/salt/cloud/deploy/bootstrap-salt.sh +++ b/salt/cloud/deploy/bootstrap-salt.sh @@ -23,7 +23,7 @@ #====================================================================================================================== set -o nounset # Treat unset variables as an error -__ScriptVersion="2023.04.26" +__ScriptVersion="2023.06.28" __ScriptName="bootstrap-salt.sh" __ScriptFullName="$0" @@ -224,7 +224,6 @@ _KEEP_TEMP_FILES=${BS_KEEP_TEMP_FILES:-$BS_FALSE} _TEMP_CONFIG_DIR="null" _SALTSTACK_REPO_URL="https://github.com/saltstack/salt.git" _SALT_REPO_URL=${_SALTSTACK_REPO_URL} -_DOWNSTREAM_PKG_REPO=$BS_FALSE _TEMP_KEYS_DIR="null" _SLEEP="${__DEFAULT_SLEEP}" _INSTALL_MASTER=$BS_FALSE @@ -311,21 +310,31 @@ __usage() { - onedir_rc Install latest onedir RC release. - onedir_rc [version] Install a specific version. Only supported for onedir RC packages available at repo.saltproject.io + - old-stable Install latest old stable release. + - old-stable [branch] Install latest version on a branch. Only supported + for packages available at repo.saltproject.io + - old-stable [version] Install a specific version. Only supported for + packages available at repo.saltproject.io + To pin a 3xxx minor version, specify it as 3xxx.0 Examples: - ${__ScriptName} - ${__ScriptName} stable - - ${__ScriptName} stable 2017.7 - - ${__ScriptName} stable 2017.7.2 + - ${__ScriptName} stable 3006 + - ${__ScriptName} stable 3006.1 - ${__ScriptName} testing - ${__ScriptName} git - ${__ScriptName} git 2017.7 - ${__ScriptName} git v2017.7.2 - ${__ScriptName} git 06f249901a2e2f1ed310d58ea3921a129f214358 - ${__ScriptName} onedir - - ${__ScriptName} onedir 3005 + - ${__ScriptName} onedir 3006 - ${__ScriptName} onedir_rc - - ${__ScriptName} onedir_rc 3005 + - ${__ScriptName} onedir_rc 3006 + - ${__ScriptName} old-stable + - ${__ScriptName} old-stable 3005 + - ${__ScriptName} old-stable 3005.1 + Options: -a Pip install all Python pkg dependencies for Salt. Requires -V to install @@ -401,9 +410,6 @@ __usage() { -v Display script version -V Install Salt into virtualenv (only available for Ubuntu based distributions) - -w Install packages from downstream package repository rather than - upstream, saltstack package repository. This is currently only - implemented for SUSE. -x Changes the Python version used to install Salt. For CentOS 6 git installations python2.7 is supported. Fedora git installation, CentOS 7, Ubuntu 18.04 support python3. @@ -420,7 +426,7 @@ EOT } # ---------- end of function __usage ---------- -while getopts ':hvnDc:g:Gyx:wk:s:MSNXCPFUKIA:i:Lp:dH:bflV:J:j:rR:aq' opt +while getopts ':hvnDc:g:Gyx:k:s:MSNXCPFUKIA:i:Lp:dH:bflV:J:j:rR:aq' opt do case "${opt}" in @@ -436,7 +442,6 @@ do echowarn "No need to provide this option anymore, now it is a default behavior." ;; - w ) _DOWNSTREAM_PKG_REPO=$BS_TRUE ;; k ) _TEMP_KEYS_DIR="$OPTARG" ;; s ) _SLEEP=$OPTARG ;; M ) _INSTALL_MASTER=$BS_TRUE ;; @@ -595,7 +600,7 @@ if [ "$#" -gt 0 ];then fi # Check installation type -if [ "$(echo "$ITYPE" | grep -E '(stable|testing|git|onedir|onedir_rc)')" = "" ]; then +if [ "$(echo "$ITYPE" | grep -E '(stable|testing|git|onedir|onedir_rc|old-stable)')" = "" ]; then echoerror "Installation type \"$ITYPE\" is not known..." exit 1 fi @@ -619,28 +624,41 @@ elif [ "$ITYPE" = "stable" ]; then _ONEDIR_REV="latest" ITYPE="onedir" else - if [ "$(echo "$1" | grep -E '^(nightly|latest|3006)$')" != "" ]; then + if [ "$(echo "$1" | grep -E '^(nightly|latest|3005|3006)$')" != "" ]; then ONEDIR_REV="$1" _ONEDIR_REV="$1" ITYPE="onedir" shift - elif [ "$(echo "$1" | grep -E '^(3003|3004|3005)$')" != "" ]; then - STABLE_REV="$1" - shift - elif [ "$(echo "$1" | grep -E '^([3-9][0-5]{2}[6-9](\.[0-9]*)?)')" != "" ]; then + elif [ "$(echo "$1" | grep -E '^([3-9][0-5]{2}[5-9](\.[0-9]*)?)')" != "" ]; then ONEDIR_REV="minor/$1" _ONEDIR_REV="$1" ITYPE="onedir" shift + else + echo "Unknown stable version: $1 (valid: 3005, 3006, latest)" + exit 1 + fi + fi + +# If doing old-stable install, check if version specified +elif [ "$ITYPE" = "old-stable" ]; then + if [ "$#" -eq 0 ];then + ITYPE="stable" + else + if [ "$(echo "$1" | grep -E '^(3003|3004|3005)$')" != "" ]; then + STABLE_REV="$1" + ITYPE="stable" + shift elif [ "$(echo "$1" | grep -E '^([3-9][0-5]{3}(\.[0-9]*)?)$')" != "" ]; then # Handle the 3xxx.0 version as 3xxx archive (pin to minor) and strip the fake ".0" suffix + ITYPE="stable" STABLE_REV=$(echo "$1" | sed -E 's/^([3-9][0-9]{3})\.0$/\1/') if [ "$(uname)" != "Darwin" ]; then STABLE_REV="archive/$STABLE_REV" fi shift else - echo "Unknown stable version: $1 (valid: 3003, 3004, 3005, 3006, latest)" + echo "Unknown old stable version: $1 (valid: 3003, 3004, 3005)" exit 1 fi fi @@ -4573,6 +4591,12 @@ install_fedora_onedir_post() { # CentOS Install Functions # __install_saltstack_rhel_repository() { + if [ "${DISTRO_MAJOR_VERSION}" -ge 9 ]; then + echoerror "Old stable repository unavailable on RH variants greater than or equal to 9" + echoerror "Use the stable install type." + exit 1 + fi + if [ "$ITYPE" = "stable" ]; then repo_rev="$STABLE_REV" else @@ -4827,7 +4851,6 @@ install_centos_git_deps() { # Set ONEDIR_REV to STABLE_REV in case we # end up calling install_centos_onedir_deps ONEDIR_REV=${STABLE_REV} - install_centos_stable_deps || \ install_centos_onedir_deps || \ return 1 @@ -7698,13 +7721,8 @@ __set_suse_pkg_repo() { DISTRO_REPO="SLE_${DISTRO_MAJOR_VERSION}_SP${SUSE_PATCHLEVEL}" fi - if [ "$_DOWNSTREAM_PKG_REPO" -eq $BS_TRUE ]; then - suse_pkg_url_base="https://download.opensuse.org/repositories/systemsmanagement:/saltstack" - suse_pkg_url_path="${DISTRO_REPO}/systemsmanagement:saltstack.repo" - else - suse_pkg_url_base="${HTTP_VAL}://repo.saltproject.io/opensuse" - suse_pkg_url_path="${DISTRO_REPO}/systemsmanagement:saltstack:products.repo" - fi + suse_pkg_url_base="https://download.opensuse.org/repositories/systemsmanagement:/saltstack" + suse_pkg_url_path="${DISTRO_REPO}/systemsmanagement:saltstack.repo" SUSE_PKG_URL="$suse_pkg_url_base/$suse_pkg_url_path" } @@ -7724,7 +7742,7 @@ __version_lte() { zypper --non-interactive install --auto-agree-with-licenses python || return 1 fi - if [ "$(python -c 'import sys; V1=tuple([int(i) for i in sys.argv[1].split(".")]); V2=tuple([int(i) for i in sys.argv[2].split(".")]); print V1<=V2' "$1" "$2")" = "True" ]; then + if [ "$(${_PY_EXE} -c 'import sys; V1=tuple([int(i) for i in sys.argv[1].split(".")]); V2=tuple([int(i) for i in sys.argv[2].split(".")]); print(V1<=V2)' "$1" "$2")" = "True" ]; then __ZYPPER_REQUIRES_REPLACE_FILES=${BS_TRUE} else __ZYPPER_REQUIRES_REPLACE_FILES=${BS_FALSE} @@ -8130,6 +8148,11 @@ install_opensuse_15_git() { return 0 } +install_opensuse_15_onedir_deps() { + __opensuse_prep_install || return 1 + return 0 +} + # # End of openSUSE Leap 15 # @@ -8159,6 +8182,13 @@ install_suse_15_git_deps() { return 0 } +install_suse_15_onedir_deps() { + __opensuse_prep_install || return 1 + install_opensuse_15_onedir_deps || return 1 + + return 0 +} + install_suse_15_stable() { install_opensuse_stable || return 1 return 0 @@ -8169,6 +8199,11 @@ install_suse_15_git() { return 0 } +install_suse_15_onedir() { + install_opensuse_stable || return 1 + return 0 +} + install_suse_15_stable_post() { install_opensuse_stable_post || return 1 return 0 @@ -8179,6 +8214,11 @@ install_suse_15_git_post() { return 0 } +install_suse_15_onedir_post() { + install_opensuse_stable_post || return 1 + return 0 +} + install_suse_15_restart_daemons() { install_opensuse_restart_daemons || return 1 return 0 @@ -8261,6 +8301,11 @@ install_suse_12_git_deps() { return 0 } +install_suse_12_onedir_deps() { + install_suse_12_stable_deps || return 1 + return 0 +} + install_suse_12_stable() { install_opensuse_stable || return 1 return 0 @@ -8271,6 +8316,11 @@ install_suse_12_git() { return 0 } +install_suse_12_onedir() { + install_opensuse_stable || return 1 + return 0 +} + install_suse_12_stable_post() { install_opensuse_stable_post || return 1 return 0 @@ -8281,6 +8331,11 @@ install_suse_12_git_post() { return 0 } +install_suse_12_onedir_post() { + install_opensuse_stable_post || return 1 + return 0 +} + install_suse_12_restart_daemons() { install_opensuse_restart_daemons || return 1 return 0 @@ -8357,6 +8412,11 @@ install_suse_11_git_deps() { return 0 } +install_suse_11_onedir_deps() { + install_suse_11_stable_deps || return 1 + return 0 +} + install_suse_11_stable() { install_opensuse_stable || return 1 return 0 @@ -8367,6 +8427,11 @@ install_suse_11_git() { return 0 } +install_suse_11_onedir() { + install_opensuse_stable || return 1 + return 0 +} + install_suse_11_stable_post() { install_opensuse_stable_post || return 1 return 0 @@ -8377,6 +8442,11 @@ install_suse_11_git_post() { return 0 } +install_suse_11_onedir_post() { + install_opensuse_stable_post || return 1 + return 0 +} + install_suse_11_restart_daemons() { install_opensuse_restart_daemons || return 1 return 0 From 3d097b8ed5579b3a94ccc3ba087b4d67d6d14fc3 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Tue, 4 Jul 2023 07:45:38 +0100 Subject: [PATCH 109/393] Upgrade to `cryptography==41.0.1`(and therefor `pyopenssl==23.2.0` due to https://github.com/advisories/GHSA-5cpq-8wj7-hf2v This only really impacts pip installs of Salt and the windows onedir since the linux and macos onedir build every package dependency from source, not from pre-existing wheels. Signed-off-by: Pedro Algarvio --- changelog/64595.security.md | 3 +++ requirements/darwin.txt | 2 +- requirements/static/ci/py3.10/cloud.txt | 4 ++-- requirements/static/ci/py3.10/darwin.txt | 4 ++-- requirements/static/ci/py3.10/freebsd.txt | 4 ++-- requirements/static/ci/py3.10/lint.txt | 4 ++-- requirements/static/ci/py3.10/linux.txt | 4 ++-- requirements/static/ci/py3.10/windows.txt | 4 ++-- requirements/static/ci/py3.7/cloud.txt | 4 ++-- requirements/static/ci/py3.7/freebsd.txt | 4 ++-- requirements/static/ci/py3.7/lint.txt | 4 ++-- requirements/static/ci/py3.7/linux.txt | 4 ++-- requirements/static/ci/py3.7/windows.txt | 4 ++-- requirements/static/ci/py3.8/cloud.txt | 4 ++-- requirements/static/ci/py3.8/freebsd.txt | 4 ++-- requirements/static/ci/py3.8/lint.txt | 4 ++-- requirements/static/ci/py3.8/linux.txt | 4 ++-- requirements/static/ci/py3.8/windows.txt | 4 ++-- requirements/static/ci/py3.9/cloud.txt | 4 ++-- requirements/static/ci/py3.9/darwin.txt | 4 ++-- requirements/static/ci/py3.9/freebsd.txt | 4 ++-- requirements/static/ci/py3.9/lint.txt | 4 ++-- requirements/static/ci/py3.9/linux.txt | 4 ++-- requirements/static/ci/py3.9/windows.txt | 4 ++-- requirements/static/pkg/linux.in | 2 +- requirements/static/pkg/py3.10/darwin.txt | 4 ++-- requirements/static/pkg/py3.10/freebsd.txt | 2 +- requirements/static/pkg/py3.10/linux.txt | 4 ++-- requirements/static/pkg/py3.10/windows.txt | 4 ++-- requirements/static/pkg/py3.7/freebsd.txt | 2 +- requirements/static/pkg/py3.7/linux.txt | 4 ++-- requirements/static/pkg/py3.7/windows.txt | 4 ++-- requirements/static/pkg/py3.8/freebsd.txt | 2 +- requirements/static/pkg/py3.8/linux.txt | 4 ++-- requirements/static/pkg/py3.8/windows.txt | 4 ++-- requirements/static/pkg/py3.9/darwin.txt | 4 ++-- requirements/static/pkg/py3.9/freebsd.txt | 2 +- requirements/static/pkg/py3.9/linux.txt | 4 ++-- requirements/static/pkg/py3.9/windows.txt | 4 ++-- requirements/windows.txt | 2 +- 40 files changed, 74 insertions(+), 71 deletions(-) create mode 100644 changelog/64595.security.md diff --git a/changelog/64595.security.md b/changelog/64595.security.md new file mode 100644 index 00000000000..63a7d529f92 --- /dev/null +++ b/changelog/64595.security.md @@ -0,0 +1,3 @@ +Upgrade to `cryptography==41.0.1`(and therefor `pyopenssl==23.2.0` due to https://github.com/advisories/GHSA-5cpq-8wj7-hf2v + +This only really impacts pip installs of Salt and the windows onedir since the linux and macos onedir build every package dependency from source, not from pre-existing wheels. diff --git a/requirements/darwin.txt b/requirements/darwin.txt index be8a547ae8e..a77dad5d7e3 100644 --- a/requirements/darwin.txt +++ b/requirements/darwin.txt @@ -5,7 +5,7 @@ apache-libcloud>=2.4.0 backports.ssl_match_hostname>=3.7.0.1; python_version < '3.7' cherrypy>=17.4.1 -cryptography>=39.0.1 +cryptography>=41.0.1 gitpython>=3.1.30; python_version >= '3.7' idna>=2.8 linode-python>=1.1.1 diff --git a/requirements/static/ci/py3.10/cloud.txt b/requirements/static/ci/py3.10/cloud.txt index daf4d5e1570..9da18084d70 100644 --- a/requirements/static/ci/py3.10/cloud.txt +++ b/requirements/static/ci/py3.10/cloud.txt @@ -385,7 +385,7 @@ contextvars==2.4 # via -r requirements/base.txt croniter==1.0.15 ; sys_platform != "win32" # via -r requirements/static/ci/common.in -cryptography==39.0.2 +cryptography==41.0.1 # via # -r requirements/static/pkg/linux.in # adal @@ -669,7 +669,7 @@ pyjwt==2.4.0 # via adal pynacl==1.4.0 # via paramiko -pyopenssl==23.0.0 +pyopenssl==23.2.0 # via # -r requirements/static/pkg/linux.in # etcd3-py diff --git a/requirements/static/ci/py3.10/darwin.txt b/requirements/static/ci/py3.10/darwin.txt index 800698143fa..8d4edd7d491 100644 --- a/requirements/static/ci/py3.10/darwin.txt +++ b/requirements/static/ci/py3.10/darwin.txt @@ -386,7 +386,7 @@ contextvars==2.4 # via -r requirements/base.txt croniter==0.3.29 ; sys_platform != "win32" # via -r requirements/static/ci/common.in -cryptography==39.0.2 +cryptography==41.0.1 # via # -r requirements/darwin.txt # adal @@ -670,7 +670,7 @@ pyjwt==2.4.0 # via adal pynacl==1.3.0 # via paramiko -pyopenssl==23.0.0 +pyopenssl==23.2.0 # via # -r requirements/darwin.txt # etcd3-py diff --git a/requirements/static/ci/py3.10/freebsd.txt b/requirements/static/ci/py3.10/freebsd.txt index 9f485ddbca5..92e27ed6d94 100644 --- a/requirements/static/ci/py3.10/freebsd.txt +++ b/requirements/static/ci/py3.10/freebsd.txt @@ -384,7 +384,7 @@ contextvars==2.4 # via -r requirements/base.txt croniter==0.3.29 ; sys_platform != "win32" # via -r requirements/static/ci/common.in -cryptography==39.0.2 +cryptography==41.0.0 # via # adal # azure-cosmosdb-table @@ -669,7 +669,7 @@ pyjwt==2.4.0 # via adal pynacl==1.3.0 # via paramiko -pyopenssl==23.0.0 +pyopenssl==23.2.0 # via # -r requirements/static/pkg/freebsd.in # etcd3-py diff --git a/requirements/static/ci/py3.10/lint.txt b/requirements/static/ci/py3.10/lint.txt index 72daefca405..9b35d0508bb 100644 --- a/requirements/static/ci/py3.10/lint.txt +++ b/requirements/static/ci/py3.10/lint.txt @@ -390,7 +390,7 @@ contextvars==2.4 # via -r requirements/base.txt croniter==1.0.15 ; sys_platform != "win32" # via -r requirements/static/ci/common.in -cryptography==39.0.2 +cryptography==41.0.1 # via # -r requirements/static/pkg/linux.in # adal @@ -675,7 +675,7 @@ pymysql==1.0.2 ; python_version > "3.5" # via -r requirements/static/ci/linux.in pynacl==1.4.0 # via paramiko -pyopenssl==23.0.0 +pyopenssl==23.2.0 # via # -r requirements/static/pkg/linux.in # etcd3-py diff --git a/requirements/static/ci/py3.10/linux.txt b/requirements/static/ci/py3.10/linux.txt index 94a3863c683..6c88290286c 100644 --- a/requirements/static/ci/py3.10/linux.txt +++ b/requirements/static/ci/py3.10/linux.txt @@ -398,7 +398,7 @@ contextvars==2.4 # via -r requirements/base.txt croniter==0.3.29 ; sys_platform != "win32" # via -r requirements/static/ci/common.in -cryptography==39.0.2 +cryptography==41.0.1 # via # -r requirements/static/pkg/linux.in # adal @@ -689,7 +689,7 @@ pymysql==1.0.2 ; python_version > "3.5" # via -r requirements/static/ci/linux.in pynacl==1.3.0 # via paramiko -pyopenssl==23.0.0 +pyopenssl==23.2.0 # via # -r requirements/static/pkg/linux.in # etcd3-py diff --git a/requirements/static/ci/py3.10/windows.txt b/requirements/static/ci/py3.10/windows.txt index 091c51ec590..033084010b5 100644 --- a/requirements/static/ci/py3.10/windows.txt +++ b/requirements/static/ci/py3.10/windows.txt @@ -71,7 +71,7 @@ colorama==0.4.1 # via pytest contextvars==2.4 # via -r requirements/base.txt -cryptography==39.0.2 +cryptography==41.0.1 # via # -r requirements/windows.txt # etcd3-py @@ -237,7 +237,7 @@ pymssql==2.2.7 # via -r requirements/windows.txt pymysql==1.0.2 # via -r requirements/windows.txt -pyopenssl==23.0.0 +pyopenssl==23.2.0 # via # -r requirements/windows.txt # etcd3-py diff --git a/requirements/static/ci/py3.7/cloud.txt b/requirements/static/ci/py3.7/cloud.txt index 74e67f129c1..7ab45ff74f7 100644 --- a/requirements/static/ci/py3.7/cloud.txt +++ b/requirements/static/ci/py3.7/cloud.txt @@ -392,7 +392,7 @@ contextvars==2.4 # via -r requirements/base.txt croniter==1.0.15 ; sys_platform != "win32" # via -r requirements/static/ci/common.in -cryptography==39.0.2 +cryptography==41.0.1 # via # -r requirements/static/pkg/linux.in # adal @@ -711,7 +711,7 @@ pyjwt==2.4.0 # via adal pynacl==1.4.0 # via paramiko -pyopenssl==23.0.0 +pyopenssl==23.2.0 # via # -r requirements/static/pkg/linux.in # etcd3-py diff --git a/requirements/static/ci/py3.7/freebsd.txt b/requirements/static/ci/py3.7/freebsd.txt index 661a1670dde..13e97515d7d 100644 --- a/requirements/static/ci/py3.7/freebsd.txt +++ b/requirements/static/ci/py3.7/freebsd.txt @@ -391,7 +391,7 @@ contextvars==2.4 # via -r requirements/base.txt croniter==0.3.29 ; sys_platform != "win32" # via -r requirements/static/ci/common.in -cryptography==39.0.2 +cryptography==41.0.0 # via # adal # azure-cosmosdb-table @@ -705,7 +705,7 @@ pyjwt==2.4.0 # via adal pynacl==1.3.0 # via paramiko -pyopenssl==23.0.0 +pyopenssl==23.2.0 # via # -r requirements/static/pkg/freebsd.in # etcd3-py diff --git a/requirements/static/ci/py3.7/lint.txt b/requirements/static/ci/py3.7/lint.txt index 8d8771573c6..33080ce341d 100644 --- a/requirements/static/ci/py3.7/lint.txt +++ b/requirements/static/ci/py3.7/lint.txt @@ -399,7 +399,7 @@ contextvars==2.4 # via -r requirements/base.txt croniter==1.0.15 ; sys_platform != "win32" # via -r requirements/static/ci/common.in -cryptography==39.0.2 +cryptography==41.0.1 # via # -r requirements/static/pkg/linux.in # adal @@ -718,7 +718,7 @@ pymysql==1.0.2 ; python_version > "3.5" # via -r requirements/static/ci/linux.in pynacl==1.4.0 # via paramiko -pyopenssl==23.0.0 +pyopenssl==23.2.0 # via # -r requirements/static/pkg/linux.in # etcd3-py diff --git a/requirements/static/ci/py3.7/linux.txt b/requirements/static/ci/py3.7/linux.txt index 5f0a0509d76..c8307fc7986 100644 --- a/requirements/static/ci/py3.7/linux.txt +++ b/requirements/static/ci/py3.7/linux.txt @@ -405,7 +405,7 @@ contextvars==2.4 # via -r requirements/base.txt croniter==0.3.29 ; sys_platform != "win32" # via -r requirements/static/ci/common.in -cryptography==39.0.2 +cryptography==41.0.1 # via # -r requirements/static/pkg/linux.in # adal @@ -725,7 +725,7 @@ pymysql==1.0.2 ; python_version > "3.5" # via -r requirements/static/ci/linux.in pynacl==1.3.0 # via paramiko -pyopenssl==23.0.0 +pyopenssl==23.2.0 # via # -r requirements/static/pkg/linux.in # etcd3-py diff --git a/requirements/static/ci/py3.7/windows.txt b/requirements/static/ci/py3.7/windows.txt index 247778c256e..37aaab11ea7 100644 --- a/requirements/static/ci/py3.7/windows.txt +++ b/requirements/static/ci/py3.7/windows.txt @@ -77,7 +77,7 @@ colorama==0.4.1 # via pytest contextvars==2.4 # via -r requirements/base.txt -cryptography==39.0.2 +cryptography==41.0.1 # via # -r requirements/windows.txt # etcd3-py @@ -250,7 +250,7 @@ pymssql==2.2.1 # via -r requirements/windows.txt pymysql==1.0.2 # via -r requirements/windows.txt -pyopenssl==23.0.0 +pyopenssl==23.2.0 # via # -r requirements/windows.txt # etcd3-py diff --git a/requirements/static/ci/py3.8/cloud.txt b/requirements/static/ci/py3.8/cloud.txt index fe4a7bcea2b..b60fd1d789d 100644 --- a/requirements/static/ci/py3.8/cloud.txt +++ b/requirements/static/ci/py3.8/cloud.txt @@ -390,7 +390,7 @@ contextvars==2.4 # via -r requirements/base.txt croniter==1.0.15 ; sys_platform != "win32" # via -r requirements/static/ci/common.in -cryptography==39.0.2 +cryptography==41.0.1 # via # -r requirements/static/pkg/linux.in # adal @@ -700,7 +700,7 @@ pyjwt==2.4.0 # via adal pynacl==1.4.0 # via paramiko -pyopenssl==23.0.0 +pyopenssl==23.2.0 # via # -r requirements/static/pkg/linux.in # etcd3-py diff --git a/requirements/static/ci/py3.8/freebsd.txt b/requirements/static/ci/py3.8/freebsd.txt index 7b8109b51eb..a38caa62b63 100644 --- a/requirements/static/ci/py3.8/freebsd.txt +++ b/requirements/static/ci/py3.8/freebsd.txt @@ -389,7 +389,7 @@ contextvars==2.4 # via -r requirements/base.txt croniter==0.3.29 ; sys_platform != "win32" # via -r requirements/static/ci/common.in -cryptography==39.0.2 +cryptography==41.0.0 # via # adal # azure-cosmosdb-table @@ -695,7 +695,7 @@ pyjwt==2.4.0 # via adal pynacl==1.3.0 # via paramiko -pyopenssl==23.0.0 +pyopenssl==23.2.0 # via # -r requirements/static/pkg/freebsd.in # etcd3-py diff --git a/requirements/static/ci/py3.8/lint.txt b/requirements/static/ci/py3.8/lint.txt index b0a9aa31f4a..c9084b3f32a 100644 --- a/requirements/static/ci/py3.8/lint.txt +++ b/requirements/static/ci/py3.8/lint.txt @@ -397,7 +397,7 @@ contextvars==2.4 # via -r requirements/base.txt croniter==1.0.15 ; sys_platform != "win32" # via -r requirements/static/ci/common.in -cryptography==39.0.2 +cryptography==41.0.1 # via # -r requirements/static/pkg/linux.in # adal @@ -709,7 +709,7 @@ pymysql==1.0.2 ; python_version > "3.5" # via -r requirements/static/ci/linux.in pynacl==1.4.0 # via paramiko -pyopenssl==23.0.0 +pyopenssl==23.2.0 # via # -r requirements/static/pkg/linux.in # etcd3-py diff --git a/requirements/static/ci/py3.8/linux.txt b/requirements/static/ci/py3.8/linux.txt index 19c4a389755..88bdfd4febf 100644 --- a/requirements/static/ci/py3.8/linux.txt +++ b/requirements/static/ci/py3.8/linux.txt @@ -403,7 +403,7 @@ contextvars==2.4 # via -r requirements/base.txt croniter==0.3.29 ; sys_platform != "win32" # via -r requirements/static/ci/common.in -cryptography==39.0.2 +cryptography==41.0.1 # via # -r requirements/static/pkg/linux.in # adal @@ -715,7 +715,7 @@ pymysql==1.0.2 ; python_version > "3.5" # via -r requirements/static/ci/linux.in pynacl==1.3.0 # via paramiko -pyopenssl==23.0.0 +pyopenssl==23.2.0 # via # -r requirements/static/pkg/linux.in # etcd3-py diff --git a/requirements/static/ci/py3.8/windows.txt b/requirements/static/ci/py3.8/windows.txt index deb490a493b..0638887da49 100644 --- a/requirements/static/ci/py3.8/windows.txt +++ b/requirements/static/ci/py3.8/windows.txt @@ -73,7 +73,7 @@ colorama==0.4.1 # via pytest contextvars==2.4 # via -r requirements/base.txt -cryptography==39.0.2 +cryptography==41.0.1 # via # -r requirements/windows.txt # etcd3-py @@ -238,7 +238,7 @@ pymssql==2.2.1 # via -r requirements/windows.txt pymysql==1.0.2 # via -r requirements/windows.txt -pyopenssl==23.0.0 +pyopenssl==23.2.0 # via # -r requirements/windows.txt # etcd3-py diff --git a/requirements/static/ci/py3.9/cloud.txt b/requirements/static/ci/py3.9/cloud.txt index ec7cb3da6ba..a866a0b15f6 100644 --- a/requirements/static/ci/py3.9/cloud.txt +++ b/requirements/static/ci/py3.9/cloud.txt @@ -390,7 +390,7 @@ contextvars==2.4 # via -r requirements/base.txt croniter==1.0.15 ; sys_platform != "win32" # via -r requirements/static/ci/common.in -cryptography==39.0.2 +cryptography==41.0.1 # via # -r requirements/static/pkg/linux.in # adal @@ -703,7 +703,7 @@ pyjwt==2.4.0 # via adal pynacl==1.4.0 # via paramiko -pyopenssl==23.0.0 +pyopenssl==23.2.0 # via # -r requirements/static/pkg/linux.in # etcd3-py diff --git a/requirements/static/ci/py3.9/darwin.txt b/requirements/static/ci/py3.9/darwin.txt index 2101a94d609..a309cf7c1ac 100644 --- a/requirements/static/ci/py3.9/darwin.txt +++ b/requirements/static/ci/py3.9/darwin.txt @@ -391,7 +391,7 @@ contextvars==2.4 # via -r requirements/base.txt croniter==0.3.29 ; sys_platform != "win32" # via -r requirements/static/ci/common.in -cryptography==39.0.2 +cryptography==41.0.1 # via # -r requirements/darwin.txt # adal @@ -699,7 +699,7 @@ pyjwt==2.4.0 # via adal pynacl==1.3.0 # via paramiko -pyopenssl==23.0.0 +pyopenssl==23.2.0 # via # -r requirements/darwin.txt # etcd3-py diff --git a/requirements/static/ci/py3.9/freebsd.txt b/requirements/static/ci/py3.9/freebsd.txt index e7d17091d8d..b352259132b 100644 --- a/requirements/static/ci/py3.9/freebsd.txt +++ b/requirements/static/ci/py3.9/freebsd.txt @@ -389,7 +389,7 @@ contextvars==2.4 # via -r requirements/base.txt croniter==0.3.29 ; sys_platform != "win32" # via -r requirements/static/ci/common.in -cryptography==39.0.2 +cryptography==41.0.0 # via # adal # azure-cosmosdb-table @@ -698,7 +698,7 @@ pyjwt==2.4.0 # via adal pynacl==1.3.0 # via paramiko -pyopenssl==23.0.0 +pyopenssl==23.2.0 # via # -r requirements/static/pkg/freebsd.in # etcd3-py diff --git a/requirements/static/ci/py3.9/lint.txt b/requirements/static/ci/py3.9/lint.txt index 50e4c72ed5e..ca6f7af483d 100644 --- a/requirements/static/ci/py3.9/lint.txt +++ b/requirements/static/ci/py3.9/lint.txt @@ -395,7 +395,7 @@ contextvars==2.4 # via -r requirements/base.txt croniter==1.0.15 ; sys_platform != "win32" # via -r requirements/static/ci/common.in -cryptography==39.0.2 +cryptography==41.0.1 # via # -r requirements/static/pkg/linux.in # adal @@ -710,7 +710,7 @@ pymysql==1.0.2 ; python_version > "3.5" # via -r requirements/static/ci/linux.in pynacl==1.4.0 # via paramiko -pyopenssl==23.0.0 +pyopenssl==23.2.0 # via # -r requirements/static/pkg/linux.in # etcd3-py diff --git a/requirements/static/ci/py3.9/linux.txt b/requirements/static/ci/py3.9/linux.txt index 647f4d91017..fd99af75b6a 100644 --- a/requirements/static/ci/py3.9/linux.txt +++ b/requirements/static/ci/py3.9/linux.txt @@ -405,7 +405,7 @@ contextvars==2.4 # via -r requirements/base.txt croniter==0.3.29 ; sys_platform != "win32" # via -r requirements/static/ci/common.in -cryptography==39.0.2 +cryptography==41.0.1 # via # -r requirements/static/pkg/linux.in # adal @@ -720,7 +720,7 @@ pymysql==1.0.2 ; python_version > "3.5" # via -r requirements/static/ci/linux.in pynacl==1.3.0 # via paramiko -pyopenssl==23.0.0 +pyopenssl==23.2.0 # via # -r requirements/static/pkg/linux.in # etcd3-py diff --git a/requirements/static/ci/py3.9/windows.txt b/requirements/static/ci/py3.9/windows.txt index 0f62ef8482d..671f49ddcc4 100644 --- a/requirements/static/ci/py3.9/windows.txt +++ b/requirements/static/ci/py3.9/windows.txt @@ -73,7 +73,7 @@ colorama==0.4.1 # via pytest contextvars==2.4 # via -r requirements/base.txt -cryptography==39.0.2 +cryptography==41.0.1 # via # -r requirements/windows.txt # etcd3-py @@ -239,7 +239,7 @@ pymssql==2.2.1 # via -r requirements/windows.txt pymysql==1.0.2 # via -r requirements/windows.txt -pyopenssl==23.0.0 +pyopenssl==23.2.0 # via # -r requirements/windows.txt # etcd3-py diff --git a/requirements/static/pkg/linux.in b/requirements/static/pkg/linux.in index 3555af3b9c3..340dde10eaa 100644 --- a/requirements/static/pkg/linux.in +++ b/requirements/static/pkg/linux.in @@ -10,4 +10,4 @@ rpm-vercmp setproctitle>=1.2.3 timelib>=0.2.5 importlib-metadata>=3.3.0 -cryptography>=39.0.1 +cryptography>=41.0.1 diff --git a/requirements/static/pkg/py3.10/darwin.txt b/requirements/static/pkg/py3.10/darwin.txt index 276394f1f8d..77f7ac11e69 100644 --- a/requirements/static/pkg/py3.10/darwin.txt +++ b/requirements/static/pkg/py3.10/darwin.txt @@ -18,7 +18,7 @@ cherrypy==18.6.1 # via -r requirements/darwin.txt contextvars==2.4 # via -r requirements/base.txt -cryptography==39.0.2 +cryptography==41.0.1 # via # -r requirements/darwin.txt # pyopenssl @@ -81,7 +81,7 @@ pycparser==2.21 # cffi pycryptodomex==3.9.8 # via -r requirements/crypto.txt -pyopenssl==23.0.0 +pyopenssl==23.2.0 # via -r requirements/darwin.txt python-dateutil==2.8.0 # via -r requirements/darwin.txt diff --git a/requirements/static/pkg/py3.10/freebsd.txt b/requirements/static/pkg/py3.10/freebsd.txt index fd41185e664..eb3f047d200 100644 --- a/requirements/static/pkg/py3.10/freebsd.txt +++ b/requirements/static/pkg/py3.10/freebsd.txt @@ -69,7 +69,7 @@ pycparser==2.21 ; python_version >= "3.9" # cffi pycryptodomex==3.9.8 # via -r requirements/crypto.txt -pyopenssl==23.0.0 +pyopenssl==23.2.0 # via -r requirements/static/pkg/freebsd.in python-dateutil==2.8.1 # via -r requirements/static/pkg/freebsd.in diff --git a/requirements/static/pkg/py3.10/linux.txt b/requirements/static/pkg/py3.10/linux.txt index 18d7c07ca8f..e9f1c6c50e0 100644 --- a/requirements/static/pkg/py3.10/linux.txt +++ b/requirements/static/pkg/py3.10/linux.txt @@ -16,7 +16,7 @@ cherrypy==18.6.1 # via -r requirements/static/pkg/linux.in contextvars==2.4 # via -r requirements/base.txt -cryptography==39.0.2 +cryptography==41.0.1 # via # -r requirements/static/pkg/linux.in # pyopenssl @@ -69,7 +69,7 @@ pycparser==2.21 ; python_version >= "3.9" # cffi pycryptodomex==3.9.8 # via -r requirements/crypto.txt -pyopenssl==23.0.0 +pyopenssl==23.2.0 # via -r requirements/static/pkg/linux.in python-dateutil==2.8.1 # via -r requirements/static/pkg/linux.in diff --git a/requirements/static/pkg/py3.10/windows.txt b/requirements/static/pkg/py3.10/windows.txt index f619ededaa4..72d665f7fa6 100644 --- a/requirements/static/pkg/py3.10/windows.txt +++ b/requirements/static/pkg/py3.10/windows.txt @@ -23,7 +23,7 @@ clr-loader==0.2.4 # via pythonnet contextvars==2.4 # via -r requirements/base.txt -cryptography==39.0.2 +cryptography==41.0.1 # via # -r requirements/windows.txt # pyopenssl @@ -90,7 +90,7 @@ pymssql==2.2.7 # via -r requirements/windows.txt pymysql==1.0.2 # via -r requirements/windows.txt -pyopenssl==23.0.0 +pyopenssl==23.2.0 # via -r requirements/windows.txt python-dateutil==2.8.1 # via -r requirements/windows.txt diff --git a/requirements/static/pkg/py3.7/freebsd.txt b/requirements/static/pkg/py3.7/freebsd.txt index 15b2d47cca7..ae5865986b3 100644 --- a/requirements/static/pkg/py3.7/freebsd.txt +++ b/requirements/static/pkg/py3.7/freebsd.txt @@ -67,7 +67,7 @@ pycparser==2.17 # via cffi pycryptodomex==3.9.8 # via -r requirements/crypto.txt -pyopenssl==23.0.0 +pyopenssl==23.2.0 # via -r requirements/static/pkg/freebsd.in python-dateutil==2.8.1 # via -r requirements/static/pkg/freebsd.in diff --git a/requirements/static/pkg/py3.7/linux.txt b/requirements/static/pkg/py3.7/linux.txt index f44232437ad..d1c058f6f48 100644 --- a/requirements/static/pkg/py3.7/linux.txt +++ b/requirements/static/pkg/py3.7/linux.txt @@ -16,7 +16,7 @@ cherrypy==18.6.1 # via -r requirements/static/pkg/linux.in contextvars==2.4 # via -r requirements/base.txt -cryptography==39.0.2 +cryptography==41.0.1 # via # -r requirements/static/pkg/linux.in # pyopenssl @@ -67,7 +67,7 @@ pycparser==2.17 # via cffi pycryptodomex==3.9.8 # via -r requirements/crypto.txt -pyopenssl==23.0.0 +pyopenssl==23.2.0 # via -r requirements/static/pkg/linux.in python-dateutil==2.8.1 # via -r requirements/static/pkg/linux.in diff --git a/requirements/static/pkg/py3.7/windows.txt b/requirements/static/pkg/py3.7/windows.txt index ec7a648807b..23b16d98e78 100644 --- a/requirements/static/pkg/py3.7/windows.txt +++ b/requirements/static/pkg/py3.7/windows.txt @@ -23,7 +23,7 @@ clr-loader==0.2.4 # via pythonnet contextvars==2.4 # via -r requirements/base.txt -cryptography==39.0.2 +cryptography==41.0.1 # via # -r requirements/windows.txt # pyopenssl @@ -90,7 +90,7 @@ pymssql==2.2.1 # via -r requirements/windows.txt pymysql==1.0.2 # via -r requirements/windows.txt -pyopenssl==23.0.0 +pyopenssl==23.2.0 # via -r requirements/windows.txt python-dateutil==2.8.1 # via -r requirements/windows.txt diff --git a/requirements/static/pkg/py3.8/freebsd.txt b/requirements/static/pkg/py3.8/freebsd.txt index ef5b28be524..2419a87646c 100644 --- a/requirements/static/pkg/py3.8/freebsd.txt +++ b/requirements/static/pkg/py3.8/freebsd.txt @@ -67,7 +67,7 @@ pycparser==2.17 # via cffi pycryptodomex==3.9.8 # via -r requirements/crypto.txt -pyopenssl==23.0.0 +pyopenssl==23.2.0 # via -r requirements/static/pkg/freebsd.in python-dateutil==2.8.1 # via -r requirements/static/pkg/freebsd.in diff --git a/requirements/static/pkg/py3.8/linux.txt b/requirements/static/pkg/py3.8/linux.txt index 1db80471daf..6dc2d7918d9 100644 --- a/requirements/static/pkg/py3.8/linux.txt +++ b/requirements/static/pkg/py3.8/linux.txt @@ -16,7 +16,7 @@ cherrypy==18.6.1 # via -r requirements/static/pkg/linux.in contextvars==2.4 # via -r requirements/base.txt -cryptography==39.0.2 +cryptography==41.0.1 # via # -r requirements/static/pkg/linux.in # pyopenssl @@ -67,7 +67,7 @@ pycparser==2.17 # via cffi pycryptodomex==3.9.8 # via -r requirements/crypto.txt -pyopenssl==23.0.0 +pyopenssl==23.2.0 # via -r requirements/static/pkg/linux.in python-dateutil==2.8.1 # via -r requirements/static/pkg/linux.in diff --git a/requirements/static/pkg/py3.8/windows.txt b/requirements/static/pkg/py3.8/windows.txt index b37c1ed5819..0363e776489 100644 --- a/requirements/static/pkg/py3.8/windows.txt +++ b/requirements/static/pkg/py3.8/windows.txt @@ -23,7 +23,7 @@ clr-loader==0.2.4 # via pythonnet contextvars==2.4 # via -r requirements/base.txt -cryptography==39.0.2 +cryptography==41.0.1 # via # -r requirements/windows.txt # pyopenssl @@ -90,7 +90,7 @@ pymssql==2.2.1 # via -r requirements/windows.txt pymysql==1.0.2 # via -r requirements/windows.txt -pyopenssl==23.0.0 +pyopenssl==23.2.0 # via -r requirements/windows.txt python-dateutil==2.8.1 # via -r requirements/windows.txt diff --git a/requirements/static/pkg/py3.9/darwin.txt b/requirements/static/pkg/py3.9/darwin.txt index 636e8766bff..6dc90cc344f 100644 --- a/requirements/static/pkg/py3.9/darwin.txt +++ b/requirements/static/pkg/py3.9/darwin.txt @@ -18,7 +18,7 @@ cherrypy==18.6.1 # via -r requirements/darwin.txt contextvars==2.4 # via -r requirements/base.txt -cryptography==39.0.2 +cryptography==41.0.1 # via # -r requirements/darwin.txt # pyopenssl @@ -81,7 +81,7 @@ pycparser==2.21 # cffi pycryptodomex==3.9.8 # via -r requirements/crypto.txt -pyopenssl==23.0.0 +pyopenssl==23.2.0 # via -r requirements/darwin.txt python-dateutil==2.8.0 # via -r requirements/darwin.txt diff --git a/requirements/static/pkg/py3.9/freebsd.txt b/requirements/static/pkg/py3.9/freebsd.txt index c8e2570bf9d..dfa83b9c31d 100644 --- a/requirements/static/pkg/py3.9/freebsd.txt +++ b/requirements/static/pkg/py3.9/freebsd.txt @@ -69,7 +69,7 @@ pycparser==2.21 ; python_version >= "3.9" # cffi pycryptodomex==3.9.8 # via -r requirements/crypto.txt -pyopenssl==23.0.0 +pyopenssl==23.2.0 # via -r requirements/static/pkg/freebsd.in python-dateutil==2.8.1 # via -r requirements/static/pkg/freebsd.in diff --git a/requirements/static/pkg/py3.9/linux.txt b/requirements/static/pkg/py3.9/linux.txt index 0c366bf1869..56e78f78351 100644 --- a/requirements/static/pkg/py3.9/linux.txt +++ b/requirements/static/pkg/py3.9/linux.txt @@ -16,7 +16,7 @@ cherrypy==18.6.1 # via -r requirements/static/pkg/linux.in contextvars==2.4 # via -r requirements/base.txt -cryptography==39.0.2 +cryptography==41.0.1 # via # -r requirements/static/pkg/linux.in # pyopenssl @@ -69,7 +69,7 @@ pycparser==2.21 ; python_version >= "3.9" # cffi pycryptodomex==3.9.8 # via -r requirements/crypto.txt -pyopenssl==23.0.0 +pyopenssl==23.2.0 # via -r requirements/static/pkg/linux.in python-dateutil==2.8.1 # via -r requirements/static/pkg/linux.in diff --git a/requirements/static/pkg/py3.9/windows.txt b/requirements/static/pkg/py3.9/windows.txt index f9a874bd592..273acb031d2 100644 --- a/requirements/static/pkg/py3.9/windows.txt +++ b/requirements/static/pkg/py3.9/windows.txt @@ -23,7 +23,7 @@ clr-loader==0.2.4 # via pythonnet contextvars==2.4 # via -r requirements/base.txt -cryptography==39.0.2 +cryptography==41.0.1 # via # -r requirements/windows.txt # pyopenssl @@ -90,7 +90,7 @@ pymssql==2.2.1 # via -r requirements/windows.txt pymysql==1.0.2 # via -r requirements/windows.txt -pyopenssl==23.0.0 +pyopenssl==23.2.0 # via -r requirements/windows.txt python-dateutil==2.8.1 # via -r requirements/windows.txt diff --git a/requirements/windows.txt b/requirements/windows.txt index dacdbd1279a..b91cd0ecf2d 100644 --- a/requirements/windows.txt +++ b/requirements/windows.txt @@ -10,7 +10,7 @@ backports.ssl-match-hostname>=3.7.0.1; python_version < '3.7' certifi>=2022.12.07 cffi>=1.14.5 cherrypy>=18.6.1 -cryptography>=39.0.1 +cryptography>=41.0.1 gitpython>=3.1.30; python_version >= '3.7' ioloop>=0.1a0 lxml>=4.6.3 From dc9c22ab9b76b5d444a279e130c8c6fee9bc7500 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Wed, 5 Jul 2023 09:37:12 +0100 Subject: [PATCH 110/393] Switch to Debian 12 to build packages. The latest cryptography 1.41.1 requires a version of rustc which is not available on Debian 11 Signed-off-by: Pedro Algarvio --- .../setup-python-tools-scripts/action.yml | 7 ++- .github/workflows/build-deb-packages.yml | 2 +- .pre-commit-config.yaml | 11 ++++ requirements/static/ci/py3.11/tools.txt | 58 +++++++++++++++++++ 4 files changed, 76 insertions(+), 2 deletions(-) create mode 100644 requirements/static/ci/py3.11/tools.txt diff --git a/.github/actions/setup-python-tools-scripts/action.yml b/.github/actions/setup-python-tools-scripts/action.yml index dcd46feb2b0..72bcf3b1d37 100644 --- a/.github/actions/setup-python-tools-scripts/action.yml +++ b/.github/actions/setup-python-tools-scripts/action.yml @@ -33,7 +33,12 @@ runs: shell: bash working-directory: ${{ inputs.cwd }} run: | - python3 -m pip install -r requirements/static/ci/py${{ steps.get-python-version.outputs.version }}/tools.txt + (python3 -m pip install --help | grep break-system-packages > /dev/null 2>&1) && exitcode=0 || exitcode=1 + if [ $exitcode -eq 0 ]; then + python3 -m pip install --break-system-packages -r requirements/static/ci/py${{ steps.get-python-version.outputs.version }}/tools.txt + else + python3 -m pip install -r requirements/static/ci/py${{ steps.get-python-version.outputs.version }}/tools.txt + fi - name: Get 'python-tools-scripts' Version id: get-version diff --git a/.github/workflows/build-deb-packages.yml b/.github/workflows/build-deb-packages.yml index c24fef37c14..42f7f4eb6e7 100644 --- a/.github/workflows/build-deb-packages.yml +++ b/.github/workflows/build-deb-packages.yml @@ -35,7 +35,7 @@ jobs: - src container: - image: ghcr.io/saltstack/salt-ci-containers/packaging:debian-11 + image: ghcr.io/saltstack/salt-ci-containers/packaging:debian-12 steps: # Checkout here so we can easily use custom actions diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3bf36c32476..d6cb848d7e6 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1022,6 +1022,17 @@ repos: - --py-version=3.10 - --pip-args=--constraint=requirements/static/ci/py{py_version}/linux.txt - requirements/static/ci/tools.in + + - id: pip-tools-compile + alias: compile-ci-tools-3.11-requirements + name: Linux CI Py3.11 Tools Requirements + files: ^requirements/static/ci/(tools\.in|py3.11/(tools|linux)\.txt)$ + pass_filenames: false + args: + - -v + - --py-version=3.11 + - --pip-args=--constraint=requirements/static/ci/py{py_version}/linux.txt + - requirements/static/ci/tools.in # <---- Tools ----------------------------------------------------------------------------------------------------- # ----- Code Formatting -------------------------------------------------------------------------------------------> diff --git a/requirements/static/ci/py3.11/tools.txt b/requirements/static/ci/py3.11/tools.txt new file mode 100644 index 00000000000..bdd05d1f2ee --- /dev/null +++ b/requirements/static/ci/py3.11/tools.txt @@ -0,0 +1,58 @@ +# +# This file is autogenerated by pip-compile +# To update, run: +# +# pip-compile --output-file=requirements/static/ci/py3.11/tools.txt --pip-args='--constraint=requirements/static/ci/py3.11/linux.txt' requirements/static/ci/tools.in +# +attrs==22.1.0 + # via + # -r requirements/static/ci/tools.in + # python-tools-scripts +boto3==1.21.46 + # via -r requirements/static/ci/tools.in +botocore==1.24.46 + # via + # boto3 + # s3transfer +certifi==2022.12.7 + # via requests +charset-normalizer==3.0.1 + # via requests +commonmark==0.9.1 + # via rich +idna==3.4 + # via requests +jinja2==3.1.2 + # via -r requirements/static/ci/tools.in +jmespath==1.0.1 + # via + # boto3 + # botocore +markupsafe==2.1.2 + # via jinja2 +packaging==23.0 + # via -r requirements/static/ci/tools.in +pygments==2.13.0 + # via rich +python-dateutil==2.8.2 + # via botocore +python-tools-scripts==0.12.0 + # via -r requirements/static/ci/tools.in +pyyaml==6.0 + # via -r requirements/static/ci/tools.in +requests==2.31.0 + # via + # python-tools-scripts + # virustotal3 +rich==12.5.1 + # via python-tools-scripts +s3transfer==0.5.2 + # via boto3 +six==1.16.0 + # via python-dateutil +urllib3==1.26.12 + # via + # botocore + # requests +virustotal3==1.0.8 + # via -r requirements/static/ci/tools.in From 7a2eeada097b4f041cd305cddd959cc39ac1c2a2 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Fri, 7 Jul 2023 07:52:37 +0100 Subject: [PATCH 111/393] Allow forcing the package tests to run by the `test:pkg` label Signed-off-by: Pedro Algarvio --- tools/ci.py | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/tools/ci.py b/tools/ci.py index 566a1f388f6..78e65ad84c3 100644 --- a/tools/ci.py +++ b/tools/ci.py @@ -305,6 +305,23 @@ def define_jobs( ) return + # This is a pull-request + + labels: list[str] = [] + gh_event_path = os.environ.get("GITHUB_EVENT_PATH") or None + if gh_event_path is not None: + try: + gh_event = json.loads(open(gh_event_path).read()) + except Exception as exc: + ctx.error( + f"Could not load the GH Event payload from {gh_event_path!r}:\n", exc + ) + ctx.exit(1) + + labels.extend( + label[0] for label in _get_pr_test_labels_from_event_payload(gh_event) + ) + if not changed_files.exists(): ctx.error(f"The '{changed_files}' file does not exist.") ctx.error( @@ -354,9 +371,16 @@ def define_jobs( changed_files_contents["workflows"], } if jobs["test-pkg"] and required_pkg_test_changes == {"false"}: - with open(github_step_summary, "a", encoding="utf-8") as wfh: - wfh.write("De-selecting the 'test-pkg' job.\n") - jobs["test-pkg"] = False + if "test:pkg" in labels: + with open(github_step_summary, "a", encoding="utf-8") as wfh: + wfh.write( + "The 'test-pkg' job is forcefully selected by the use of the 'test:pkg' label.\n" + ) + jobs["test-pkg"] = True + else: + with open(github_step_summary, "a", encoding="utf-8") as wfh: + wfh.write("De-selecting the 'test-pkg' job.\n") + jobs["test-pkg"] = False if jobs["test-pkg-download"] and required_pkg_test_changes == {"false"}: with open(github_step_summary, "a", encoding="utf-8") as wfh: From 46103123e42731efd6bbee9bdc8ce3ce629f3ced Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Fri, 7 Jul 2023 07:52:37 +0100 Subject: [PATCH 112/393] Allow forcing the package tests to run by the `test:pkg` label Signed-off-by: Pedro Algarvio --- tools/ci.py | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/tools/ci.py b/tools/ci.py index 8264cb37019..4dd7ab4e145 100644 --- a/tools/ci.py +++ b/tools/ci.py @@ -306,6 +306,23 @@ def define_jobs( ) return + # This is a pull-request + + labels: list[str] = [] + gh_event_path = os.environ.get("GITHUB_EVENT_PATH") or None + if gh_event_path is not None: + try: + gh_event = json.loads(open(gh_event_path).read()) + except Exception as exc: + ctx.error( + f"Could not load the GH Event payload from {gh_event_path!r}:\n", exc + ) + ctx.exit(1) + + labels.extend( + label[0] for label in _get_pr_test_labels_from_event_payload(gh_event) + ) + if not changed_files.exists(): ctx.error(f"The '{changed_files}' file does not exist.") ctx.error( @@ -355,9 +372,16 @@ def define_jobs( changed_files_contents["workflows"], } if jobs["test-pkg"] and required_pkg_test_changes == {"false"}: - with open(github_step_summary, "a", encoding="utf-8") as wfh: - wfh.write("De-selecting the 'test-pkg' job.\n") - jobs["test-pkg"] = False + if "test:pkg" in labels: + with open(github_step_summary, "a", encoding="utf-8") as wfh: + wfh.write( + "The 'test-pkg' job is forcefully selected by the use of the 'test:pkg' label.\n" + ) + jobs["test-pkg"] = True + else: + with open(github_step_summary, "a", encoding="utf-8") as wfh: + wfh.write("De-selecting the 'test-pkg' job.\n") + jobs["test-pkg"] = False if jobs["test-pkg-download"] and required_pkg_test_changes == {"false"}: with open(github_step_summary, "a", encoding="utf-8") as wfh: From 892aeeda0f9a6496c4a476bb2a60c194e55ddf80 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Sat, 8 Jul 2023 08:56:27 +0100 Subject: [PATCH 113/393] Downgrade to `psutil==5.8.0` on windows to fix the package upgrade tests Signed-off-by: Pedro Algarvio --- requirements/static/ci/py3.10/windows.txt | 2 +- requirements/static/ci/py3.11/windows.txt | 2 +- requirements/static/ci/py3.8/windows.txt | 2 +- requirements/static/ci/py3.9/windows.txt | 2 +- requirements/static/pkg/py3.10/windows.txt | 2 +- requirements/static/pkg/py3.11/windows.txt | 2 +- requirements/static/pkg/py3.8/windows.txt | 2 +- requirements/static/pkg/py3.9/windows.txt | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/requirements/static/ci/py3.10/windows.txt b/requirements/static/ci/py3.10/windows.txt index 1960ea708b7..0b06eca4729 100644 --- a/requirements/static/ci/py3.10/windows.txt +++ b/requirements/static/ci/py3.10/windows.txt @@ -256,7 +256,7 @@ portend==3.1.0 # via # -c requirements/static/ci/../pkg/py3.10/windows.txt # cherrypy -psutil==5.9.5 +psutil==5.8.0 # via # -c requirements/static/ci/../pkg/py3.10/windows.txt # -r requirements/base.txt diff --git a/requirements/static/ci/py3.11/windows.txt b/requirements/static/ci/py3.11/windows.txt index efe267454b8..54384908d4a 100644 --- a/requirements/static/ci/py3.11/windows.txt +++ b/requirements/static/ci/py3.11/windows.txt @@ -254,7 +254,7 @@ portend==3.1.0 # via # -c requirements/static/ci/../pkg/py3.11/windows.txt # cherrypy -psutil==5.9.5 +psutil==5.8.0 # via # -c requirements/static/ci/../pkg/py3.11/windows.txt # -r requirements/base.txt diff --git a/requirements/static/ci/py3.8/windows.txt b/requirements/static/ci/py3.8/windows.txt index dcc52446907..78d5c251e86 100644 --- a/requirements/static/ci/py3.8/windows.txt +++ b/requirements/static/ci/py3.8/windows.txt @@ -260,7 +260,7 @@ portend==3.1.0 # via # -c requirements/static/ci/../pkg/py3.8/windows.txt # cherrypy -psutil==5.9.5 +psutil==5.8.0 # via # -c requirements/static/ci/../pkg/py3.8/windows.txt # -r requirements/base.txt diff --git a/requirements/static/ci/py3.9/windows.txt b/requirements/static/ci/py3.9/windows.txt index fdee7fa5a56..10557727d61 100644 --- a/requirements/static/ci/py3.9/windows.txt +++ b/requirements/static/ci/py3.9/windows.txt @@ -256,7 +256,7 @@ portend==3.1.0 # via # -c requirements/static/ci/../pkg/py3.9/windows.txt # cherrypy -psutil==5.9.5 +psutil==5.8.0 # via # -c requirements/static/ci/../pkg/py3.9/windows.txt # -r requirements/base.txt diff --git a/requirements/static/pkg/py3.10/windows.txt b/requirements/static/pkg/py3.10/windows.txt index 3d101277be6..30ec23f4651 100644 --- a/requirements/static/pkg/py3.10/windows.txt +++ b/requirements/static/pkg/py3.10/windows.txt @@ -78,7 +78,7 @@ packaging==23.1 # via -r requirements/base.txt portend==3.1.0 # via cherrypy -psutil==5.9.5 +psutil==5.8.0 # via -r requirements/base.txt pyasn1==0.4.8 # via -r requirements/windows.txt diff --git a/requirements/static/pkg/py3.11/windows.txt b/requirements/static/pkg/py3.11/windows.txt index 0ea4adef5b2..84f205c8b57 100644 --- a/requirements/static/pkg/py3.11/windows.txt +++ b/requirements/static/pkg/py3.11/windows.txt @@ -78,7 +78,7 @@ packaging==23.1 # via -r requirements/base.txt portend==3.1.0 # via cherrypy -psutil==5.9.5 +psutil==5.8.0 # via -r requirements/base.txt pyasn1==0.4.8 # via -r requirements/windows.txt diff --git a/requirements/static/pkg/py3.8/windows.txt b/requirements/static/pkg/py3.8/windows.txt index 58438f7c9e6..cb8051a1e86 100644 --- a/requirements/static/pkg/py3.8/windows.txt +++ b/requirements/static/pkg/py3.8/windows.txt @@ -80,7 +80,7 @@ packaging==23.1 # via -r requirements/base.txt portend==3.1.0 # via cherrypy -psutil==5.9.5 +psutil==5.8.0 # via -r requirements/base.txt pyasn1==0.4.8 # via -r requirements/windows.txt diff --git a/requirements/static/pkg/py3.9/windows.txt b/requirements/static/pkg/py3.9/windows.txt index 8be8303ae81..6442356b299 100644 --- a/requirements/static/pkg/py3.9/windows.txt +++ b/requirements/static/pkg/py3.9/windows.txt @@ -78,7 +78,7 @@ packaging==23.1 # via -r requirements/base.txt portend==3.1.0 # via cherrypy -psutil==5.9.5 +psutil==5.8.0 # via -r requirements/base.txt pyasn1==0.4.8 # via -r requirements/windows.txt From 3a91a197d4a696fd8c40cd93bc4be51072b31436 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Sat, 8 Jul 2023 08:57:49 +0100 Subject: [PATCH 114/393] Downgrade to `cffi==1.14.6` on windows to fix the package upgrade tests Signed-off-by: Pedro Algarvio --- requirements/static/ci/py3.10/windows.txt | 2 +- requirements/static/ci/py3.11/windows.txt | 2 +- requirements/static/ci/py3.8/windows.txt | 2 +- requirements/static/ci/py3.9/windows.txt | 2 +- requirements/static/pkg/py3.10/windows.txt | 2 +- requirements/static/pkg/py3.11/windows.txt | 2 +- requirements/static/pkg/py3.8/windows.txt | 2 +- requirements/static/pkg/py3.9/windows.txt | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/requirements/static/ci/py3.10/windows.txt b/requirements/static/ci/py3.10/windows.txt index 0b06eca4729..d325dde3c7c 100644 --- a/requirements/static/ci/py3.10/windows.txt +++ b/requirements/static/ci/py3.10/windows.txt @@ -47,7 +47,7 @@ certifi==2023.5.7 # -r requirements/windows.txt # kubernetes # requests -cffi==1.15.1 +cffi==1.14.6 # via # -c requirements/static/ci/../pkg/py3.10/windows.txt # -r requirements/static/ci/common.in diff --git a/requirements/static/ci/py3.11/windows.txt b/requirements/static/ci/py3.11/windows.txt index 54384908d4a..273b0594f44 100644 --- a/requirements/static/ci/py3.11/windows.txt +++ b/requirements/static/ci/py3.11/windows.txt @@ -47,7 +47,7 @@ certifi==2023.5.7 # -r requirements/windows.txt # kubernetes # requests -cffi==1.15.1 +cffi==1.14.6 # via # -c requirements/static/ci/../pkg/py3.11/windows.txt # -r requirements/static/ci/common.in diff --git a/requirements/static/ci/py3.8/windows.txt b/requirements/static/ci/py3.8/windows.txt index 78d5c251e86..4b4388b487c 100644 --- a/requirements/static/ci/py3.8/windows.txt +++ b/requirements/static/ci/py3.8/windows.txt @@ -47,7 +47,7 @@ certifi==2023.5.7 # -r requirements/windows.txt # kubernetes # requests -cffi==1.15.1 +cffi==1.14.6 # via # -c requirements/static/ci/../pkg/py3.8/windows.txt # -r requirements/static/ci/common.in diff --git a/requirements/static/ci/py3.9/windows.txt b/requirements/static/ci/py3.9/windows.txt index 10557727d61..b7c02a20b19 100644 --- a/requirements/static/ci/py3.9/windows.txt +++ b/requirements/static/ci/py3.9/windows.txt @@ -47,7 +47,7 @@ certifi==2023.5.7 # -r requirements/windows.txt # kubernetes # requests -cffi==1.15.1 +cffi==1.14.6 # via # -c requirements/static/ci/../pkg/py3.9/windows.txt # -r requirements/static/ci/common.in diff --git a/requirements/static/pkg/py3.10/windows.txt b/requirements/static/pkg/py3.10/windows.txt index 30ec23f4651..dd43c167f38 100644 --- a/requirements/static/pkg/py3.10/windows.txt +++ b/requirements/static/pkg/py3.10/windows.txt @@ -10,7 +10,7 @@ certifi==2023.5.7 # via # -r requirements/windows.txt # requests -cffi==1.15.1 +cffi==1.14.6 # via # -r requirements/windows.txt # clr-loader diff --git a/requirements/static/pkg/py3.11/windows.txt b/requirements/static/pkg/py3.11/windows.txt index 84f205c8b57..bf9a4201e9e 100644 --- a/requirements/static/pkg/py3.11/windows.txt +++ b/requirements/static/pkg/py3.11/windows.txt @@ -10,7 +10,7 @@ certifi==2023.5.7 # via # -r requirements/windows.txt # requests -cffi==1.15.1 +cffi==1.14.6 # via # -r requirements/windows.txt # clr-loader diff --git a/requirements/static/pkg/py3.8/windows.txt b/requirements/static/pkg/py3.8/windows.txt index cb8051a1e86..6ec9eec7c47 100644 --- a/requirements/static/pkg/py3.8/windows.txt +++ b/requirements/static/pkg/py3.8/windows.txt @@ -10,7 +10,7 @@ certifi==2023.5.7 # via # -r requirements/windows.txt # requests -cffi==1.15.1 +cffi==1.14.6 # via # -r requirements/windows.txt # clr-loader diff --git a/requirements/static/pkg/py3.9/windows.txt b/requirements/static/pkg/py3.9/windows.txt index 6442356b299..7f33992db7c 100644 --- a/requirements/static/pkg/py3.9/windows.txt +++ b/requirements/static/pkg/py3.9/windows.txt @@ -10,7 +10,7 @@ certifi==2023.5.7 # via # -r requirements/windows.txt # requests -cffi==1.15.1 +cffi==1.14.6 # via # -r requirements/windows.txt # clr-loader From 261e3e825d4a2e2db8351b2c89002d586fafa5cd Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Sat, 8 Jul 2023 21:32:10 +0100 Subject: [PATCH 115/393] Run `pyupgrade` against the files changed on the merge forward Signed-off-by: Pedro Algarvio --- salt/modules/win_pkg.py | 98 ++++++++++------------ tests/pytests/unit/modules/test_win_pkg.py | 4 +- 2 files changed, 46 insertions(+), 56 deletions(-) diff --git a/salt/modules/win_pkg.py b/salt/modules/win_pkg.py index e8fdf22e419..c2ea64d823a 100644 --- a/salt/modules/win_pkg.py +++ b/salt/modules/win_pkg.py @@ -490,14 +490,14 @@ def _get_reg_software(include_components=True, include_updates=True): return False if __utils__["reg.value_exists"]( hive=hive, - key="{}\\{}".format(key, sub_key), + key=f"{key}\\{sub_key}", vname="SystemComponent", use_32bit_registry=use_32bit_registry, ): if ( __utils__["reg.read_value"]( hive=hive, - key="{}\\{}".format(key, sub_key), + key=f"{key}\\{sub_key}", vname="SystemComponent", use_32bit_registry=use_32bit_registry, )["vdata"] @@ -519,14 +519,14 @@ def _get_reg_software(include_components=True, include_updates=True): products_key = "Software\\Classes\\Installer\\Products\\{0}" if __utils__["reg.value_exists"]( hive=hive, - key="{}\\{}".format(key, sub_key), + key=f"{key}\\{sub_key}", vname="WindowsInstaller", use_32bit_registry=use_32bit_registry, ): if ( __utils__["reg.read_value"]( hive=hive, - key="{}\\{}".format(key, sub_key), + key=f"{key}\\{sub_key}", vname="WindowsInstaller", use_32bit_registry=use_32bit_registry, )["vdata"] @@ -557,14 +557,14 @@ def _get_reg_software(include_components=True, include_updates=True): # https://docs.microsoft.com/en-us/windows/win32/msi/arpnoremove if __utils__["reg.value_exists"]( hive=hive, - key="{}\\{}".format(key, sub_key), + key=f"{key}\\{sub_key}", vname="NoRemove", use_32bit_registry=use_32bit_registry, ): if ( __utils__["reg.read_value"]( hive=hive, - key="{}\\{}".format(key, sub_key), + key=f"{key}\\{sub_key}", vname="NoRemove", use_32bit_registry=use_32bit_registry, )["vdata"] @@ -573,7 +573,7 @@ def _get_reg_software(include_components=True, include_updates=True): return False if not __utils__["reg.value_exists"]( hive=hive, - key="{}\\{}".format(key, sub_key), + key=f"{key}\\{sub_key}", vname="UninstallString", use_32bit_registry=use_32bit_registry, ): @@ -594,14 +594,14 @@ def _get_reg_software(include_components=True, include_updates=True): skip_types = ["Hotfix", "Security Update", "Update Rollup"] if __utils__["reg.value_exists"]( hive=hive, - key="{}\\{}".format(key, sub_key), + key=f"{key}\\{sub_key}", vname="ReleaseType", use_32bit_registry=use_32bit_registry, ): if ( __utils__["reg.read_value"]( hive=hive, - key="{}\\{}".format(key, sub_key), + key=f"{key}\\{sub_key}", vname="ReleaseType", use_32bit_registry=use_32bit_registry, )["vdata"] @@ -620,7 +620,7 @@ def _get_reg_software(include_components=True, include_updates=True): """ if __utils__["reg.value_exists"]( hive=hive, - key="{}\\{}".format(key, sub_key), + key=f"{key}\\{sub_key}", vname="ParentKeyName", use_32bit_registry=use_32bit_registry, ): @@ -637,7 +637,7 @@ def _get_reg_software(include_components=True, include_updates=True): """ d_name_regdata = __utils__["reg.read_value"]( hive=hive, - key="{}\\{}".format(key, sub_key), + key=f"{key}\\{sub_key}", vname="DisplayName", use_32bit_registry=use_32bit_registry, ) @@ -656,7 +656,7 @@ def _get_reg_software(include_components=True, include_updates=True): d_vers_regdata = __utils__["reg.read_value"]( hive=hive, - key="{}\\{}".format(key, sub_key), + key=f"{key}\\{sub_key}", vname="DisplayVersion", use_32bit_registry=use_32bit_registry, ) @@ -727,7 +727,7 @@ def _get_reg_software(include_components=True, include_updates=True): for sub_key in __utils__["reg.list_keys"](**kwargs): # If the key does not exist in userdata, skip it if not __utils__["reg.key_exists"]( - hive=kwargs["hive"], key="{}\\{}".format(userdata_key, sub_key) + hive=kwargs["hive"], key=f"{userdata_key}\\{sub_key}" ): continue kwargs["sub_key"] = sub_key @@ -1041,7 +1041,7 @@ def _get_repo_details(saltenv): """ Return repo details for the specified saltenv as a namedtuple """ - contextkey = "winrepo._get_repo_details.{}".format(saltenv) + contextkey = f"winrepo._get_repo_details.{saltenv}" if contextkey in __context__: (winrepo_source_dir, local_dest, winrepo_file) = __context__[contextkey] @@ -1086,9 +1086,7 @@ def _get_repo_details(saltenv): os.makedirs(local_dest) except OSError as exc: if exc.errno != errno.EEXIST: - raise CommandExecutionError( - "Failed to create {}: {}".format(local_dest, exc) - ) + raise CommandExecutionError(f"Failed to create {local_dest}: {exc}") winrepo_age = -1 try: @@ -1097,9 +1095,7 @@ def _get_repo_details(saltenv): winrepo_age = time.time() - mtime except OSError as exc: if exc.errno != errno.ENOENT: - raise CommandExecutionError( - "Failed to get age of {}: {}".format(winrepo_file, exc) - ) + raise CommandExecutionError(f"Failed to get age of {winrepo_file}: {exc}") except AttributeError: # Shouldn't happen but log if it does log.warning("st_mtime missing from stat result %s", stat_result) @@ -1222,9 +1218,7 @@ def _repo_process_pkg_sls(filename, short_path_name, ret, successful_verbose): def _failed_compile(prefix_msg, error_msg): log.error("%s '%s': %s", prefix_msg, short_path_name, error_msg) - ret.setdefault("errors", {})[short_path_name] = [ - "{}, {} ".format(prefix_msg, error_msg) - ] + ret.setdefault("errors", {})[short_path_name] = [f"{prefix_msg}, {error_msg} "] return False try: @@ -1250,7 +1244,7 @@ def _repo_process_pkg_sls(filename, short_path_name, ret, successful_verbose): pkgname, short_path_name, ) - errors.append("package '{}' already defined".format(pkgname)) + errors.append(f"package '{pkgname}' already defined") break for version_str, repodata in version_list.items(): # Ensure version is a string/unicode @@ -1322,9 +1316,7 @@ def _get_source_sum(source_hash, file_path, saltenv, verify_ssl=True): raise if not cached_hash_file: - raise CommandExecutionError( - "Source hash file {} not found".format(source_hash) - ) + raise CommandExecutionError(f"Source hash file {source_hash} not found") ret = __salt__["file.extract_hash"](cached_hash_file, "", file_path) if ret is None: @@ -1582,7 +1574,7 @@ def install(name=None, refresh=False, pkgs=None, **kwargs): # Make sure pkginfo was found if not pkginfo: log.error("Unable to locate package %s", pkg_name) - ret[pkg_name] = "Unable to locate package {}".format(pkg_name) + ret[pkg_name] = f"Unable to locate package {pkg_name}" continue version_num = options.get("version") @@ -1666,9 +1658,9 @@ def install(name=None, refresh=False, pkgs=None, **kwargs): exclude_pat="E@init.sls$", ) except MinionError as exc: - msg = "Failed to cache {}".format(path) + msg = f"Failed to cache {path}" log.exception(msg, exc_info=exc) - return "{}\n{}".format(msg, exc) + return f"{msg}\n{exc}" # Check to see if the cache_file is cached... if passed if cache_file and cache_file.startswith("salt:"): @@ -1682,9 +1674,9 @@ def install(name=None, refresh=False, pkgs=None, **kwargs): verify_ssl=kwargs.get("verify_ssl", True), ) except MinionError as exc: - msg = "Failed to cache {}".format(cache_file) + msg = f"Failed to cache {cache_file}" log.exception(msg, exc_info=exc) - return "{}\n{}".format(msg, exc) + return f"{msg}\n{exc}" # Check if the cache_file was cached successfully if not cached_file: @@ -1713,9 +1705,9 @@ def install(name=None, refresh=False, pkgs=None, **kwargs): use_etag=True, ) except MinionError as exc: - msg = "Failed to cache {}".format(installer) + msg = f"Failed to cache {installer}" log.exception(msg, exc_info=exc) - return "{}\n{}".format(msg, exc) + return f"{msg}\n{exc}" # Check if the installer was cached successfully if not cached_pkg: @@ -1780,14 +1772,14 @@ def install(name=None, refresh=False, pkgs=None, **kwargs): "ComSpec", "{}\\system32\\cmd.exe".format(os.getenv("WINDIR")) ) if use_msiexec: - arguments = '"{}" /I "{}"'.format(msiexec, cached_pkg) + arguments = f'"{msiexec}" /I "{cached_pkg}"' if pkginfo[version_num].get("allusers", True): - arguments = "{} ALLUSERS=1".format(arguments) + arguments = f"{arguments} ALLUSERS=1" else: - arguments = '"{}"'.format(cached_pkg) + arguments = f'"{cached_pkg}"' if install_flags: - arguments = "{} {}".format(arguments, install_flags) + arguments = f"{arguments} {install_flags}" # Install the software # Check Use Scheduler Option @@ -1801,7 +1793,7 @@ def install(name=None, refresh=False, pkgs=None, **kwargs): force=True, action_type="Execute", cmd=cmd_shell, - arguments='/c "{}"'.format(arguments), + arguments=f'/c "{arguments}"', start_in=cache_path, trigger_type="Once", start_date="1975-01-01", @@ -1853,7 +1845,7 @@ def install(name=None, refresh=False, pkgs=None, **kwargs): else: # Launch the command result = __salt__["cmd.run_all"]( - '"{}" /c "{}"'.format(cmd_shell, arguments), + f'"{cmd_shell}" /c "{arguments}"', cache_path, output_loglevel="trace", python_shell=False, @@ -2006,7 +1998,7 @@ def remove(name=None, pkgs=None, **kwargs): # Make sure pkginfo was found if not pkginfo: - msg = "Unable to locate package {}".format(pkgname) + msg = f"Unable to locate package {pkgname}" log.error(msg) ret[pkgname] = msg continue @@ -2046,7 +2038,7 @@ def remove(name=None, pkgs=None, **kwargs): removal_targets.append(version_num) else: log.debug("%s %s not installed", pkgname, version_num) - ret[pkgname] = {"current": "{} not installed".format(version_num)} + ret[pkgname] = {"current": f"{version_num} not installed"} continue elif "latest" in pkginfo: # we do not have version entry, assume software can self upgrade and use latest @@ -2061,9 +2053,7 @@ def remove(name=None, pkgs=None, **kwargs): log.error( "%s %s no definition to remove this version", pkgname, version_num ) - ret[pkgname] = { - "current": "{} no definition, cannot removed".format(version_num) - } + ret[pkgname] = {"current": f"{version_num} no definition, cannot removed"} continue for target in removal_targets: @@ -2112,9 +2102,9 @@ def remove(name=None, pkgs=None, **kwargs): exclude_pat="E@init.sls$", ) except MinionError as exc: - msg = "Failed to cache {}".format(path) + msg = f"Failed to cache {path}" log.exception(msg, exc_info=exc) - return "{}\n{}".format(msg, exc) + return f"{msg}\n{exc}" # Check to see if the uninstaller is cached. We don't want to # check for latest here like we do for "pkg.install" because we @@ -2136,9 +2126,9 @@ def remove(name=None, pkgs=None, **kwargs): use_etag=True, ) except MinionError as exc: - msg = "Failed to cache {}".format(uninstaller) + msg = f"Failed to cache {uninstaller}" log.exception(msg, exc_info=exc) - return "{}\n{}".format(msg, exc) + return f"{msg}\n{exc}" # Check if the uninstaller was cached successfully if not cached_pkg: @@ -2172,12 +2162,12 @@ def remove(name=None, pkgs=None, **kwargs): if use_msiexec: # Check if uninstaller is set to {guid}, if not we assume its a remote msi file. # which has already been downloaded. - arguments = '"{}" /X "{}"'.format(msiexec, cached_pkg) + arguments = f'"{msiexec}" /X "{cached_pkg}"' else: - arguments = '"{}"'.format(cached_pkg) + arguments = f'"{cached_pkg}"' if uninstall_flags: - arguments = "{} {}".format(arguments, uninstall_flags) + arguments = f"{arguments} {uninstall_flags}" # Uninstall the software changed.append(pkgname) @@ -2192,7 +2182,7 @@ def remove(name=None, pkgs=None, **kwargs): force=True, action_type="Execute", cmd=cmd_shell, - arguments='/c "{}"'.format(arguments), + arguments=f'/c "{arguments}"', start_in=cache_path, trigger_type="Once", start_date="1975-01-01", @@ -2209,7 +2199,7 @@ def remove(name=None, pkgs=None, **kwargs): else: # Launch the command result = __salt__["cmd.run_all"]( - '"{}" /c "{}"'.format(cmd_shell, arguments), + f'"{cmd_shell}" /c "{arguments}"', output_loglevel="trace", python_shell=False, redirect_stderr=True, diff --git a/tests/pytests/unit/modules/test_win_pkg.py b/tests/pytests/unit/modules/test_win_pkg.py index 9ef693a21f7..2d8439f9b44 100644 --- a/tests/pytests/unit/modules/test_win_pkg.py +++ b/tests/pytests/unit/modules/test_win_pkg.py @@ -92,7 +92,7 @@ def test_pkg__get_reg_software(): def test_pkg__get_reg_software_noremove(): search = "test_pkg_noremove" - key = "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\{}".format(search) + key = f"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\{search}" win_reg.set_value(hive="HKLM", key=key, vname="DisplayName", vdata=search) win_reg.set_value(hive="HKLM", key=key, vname="DisplayVersion", vdata="1.0.0") win_reg.set_value( @@ -114,7 +114,7 @@ def test_pkg__get_reg_software_noremove(): def test_pkg__get_reg_software_noremove_not_present(): search = "test_pkg_noremove_not_present" - key = "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\{}".format(search) + key = f"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\{search}" win_reg.set_value(hive="HKLM", key=key, vname="DisplayName", vdata=search) win_reg.set_value(hive="HKLM", key=key, vname="DisplayVersion", vdata="1.0.0") try: From 439b36581797ec747e6c4964cfe08990a683a1da Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Sat, 8 Jul 2023 09:37:43 +0100 Subject: [PATCH 116/393] Allow randomizing the GH Actions cache seed value by setting the `test:random-cache-seed` label This allows us to force a PR to not use any caches at all(since they are all getting build from scratch again) to debug potential GH Actions caching issues. Signed-off-by: Pedro Algarvio --- .github/workflows/ci.yml | 10 +-- .github/workflows/nightly.yml | 10 +-- .github/workflows/scheduled.yml | 10 +-- .github/workflows/staging.yml | 10 +-- .github/workflows/templates/layout.yml.jinja | 10 +-- tools/ci.py | 69 ++++++++++++++++++++ 6 files changed, 94 insertions(+), 25 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7fcf1a49409..a49625ba1f1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -140,6 +140,11 @@ jobs: run: tools ci print-gh-event + - name: Set Cache Seed Output + id: set-cache-seed + run: | + tools ci define-cache-seed ${{ env.CACHE_SEED }} + - name: Setup Salt Version id: setup-salt-version uses: ./.github/actions/setup-salt-version @@ -232,11 +237,6 @@ jobs: with: name: testrun-changed-files.txt path: testrun-changed-files.txt - - - name: Set Cache Seed Output - id: set-cache-seed - run: | - echo "cache-seed=${{ env.CACHE_SEED }}" >> "$GITHUB_OUTPUT" pre-commit: name: Pre-Commit if: ${{ fromJSON(needs.prepare-workflow.outputs.runners)['github-hosted'] }} diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 0760d097246..0ba1a998f5d 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -186,6 +186,11 @@ jobs: run: tools ci print-gh-event + - name: Set Cache Seed Output + id: set-cache-seed + run: | + tools ci define-cache-seed ${{ env.CACHE_SEED }} + - name: Setup Salt Version id: setup-salt-version uses: ./.github/actions/setup-salt-version @@ -278,11 +283,6 @@ jobs: with: name: testrun-changed-files.txt path: testrun-changed-files.txt - - - name: Set Cache Seed Output - id: set-cache-seed - run: | - echo "cache-seed=${{ env.CACHE_SEED }}" >> "$GITHUB_OUTPUT" pre-commit: name: Pre-Commit if: ${{ fromJSON(needs.prepare-workflow.outputs.runners)['github-hosted'] }} diff --git a/.github/workflows/scheduled.yml b/.github/workflows/scheduled.yml index 2703a6421ad..9bd70b42e00 100644 --- a/.github/workflows/scheduled.yml +++ b/.github/workflows/scheduled.yml @@ -176,6 +176,11 @@ jobs: run: tools ci print-gh-event + - name: Set Cache Seed Output + id: set-cache-seed + run: | + tools ci define-cache-seed ${{ env.CACHE_SEED }} + - name: Setup Salt Version id: setup-salt-version uses: ./.github/actions/setup-salt-version @@ -268,11 +273,6 @@ jobs: with: name: testrun-changed-files.txt path: testrun-changed-files.txt - - - name: Set Cache Seed Output - id: set-cache-seed - run: | - echo "cache-seed=${{ env.CACHE_SEED }}" >> "$GITHUB_OUTPUT" pre-commit: name: Pre-Commit if: ${{ fromJSON(needs.prepare-workflow.outputs.runners)['github-hosted'] }} diff --git a/.github/workflows/staging.yml b/.github/workflows/staging.yml index e0dd006dd17..cbcbd42e9c0 100644 --- a/.github/workflows/staging.yml +++ b/.github/workflows/staging.yml @@ -166,6 +166,11 @@ jobs: run: tools ci print-gh-event + - name: Set Cache Seed Output + id: set-cache-seed + run: | + tools ci define-cache-seed ${{ env.CACHE_SEED }} + - name: Setup Salt Version id: setup-salt-version uses: ./.github/actions/setup-salt-version @@ -264,11 +269,6 @@ jobs: with: name: testrun-changed-files.txt path: testrun-changed-files.txt - - - name: Set Cache Seed Output - id: set-cache-seed - run: | - echo "cache-seed=${{ env.CACHE_SEED }}" >> "$GITHUB_OUTPUT" pre-commit: name: Pre-Commit if: ${{ fromJSON(needs.prepare-workflow.outputs.runners)['github-hosted'] }} diff --git a/.github/workflows/templates/layout.yml.jinja b/.github/workflows/templates/layout.yml.jinja index f33531c32d4..839c1b4b5d5 100644 --- a/.github/workflows/templates/layout.yml.jinja +++ b/.github/workflows/templates/layout.yml.jinja @@ -185,6 +185,11 @@ jobs: run: tools ci print-gh-event + - name: Set Cache Seed Output + id: set-cache-seed + run: | + tools ci define-cache-seed ${{ env.CACHE_SEED }} + - name: Setup Salt Version id: setup-salt-version uses: ./.github/actions/setup-salt-version @@ -289,11 +294,6 @@ jobs: with: name: testrun-changed-files.txt path: testrun-changed-files.txt - - - name: Set Cache Seed Output - id: set-cache-seed - run: | - echo "cache-seed=${{ env.CACHE_SEED }}" >> "$GITHUB_OUTPUT" <%- endblock prepare_workflow_job %> <%- endif %> diff --git a/tools/ci.py b/tools/ci.py index 78e65ad84c3..08264bb4e50 100644 --- a/tools/ci.py +++ b/tools/ci.py @@ -8,6 +8,7 @@ import json import logging import os import pathlib +import random import sys import time from typing import TYPE_CHECKING, Any @@ -954,3 +955,71 @@ def get_testing_releases( wfh.write(f"testing-releases={json.dumps(str_releases)}\n") ctx.exit(0) + + +@ci.command( + name="define-cache-seed", + arguments={ + "static_cache_seed": { + "help": "The static cache seed value", + }, + "randomize": { + "help": "Randomize the cache seed value", + }, + }, +) +def define_cache_seed(ctx: Context, static_cache_seed: str, randomize: bool = False): + """ + Set `cache-seed` in GH Actions outputs. + """ + github_output = os.environ.get("GITHUB_OUTPUT") + if github_output is None: + ctx.warn("The 'GITHUB_OUTPUT' variable is not set.") + ctx.exit(1) + + if TYPE_CHECKING: + assert github_output is not None + + github_step_summary = os.environ.get("GITHUB_STEP_SUMMARY") + if github_step_summary is None: + ctx.warn("The 'GITHUB_STEP_SUMMARY' variable is not set.") + ctx.exit(1) + + if TYPE_CHECKING: + assert github_step_summary is not None + + labels: list[str] = [] + gh_event_path = os.environ.get("GITHUB_EVENT_PATH") or None + if gh_event_path is not None: + try: + gh_event = json.loads(open(gh_event_path).read()) + except Exception as exc: + ctx.error( + f"Could not load the GH Event payload from {gh_event_path!r}:\n", exc + ) + ctx.exit(1) + + labels.extend( + label[0] for label in _get_pr_test_labels_from_event_payload(gh_event) + ) + + if randomize is True: + cache_seed = f"SEED-{random.randint(100, 1000)}" + with open(github_step_summary, "a", encoding="utf-8") as wfh: + wfh.write( + f"The cache seed has been randomized to `{cache_seed}` because " + "`--randomize` was passed to `tools ci define-cache-seed`." + ) + elif "test:random-cache-seed" in labels: + cache_seed = f"SEED-{random.randint(100, 1000)}" + with open(github_step_summary, "a", encoding="utf-8") as wfh: + wfh.write( + f"The cache seed has been randomized to `{cache_seed}` because " + "the label `test:random-cache-seed` was set." + ) + else: + cache_seed = static_cache_seed + + ctx.info("Writing 'cache-seed' to the github outputs file") + with open(github_output, "a", encoding="utf-8") as wfh: + wfh.write(f"cache-seed={cache_seed}\n") From 89b6c7862953452470a81f06e103b479c6e51656 Mon Sep 17 00:00:00 2001 From: David Murphy < dmurphy@saltstack.com> Date: Wed, 14 Jun 2023 13:14:10 -0600 Subject: [PATCH 117/393] WIP - holding changes still debugging --- salt/auth/__init__.py | 110 ++++++++++++++++++++++++++++++++++++------ 1 file changed, 95 insertions(+), 15 deletions(-) diff --git a/salt/auth/__init__.py b/salt/auth/__init__.py index b87e2aff0df..745263aabca 100644 --- a/salt/auth/__init__.py +++ b/salt/auth/__init__.py @@ -322,37 +322,89 @@ class LoadAuth: If the effective user id is the same as the passed one, return True on success or False on failure. """ + log.warning(f"DGM auth authenticate_key load '{load}', key '{key}'") error_msg = 'Authentication failure of type "user" occurred.' + auth_key = load.pop("key", None) if auth_key is None: + log.warning( + f"DGM auth authenticate_key auth_key is none, error_msg '{error_msg}'" + ) log.warning(error_msg) return False if "user" in load: auth_user = AuthUser(load["user"]) + log.warning(f"DGM auth auth_user '{auth_user}', load '{load}'") if auth_user.is_sudo(): # If someone sudos check to make sure there is no ACL's around their username - if auth_key != key[self.opts.get("user", "root")]: - log.warning(error_msg) - return False - return auth_user.sudo_name() + dgm_user = self.opts.get("user", "root") + + ## dgm_opts_key = key[self.opts.get("user", "root")] + ## log.warning(f"DGM auth auth_key, user in load, dgm_user '{dgm_user}', '{auth_key}', dgm_opts_key '{dgm_opts_key}', opts '{self.opts}'") + ## if auth_key != key[self.opts.get("user", "root")]: + ## log.warning(f"DGM auth error error_msg '{error_msg}'") + ## log.warning(error_msg) + ## return False + ## return auth_user.sudo_name() + + for check_key in key: + dgm_user = self.opts.get("user", "root") + dgm_check_key = key[check_key] + log.warning( + f"DGM auth auth_key, user in load is_sudo, dgm_user '{dgm_user}', '{auth_key}', check_key '{check_key}', dgm_check_key '{dgm_check_key}'" + ) + if auth_key == key[check_key]: + log.warning( + f"DGM auth user successful auth_user.sudo_name '{auth_user.sudo_name()}'" + ) + return auth_user.sudo_name() + + log.warning(f"DGM auth error error_msg '{error_msg}'") + log.warning(error_msg) + return False elif ( load["user"] == self.opts.get("user", "root") or load["user"] == "root" ): - if auth_key != key[self.opts.get("user", "root")]: + ## if auth_key != key[self.opts.get("user", "root")]: + ## log.warning( + ## "Master runs as %r, but user in payload is %r", + ## self.opts.get("user", "root"), + ## load["user"], + ## ) + ## log.warning(error_msg) + ## return False + + for check_key in key: + dgm_user = self.opts.get("user", "root") + dgm_check_key = key[check_key] + if auth_key == key[check_key]: + log.warning( + f"DGM auth user successful, auth_key matches check_key dgm_user '{dgm_user}', auth_key '{auth_key}', check_key '{check_key}', dgm_check_key '{dgm_check_key}', key[dgm_user] '{key[dgm_user]}'" + ) + return True + log.warning( + "Master runs as %r, but user in payload is %r", + self.opts.get("user", "root"), + load["user"], + ) + log.warning(error_msg) + return False + + elif auth_user.is_running_user(): + if auth_key != key.get(load["user"]): + load_user = load["user"] log.warning( - "Master runs as %r, but user in payload is %r", - self.opts.get("user", "root"), - load["user"], + f"DGM auth user unsuccessful, auth_user is running useri and not present, load_user '{load_user}', auth_key '{auth_key}', key '{key}' " ) log.warning(error_msg) return False - elif auth_user.is_running_user(): - if auth_key != key.get(load["user"]): - log.warning(error_msg) - return False elif auth_key == key.get("root"): pass + # DGM TBD should we allow for salt ? here, sounds too breakable + # but there is nologin for salt, so maybe fine + elif auth_key == key.get("salt"): + pass else: if load["user"] in key: # User is authorised, check key and check perms @@ -364,9 +416,31 @@ class LoadAuth: log.warning(error_msg) return False else: - if auth_key != key[salt.utils.user.get_user()]: - log.warning(error_msg) - return False + ## dgm_user = salt.utils.user.get_user() + ## dgm_key = key[salt.utils.user.get_user()] + ## log.warning(f"DGM authenticate_key, user '{dgm_user}', user key '{dgm_user_key}', auth_key '{auth_key}'") + ## if auth_key != key[salt.utils.user.get_user()]: + ## log.warning(f"DGM authenticate_key, user '{dgm_user}', user key '{dgm_user_key}', auth_key '{auth_key}', keys not equal '{error_msg}'") + ## log.warning(error_msg) + ## return False + for check_key in key: + dgm_user = salt.utils.user.get_user() + dgm_check_key = key[check_key] + log.warning( + f"DGM authenticate_key, user '{dgm_user}', check_key '{check_key}', dgm_check_key '{dgm_check_key}', auth_key '{auth_key}'" + ) + if auth_key == key[check_key]: + log.warning( + f"DGM authenticate_key, user '{dgm_user}', check_key '{check_key}', dgm_check_key '{dgm_check_key}', auth_key '{auth_key}', keys equal" + ) + return True + + log.warning( + f"DGM authenticate_key, user '{dgm_user}', auth_key '{auth_key}', keys not equal '{error_msg}', key '{key}'" + ) + log.warning(error_msg) + return False + return True def get_auth_list(self, load, token=None): @@ -430,10 +504,15 @@ class LoadAuth: If an error is encountered, return immediately with the relevant error dictionary as authentication has failed. Otherwise, return the username and valid auth_list. """ + log.warning( + f"DGM check_authentication auth_type '{auth_type}', key '{key}', load '{load}'" + ) auth_list = [] username = load.get("username", "UNKNOWN") ret = {"auth_list": auth_list, "username": username, "error": {}} + log.warning(f"DGM check_authentication initial ret '{ret}'") + # Authenticate if auth_type == "token": token = self.authenticate_token(load) @@ -449,6 +528,7 @@ class LoadAuth: ret["username"] = username auth_list = self.get_auth_list(load, token=token) elif auth_type == "eauth": + # DGM TBD needs to check how eauth handles the load and multiple users and their keys if not self.authenticate_eauth(load): ret["error"] = { "name": "EauthAuthenticationError", From 9b11da3ee7846cd37d397bb964a6bade793fb367 Mon Sep 17 00:00:00 2001 From: David Murphy < dmurphy@saltstack.com> Date: Thu, 15 Jun 2023 10:50:33 -0600 Subject: [PATCH 118/393] Allow for multiple user's keys presented, root, salt, etc. --- salt/auth/__init__.py | 69 +------------------------------------------ 1 file changed, 1 insertion(+), 68 deletions(-) diff --git a/salt/auth/__init__.py b/salt/auth/__init__.py index 745263aabca..a13fc469b91 100644 --- a/salt/auth/__init__.py +++ b/salt/auth/__init__.py @@ -322,66 +322,27 @@ class LoadAuth: If the effective user id is the same as the passed one, return True on success or False on failure. """ - log.warning(f"DGM auth authenticate_key load '{load}', key '{key}'") error_msg = 'Authentication failure of type "user" occurred.' auth_key = load.pop("key", None) if auth_key is None: - log.warning( - f"DGM auth authenticate_key auth_key is none, error_msg '{error_msg}'" - ) log.warning(error_msg) return False if "user" in load: auth_user = AuthUser(load["user"]) - log.warning(f"DGM auth auth_user '{auth_user}', load '{load}'") if auth_user.is_sudo(): - # If someone sudos check to make sure there is no ACL's around their username - dgm_user = self.opts.get("user", "root") - - ## dgm_opts_key = key[self.opts.get("user", "root")] - ## log.warning(f"DGM auth auth_key, user in load, dgm_user '{dgm_user}', '{auth_key}', dgm_opts_key '{dgm_opts_key}', opts '{self.opts}'") - ## if auth_key != key[self.opts.get("user", "root")]: - ## log.warning(f"DGM auth error error_msg '{error_msg}'") - ## log.warning(error_msg) - ## return False - ## return auth_user.sudo_name() - for check_key in key: - dgm_user = self.opts.get("user", "root") - dgm_check_key = key[check_key] - log.warning( - f"DGM auth auth_key, user in load is_sudo, dgm_user '{dgm_user}', '{auth_key}', check_key '{check_key}', dgm_check_key '{dgm_check_key}'" - ) if auth_key == key[check_key]: - log.warning( - f"DGM auth user successful auth_user.sudo_name '{auth_user.sudo_name()}'" - ) return auth_user.sudo_name() - - log.warning(f"DGM auth error error_msg '{error_msg}'") - log.warning(error_msg) return False elif ( load["user"] == self.opts.get("user", "root") or load["user"] == "root" ): - ## if auth_key != key[self.opts.get("user", "root")]: - ## log.warning( - ## "Master runs as %r, but user in payload is %r", - ## self.opts.get("user", "root"), - ## load["user"], - ## ) - ## log.warning(error_msg) - ## return False - for check_key in key: dgm_user = self.opts.get("user", "root") dgm_check_key = key[check_key] if auth_key == key[check_key]: - log.warning( - f"DGM auth user successful, auth_key matches check_key dgm_user '{dgm_user}', auth_key '{auth_key}', check_key '{check_key}', dgm_check_key '{dgm_check_key}', key[dgm_user] '{key[dgm_user]}'" - ) return True log.warning( "Master runs as %r, but user in payload is %r", @@ -394,16 +355,12 @@ class LoadAuth: elif auth_user.is_running_user(): if auth_key != key.get(load["user"]): load_user = load["user"] - log.warning( - f"DGM auth user unsuccessful, auth_user is running useri and not present, load_user '{load_user}', auth_key '{auth_key}', key '{key}' " - ) log.warning(error_msg) return False elif auth_key == key.get("root"): pass - # DGM TBD should we allow for salt ? here, sounds too breakable - # but there is nologin for salt, so maybe fine elif auth_key == key.get("salt"): + # there is nologin for salt pass else: if load["user"] in key: @@ -416,28 +373,10 @@ class LoadAuth: log.warning(error_msg) return False else: - ## dgm_user = salt.utils.user.get_user() - ## dgm_key = key[salt.utils.user.get_user()] - ## log.warning(f"DGM authenticate_key, user '{dgm_user}', user key '{dgm_user_key}', auth_key '{auth_key}'") - ## if auth_key != key[salt.utils.user.get_user()]: - ## log.warning(f"DGM authenticate_key, user '{dgm_user}', user key '{dgm_user_key}', auth_key '{auth_key}', keys not equal '{error_msg}'") - ## log.warning(error_msg) - ## return False for check_key in key: - dgm_user = salt.utils.user.get_user() - dgm_check_key = key[check_key] - log.warning( - f"DGM authenticate_key, user '{dgm_user}', check_key '{check_key}', dgm_check_key '{dgm_check_key}', auth_key '{auth_key}'" - ) if auth_key == key[check_key]: - log.warning( - f"DGM authenticate_key, user '{dgm_user}', check_key '{check_key}', dgm_check_key '{dgm_check_key}', auth_key '{auth_key}', keys equal" - ) return True - log.warning( - f"DGM authenticate_key, user '{dgm_user}', auth_key '{auth_key}', keys not equal '{error_msg}', key '{key}'" - ) log.warning(error_msg) return False @@ -504,15 +443,10 @@ class LoadAuth: If an error is encountered, return immediately with the relevant error dictionary as authentication has failed. Otherwise, return the username and valid auth_list. """ - log.warning( - f"DGM check_authentication auth_type '{auth_type}', key '{key}', load '{load}'" - ) auth_list = [] username = load.get("username", "UNKNOWN") ret = {"auth_list": auth_list, "username": username, "error": {}} - log.warning(f"DGM check_authentication initial ret '{ret}'") - # Authenticate if auth_type == "token": token = self.authenticate_token(load) @@ -528,7 +462,6 @@ class LoadAuth: ret["username"] = username auth_list = self.get_auth_list(load, token=token) elif auth_type == "eauth": - # DGM TBD needs to check how eauth handles the load and multiple users and their keys if not self.authenticate_eauth(load): ret["error"] = { "name": "EauthAuthenticationError", From c0222700256d966765a2d7de4c3cd1ac5c18ad68 Mon Sep 17 00:00:00 2001 From: David Murphy < dmurphy@saltstack.com> Date: Thu, 15 Jun 2023 11:06:56 -0600 Subject: [PATCH 119/393] Added changelog --- changelog/64398.fixed.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog/64398.fixed.md diff --git a/changelog/64398.fixed.md b/changelog/64398.fixed.md new file mode 100644 index 00000000000..fb1a54019ca --- /dev/null +++ b/changelog/64398.fixed.md @@ -0,0 +1 @@ +Allow for multiple user's keys presented when authenticating, for example: root, salt, etc. From ddb98b698c7258cf91a0664e0db3f7c2ef58ce77 Mon Sep 17 00:00:00 2001 From: David Murphy < dmurphy@saltstack.com> Date: Fri, 30 Jun 2023 12:21:29 -0600 Subject: [PATCH 120/393] Updated test to check for multiple user keys presented when authenticating --- .../daemons/masterapi/test_local_funcs.py | 64 +++++++++++++++++++ 1 file changed, 64 insertions(+) diff --git a/tests/pytests/unit/daemons/masterapi/test_local_funcs.py b/tests/pytests/unit/daemons/masterapi/test_local_funcs.py index 3c439f49477..2e40a4aa0fd 100644 --- a/tests/pytests/unit/daemons/masterapi/test_local_funcs.py +++ b/tests/pytests/unit/daemons/masterapi/test_local_funcs.py @@ -1,3 +1,5 @@ +import logging + import pytest import salt.config @@ -5,10 +7,17 @@ import salt.daemons.masterapi as masterapi import salt.utils.platform from tests.support.mock import MagicMock, patch +log = logging.getLogger(__name__) + pytestmark = [ pytest.mark.slow_test, ] +test_check_key = { + "test": "mGXdurU1c8lXt5cmpbGq4rWvrOvDXxkwI9gbkP5CBBjpyGWuB8vkgz9r+sjjG0wVDL9/uFuREtk=", + "root": "2t5HHv/ek2wIFh8tTX2c3hdt+6V+93xKlcXb7IlGLIszOeCVv2NuH38LyCw9UwQTfUFTeseXhSs=", +} + @pytest.fixture def local_funcs(): @@ -16,6 +25,12 @@ def local_funcs(): return masterapi.LocalFuncs(opts, "test-key") +@pytest.fixture +def check_local_funcs(): + opts = salt.config.master_config(None) + return masterapi.LocalFuncs(opts, test_check_key) + + # runner tests @@ -510,3 +525,52 @@ def test_publish_user_authorization_error(local_funcs): "salt.utils.minions.CkMinions.auth_check", MagicMock(return_value=False) ): assert mock_ret == local_funcs.publish(load) + + +def test_dual_key_auth(check_local_funcs): + """ + Test for check for presented dual keys (salt, root) are authenticated + """ + load = { + "user": "test", + "fun": "test.arg", + "tgt": "test_minion", + "kwargs": {"user": "test"}, + "arg": "foo", + "key": "mGXdurU1c8lXt5cmpbGq4rWvrOvDXxkwI9gbkP5CBBjpyGWuB8vkgz9r+sjjG0wVDL9/uFuREtk=", + } + with patch( + "salt.acl.PublisherACL.user_is_blacklisted", MagicMock(return_value=False) + ), patch( + "salt.acl.PublisherACL.cmd_is_blacklisted", MagicMock(return_value=False) + ), patch( + "salt.utils.master.get_values_of_matching_keys", + MagicMock(return_value=["test"]), + ): + results = check_local_funcs.publish(load) + assert results == {"enc": "clear", "load": {"jid": None, "minions": []}} + + +def test_dual_key_auth_sudo(check_local_funcs): + """ + Test for check for presented dual keys (salt, root) are authenticated + with a sudo user + """ + load = { + "user": "sudo_test", + "fun": "test.arg", + "tgt": "test_minion", + "kwargs": {"user": "sudo_test"}, + "arg": "foo", + "key": "mGXdurU1c8lXt5cmpbGq4rWvrOvDXxkwI9gbkP5CBBjpyGWuB8vkgz9r+sjjG0wVDL9/uFuREtk=", + } + with patch( + "salt.acl.PublisherACL.user_is_blacklisted", MagicMock(return_value=False) + ), patch( + "salt.acl.PublisherACL.cmd_is_blacklisted", MagicMock(return_value=False) + ), patch( + "salt.utils.master.get_values_of_matching_keys", + MagicMock(return_value=["test"]), + ): + results = check_local_funcs.publish(load) + assert results == {"enc": "clear", "load": {"jid": None, "minions": []}} From ba15a8c64b4054625b96ff1fdcaca2085de21f5c Mon Sep 17 00:00:00 2001 From: David Murphy < dmurphy@saltstack.com> Date: Thu, 13 Jul 2023 12:20:54 -0600 Subject: [PATCH 121/393] Updates due to reviewer comments --- .../daemons/masterapi/test_local_funcs.py | 23 +++++++++---------- 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/tests/pytests/unit/daemons/masterapi/test_local_funcs.py b/tests/pytests/unit/daemons/masterapi/test_local_funcs.py index 2e40a4aa0fd..efc2972345d 100644 --- a/tests/pytests/unit/daemons/masterapi/test_local_funcs.py +++ b/tests/pytests/unit/daemons/masterapi/test_local_funcs.py @@ -2,9 +2,7 @@ import logging import pytest -import salt.config import salt.daemons.masterapi as masterapi -import salt.utils.platform from tests.support.mock import MagicMock, patch log = logging.getLogger(__name__) @@ -13,22 +11,23 @@ pytestmark = [ pytest.mark.slow_test, ] -test_check_key = { - "test": "mGXdurU1c8lXt5cmpbGq4rWvrOvDXxkwI9gbkP5CBBjpyGWuB8vkgz9r+sjjG0wVDL9/uFuREtk=", - "root": "2t5HHv/ek2wIFh8tTX2c3hdt+6V+93xKlcXb7IlGLIszOeCVv2NuH38LyCw9UwQTfUFTeseXhSs=", -} + +@pytest.fixture +def check_keys(): + return { + "test": "mGXdurU1c8lXt5cmpbGq4rWvrOvDXxkwI9gbkP5CBBjpyGWuB8vkgz9r+sjjG0wVDL9/uFuREtk=", + "root": "2t5HHv/ek2wIFh8tTX2c3hdt+6V+93xKlcXb7IlGLIszOeCVv2NuH38LyCw9UwQTfUFTeseXhSs=", + } @pytest.fixture -def local_funcs(): - opts = salt.config.master_config(None) - return masterapi.LocalFuncs(opts, "test-key") +def local_funcs(master_opts): + return masterapi.LocalFuncs(master_opts, "test-key") @pytest.fixture -def check_local_funcs(): - opts = salt.config.master_config(None) - return masterapi.LocalFuncs(opts, test_check_key) +def check_local_funcs(master_opts, check_keys): + return masterapi.LocalFuncs(master_opts, check_keys) # runner tests From 2958d3747e8a6726ca5d53fb150d979bebaf9ce3 Mon Sep 17 00:00:00 2001 From: David Murphy < dmurphy@saltstack.com> Date: Fri, 14 Jul 2023 07:57:55 -0600 Subject: [PATCH 122/393] Remove line left over from debugging --- salt/auth/__init__.py | 1 - 1 file changed, 1 deletion(-) diff --git a/salt/auth/__init__.py b/salt/auth/__init__.py index a13fc469b91..0a93e803229 100644 --- a/salt/auth/__init__.py +++ b/salt/auth/__init__.py @@ -354,7 +354,6 @@ class LoadAuth: elif auth_user.is_running_user(): if auth_key != key.get(load["user"]): - load_user = load["user"] log.warning(error_msg) return False elif auth_key == key.get("root"): From d0851b498f0accfd7ffd32fe3cbb3ad8d195ee31 Mon Sep 17 00:00:00 2001 From: David Murphy < dmurphy@saltstack.com> Date: Fri, 14 Jul 2023 08:34:00 -0600 Subject: [PATCH 123/393] Revert some reviewer suggestions as broke existing tests --- tests/pytests/unit/daemons/masterapi/test_local_funcs.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/pytests/unit/daemons/masterapi/test_local_funcs.py b/tests/pytests/unit/daemons/masterapi/test_local_funcs.py index efc2972345d..2edb21a6a59 100644 --- a/tests/pytests/unit/daemons/masterapi/test_local_funcs.py +++ b/tests/pytests/unit/daemons/masterapi/test_local_funcs.py @@ -2,7 +2,9 @@ import logging import pytest +import salt.config import salt.daemons.masterapi as masterapi +import salt.utils.platform from tests.support.mock import MagicMock, patch log = logging.getLogger(__name__) @@ -22,7 +24,8 @@ def check_keys(): @pytest.fixture def local_funcs(master_opts): - return masterapi.LocalFuncs(master_opts, "test-key") + opts = salt.config.master_config(None) + return masterapi.LocalFuncs(opts, "test-key") @pytest.fixture From b85a3ab8a0bede49f0b38bb47a3e091e4b98d872 Mon Sep 17 00:00:00 2001 From: David Murphy < dmurphy@saltstack.com> Date: Fri, 14 Jul 2023 15:01:42 -0600 Subject: [PATCH 124/393] Removed extraous logging from debugging --- tests/pytests/unit/daemons/masterapi/test_local_funcs.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/tests/pytests/unit/daemons/masterapi/test_local_funcs.py b/tests/pytests/unit/daemons/masterapi/test_local_funcs.py index 2edb21a6a59..06e80f7be83 100644 --- a/tests/pytests/unit/daemons/masterapi/test_local_funcs.py +++ b/tests/pytests/unit/daemons/masterapi/test_local_funcs.py @@ -1,5 +1,3 @@ -import logging - import pytest import salt.config @@ -7,8 +5,6 @@ import salt.daemons.masterapi as masterapi import salt.utils.platform from tests.support.mock import MagicMock, patch -log = logging.getLogger(__name__) - pytestmark = [ pytest.mark.slow_test, ] From 5b2e752d5e04886fb8017a1c0e7f30cd9a20f17d Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Sun, 16 Jul 2023 09:45:17 +0100 Subject: [PATCH 125/393] Bump to `cryptography==41.0.2` to address GHSA-cf7p-gm2m-833m The cryptography package before 41.0.2 for Python mishandles SSH certificates that have critical options. References: https://nvd.nist.gov/vuln/detail/CVE-2023-38325 [https://github.com/pyca/cryptography/issues/9207](pyca/cryptography#9207) [https://github.com/pyca/cryptography/issues/9208](pyca/cryptography#9208) [https://github.com/pyca/cryptography/compare/41.0.1...41.0.2](pyca/cryptography@41.0.1...41.0.2) https://pypi.org/project/cryptography/#history [https://github.com/pyca/cryptography/commit/1ca7adc97b76a9dfbd3d850628b613eb93b78fc3](pyca/cryptography@1ca7adc) Signed-off-by: Pedro Algarvio --- requirements/darwin.txt | 2 +- requirements/static/ci/py3.10/cloud.txt | 2 +- requirements/static/ci/py3.10/darwin.txt | 2 +- requirements/static/ci/py3.10/freebsd.txt | 2 +- requirements/static/ci/py3.10/lint.txt | 2 +- requirements/static/ci/py3.10/linux.txt | 2 +- requirements/static/ci/py3.10/windows.txt | 2 +- requirements/static/ci/py3.7/cloud.txt | 2 +- requirements/static/ci/py3.7/freebsd.txt | 2 +- requirements/static/ci/py3.7/lint.txt | 2 +- requirements/static/ci/py3.7/linux.txt | 2 +- requirements/static/ci/py3.7/windows.txt | 2 +- requirements/static/ci/py3.8/cloud.txt | 2 +- requirements/static/ci/py3.8/freebsd.txt | 2 +- requirements/static/ci/py3.8/lint.txt | 2 +- requirements/static/ci/py3.8/linux.txt | 2 +- requirements/static/ci/py3.8/windows.txt | 2 +- requirements/static/ci/py3.9/cloud.txt | 2 +- requirements/static/ci/py3.9/darwin.txt | 2 +- requirements/static/ci/py3.9/freebsd.txt | 2 +- requirements/static/ci/py3.9/lint.txt | 2 +- requirements/static/ci/py3.9/linux.txt | 2 +- requirements/static/ci/py3.9/windows.txt | 2 +- requirements/static/pkg/linux.in | 2 +- requirements/static/pkg/py3.10/darwin.txt | 2 +- requirements/static/pkg/py3.10/freebsd.txt | 2 +- requirements/static/pkg/py3.10/linux.txt | 2 +- requirements/static/pkg/py3.10/windows.txt | 2 +- requirements/static/pkg/py3.7/freebsd.txt | 2 +- requirements/static/pkg/py3.7/linux.txt | 2 +- requirements/static/pkg/py3.7/windows.txt | 2 +- requirements/static/pkg/py3.8/freebsd.txt | 2 +- requirements/static/pkg/py3.8/linux.txt | 2 +- requirements/static/pkg/py3.8/windows.txt | 2 +- requirements/static/pkg/py3.9/darwin.txt | 2 +- requirements/static/pkg/py3.9/freebsd.txt | 2 +- requirements/static/pkg/py3.9/linux.txt | 2 +- requirements/static/pkg/py3.9/windows.txt | 2 +- requirements/windows.txt | 2 +- 39 files changed, 39 insertions(+), 39 deletions(-) diff --git a/requirements/darwin.txt b/requirements/darwin.txt index a77dad5d7e3..8477bdf0b1a 100644 --- a/requirements/darwin.txt +++ b/requirements/darwin.txt @@ -5,7 +5,7 @@ apache-libcloud>=2.4.0 backports.ssl_match_hostname>=3.7.0.1; python_version < '3.7' cherrypy>=17.4.1 -cryptography>=41.0.1 +cryptography>=41.0.2 gitpython>=3.1.30; python_version >= '3.7' idna>=2.8 linode-python>=1.1.1 diff --git a/requirements/static/ci/py3.10/cloud.txt b/requirements/static/ci/py3.10/cloud.txt index 9da18084d70..59de3525cf0 100644 --- a/requirements/static/ci/py3.10/cloud.txt +++ b/requirements/static/ci/py3.10/cloud.txt @@ -385,7 +385,7 @@ contextvars==2.4 # via -r requirements/base.txt croniter==1.0.15 ; sys_platform != "win32" # via -r requirements/static/ci/common.in -cryptography==41.0.1 +cryptography==41.0.2 # via # -r requirements/static/pkg/linux.in # adal diff --git a/requirements/static/ci/py3.10/darwin.txt b/requirements/static/ci/py3.10/darwin.txt index 8d4edd7d491..de99b96c48e 100644 --- a/requirements/static/ci/py3.10/darwin.txt +++ b/requirements/static/ci/py3.10/darwin.txt @@ -386,7 +386,7 @@ contextvars==2.4 # via -r requirements/base.txt croniter==0.3.29 ; sys_platform != "win32" # via -r requirements/static/ci/common.in -cryptography==41.0.1 +cryptography==41.0.2 # via # -r requirements/darwin.txt # adal diff --git a/requirements/static/ci/py3.10/freebsd.txt b/requirements/static/ci/py3.10/freebsd.txt index 92e27ed6d94..cc7b0718ed6 100644 --- a/requirements/static/ci/py3.10/freebsd.txt +++ b/requirements/static/ci/py3.10/freebsd.txt @@ -384,7 +384,7 @@ contextvars==2.4 # via -r requirements/base.txt croniter==0.3.29 ; sys_platform != "win32" # via -r requirements/static/ci/common.in -cryptography==41.0.0 +cryptography==41.0.2 # via # adal # azure-cosmosdb-table diff --git a/requirements/static/ci/py3.10/lint.txt b/requirements/static/ci/py3.10/lint.txt index 9b35d0508bb..971b1158c7c 100644 --- a/requirements/static/ci/py3.10/lint.txt +++ b/requirements/static/ci/py3.10/lint.txt @@ -390,7 +390,7 @@ contextvars==2.4 # via -r requirements/base.txt croniter==1.0.15 ; sys_platform != "win32" # via -r requirements/static/ci/common.in -cryptography==41.0.1 +cryptography==41.0.2 # via # -r requirements/static/pkg/linux.in # adal diff --git a/requirements/static/ci/py3.10/linux.txt b/requirements/static/ci/py3.10/linux.txt index 6c88290286c..9973759f47f 100644 --- a/requirements/static/ci/py3.10/linux.txt +++ b/requirements/static/ci/py3.10/linux.txt @@ -398,7 +398,7 @@ contextvars==2.4 # via -r requirements/base.txt croniter==0.3.29 ; sys_platform != "win32" # via -r requirements/static/ci/common.in -cryptography==41.0.1 +cryptography==41.0.2 # via # -r requirements/static/pkg/linux.in # adal diff --git a/requirements/static/ci/py3.10/windows.txt b/requirements/static/ci/py3.10/windows.txt index 033084010b5..48dfe87ea86 100644 --- a/requirements/static/ci/py3.10/windows.txt +++ b/requirements/static/ci/py3.10/windows.txt @@ -71,7 +71,7 @@ colorama==0.4.1 # via pytest contextvars==2.4 # via -r requirements/base.txt -cryptography==41.0.1 +cryptography==41.0.2 # via # -r requirements/windows.txt # etcd3-py diff --git a/requirements/static/ci/py3.7/cloud.txt b/requirements/static/ci/py3.7/cloud.txt index 7ab45ff74f7..107299eb47c 100644 --- a/requirements/static/ci/py3.7/cloud.txt +++ b/requirements/static/ci/py3.7/cloud.txt @@ -392,7 +392,7 @@ contextvars==2.4 # via -r requirements/base.txt croniter==1.0.15 ; sys_platform != "win32" # via -r requirements/static/ci/common.in -cryptography==41.0.1 +cryptography==41.0.2 # via # -r requirements/static/pkg/linux.in # adal diff --git a/requirements/static/ci/py3.7/freebsd.txt b/requirements/static/ci/py3.7/freebsd.txt index 13e97515d7d..7476807b991 100644 --- a/requirements/static/ci/py3.7/freebsd.txt +++ b/requirements/static/ci/py3.7/freebsd.txt @@ -391,7 +391,7 @@ contextvars==2.4 # via -r requirements/base.txt croniter==0.3.29 ; sys_platform != "win32" # via -r requirements/static/ci/common.in -cryptography==41.0.0 +cryptography==41.0.2 # via # adal # azure-cosmosdb-table diff --git a/requirements/static/ci/py3.7/lint.txt b/requirements/static/ci/py3.7/lint.txt index 33080ce341d..a00764291ef 100644 --- a/requirements/static/ci/py3.7/lint.txt +++ b/requirements/static/ci/py3.7/lint.txt @@ -399,7 +399,7 @@ contextvars==2.4 # via -r requirements/base.txt croniter==1.0.15 ; sys_platform != "win32" # via -r requirements/static/ci/common.in -cryptography==41.0.1 +cryptography==41.0.2 # via # -r requirements/static/pkg/linux.in # adal diff --git a/requirements/static/ci/py3.7/linux.txt b/requirements/static/ci/py3.7/linux.txt index c8307fc7986..9b44033cc6e 100644 --- a/requirements/static/ci/py3.7/linux.txt +++ b/requirements/static/ci/py3.7/linux.txt @@ -405,7 +405,7 @@ contextvars==2.4 # via -r requirements/base.txt croniter==0.3.29 ; sys_platform != "win32" # via -r requirements/static/ci/common.in -cryptography==41.0.1 +cryptography==41.0.2 # via # -r requirements/static/pkg/linux.in # adal diff --git a/requirements/static/ci/py3.7/windows.txt b/requirements/static/ci/py3.7/windows.txt index 37aaab11ea7..d76d05bcb82 100644 --- a/requirements/static/ci/py3.7/windows.txt +++ b/requirements/static/ci/py3.7/windows.txt @@ -77,7 +77,7 @@ colorama==0.4.1 # via pytest contextvars==2.4 # via -r requirements/base.txt -cryptography==41.0.1 +cryptography==41.0.2 # via # -r requirements/windows.txt # etcd3-py diff --git a/requirements/static/ci/py3.8/cloud.txt b/requirements/static/ci/py3.8/cloud.txt index b60fd1d789d..a2074674203 100644 --- a/requirements/static/ci/py3.8/cloud.txt +++ b/requirements/static/ci/py3.8/cloud.txt @@ -390,7 +390,7 @@ contextvars==2.4 # via -r requirements/base.txt croniter==1.0.15 ; sys_platform != "win32" # via -r requirements/static/ci/common.in -cryptography==41.0.1 +cryptography==41.0.2 # via # -r requirements/static/pkg/linux.in # adal diff --git a/requirements/static/ci/py3.8/freebsd.txt b/requirements/static/ci/py3.8/freebsd.txt index a38caa62b63..5787541070c 100644 --- a/requirements/static/ci/py3.8/freebsd.txt +++ b/requirements/static/ci/py3.8/freebsd.txt @@ -389,7 +389,7 @@ contextvars==2.4 # via -r requirements/base.txt croniter==0.3.29 ; sys_platform != "win32" # via -r requirements/static/ci/common.in -cryptography==41.0.0 +cryptography==41.0.2 # via # adal # azure-cosmosdb-table diff --git a/requirements/static/ci/py3.8/lint.txt b/requirements/static/ci/py3.8/lint.txt index c9084b3f32a..704a7b455d6 100644 --- a/requirements/static/ci/py3.8/lint.txt +++ b/requirements/static/ci/py3.8/lint.txt @@ -397,7 +397,7 @@ contextvars==2.4 # via -r requirements/base.txt croniter==1.0.15 ; sys_platform != "win32" # via -r requirements/static/ci/common.in -cryptography==41.0.1 +cryptography==41.0.2 # via # -r requirements/static/pkg/linux.in # adal diff --git a/requirements/static/ci/py3.8/linux.txt b/requirements/static/ci/py3.8/linux.txt index 88bdfd4febf..d1a5b4fdab9 100644 --- a/requirements/static/ci/py3.8/linux.txt +++ b/requirements/static/ci/py3.8/linux.txt @@ -403,7 +403,7 @@ contextvars==2.4 # via -r requirements/base.txt croniter==0.3.29 ; sys_platform != "win32" # via -r requirements/static/ci/common.in -cryptography==41.0.1 +cryptography==41.0.2 # via # -r requirements/static/pkg/linux.in # adal diff --git a/requirements/static/ci/py3.8/windows.txt b/requirements/static/ci/py3.8/windows.txt index 0638887da49..9ca8d9d9f48 100644 --- a/requirements/static/ci/py3.8/windows.txt +++ b/requirements/static/ci/py3.8/windows.txt @@ -73,7 +73,7 @@ colorama==0.4.1 # via pytest contextvars==2.4 # via -r requirements/base.txt -cryptography==41.0.1 +cryptography==41.0.2 # via # -r requirements/windows.txt # etcd3-py diff --git a/requirements/static/ci/py3.9/cloud.txt b/requirements/static/ci/py3.9/cloud.txt index a866a0b15f6..d2ddb849e0b 100644 --- a/requirements/static/ci/py3.9/cloud.txt +++ b/requirements/static/ci/py3.9/cloud.txt @@ -390,7 +390,7 @@ contextvars==2.4 # via -r requirements/base.txt croniter==1.0.15 ; sys_platform != "win32" # via -r requirements/static/ci/common.in -cryptography==41.0.1 +cryptography==41.0.2 # via # -r requirements/static/pkg/linux.in # adal diff --git a/requirements/static/ci/py3.9/darwin.txt b/requirements/static/ci/py3.9/darwin.txt index a309cf7c1ac..0bffe2aeb5d 100644 --- a/requirements/static/ci/py3.9/darwin.txt +++ b/requirements/static/ci/py3.9/darwin.txt @@ -391,7 +391,7 @@ contextvars==2.4 # via -r requirements/base.txt croniter==0.3.29 ; sys_platform != "win32" # via -r requirements/static/ci/common.in -cryptography==41.0.1 +cryptography==41.0.2 # via # -r requirements/darwin.txt # adal diff --git a/requirements/static/ci/py3.9/freebsd.txt b/requirements/static/ci/py3.9/freebsd.txt index b352259132b..e4a89b753e6 100644 --- a/requirements/static/ci/py3.9/freebsd.txt +++ b/requirements/static/ci/py3.9/freebsd.txt @@ -389,7 +389,7 @@ contextvars==2.4 # via -r requirements/base.txt croniter==0.3.29 ; sys_platform != "win32" # via -r requirements/static/ci/common.in -cryptography==41.0.0 +cryptography==41.0.2 # via # adal # azure-cosmosdb-table diff --git a/requirements/static/ci/py3.9/lint.txt b/requirements/static/ci/py3.9/lint.txt index ca6f7af483d..d9713037b6c 100644 --- a/requirements/static/ci/py3.9/lint.txt +++ b/requirements/static/ci/py3.9/lint.txt @@ -395,7 +395,7 @@ contextvars==2.4 # via -r requirements/base.txt croniter==1.0.15 ; sys_platform != "win32" # via -r requirements/static/ci/common.in -cryptography==41.0.1 +cryptography==41.0.2 # via # -r requirements/static/pkg/linux.in # adal diff --git a/requirements/static/ci/py3.9/linux.txt b/requirements/static/ci/py3.9/linux.txt index fd99af75b6a..ac16b6e52b0 100644 --- a/requirements/static/ci/py3.9/linux.txt +++ b/requirements/static/ci/py3.9/linux.txt @@ -405,7 +405,7 @@ contextvars==2.4 # via -r requirements/base.txt croniter==0.3.29 ; sys_platform != "win32" # via -r requirements/static/ci/common.in -cryptography==41.0.1 +cryptography==41.0.2 # via # -r requirements/static/pkg/linux.in # adal diff --git a/requirements/static/ci/py3.9/windows.txt b/requirements/static/ci/py3.9/windows.txt index 671f49ddcc4..7d18515c83e 100644 --- a/requirements/static/ci/py3.9/windows.txt +++ b/requirements/static/ci/py3.9/windows.txt @@ -73,7 +73,7 @@ colorama==0.4.1 # via pytest contextvars==2.4 # via -r requirements/base.txt -cryptography==41.0.1 +cryptography==41.0.2 # via # -r requirements/windows.txt # etcd3-py diff --git a/requirements/static/pkg/linux.in b/requirements/static/pkg/linux.in index 340dde10eaa..03173a533d1 100644 --- a/requirements/static/pkg/linux.in +++ b/requirements/static/pkg/linux.in @@ -10,4 +10,4 @@ rpm-vercmp setproctitle>=1.2.3 timelib>=0.2.5 importlib-metadata>=3.3.0 -cryptography>=41.0.1 +cryptography>=41.0.2 diff --git a/requirements/static/pkg/py3.10/darwin.txt b/requirements/static/pkg/py3.10/darwin.txt index 77f7ac11e69..c40cbc9b915 100644 --- a/requirements/static/pkg/py3.10/darwin.txt +++ b/requirements/static/pkg/py3.10/darwin.txt @@ -18,7 +18,7 @@ cherrypy==18.6.1 # via -r requirements/darwin.txt contextvars==2.4 # via -r requirements/base.txt -cryptography==41.0.1 +cryptography==41.0.2 # via # -r requirements/darwin.txt # pyopenssl diff --git a/requirements/static/pkg/py3.10/freebsd.txt b/requirements/static/pkg/py3.10/freebsd.txt index eb3f047d200..167359b9d13 100644 --- a/requirements/static/pkg/py3.10/freebsd.txt +++ b/requirements/static/pkg/py3.10/freebsd.txt @@ -16,7 +16,7 @@ cherrypy==18.6.1 # via -r requirements/static/pkg/freebsd.in contextvars==2.4 # via -r requirements/base.txt -cryptography==39.0.2 +cryptography==41.0.2 # via pyopenssl distro==1.5.0 # via diff --git a/requirements/static/pkg/py3.10/linux.txt b/requirements/static/pkg/py3.10/linux.txt index e9f1c6c50e0..bd61f53cc0f 100644 --- a/requirements/static/pkg/py3.10/linux.txt +++ b/requirements/static/pkg/py3.10/linux.txt @@ -16,7 +16,7 @@ cherrypy==18.6.1 # via -r requirements/static/pkg/linux.in contextvars==2.4 # via -r requirements/base.txt -cryptography==41.0.1 +cryptography==41.0.2 # via # -r requirements/static/pkg/linux.in # pyopenssl diff --git a/requirements/static/pkg/py3.10/windows.txt b/requirements/static/pkg/py3.10/windows.txt index 72d665f7fa6..161d9ce0285 100644 --- a/requirements/static/pkg/py3.10/windows.txt +++ b/requirements/static/pkg/py3.10/windows.txt @@ -23,7 +23,7 @@ clr-loader==0.2.4 # via pythonnet contextvars==2.4 # via -r requirements/base.txt -cryptography==41.0.1 +cryptography==41.0.2 # via # -r requirements/windows.txt # pyopenssl diff --git a/requirements/static/pkg/py3.7/freebsd.txt b/requirements/static/pkg/py3.7/freebsd.txt index ae5865986b3..19e947ea090 100644 --- a/requirements/static/pkg/py3.7/freebsd.txt +++ b/requirements/static/pkg/py3.7/freebsd.txt @@ -16,7 +16,7 @@ cherrypy==18.6.1 # via -r requirements/static/pkg/freebsd.in contextvars==2.4 # via -r requirements/base.txt -cryptography==39.0.2 +cryptography==41.0.2 # via pyopenssl distro==1.5.0 # via diff --git a/requirements/static/pkg/py3.7/linux.txt b/requirements/static/pkg/py3.7/linux.txt index d1c058f6f48..fd0d0c90932 100644 --- a/requirements/static/pkg/py3.7/linux.txt +++ b/requirements/static/pkg/py3.7/linux.txt @@ -16,7 +16,7 @@ cherrypy==18.6.1 # via -r requirements/static/pkg/linux.in contextvars==2.4 # via -r requirements/base.txt -cryptography==41.0.1 +cryptography==41.0.2 # via # -r requirements/static/pkg/linux.in # pyopenssl diff --git a/requirements/static/pkg/py3.7/windows.txt b/requirements/static/pkg/py3.7/windows.txt index 23b16d98e78..d93e5afdbce 100644 --- a/requirements/static/pkg/py3.7/windows.txt +++ b/requirements/static/pkg/py3.7/windows.txt @@ -23,7 +23,7 @@ clr-loader==0.2.4 # via pythonnet contextvars==2.4 # via -r requirements/base.txt -cryptography==41.0.1 +cryptography==41.0.2 # via # -r requirements/windows.txt # pyopenssl diff --git a/requirements/static/pkg/py3.8/freebsd.txt b/requirements/static/pkg/py3.8/freebsd.txt index 2419a87646c..c8e7dbea2da 100644 --- a/requirements/static/pkg/py3.8/freebsd.txt +++ b/requirements/static/pkg/py3.8/freebsd.txt @@ -16,7 +16,7 @@ cherrypy==18.6.1 # via -r requirements/static/pkg/freebsd.in contextvars==2.4 # via -r requirements/base.txt -cryptography==39.0.2 +cryptography==41.0.2 # via pyopenssl distro==1.5.0 # via diff --git a/requirements/static/pkg/py3.8/linux.txt b/requirements/static/pkg/py3.8/linux.txt index 6dc2d7918d9..95417d0c300 100644 --- a/requirements/static/pkg/py3.8/linux.txt +++ b/requirements/static/pkg/py3.8/linux.txt @@ -16,7 +16,7 @@ cherrypy==18.6.1 # via -r requirements/static/pkg/linux.in contextvars==2.4 # via -r requirements/base.txt -cryptography==41.0.1 +cryptography==41.0.2 # via # -r requirements/static/pkg/linux.in # pyopenssl diff --git a/requirements/static/pkg/py3.8/windows.txt b/requirements/static/pkg/py3.8/windows.txt index 0363e776489..ad6d0052429 100644 --- a/requirements/static/pkg/py3.8/windows.txt +++ b/requirements/static/pkg/py3.8/windows.txt @@ -23,7 +23,7 @@ clr-loader==0.2.4 # via pythonnet contextvars==2.4 # via -r requirements/base.txt -cryptography==41.0.1 +cryptography==41.0.2 # via # -r requirements/windows.txt # pyopenssl diff --git a/requirements/static/pkg/py3.9/darwin.txt b/requirements/static/pkg/py3.9/darwin.txt index 6dc90cc344f..b9b44e8b661 100644 --- a/requirements/static/pkg/py3.9/darwin.txt +++ b/requirements/static/pkg/py3.9/darwin.txt @@ -18,7 +18,7 @@ cherrypy==18.6.1 # via -r requirements/darwin.txt contextvars==2.4 # via -r requirements/base.txt -cryptography==41.0.1 +cryptography==41.0.2 # via # -r requirements/darwin.txt # pyopenssl diff --git a/requirements/static/pkg/py3.9/freebsd.txt b/requirements/static/pkg/py3.9/freebsd.txt index dfa83b9c31d..b4cefb4824c 100644 --- a/requirements/static/pkg/py3.9/freebsd.txt +++ b/requirements/static/pkg/py3.9/freebsd.txt @@ -16,7 +16,7 @@ cherrypy==18.6.1 # via -r requirements/static/pkg/freebsd.in contextvars==2.4 # via -r requirements/base.txt -cryptography==39.0.2 +cryptography==41.0.2 # via pyopenssl distro==1.5.0 # via diff --git a/requirements/static/pkg/py3.9/linux.txt b/requirements/static/pkg/py3.9/linux.txt index 56e78f78351..e64cb115584 100644 --- a/requirements/static/pkg/py3.9/linux.txt +++ b/requirements/static/pkg/py3.9/linux.txt @@ -16,7 +16,7 @@ cherrypy==18.6.1 # via -r requirements/static/pkg/linux.in contextvars==2.4 # via -r requirements/base.txt -cryptography==41.0.1 +cryptography==41.0.2 # via # -r requirements/static/pkg/linux.in # pyopenssl diff --git a/requirements/static/pkg/py3.9/windows.txt b/requirements/static/pkg/py3.9/windows.txt index 273acb031d2..730c04799db 100644 --- a/requirements/static/pkg/py3.9/windows.txt +++ b/requirements/static/pkg/py3.9/windows.txt @@ -23,7 +23,7 @@ clr-loader==0.2.4 # via pythonnet contextvars==2.4 # via -r requirements/base.txt -cryptography==41.0.1 +cryptography==41.0.2 # via # -r requirements/windows.txt # pyopenssl diff --git a/requirements/windows.txt b/requirements/windows.txt index b91cd0ecf2d..9490031d7df 100644 --- a/requirements/windows.txt +++ b/requirements/windows.txt @@ -10,7 +10,7 @@ backports.ssl-match-hostname>=3.7.0.1; python_version < '3.7' certifi>=2022.12.07 cffi>=1.14.5 cherrypy>=18.6.1 -cryptography>=41.0.1 +cryptography>=41.0.2 gitpython>=3.1.30; python_version >= '3.7' ioloop>=0.1a0 lxml>=4.6.3 From 53aafe7ebaa117639c0dc4759b376a692be0f79e Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Tue, 18 Jul 2023 06:34:22 +0100 Subject: [PATCH 126/393] Bump to `pyyaml==6.0.1` due to https://github.com/yaml/pyyaml/issues/601 Signed-off-by: Pedro Algarvio --- .pre-commit-config.yaml | 16 ++++++++-------- requirements/static/ci/py3.10/cloud.txt | 2 +- requirements/static/ci/py3.10/darwin.txt | 2 +- requirements/static/ci/py3.10/docs.txt | 2 +- requirements/static/ci/py3.10/freebsd.txt | 2 +- requirements/static/ci/py3.10/invoke.txt | 2 +- requirements/static/ci/py3.10/lint.txt | 2 +- requirements/static/ci/py3.10/linux.txt | 2 +- .../static/ci/py3.10/pkgtests-windows.txt | 2 +- requirements/static/ci/py3.10/pkgtests.txt | 2 +- requirements/static/ci/py3.10/tools.txt | 2 +- requirements/static/ci/py3.10/windows.txt | 2 +- requirements/static/ci/py3.11/tools.txt | 2 +- requirements/static/ci/py3.7/cloud.txt | 2 +- requirements/static/ci/py3.7/docs.txt | 2 +- requirements/static/ci/py3.7/freebsd.txt | 2 +- requirements/static/ci/py3.7/invoke.txt | 2 +- requirements/static/ci/py3.7/lint.txt | 2 +- requirements/static/ci/py3.7/linux.txt | 2 +- requirements/static/ci/py3.7/windows.txt | 2 +- requirements/static/ci/py3.8/cloud.txt | 2 +- requirements/static/ci/py3.8/docs.txt | 2 +- requirements/static/ci/py3.8/freebsd.txt | 2 +- requirements/static/ci/py3.8/invoke.txt | 2 +- requirements/static/ci/py3.8/lint.txt | 2 +- requirements/static/ci/py3.8/linux.txt | 2 +- requirements/static/ci/py3.8/windows.txt | 2 +- requirements/static/ci/py3.9/cloud.txt | 2 +- requirements/static/ci/py3.9/darwin.txt | 2 +- requirements/static/ci/py3.9/docs.txt | 2 +- requirements/static/ci/py3.9/freebsd.txt | 2 +- requirements/static/ci/py3.9/invoke.txt | 2 +- requirements/static/ci/py3.9/lint.txt | 2 +- requirements/static/ci/py3.9/linux.txt | 2 +- requirements/static/ci/py3.9/tools.txt | 2 +- requirements/static/ci/py3.9/windows.txt | 2 +- requirements/static/pkg/py3.10/darwin.txt | 2 +- requirements/static/pkg/py3.10/freebsd.txt | 2 +- requirements/static/pkg/py3.10/linux.txt | 2 +- requirements/static/pkg/py3.10/windows.txt | 2 +- requirements/static/pkg/py3.7/freebsd.txt | 2 +- requirements/static/pkg/py3.7/linux.txt | 2 +- requirements/static/pkg/py3.7/windows.txt | 2 +- requirements/static/pkg/py3.8/freebsd.txt | 2 +- requirements/static/pkg/py3.8/linux.txt | 2 +- requirements/static/pkg/py3.8/windows.txt | 2 +- requirements/static/pkg/py3.9/darwin.txt | 2 +- requirements/static/pkg/py3.9/freebsd.txt | 2 +- requirements/static/pkg/py3.9/linux.txt | 2 +- requirements/static/pkg/py3.9/windows.txt | 2 +- 50 files changed, 57 insertions(+), 57 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d6cb848d7e6..7a97ad415a1 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -56,7 +56,7 @@ repos: - pre-commit-checks additional_dependencies: - boto3==1.21.46 - - pyyaml==6.0 + - pyyaml==6.0.1 - jinja2==3.1.2 - packaging==23.0 - virustotal3==1.0.8 @@ -70,7 +70,7 @@ repos: - generate-workflows additional_dependencies: - boto3==1.21.46 - - pyyaml==6.0 + - pyyaml==6.0.1 - jinja2==3.1.2 - packaging==23.0 - virustotal3==1.0.8 @@ -85,7 +85,7 @@ repos: - actionlint additional_dependencies: - boto3==1.21.46 - - pyyaml==6.0 + - pyyaml==6.0.1 - jinja2==3.1.2 - packaging==23.0 - virustotal3==1.0.8 @@ -1153,7 +1153,7 @@ repos: - docs.check additional_dependencies: - blessings==1.7 - - pyyaml==6.0 + - pyyaml==6.0.1 - distro==1.7.0 - jinja2==3.0.3 - msgpack==1.0.3 @@ -1172,7 +1172,7 @@ repos: - filemap.check additional_dependencies: - blessings==1.7 - - pyyaml==6.0 + - pyyaml==6.0.1 - distro==1.7.0 - jinja2==3.0.3 - msgpack==1.0.3 @@ -1195,7 +1195,7 @@ repos: - loader.check-virtual additional_dependencies: - blessings==1.7 - - pyyaml==6.0 + - pyyaml==6.0.1 - distro==1.7.0 - jinja2==3.0.3 - msgpack==1.0.3 @@ -1218,7 +1218,7 @@ repos: - docstrings.check additional_dependencies: - blessings==1.7 - - pyyaml==6.0 + - pyyaml==6.0.1 - distro==1.7.0 - jinja2==3.0.3 - msgpack==1.0.3 @@ -1243,7 +1243,7 @@ repos: - --error-on-known-failures additional_dependencies: - blessings==1.7 - - pyyaml==6.0 + - pyyaml==6.0.1 - distro==1.7.0 - jinja2==3.0.3 - msgpack==1.0.3 diff --git a/requirements/static/ci/py3.10/cloud.txt b/requirements/static/ci/py3.10/cloud.txt index 59de3525cf0..2af515324f4 100644 --- a/requirements/static/ci/py3.10/cloud.txt +++ b/requirements/static/ci/py3.10/cloud.txt @@ -750,7 +750,7 @@ pyvmomi==7.0.2 # via -r requirements/static/ci/common.in pywinrm==0.3.0 # via -r requirements/static/ci/cloud.in -pyyaml==5.4.1 +pyyaml==6.0.1 # via # -r requirements/base.txt # clustershell diff --git a/requirements/static/ci/py3.10/darwin.txt b/requirements/static/ci/py3.10/darwin.txt index de99b96c48e..73f4def8791 100644 --- a/requirements/static/ci/py3.10/darwin.txt +++ b/requirements/static/ci/py3.10/darwin.txt @@ -743,7 +743,7 @@ pytz==2022.1 # tempora pyvmomi==6.7.1.2018.12 # via -r requirements/static/ci/common.in -pyyaml==5.4.1 +pyyaml==6.0.1 # via # -r requirements/base.txt # clustershell diff --git a/requirements/static/ci/py3.10/docs.txt b/requirements/static/ci/py3.10/docs.txt index 013b160daa5..ce07a3a5061 100644 --- a/requirements/static/ci/py3.10/docs.txt +++ b/requirements/static/ci/py3.10/docs.txt @@ -130,7 +130,7 @@ pytz==2022.1 # -c requirements/static/ci/py3.10/linux.txt # babel # tempora -pyyaml==5.4.1 +pyyaml==6.0.1 # via # -c requirements/static/ci/py3.10/linux.txt # -r requirements/base.txt diff --git a/requirements/static/ci/py3.10/freebsd.txt b/requirements/static/ci/py3.10/freebsd.txt index cc7b0718ed6..3739dcb0e73 100644 --- a/requirements/static/ci/py3.10/freebsd.txt +++ b/requirements/static/ci/py3.10/freebsd.txt @@ -742,7 +742,7 @@ pytz==2022.1 # tempora pyvmomi==6.7.1.2018.12 # via -r requirements/static/ci/common.in -pyyaml==5.4.1 +pyyaml==6.0.1 # via # -r requirements/base.txt # clustershell diff --git a/requirements/static/ci/py3.10/invoke.txt b/requirements/static/ci/py3.10/invoke.txt index 591666c8468..bcca631927a 100644 --- a/requirements/static/ci/py3.10/invoke.txt +++ b/requirements/static/ci/py3.10/invoke.txt @@ -8,7 +8,7 @@ blessings==1.7 # via -r requirements/static/ci/invoke.in invoke==1.4.1 # via -r requirements/static/ci/invoke.in -pyyaml==5.4.1 +pyyaml==6.0.1 # via -r requirements/static/ci/invoke.in six==1.16.0 # via blessings diff --git a/requirements/static/ci/py3.10/lint.txt b/requirements/static/ci/py3.10/lint.txt index 971b1158c7c..c88948c6d8a 100644 --- a/requirements/static/ci/py3.10/lint.txt +++ b/requirements/static/ci/py3.10/lint.txt @@ -715,7 +715,7 @@ pytz==2022.1 # twilio pyvmomi==7.0.2 # via -r requirements/static/ci/common.in -pyyaml==5.4.1 +pyyaml==6.0.1 # via # -r requirements/base.txt # ansible-core diff --git a/requirements/static/ci/py3.10/linux.txt b/requirements/static/ci/py3.10/linux.txt index 9973759f47f..9edac4588d2 100644 --- a/requirements/static/ci/py3.10/linux.txt +++ b/requirements/static/ci/py3.10/linux.txt @@ -768,7 +768,7 @@ pytz==2022.1 # tzlocal pyvmomi==6.7.1.2018.12 # via -r requirements/static/ci/common.in -pyyaml==5.4.1 +pyyaml==6.0.1 # via # -r requirements/base.txt # ansible-core diff --git a/requirements/static/ci/py3.10/pkgtests-windows.txt b/requirements/static/ci/py3.10/pkgtests-windows.txt index 1f63fb7cdc9..fc22d0a9805 100644 --- a/requirements/static/ci/py3.10/pkgtests-windows.txt +++ b/requirements/static/ci/py3.10/pkgtests-windows.txt @@ -136,7 +136,7 @@ pywin32==305 # via # pytest-skip-markers # wmi -pyyaml==6.0 +pyyaml==6.0.1 # via -r requirements/base.txt pyzmq==25.0.2 ; sys_platform == "win32" # via diff --git a/requirements/static/ci/py3.10/pkgtests.txt b/requirements/static/ci/py3.10/pkgtests.txt index 09e90491007..bb18c792933 100644 --- a/requirements/static/ci/py3.10/pkgtests.txt +++ b/requirements/static/ci/py3.10/pkgtests.txt @@ -123,7 +123,7 @@ pytest==7.2.1 # pytest-tempdir pytz==2022.7.1 # via tempora -pyyaml==6.0 +pyyaml==6.0.1 # via -r requirements/base.txt pyzmq==25.0.2 # via diff --git a/requirements/static/ci/py3.10/tools.txt b/requirements/static/ci/py3.10/tools.txt index 285d90d8f9c..4981fc3c640 100644 --- a/requirements/static/ci/py3.10/tools.txt +++ b/requirements/static/ci/py3.10/tools.txt @@ -38,7 +38,7 @@ python-dateutil==2.8.2 # via botocore python-tools-scripts==0.12.0 # via -r requirements/static/ci/tools.in -pyyaml==6.0 +pyyaml==6.0.1 # via -r requirements/static/ci/tools.in requests==2.31.0 # via diff --git a/requirements/static/ci/py3.10/windows.txt b/requirements/static/ci/py3.10/windows.txt index 48dfe87ea86..ecccb3335b0 100644 --- a/requirements/static/ci/py3.10/windows.txt +++ b/requirements/static/ci/py3.10/windows.txt @@ -310,7 +310,7 @@ pywin32==305 # wmi pywinrm==0.4.1 # via -r requirements/static/ci/windows.in -pyyaml==5.4.1 +pyyaml==6.0.1 # via # -r requirements/base.txt # clustershell diff --git a/requirements/static/ci/py3.11/tools.txt b/requirements/static/ci/py3.11/tools.txt index bdd05d1f2ee..556718941f1 100644 --- a/requirements/static/ci/py3.11/tools.txt +++ b/requirements/static/ci/py3.11/tools.txt @@ -38,7 +38,7 @@ python-dateutil==2.8.2 # via botocore python-tools-scripts==0.12.0 # via -r requirements/static/ci/tools.in -pyyaml==6.0 +pyyaml==6.0.1 # via -r requirements/static/ci/tools.in requests==2.31.0 # via diff --git a/requirements/static/ci/py3.7/cloud.txt b/requirements/static/ci/py3.7/cloud.txt index 107299eb47c..bbbabcd11fc 100644 --- a/requirements/static/ci/py3.7/cloud.txt +++ b/requirements/static/ci/py3.7/cloud.txt @@ -794,7 +794,7 @@ pyvmomi==7.0.2 # via -r requirements/static/ci/common.in pywinrm==0.3.0 # via -r requirements/static/ci/cloud.in -pyyaml==5.4.1 +pyyaml==6.0.1 # via # -r requirements/base.txt # clustershell diff --git a/requirements/static/ci/py3.7/docs.txt b/requirements/static/ci/py3.7/docs.txt index 9d997b6ca64..96093a63491 100644 --- a/requirements/static/ci/py3.7/docs.txt +++ b/requirements/static/ci/py3.7/docs.txt @@ -138,7 +138,7 @@ pytz==2022.1 # -c requirements/static/ci/py3.7/linux.txt # babel # tempora -pyyaml==5.4.1 +pyyaml==6.0.1 # via # -c requirements/static/ci/py3.7/linux.txt # -r requirements/base.txt diff --git a/requirements/static/ci/py3.7/freebsd.txt b/requirements/static/ci/py3.7/freebsd.txt index 7476807b991..8a3346af2c3 100644 --- a/requirements/static/ci/py3.7/freebsd.txt +++ b/requirements/static/ci/py3.7/freebsd.txt @@ -780,7 +780,7 @@ pytz==2022.1 # tempora pyvmomi==6.7.1.2018.12 # via -r requirements/static/ci/common.in -pyyaml==5.4.1 +pyyaml==6.0.1 # via # -r requirements/base.txt # clustershell diff --git a/requirements/static/ci/py3.7/invoke.txt b/requirements/static/ci/py3.7/invoke.txt index e2cad5c72e0..669f7a7fce8 100644 --- a/requirements/static/ci/py3.7/invoke.txt +++ b/requirements/static/ci/py3.7/invoke.txt @@ -8,7 +8,7 @@ blessings==1.7 # via -r requirements/static/ci/invoke.in invoke==1.4.1 # via -r requirements/static/ci/invoke.in -pyyaml==5.4.1 +pyyaml==6.0.1 # via -r requirements/static/ci/invoke.in six==1.16.0 # via blessings diff --git a/requirements/static/ci/py3.7/lint.txt b/requirements/static/ci/py3.7/lint.txt index a00764291ef..28cff6fb6d6 100644 --- a/requirements/static/ci/py3.7/lint.txt +++ b/requirements/static/ci/py3.7/lint.txt @@ -760,7 +760,7 @@ pytz==2022.1 # twilio pyvmomi==7.0.2 # via -r requirements/static/ci/common.in -pyyaml==5.4.1 +pyyaml==6.0.1 # via # -r requirements/base.txt # ansible-core diff --git a/requirements/static/ci/py3.7/linux.txt b/requirements/static/ci/py3.7/linux.txt index 9b44033cc6e..f93050ab932 100644 --- a/requirements/static/ci/py3.7/linux.txt +++ b/requirements/static/ci/py3.7/linux.txt @@ -808,7 +808,7 @@ pytz==2022.1 # tzlocal pyvmomi==6.7.1.2018.12 # via -r requirements/static/ci/common.in -pyyaml==5.4.1 +pyyaml==6.0.1 # via # -r requirements/base.txt # ansible-core diff --git a/requirements/static/ci/py3.7/windows.txt b/requirements/static/ci/py3.7/windows.txt index d76d05bcb82..1f67dcfba0c 100644 --- a/requirements/static/ci/py3.7/windows.txt +++ b/requirements/static/ci/py3.7/windows.txt @@ -324,7 +324,7 @@ pywin32==305 # wmi pywinrm==0.4.1 # via -r requirements/static/ci/windows.in -pyyaml==5.4.1 +pyyaml==6.0.1 # via # -r requirements/base.txt # clustershell diff --git a/requirements/static/ci/py3.8/cloud.txt b/requirements/static/ci/py3.8/cloud.txt index a2074674203..bd0e08a58b1 100644 --- a/requirements/static/ci/py3.8/cloud.txt +++ b/requirements/static/ci/py3.8/cloud.txt @@ -783,7 +783,7 @@ pyvmomi==7.0.2 # via -r requirements/static/ci/common.in pywinrm==0.3.0 # via -r requirements/static/ci/cloud.in -pyyaml==5.4.1 +pyyaml==6.0.1 # via # -r requirements/base.txt # clustershell diff --git a/requirements/static/ci/py3.8/docs.txt b/requirements/static/ci/py3.8/docs.txt index 10e2c9040d4..3f7c81f3f36 100644 --- a/requirements/static/ci/py3.8/docs.txt +++ b/requirements/static/ci/py3.8/docs.txt @@ -130,7 +130,7 @@ pytz==2022.1 # -c requirements/static/ci/py3.8/linux.txt # babel # tempora -pyyaml==5.4.1 +pyyaml==6.0.1 # via # -c requirements/static/ci/py3.8/linux.txt # -r requirements/base.txt diff --git a/requirements/static/ci/py3.8/freebsd.txt b/requirements/static/ci/py3.8/freebsd.txt index 5787541070c..c5405765a61 100644 --- a/requirements/static/ci/py3.8/freebsd.txt +++ b/requirements/static/ci/py3.8/freebsd.txt @@ -770,7 +770,7 @@ pytz==2022.1 # tempora pyvmomi==6.7.1.2018.12 # via -r requirements/static/ci/common.in -pyyaml==5.4.1 +pyyaml==6.0.1 # via # -r requirements/base.txt # clustershell diff --git a/requirements/static/ci/py3.8/invoke.txt b/requirements/static/ci/py3.8/invoke.txt index 356dd421308..d3850c6bde7 100644 --- a/requirements/static/ci/py3.8/invoke.txt +++ b/requirements/static/ci/py3.8/invoke.txt @@ -8,7 +8,7 @@ blessings==1.7 # via -r requirements/static/ci/invoke.in invoke==1.4.1 # via -r requirements/static/ci/invoke.in -pyyaml==5.4.1 +pyyaml==6.0.1 # via -r requirements/static/ci/invoke.in six==1.16.0 # via blessings diff --git a/requirements/static/ci/py3.8/lint.txt b/requirements/static/ci/py3.8/lint.txt index 704a7b455d6..6817761f343 100644 --- a/requirements/static/ci/py3.8/lint.txt +++ b/requirements/static/ci/py3.8/lint.txt @@ -751,7 +751,7 @@ pytz==2022.1 # twilio pyvmomi==7.0.2 # via -r requirements/static/ci/common.in -pyyaml==5.4.1 +pyyaml==6.0.1 # via # -r requirements/base.txt # ansible-core diff --git a/requirements/static/ci/py3.8/linux.txt b/requirements/static/ci/py3.8/linux.txt index d1a5b4fdab9..71621406fc1 100644 --- a/requirements/static/ci/py3.8/linux.txt +++ b/requirements/static/ci/py3.8/linux.txt @@ -796,7 +796,7 @@ pytz==2022.1 # tzlocal pyvmomi==6.7.1.2018.12 # via -r requirements/static/ci/common.in -pyyaml==5.4.1 +pyyaml==6.0.1 # via # -r requirements/base.txt # ansible-core diff --git a/requirements/static/ci/py3.8/windows.txt b/requirements/static/ci/py3.8/windows.txt index 9ca8d9d9f48..a4ab2b0e0c2 100644 --- a/requirements/static/ci/py3.8/windows.txt +++ b/requirements/static/ci/py3.8/windows.txt @@ -312,7 +312,7 @@ pywin32==305 # wmi pywinrm==0.4.1 # via -r requirements/static/ci/windows.in -pyyaml==5.4.1 +pyyaml==6.0.1 # via # -r requirements/base.txt # clustershell diff --git a/requirements/static/ci/py3.9/cloud.txt b/requirements/static/ci/py3.9/cloud.txt index d2ddb849e0b..0edf98cbeed 100644 --- a/requirements/static/ci/py3.9/cloud.txt +++ b/requirements/static/ci/py3.9/cloud.txt @@ -786,7 +786,7 @@ pyvmomi==7.0.2 # via -r requirements/static/ci/common.in pywinrm==0.3.0 # via -r requirements/static/ci/cloud.in -pyyaml==5.4.1 +pyyaml==6.0.1 # via # -r requirements/base.txt # clustershell diff --git a/requirements/static/ci/py3.9/darwin.txt b/requirements/static/ci/py3.9/darwin.txt index 0bffe2aeb5d..26ad2584cd8 100644 --- a/requirements/static/ci/py3.9/darwin.txt +++ b/requirements/static/ci/py3.9/darwin.txt @@ -774,7 +774,7 @@ pytz==2022.1 # tempora pyvmomi==6.7.1.2018.12 # via -r requirements/static/ci/common.in -pyyaml==5.4.1 +pyyaml==6.0.1 # via # -r requirements/base.txt # clustershell diff --git a/requirements/static/ci/py3.9/docs.txt b/requirements/static/ci/py3.9/docs.txt index c37b2578392..96c88b70650 100644 --- a/requirements/static/ci/py3.9/docs.txt +++ b/requirements/static/ci/py3.9/docs.txt @@ -134,7 +134,7 @@ pytz==2022.1 # -c requirements/static/ci/py3.9/linux.txt # babel # tempora -pyyaml==5.4.1 +pyyaml==6.0.1 # via # -c requirements/static/ci/py3.9/linux.txt # -r requirements/base.txt diff --git a/requirements/static/ci/py3.9/freebsd.txt b/requirements/static/ci/py3.9/freebsd.txt index e4a89b753e6..f86158df323 100644 --- a/requirements/static/ci/py3.9/freebsd.txt +++ b/requirements/static/ci/py3.9/freebsd.txt @@ -773,7 +773,7 @@ pytz==2022.1 # tempora pyvmomi==6.7.1.2018.12 # via -r requirements/static/ci/common.in -pyyaml==5.4.1 +pyyaml==6.0.1 # via # -r requirements/base.txt # clustershell diff --git a/requirements/static/ci/py3.9/invoke.txt b/requirements/static/ci/py3.9/invoke.txt index 3e1879c97e1..e9e8bf56b12 100644 --- a/requirements/static/ci/py3.9/invoke.txt +++ b/requirements/static/ci/py3.9/invoke.txt @@ -8,7 +8,7 @@ blessings==1.7 # via -r requirements/static/ci/invoke.in invoke==1.4.1 # via -r requirements/static/ci/invoke.in -pyyaml==5.4.1 +pyyaml==6.0.1 # via -r requirements/static/ci/invoke.in six==1.16.0 # via blessings diff --git a/requirements/static/ci/py3.9/lint.txt b/requirements/static/ci/py3.9/lint.txt index d9713037b6c..097b21c0876 100644 --- a/requirements/static/ci/py3.9/lint.txt +++ b/requirements/static/ci/py3.9/lint.txt @@ -752,7 +752,7 @@ pytz==2022.1 # twilio pyvmomi==7.0.2 # via -r requirements/static/ci/common.in -pyyaml==5.4.1 +pyyaml==6.0.1 # via # -r requirements/base.txt # ansible-core diff --git a/requirements/static/ci/py3.9/linux.txt b/requirements/static/ci/py3.9/linux.txt index ac16b6e52b0..064f9fbac6e 100644 --- a/requirements/static/ci/py3.9/linux.txt +++ b/requirements/static/ci/py3.9/linux.txt @@ -801,7 +801,7 @@ pytz==2022.1 # tzlocal pyvmomi==6.7.1.2018.12 # via -r requirements/static/ci/common.in -pyyaml==5.4.1 +pyyaml==6.0.1 # via # -r requirements/base.txt # ansible-core diff --git a/requirements/static/ci/py3.9/tools.txt b/requirements/static/ci/py3.9/tools.txt index 0dcf5cbef68..36efc836b96 100644 --- a/requirements/static/ci/py3.9/tools.txt +++ b/requirements/static/ci/py3.9/tools.txt @@ -38,7 +38,7 @@ python-dateutil==2.8.2 # via botocore python-tools-scripts==0.12.0 # via -r requirements/static/ci/tools.in -pyyaml==6.0 +pyyaml==6.0.1 # via -r requirements/static/ci/tools.in requests==2.31.0 # via diff --git a/requirements/static/ci/py3.9/windows.txt b/requirements/static/ci/py3.9/windows.txt index 7d18515c83e..d2c6aba824b 100644 --- a/requirements/static/ci/py3.9/windows.txt +++ b/requirements/static/ci/py3.9/windows.txt @@ -313,7 +313,7 @@ pywin32==305 # wmi pywinrm==0.4.1 # via -r requirements/static/ci/windows.in -pyyaml==5.4.1 +pyyaml==6.0.1 # via # -r requirements/base.txt # clustershell diff --git a/requirements/static/pkg/py3.10/darwin.txt b/requirements/static/pkg/py3.10/darwin.txt index c40cbc9b915..754590ec08c 100644 --- a/requirements/static/pkg/py3.10/darwin.txt +++ b/requirements/static/pkg/py3.10/darwin.txt @@ -89,7 +89,7 @@ python-gnupg==0.4.8 # via -r requirements/darwin.txt pytz==2022.1 # via tempora -pyyaml==5.4.1 +pyyaml==6.0.1 # via -r requirements/base.txt pyzmq==23.2.0 # via -r requirements/zeromq.txt diff --git a/requirements/static/pkg/py3.10/freebsd.txt b/requirements/static/pkg/py3.10/freebsd.txt index 167359b9d13..deb75954935 100644 --- a/requirements/static/pkg/py3.10/freebsd.txt +++ b/requirements/static/pkg/py3.10/freebsd.txt @@ -77,7 +77,7 @@ python-gnupg==0.4.8 # via -r requirements/static/pkg/freebsd.in pytz==2022.1 # via tempora -pyyaml==5.4.1 +pyyaml==6.0.1 # via -r requirements/base.txt pyzmq==23.2.0 # via -r requirements/zeromq.txt diff --git a/requirements/static/pkg/py3.10/linux.txt b/requirements/static/pkg/py3.10/linux.txt index bd61f53cc0f..3297db360e7 100644 --- a/requirements/static/pkg/py3.10/linux.txt +++ b/requirements/static/pkg/py3.10/linux.txt @@ -77,7 +77,7 @@ python-gnupg==0.4.8 # via -r requirements/static/pkg/linux.in pytz==2022.1 # via tempora -pyyaml==5.4.1 +pyyaml==6.0.1 # via -r requirements/base.txt pyzmq==23.2.0 # via -r requirements/zeromq.txt diff --git a/requirements/static/pkg/py3.10/windows.txt b/requirements/static/pkg/py3.10/windows.txt index 161d9ce0285..00e2e6afb64 100644 --- a/requirements/static/pkg/py3.10/windows.txt +++ b/requirements/static/pkg/py3.10/windows.txt @@ -104,7 +104,7 @@ pywin32==305 # via # -r requirements/windows.txt # wmi -pyyaml==5.4.1 +pyyaml==6.0.1 # via -r requirements/base.txt pyzmq==25.0.2 ; sys_platform == "win32" # via -r requirements/zeromq.txt diff --git a/requirements/static/pkg/py3.7/freebsd.txt b/requirements/static/pkg/py3.7/freebsd.txt index 19e947ea090..9ec3d70b083 100644 --- a/requirements/static/pkg/py3.7/freebsd.txt +++ b/requirements/static/pkg/py3.7/freebsd.txt @@ -75,7 +75,7 @@ python-gnupg==0.4.8 # via -r requirements/static/pkg/freebsd.in pytz==2022.1 # via tempora -pyyaml==5.4.1 +pyyaml==6.0.1 # via -r requirements/base.txt pyzmq==23.2.0 # via -r requirements/zeromq.txt diff --git a/requirements/static/pkg/py3.7/linux.txt b/requirements/static/pkg/py3.7/linux.txt index fd0d0c90932..1d99400bc04 100644 --- a/requirements/static/pkg/py3.7/linux.txt +++ b/requirements/static/pkg/py3.7/linux.txt @@ -75,7 +75,7 @@ python-gnupg==0.4.8 # via -r requirements/static/pkg/linux.in pytz==2022.1 # via tempora -pyyaml==5.4.1 +pyyaml==6.0.1 # via -r requirements/base.txt pyzmq==23.2.0 # via -r requirements/zeromq.txt diff --git a/requirements/static/pkg/py3.7/windows.txt b/requirements/static/pkg/py3.7/windows.txt index d93e5afdbce..b2ca9952545 100644 --- a/requirements/static/pkg/py3.7/windows.txt +++ b/requirements/static/pkg/py3.7/windows.txt @@ -105,7 +105,7 @@ pywin32==305 # -r requirements/windows.txt # cherrypy # wmi -pyyaml==5.4.1 +pyyaml==6.0.1 # via -r requirements/base.txt pyzmq==25.0.2 ; sys_platform == "win32" # via -r requirements/zeromq.txt diff --git a/requirements/static/pkg/py3.8/freebsd.txt b/requirements/static/pkg/py3.8/freebsd.txt index c8e7dbea2da..bbf7ee1d199 100644 --- a/requirements/static/pkg/py3.8/freebsd.txt +++ b/requirements/static/pkg/py3.8/freebsd.txt @@ -75,7 +75,7 @@ python-gnupg==0.4.8 # via -r requirements/static/pkg/freebsd.in pytz==2022.1 # via tempora -pyyaml==5.4.1 +pyyaml==6.0.1 # via -r requirements/base.txt pyzmq==23.2.0 # via -r requirements/zeromq.txt diff --git a/requirements/static/pkg/py3.8/linux.txt b/requirements/static/pkg/py3.8/linux.txt index 95417d0c300..ebce5bb275e 100644 --- a/requirements/static/pkg/py3.8/linux.txt +++ b/requirements/static/pkg/py3.8/linux.txt @@ -75,7 +75,7 @@ python-gnupg==0.4.8 # via -r requirements/static/pkg/linux.in pytz==2022.1 # via tempora -pyyaml==5.4.1 +pyyaml==6.0.1 # via -r requirements/base.txt pyzmq==23.2.0 # via -r requirements/zeromq.txt diff --git a/requirements/static/pkg/py3.8/windows.txt b/requirements/static/pkg/py3.8/windows.txt index ad6d0052429..3c0d8d61c7e 100644 --- a/requirements/static/pkg/py3.8/windows.txt +++ b/requirements/static/pkg/py3.8/windows.txt @@ -105,7 +105,7 @@ pywin32==305 # -r requirements/windows.txt # cherrypy # wmi -pyyaml==5.4.1 +pyyaml==6.0.1 # via -r requirements/base.txt pyzmq==25.0.2 ; sys_platform == "win32" # via -r requirements/zeromq.txt diff --git a/requirements/static/pkg/py3.9/darwin.txt b/requirements/static/pkg/py3.9/darwin.txt index b9b44e8b661..44efe7b101c 100644 --- a/requirements/static/pkg/py3.9/darwin.txt +++ b/requirements/static/pkg/py3.9/darwin.txt @@ -89,7 +89,7 @@ python-gnupg==0.4.8 # via -r requirements/darwin.txt pytz==2022.1 # via tempora -pyyaml==5.4.1 +pyyaml==6.0.1 # via -r requirements/base.txt pyzmq==23.2.0 # via -r requirements/zeromq.txt diff --git a/requirements/static/pkg/py3.9/freebsd.txt b/requirements/static/pkg/py3.9/freebsd.txt index b4cefb4824c..0320950393d 100644 --- a/requirements/static/pkg/py3.9/freebsd.txt +++ b/requirements/static/pkg/py3.9/freebsd.txt @@ -77,7 +77,7 @@ python-gnupg==0.4.8 # via -r requirements/static/pkg/freebsd.in pytz==2022.1 # via tempora -pyyaml==5.4.1 +pyyaml==6.0.1 # via -r requirements/base.txt pyzmq==23.2.0 # via -r requirements/zeromq.txt diff --git a/requirements/static/pkg/py3.9/linux.txt b/requirements/static/pkg/py3.9/linux.txt index e64cb115584..6b378323c49 100644 --- a/requirements/static/pkg/py3.9/linux.txt +++ b/requirements/static/pkg/py3.9/linux.txt @@ -77,7 +77,7 @@ python-gnupg==0.4.8 # via -r requirements/static/pkg/linux.in pytz==2022.1 # via tempora -pyyaml==5.4.1 +pyyaml==6.0.1 # via -r requirements/base.txt pyzmq==23.2.0 # via -r requirements/zeromq.txt diff --git a/requirements/static/pkg/py3.9/windows.txt b/requirements/static/pkg/py3.9/windows.txt index 730c04799db..c3a11718dd9 100644 --- a/requirements/static/pkg/py3.9/windows.txt +++ b/requirements/static/pkg/py3.9/windows.txt @@ -105,7 +105,7 @@ pywin32==305 # -r requirements/windows.txt # cherrypy # wmi -pyyaml==5.4.1 +pyyaml==6.0.1 # via -r requirements/base.txt pyzmq==25.0.2 ; sys_platform == "win32" # via -r requirements/zeromq.txt From ec658b943944494d197351548ba137e806a8f8b4 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Thu, 25 May 2023 06:56:46 +0100 Subject: [PATCH 127/393] Fix lint issues after the `pyyaml` package upgrade Signed-off-by: Pedro Algarvio --- salt/modules/win_iis.py | 5 ++--- tests/integration/utils/test_win_runas.py | 12 ++++++------ 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/salt/modules/win_iis.py b/salt/modules/win_iis.py index 0c97aa84896..42ec335bf32 100644 --- a/salt/modules/win_iis.py +++ b/salt/modules/win_iis.py @@ -13,10 +13,9 @@ import logging import os import re -import yaml - import salt.utils.json import salt.utils.platform +import salt.utils.yaml from salt.exceptions import CommandExecutionError, SaltInvocationError log = logging.getLogger(__name__) @@ -187,7 +186,7 @@ def _prepare_settings(pspath, settings): match = re.search(r"Collection\[(\{.*\})\]", setting["name"]) if match: name = setting["name"][: match.start(1) - 1] - match_dict = yaml.load(match.group(1)) + match_dict = salt.utils.yaml.load(match.group(1)) index = _collection_match_to_index( pspath, setting["filter"], name, match_dict ) diff --git a/tests/integration/utils/test_win_runas.py b/tests/integration/utils/test_win_runas.py index cd8c95b9da5..41d4169d945 100644 --- a/tests/integration/utils/test_win_runas.py +++ b/tests/integration/utils/test_win_runas.py @@ -10,10 +10,10 @@ import time import traceback import pytest -import yaml import salt.utils.files import salt.utils.win_runas +import salt.utils.yaml from tests.support.case import ModuleCase from tests.support.helpers import with_system_user from tests.support.mock import Mock @@ -658,7 +658,7 @@ class RunAsTest(ModuleCase): win32serviceutil.StartService("test service") wait_for_service("test service") with salt.utils.files.fopen(RUNAS_OUT, "r") as fp: - ret = yaml.load(fp) + ret = salt.utils.yaml.safe_load(fp) assert ret["retcode"] == 1, ret @with_system_user( @@ -676,7 +676,7 @@ class RunAsTest(ModuleCase): win32serviceutil.StartService("test service") wait_for_service("test service") with salt.utils.files.fopen(RUNAS_OUT, "r") as fp: - ret = yaml.load(fp) + ret = salt.utils.yaml.safe_load(fp) assert ret["retcode"] == 1, ret @with_system_user( @@ -698,7 +698,7 @@ class RunAsTest(ModuleCase): win32serviceutil.StartService("test service") wait_for_service("test service") with salt.utils.files.fopen(RUNAS_OUT, "r") as fp: - ret = yaml.load(fp) + ret = salt.utils.yaml.safe_load(fp) assert ret["retcode"] == 0, ret @with_system_user( @@ -720,7 +720,7 @@ class RunAsTest(ModuleCase): win32serviceutil.StartService("test service") wait_for_service("test service") with salt.utils.files.fopen(RUNAS_OUT, "r") as fp: - ret = yaml.load(fp) + ret = salt.utils.yaml.safe_load(fp) assert ret["retcode"] == 0, ret def test_runas_service_system_user(self): @@ -735,5 +735,5 @@ class RunAsTest(ModuleCase): win32serviceutil.StartService("test service") wait_for_service("test service") with salt.utils.files.fopen(RUNAS_OUT, "r") as fp: - ret = yaml.load(fp) + ret = salt.utils.yaml.safe_load(fp) assert ret["retcode"] == 0, ret From c475ccba40a876337a6d4cdde91c1a5dfc708524 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Tue, 18 Jul 2023 07:23:33 +0100 Subject: [PATCH 128/393] Add changelog entry Signed-off-by: Pedro Algarvio --- changelog/64657.changed.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog/64657.changed.md diff --git a/changelog/64657.changed.md b/changelog/64657.changed.md new file mode 100644 index 00000000000..5770e99f1d6 --- /dev/null +++ b/changelog/64657.changed.md @@ -0,0 +1 @@ +Bump to `pyyaml==6.0.1` due to https://github.com/yaml/pyyaml/issues/601 and address lint issues From 48749b15bcf667b6a0e7342a551207a14e3d74cf Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Tue, 18 Jul 2023 06:19:23 +0100 Subject: [PATCH 129/393] Bump to `pyyaml==6.0.1` due to https://github.com/yaml/pyyaml/issues/601 Signed-off-by: Pedro Algarvio --- .pre-commit-config.yaml | 16 ++++++++-------- requirements/static/ci/py3.10/darwin.txt | 4 ++-- requirements/static/ci/py3.10/docs.txt | 2 +- requirements/static/ci/py3.10/freebsd.txt | 4 ++-- requirements/static/ci/py3.10/invoke.txt | 2 +- requirements/static/ci/py3.10/linux.txt | 4 ++-- .../static/ci/py3.10/pkgtests-windows.txt | 2 +- requirements/static/ci/py3.10/pkgtests.txt | 2 +- requirements/static/ci/py3.10/tools.txt | 2 +- requirements/static/ci/py3.10/windows.txt | 4 ++-- requirements/static/ci/py3.11/darwin.txt | 4 ++-- requirements/static/ci/py3.11/docs.txt | 2 +- requirements/static/ci/py3.11/freebsd.txt | 4 ++-- requirements/static/ci/py3.11/linux.txt | 4 ++-- .../static/ci/py3.11/pkgtests-windows.txt | 2 +- requirements/static/ci/py3.11/pkgtests.txt | 2 +- requirements/static/ci/py3.11/tools.txt | 2 +- requirements/static/ci/py3.11/windows.txt | 4 ++-- requirements/static/ci/py3.8/docs.txt | 2 +- requirements/static/ci/py3.8/freebsd.txt | 4 ++-- requirements/static/ci/py3.8/invoke.txt | 2 +- requirements/static/ci/py3.8/linux.txt | 4 ++-- requirements/static/ci/py3.8/windows.txt | 4 ++-- requirements/static/ci/py3.9/darwin.txt | 4 ++-- requirements/static/ci/py3.9/docs.txt | 2 +- requirements/static/ci/py3.9/freebsd.txt | 4 ++-- requirements/static/ci/py3.9/invoke.txt | 2 +- requirements/static/ci/py3.9/linux.txt | 4 ++-- requirements/static/ci/py3.9/tools.txt | 2 +- requirements/static/ci/py3.9/windows.txt | 4 ++-- requirements/static/pkg/py3.10/darwin.txt | 2 +- requirements/static/pkg/py3.10/freebsd.txt | 2 +- requirements/static/pkg/py3.10/linux.txt | 2 +- requirements/static/pkg/py3.10/windows.txt | 2 +- requirements/static/pkg/py3.11/darwin.txt | 2 +- requirements/static/pkg/py3.11/freebsd.txt | 2 +- requirements/static/pkg/py3.11/linux.txt | 2 +- requirements/static/pkg/py3.11/windows.txt | 2 +- requirements/static/pkg/py3.8/freebsd.txt | 2 +- requirements/static/pkg/py3.8/linux.txt | 2 +- requirements/static/pkg/py3.8/windows.txt | 2 +- requirements/static/pkg/py3.9/darwin.txt | 2 +- requirements/static/pkg/py3.9/freebsd.txt | 2 +- requirements/static/pkg/py3.9/linux.txt | 2 +- requirements/static/pkg/py3.9/windows.txt | 2 +- 45 files changed, 67 insertions(+), 67 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 20737c86ee2..70bc0bf75e1 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -56,7 +56,7 @@ repos: - pre-commit-checks additional_dependencies: - boto3==1.21.46 - - pyyaml==6.0 + - pyyaml==6.0.1 - jinja2==3.1.2 - packaging==23.0 - virustotal3==1.0.8 @@ -70,7 +70,7 @@ repos: - generate-workflows additional_dependencies: - boto3==1.21.46 - - pyyaml==6.0 + - pyyaml==6.0.1 - jinja2==3.1.2 - packaging==23.0 - virustotal3==1.0.8 @@ -85,7 +85,7 @@ repos: - actionlint additional_dependencies: - boto3==1.21.46 - - pyyaml==6.0 + - pyyaml==6.0.1 - jinja2==3.1.2 - packaging==23.0 - virustotal3==1.0.8 @@ -1312,7 +1312,7 @@ repos: - docs.check additional_dependencies: - blessings==1.7 - - pyyaml==6.0 + - pyyaml==6.0.1 - distro==1.7.0 - jinja2==3.0.3 - msgpack==1.0.3 @@ -1332,7 +1332,7 @@ repos: - filemap.check additional_dependencies: - blessings==1.7 - - pyyaml==6.0 + - pyyaml==6.0.1 - distro==1.7.0 - jinja2==3.0.3 - msgpack==1.0.3 @@ -1356,7 +1356,7 @@ repos: - loader.check-virtual additional_dependencies: - blessings==1.7 - - pyyaml==6.0 + - pyyaml==6.0.1 - distro==1.7.0 - jinja2==3.0.3 - msgpack==1.0.3 @@ -1380,7 +1380,7 @@ repos: - docstrings.check additional_dependencies: - blessings==1.7 - - pyyaml==6.0 + - pyyaml==6.0.1 - distro==1.7.0 - jinja2==3.0.3 - msgpack==1.0.3 @@ -1406,7 +1406,7 @@ repos: - --error-on-known-failures additional_dependencies: - blessings==1.7 - - pyyaml==6.0 + - pyyaml==6.0.1 - distro==1.7.0 - jinja2==3.0.3 - msgpack==1.0.3 diff --git a/requirements/static/ci/py3.10/darwin.txt b/requirements/static/ci/py3.10/darwin.txt index f0ec6d1f12e..ae7f56e4b55 100644 --- a/requirements/static/ci/py3.10/darwin.txt +++ b/requirements/static/ci/py3.10/darwin.txt @@ -410,7 +410,7 @@ pytz==2023.3 # tempora pyvmomi==8.0.1.0.1 # via -r requirements/static/ci/common.in -pyyaml==6.0 +pyyaml==6.0.1 # via # -c requirements/static/ci/../pkg/py3.10/darwin.txt # -r requirements/base.txt @@ -516,7 +516,7 @@ ttp==0.9.4 # via # napalm # ttp-templates -types-pyyaml==6.0.12.10 +types-pyyaml==6.0.1 # via responses typing-extensions==4.6.2 # via diff --git a/requirements/static/ci/py3.10/docs.txt b/requirements/static/ci/py3.10/docs.txt index 46f71dc1870..beb2a1e0de1 100644 --- a/requirements/static/ci/py3.10/docs.txt +++ b/requirements/static/ci/py3.10/docs.txt @@ -107,7 +107,7 @@ pytz==2023.3 # via # -c requirements/static/ci/py3.10/linux.txt # tempora -pyyaml==6.0 +pyyaml==6.0.1 # via # -c requirements/static/ci/py3.10/linux.txt # myst-docutils diff --git a/requirements/static/ci/py3.10/freebsd.txt b/requirements/static/ci/py3.10/freebsd.txt index f8fbb28746b..41af54419ed 100644 --- a/requirements/static/ci/py3.10/freebsd.txt +++ b/requirements/static/ci/py3.10/freebsd.txt @@ -404,7 +404,7 @@ pytz==2023.3 # tempora pyvmomi==8.0.1.0.1 # via -r requirements/static/ci/common.in -pyyaml==6.0 +pyyaml==6.0.1 # via # -c requirements/static/ci/../pkg/py3.10/freebsd.txt # -r requirements/base.txt @@ -508,7 +508,7 @@ ttp==0.9.4 # via # napalm # ttp-templates -types-pyyaml==6.0.12.10 +types-pyyaml==6.0.1 # via responses typing-extensions==4.6.2 # via diff --git a/requirements/static/ci/py3.10/invoke.txt b/requirements/static/ci/py3.10/invoke.txt index 17380a770a2..7922e37a8e0 100644 --- a/requirements/static/ci/py3.10/invoke.txt +++ b/requirements/static/ci/py3.10/invoke.txt @@ -8,7 +8,7 @@ blessings==1.7 # via -r requirements/static/ci/invoke.in invoke==2.1.2 # via -r requirements/static/ci/invoke.in -pyyaml==6.0 +pyyaml==6.0.1 # via # -c requirements/static/ci/py3.10/linux.txt # -r requirements/static/ci/invoke.in diff --git a/requirements/static/ci/py3.10/linux.txt b/requirements/static/ci/py3.10/linux.txt index 9c34b310273..489f6545653 100644 --- a/requirements/static/ci/py3.10/linux.txt +++ b/requirements/static/ci/py3.10/linux.txt @@ -443,7 +443,7 @@ pytz==2023.3 # twilio pyvmomi==8.0.1.0.1 # via -r requirements/static/ci/common.in -pyyaml==6.0 +pyyaml==6.0.1 # via # -c requirements/static/ci/../pkg/py3.10/linux.txt # -r requirements/base.txt @@ -572,7 +572,7 @@ ttp==0.9.4 # ttp-templates twilio==8.2.2 # via -r requirements/static/ci/linux.in -types-pyyaml==6.0.12.10 +types-pyyaml==6.0.1 # via responses typing-extensions==4.6.2 # via diff --git a/requirements/static/ci/py3.10/pkgtests-windows.txt b/requirements/static/ci/py3.10/pkgtests-windows.txt index 75098b1e07b..b7f264f1fdc 100644 --- a/requirements/static/ci/py3.10/pkgtests-windows.txt +++ b/requirements/static/ci/py3.10/pkgtests-windows.txt @@ -136,7 +136,7 @@ pywin32==306 # via # pytest-skip-markers # wmi -pyyaml==6.0 +pyyaml==6.0.1 # via -r requirements/base.txt pyzmq==25.1.0 # via diff --git a/requirements/static/ci/py3.10/pkgtests.txt b/requirements/static/ci/py3.10/pkgtests.txt index 0d7fb526f19..e21f20816e2 100644 --- a/requirements/static/ci/py3.10/pkgtests.txt +++ b/requirements/static/ci/py3.10/pkgtests.txt @@ -127,7 +127,7 @@ pytest==7.3.2 # pytest-tempdir pytz==2023.3 # via tempora -pyyaml==6.0 +pyyaml==6.0.1 # via -r requirements/base.txt pyzmq==25.1.0 # via diff --git a/requirements/static/ci/py3.10/tools.txt b/requirements/static/ci/py3.10/tools.txt index a621604dce4..0641eb7443d 100644 --- a/requirements/static/ci/py3.10/tools.txt +++ b/requirements/static/ci/py3.10/tools.txt @@ -40,7 +40,7 @@ python-dateutil==2.8.2 # via botocore python-tools-scripts==0.17.0 # via -r requirements/static/ci/tools.in -pyyaml==6.0 +pyyaml==6.0.1 # via -r requirements/static/ci/tools.in requests==2.31.0 # via diff --git a/requirements/static/ci/py3.10/windows.txt b/requirements/static/ci/py3.10/windows.txt index 0722b741bf2..4c0e7f29cd9 100644 --- a/requirements/static/ci/py3.10/windows.txt +++ b/requirements/static/ci/py3.10/windows.txt @@ -375,7 +375,7 @@ pywin32==306 # wmi pywinrm==0.4.3 # via -r requirements/static/ci/windows.in -pyyaml==6.0 +pyyaml==6.0.1 # via # -c requirements/static/ci/../pkg/py3.10/windows.txt # -r requirements/base.txt @@ -458,7 +458,7 @@ tornado==6.3.2 ; python_version >= "3.8" # via # -c requirements/static/ci/../pkg/py3.10/windows.txt # -r requirements/base.txt -types-pyyaml==6.0.12.10 +types-pyyaml==6.0.1 # via responses typing-extensions==4.6.2 # via diff --git a/requirements/static/ci/py3.11/darwin.txt b/requirements/static/ci/py3.11/darwin.txt index cb4b5b5bb38..0cac3b1e353 100644 --- a/requirements/static/ci/py3.11/darwin.txt +++ b/requirements/static/ci/py3.11/darwin.txt @@ -408,7 +408,7 @@ pytz==2023.3 # tempora pyvmomi==8.0.1.0.1 # via -r requirements/static/ci/common.in -pyyaml==6.0 +pyyaml==6.0.1 # via # -c requirements/static/ci/../pkg/py3.11/darwin.txt # -r requirements/base.txt @@ -512,7 +512,7 @@ ttp==0.9.4 # via # napalm # ttp-templates -types-pyyaml==6.0.12.10 +types-pyyaml==6.0.1 # via responses typing-extensions==4.6.2 # via diff --git a/requirements/static/ci/py3.11/docs.txt b/requirements/static/ci/py3.11/docs.txt index 3394e5157c9..a9b55617b93 100644 --- a/requirements/static/ci/py3.11/docs.txt +++ b/requirements/static/ci/py3.11/docs.txt @@ -107,7 +107,7 @@ pytz==2023.3 # via # -c requirements/static/ci/py3.11/linux.txt # tempora -pyyaml==6.0 +pyyaml==6.0.1 # via # -c requirements/static/ci/py3.11/linux.txt # myst-docutils diff --git a/requirements/static/ci/py3.11/freebsd.txt b/requirements/static/ci/py3.11/freebsd.txt index 0d213e324b1..7717cc536e8 100644 --- a/requirements/static/ci/py3.11/freebsd.txt +++ b/requirements/static/ci/py3.11/freebsd.txt @@ -402,7 +402,7 @@ pytz==2023.3 # tempora pyvmomi==8.0.1.0.1 # via -r requirements/static/ci/common.in -pyyaml==6.0 +pyyaml==6.0.1 # via # -c requirements/static/ci/../pkg/py3.11/freebsd.txt # -r requirements/base.txt @@ -504,7 +504,7 @@ ttp==0.9.4 # via # napalm # ttp-templates -types-pyyaml==6.0.12.10 +types-pyyaml==6.0.1 # via responses typing-extensions==4.6.2 # via diff --git a/requirements/static/ci/py3.11/linux.txt b/requirements/static/ci/py3.11/linux.txt index 906e5bf073f..c00b65d4f99 100644 --- a/requirements/static/ci/py3.11/linux.txt +++ b/requirements/static/ci/py3.11/linux.txt @@ -439,7 +439,7 @@ pytz==2023.3 # twilio pyvmomi==8.0.1.0.1 # via -r requirements/static/ci/common.in -pyyaml==6.0 +pyyaml==6.0.1 # via # -c requirements/static/ci/../pkg/py3.11/linux.txt # -r requirements/base.txt @@ -566,7 +566,7 @@ ttp==0.9.4 # ttp-templates twilio==8.2.2 # via -r requirements/static/ci/linux.in -types-pyyaml==6.0.12.10 +types-pyyaml==6.0.1 # via responses typing-extensions==4.6.2 # via diff --git a/requirements/static/ci/py3.11/pkgtests-windows.txt b/requirements/static/ci/py3.11/pkgtests-windows.txt index 73ec2a9dea1..e64a2368a80 100644 --- a/requirements/static/ci/py3.11/pkgtests-windows.txt +++ b/requirements/static/ci/py3.11/pkgtests-windows.txt @@ -134,7 +134,7 @@ pywin32==306 # via # pytest-skip-markers # wmi -pyyaml==6.0 +pyyaml==6.0.1 # via -r requirements/base.txt pyzmq==25.1.0 # via diff --git a/requirements/static/ci/py3.11/pkgtests.txt b/requirements/static/ci/py3.11/pkgtests.txt index 7ca882892bc..f7b7a027870 100644 --- a/requirements/static/ci/py3.11/pkgtests.txt +++ b/requirements/static/ci/py3.11/pkgtests.txt @@ -125,7 +125,7 @@ pytest==7.3.1 # pytest-tempdir pytz==2023.3 # via tempora -pyyaml==6.0 +pyyaml==6.0.1 # via -r requirements/base.txt pyzmq==25.1.0 # via diff --git a/requirements/static/ci/py3.11/tools.txt b/requirements/static/ci/py3.11/tools.txt index 6112fab6fb1..1776cc02da7 100644 --- a/requirements/static/ci/py3.11/tools.txt +++ b/requirements/static/ci/py3.11/tools.txt @@ -40,7 +40,7 @@ python-dateutil==2.8.2 # via botocore python-tools-scripts==0.17.0 # via -r requirements/static/ci/tools.in -pyyaml==6.0 +pyyaml==6.0.1 # via -r requirements/static/ci/tools.in requests==2.31.0 # via diff --git a/requirements/static/ci/py3.11/windows.txt b/requirements/static/ci/py3.11/windows.txt index 7437b9b110b..2761058e3ec 100644 --- a/requirements/static/ci/py3.11/windows.txt +++ b/requirements/static/ci/py3.11/windows.txt @@ -373,7 +373,7 @@ pywin32==306 # wmi pywinrm==0.4.3 # via -r requirements/static/ci/windows.in -pyyaml==6.0 +pyyaml==6.0.1 # via # -c requirements/static/ci/../pkg/py3.11/windows.txt # -r requirements/base.txt @@ -454,7 +454,7 @@ tornado==6.3.2 ; python_version >= "3.8" # via # -c requirements/static/ci/../pkg/py3.11/windows.txt # -r requirements/base.txt -types-pyyaml==6.0.12.10 +types-pyyaml==6.0.1 # via responses typing-extensions==4.6.2 # via diff --git a/requirements/static/ci/py3.8/docs.txt b/requirements/static/ci/py3.8/docs.txt index b9d38ccf67b..4351387d324 100644 --- a/requirements/static/ci/py3.8/docs.txt +++ b/requirements/static/ci/py3.8/docs.txt @@ -116,7 +116,7 @@ pytz==2023.3 # -c requirements/static/ci/py3.8/linux.txt # babel # tempora -pyyaml==6.0 +pyyaml==6.0.1 # via # -c requirements/static/ci/py3.8/linux.txt # myst-docutils diff --git a/requirements/static/ci/py3.8/freebsd.txt b/requirements/static/ci/py3.8/freebsd.txt index 99f71703ac4..c9f36cebf40 100644 --- a/requirements/static/ci/py3.8/freebsd.txt +++ b/requirements/static/ci/py3.8/freebsd.txt @@ -407,7 +407,7 @@ pytz==2023.3 # tempora pyvmomi==8.0.1.0.1 # via -r requirements/static/ci/common.in -pyyaml==6.0 +pyyaml==6.0.1 # via # -c requirements/static/ci/../pkg/py3.8/freebsd.txt # -r requirements/base.txt @@ -511,7 +511,7 @@ ttp==0.9.4 # via # napalm # ttp-templates -types-pyyaml==6.0.12.10 +types-pyyaml==6.0.1 # via responses typing-extensions==4.6.2 # via diff --git a/requirements/static/ci/py3.8/invoke.txt b/requirements/static/ci/py3.8/invoke.txt index dbca8d997a3..96c1ae28b09 100644 --- a/requirements/static/ci/py3.8/invoke.txt +++ b/requirements/static/ci/py3.8/invoke.txt @@ -8,7 +8,7 @@ blessings==1.7 # via -r requirements/static/ci/invoke.in invoke==2.1.2 # via -r requirements/static/ci/invoke.in -pyyaml==6.0 +pyyaml==6.0.1 # via # -c requirements/static/ci/py3.8/linux.txt # -r requirements/static/ci/invoke.in diff --git a/requirements/static/ci/py3.8/linux.txt b/requirements/static/ci/py3.8/linux.txt index a0ef826b025..8fa38f1d181 100644 --- a/requirements/static/ci/py3.8/linux.txt +++ b/requirements/static/ci/py3.8/linux.txt @@ -447,7 +447,7 @@ pytz==2023.3 # twilio pyvmomi==8.0.1.0.1 # via -r requirements/static/ci/common.in -pyyaml==6.0 +pyyaml==6.0.1 # via # -c requirements/static/ci/../pkg/py3.8/linux.txt # -r requirements/base.txt @@ -576,7 +576,7 @@ ttp==0.9.4 # ttp-templates twilio==8.2.2 # via -r requirements/static/ci/linux.in -types-pyyaml==6.0.12.10 +types-pyyaml==6.0.1 # via responses typing-extensions==4.6.2 # via diff --git a/requirements/static/ci/py3.8/windows.txt b/requirements/static/ci/py3.8/windows.txt index 5122f9c62d5..c4af0c4d140 100644 --- a/requirements/static/ci/py3.8/windows.txt +++ b/requirements/static/ci/py3.8/windows.txt @@ -380,7 +380,7 @@ pywin32==306 # wmi pywinrm==0.4.3 # via -r requirements/static/ci/windows.in -pyyaml==6.0 +pyyaml==6.0.1 # via # -c requirements/static/ci/../pkg/py3.8/windows.txt # -r requirements/base.txt @@ -463,7 +463,7 @@ tornado==6.3.2 ; python_version >= "3.8" # via # -c requirements/static/ci/../pkg/py3.8/windows.txt # -r requirements/base.txt -types-pyyaml==6.0.12.10 +types-pyyaml==6.0.1 # via responses typing-extensions==4.6.2 # via diff --git a/requirements/static/ci/py3.9/darwin.txt b/requirements/static/ci/py3.9/darwin.txt index 1c00ebb0cf8..ce9dd34de8e 100644 --- a/requirements/static/ci/py3.9/darwin.txt +++ b/requirements/static/ci/py3.9/darwin.txt @@ -410,7 +410,7 @@ pytz==2023.3 # tempora pyvmomi==8.0.1.0.1 # via -r requirements/static/ci/common.in -pyyaml==6.0 +pyyaml==6.0.1 # via # -c requirements/static/ci/../pkg/py3.9/darwin.txt # -r requirements/base.txt @@ -516,7 +516,7 @@ ttp==0.9.4 # via # napalm # ttp-templates -types-pyyaml==6.0.12.10 +types-pyyaml==6.0.1 # via responses typing-extensions==4.6.2 # via diff --git a/requirements/static/ci/py3.9/docs.txt b/requirements/static/ci/py3.9/docs.txt index faec5ce9d47..b435d3d68aa 100644 --- a/requirements/static/ci/py3.9/docs.txt +++ b/requirements/static/ci/py3.9/docs.txt @@ -111,7 +111,7 @@ pytz==2023.3 # via # -c requirements/static/ci/py3.9/linux.txt # tempora -pyyaml==6.0 +pyyaml==6.0.1 # via # -c requirements/static/ci/py3.9/linux.txt # myst-docutils diff --git a/requirements/static/ci/py3.9/freebsd.txt b/requirements/static/ci/py3.9/freebsd.txt index c367c3a7016..5f56269b2bd 100644 --- a/requirements/static/ci/py3.9/freebsd.txt +++ b/requirements/static/ci/py3.9/freebsd.txt @@ -404,7 +404,7 @@ pytz==2023.3 # tempora pyvmomi==8.0.1.0.1 # via -r requirements/static/ci/common.in -pyyaml==6.0 +pyyaml==6.0.1 # via # -c requirements/static/ci/../pkg/py3.9/freebsd.txt # -r requirements/base.txt @@ -508,7 +508,7 @@ ttp==0.9.4 # via # napalm # ttp-templates -types-pyyaml==6.0.12.10 +types-pyyaml==6.0.1 # via responses typing-extensions==4.6.2 # via diff --git a/requirements/static/ci/py3.9/invoke.txt b/requirements/static/ci/py3.9/invoke.txt index 108009c5cdc..773d1f36669 100644 --- a/requirements/static/ci/py3.9/invoke.txt +++ b/requirements/static/ci/py3.9/invoke.txt @@ -8,7 +8,7 @@ blessings==1.7 # via -r requirements/static/ci/invoke.in invoke==2.1.2 # via -r requirements/static/ci/invoke.in -pyyaml==6.0 +pyyaml==6.0.1 # via # -c requirements/static/ci/py3.9/linux.txt # -r requirements/static/ci/invoke.in diff --git a/requirements/static/ci/py3.9/linux.txt b/requirements/static/ci/py3.9/linux.txt index b38be754f8d..1b4a2a3519c 100644 --- a/requirements/static/ci/py3.9/linux.txt +++ b/requirements/static/ci/py3.9/linux.txt @@ -445,7 +445,7 @@ pytz==2023.3 # twilio pyvmomi==8.0.1.0.1 # via -r requirements/static/ci/common.in -pyyaml==6.0 +pyyaml==6.0.1 # via # -c requirements/static/ci/../pkg/py3.9/linux.txt # -r requirements/base.txt @@ -574,7 +574,7 @@ ttp==0.9.4 # ttp-templates twilio==8.2.2 # via -r requirements/static/ci/linux.in -types-pyyaml==6.0.12.10 +types-pyyaml==6.0.1 # via responses typing-extensions==4.6.2 # via diff --git a/requirements/static/ci/py3.9/tools.txt b/requirements/static/ci/py3.9/tools.txt index 1083f11c99c..b9e076ed2d5 100644 --- a/requirements/static/ci/py3.9/tools.txt +++ b/requirements/static/ci/py3.9/tools.txt @@ -40,7 +40,7 @@ python-dateutil==2.8.2 # via botocore python-tools-scripts==0.17.0 # via -r requirements/static/ci/tools.in -pyyaml==6.0 +pyyaml==6.0.1 # via -r requirements/static/ci/tools.in requests==2.31.0 # via diff --git a/requirements/static/ci/py3.9/windows.txt b/requirements/static/ci/py3.9/windows.txt index 2540b74ffaa..94073d3e6de 100644 --- a/requirements/static/ci/py3.9/windows.txt +++ b/requirements/static/ci/py3.9/windows.txt @@ -376,7 +376,7 @@ pywin32==306 # wmi pywinrm==0.4.3 # via -r requirements/static/ci/windows.in -pyyaml==6.0 +pyyaml==6.0.1 # via # -c requirements/static/ci/../pkg/py3.9/windows.txt # -r requirements/base.txt @@ -459,7 +459,7 @@ tornado==6.3.2 ; python_version >= "3.8" # via # -c requirements/static/ci/../pkg/py3.9/windows.txt # -r requirements/base.txt -types-pyyaml==6.0.12.10 +types-pyyaml==6.0.1 # via responses typing-extensions==4.6.2 # via diff --git a/requirements/static/pkg/py3.10/darwin.txt b/requirements/static/pkg/py3.10/darwin.txt index cc90197cb37..123ac519c63 100644 --- a/requirements/static/pkg/py3.10/darwin.txt +++ b/requirements/static/pkg/py3.10/darwin.txt @@ -92,7 +92,7 @@ python-gnupg==0.5.0 # via -r requirements/darwin.txt pytz==2023.3 # via tempora -pyyaml==6.0 +pyyaml==6.0.1 # via -r requirements/base.txt pyzmq==25.1.0 # via -r requirements/zeromq.txt diff --git a/requirements/static/pkg/py3.10/freebsd.txt b/requirements/static/pkg/py3.10/freebsd.txt index d72e5dfcfc2..5ae7d5d54d9 100644 --- a/requirements/static/pkg/py3.10/freebsd.txt +++ b/requirements/static/pkg/py3.10/freebsd.txt @@ -85,7 +85,7 @@ python-gnupg==0.5.0 # via -r requirements/static/pkg/freebsd.in pytz==2023.3 # via tempora -pyyaml==6.0 +pyyaml==6.0.1 # via -r requirements/base.txt pyzmq==25.1.0 # via -r requirements/zeromq.txt diff --git a/requirements/static/pkg/py3.10/linux.txt b/requirements/static/pkg/py3.10/linux.txt index ff9b1fd62b7..64e46c2317b 100644 --- a/requirements/static/pkg/py3.10/linux.txt +++ b/requirements/static/pkg/py3.10/linux.txt @@ -82,7 +82,7 @@ python-gnupg==0.5.0 # via -r requirements/static/pkg/linux.in pytz==2023.3 # via tempora -pyyaml==6.0 +pyyaml==6.0.1 # via -r requirements/base.txt pyzmq==25.1.0 # via -r requirements/zeromq.txt diff --git a/requirements/static/pkg/py3.10/windows.txt b/requirements/static/pkg/py3.10/windows.txt index b143b88f088..c48050a5a5b 100644 --- a/requirements/static/pkg/py3.10/windows.txt +++ b/requirements/static/pkg/py3.10/windows.txt @@ -107,7 +107,7 @@ pywin32==306 # via # -r requirements/windows.txt # wmi -pyyaml==6.0 +pyyaml==6.0.1 # via -r requirements/base.txt pyzmq==25.1.0 # via -r requirements/zeromq.txt diff --git a/requirements/static/pkg/py3.11/darwin.txt b/requirements/static/pkg/py3.11/darwin.txt index 31c65b39152..aa2027fc2b8 100644 --- a/requirements/static/pkg/py3.11/darwin.txt +++ b/requirements/static/pkg/py3.11/darwin.txt @@ -92,7 +92,7 @@ python-gnupg==0.5.0 # via -r requirements/darwin.txt pytz==2023.3 # via tempora -pyyaml==6.0 +pyyaml==6.0.1 # via -r requirements/base.txt pyzmq==25.1.0 # via -r requirements/zeromq.txt diff --git a/requirements/static/pkg/py3.11/freebsd.txt b/requirements/static/pkg/py3.11/freebsd.txt index 95cf9f232e9..af78d572d79 100644 --- a/requirements/static/pkg/py3.11/freebsd.txt +++ b/requirements/static/pkg/py3.11/freebsd.txt @@ -85,7 +85,7 @@ python-gnupg==0.5.0 # via -r requirements/static/pkg/freebsd.in pytz==2023.3 # via tempora -pyyaml==6.0 +pyyaml==6.0.1 # via -r requirements/base.txt pyzmq==25.1.0 # via -r requirements/zeromq.txt diff --git a/requirements/static/pkg/py3.11/linux.txt b/requirements/static/pkg/py3.11/linux.txt index 528343309ce..231e1af95dc 100644 --- a/requirements/static/pkg/py3.11/linux.txt +++ b/requirements/static/pkg/py3.11/linux.txt @@ -82,7 +82,7 @@ python-gnupg==0.5.0 # via -r requirements/static/pkg/linux.in pytz==2023.3 # via tempora -pyyaml==6.0 +pyyaml==6.0.1 # via -r requirements/base.txt pyzmq==25.1.0 # via -r requirements/zeromq.txt diff --git a/requirements/static/pkg/py3.11/windows.txt b/requirements/static/pkg/py3.11/windows.txt index 7c4867bcd76..9de73ab2633 100644 --- a/requirements/static/pkg/py3.11/windows.txt +++ b/requirements/static/pkg/py3.11/windows.txt @@ -107,7 +107,7 @@ pywin32==306 # via # -r requirements/windows.txt # wmi -pyyaml==6.0 +pyyaml==6.0.1 # via -r requirements/base.txt pyzmq==25.1.0 # via -r requirements/zeromq.txt diff --git a/requirements/static/pkg/py3.8/freebsd.txt b/requirements/static/pkg/py3.8/freebsd.txt index fcae5a464c8..f2aaf71b11a 100644 --- a/requirements/static/pkg/py3.8/freebsd.txt +++ b/requirements/static/pkg/py3.8/freebsd.txt @@ -85,7 +85,7 @@ python-gnupg==0.5.0 # via -r requirements/static/pkg/freebsd.in pytz==2023.3 # via tempora -pyyaml==6.0 +pyyaml==6.0.1 # via -r requirements/base.txt pyzmq==25.1.0 # via -r requirements/zeromq.txt diff --git a/requirements/static/pkg/py3.8/linux.txt b/requirements/static/pkg/py3.8/linux.txt index 5487df5aa0e..8912b469110 100644 --- a/requirements/static/pkg/py3.8/linux.txt +++ b/requirements/static/pkg/py3.8/linux.txt @@ -84,7 +84,7 @@ python-gnupg==0.5.0 # via -r requirements/static/pkg/linux.in pytz==2023.3 # via tempora -pyyaml==6.0 +pyyaml==6.0.1 # via -r requirements/base.txt pyzmq==25.1.0 # via -r requirements/zeromq.txt diff --git a/requirements/static/pkg/py3.8/windows.txt b/requirements/static/pkg/py3.8/windows.txt index c7ba5b414a0..ac0efb8dc17 100644 --- a/requirements/static/pkg/py3.8/windows.txt +++ b/requirements/static/pkg/py3.8/windows.txt @@ -110,7 +110,7 @@ pywin32==306 # -r requirements/windows.txt # cherrypy # wmi -pyyaml==6.0 +pyyaml==6.0.1 # via -r requirements/base.txt pyzmq==25.1.0 # via -r requirements/zeromq.txt diff --git a/requirements/static/pkg/py3.9/darwin.txt b/requirements/static/pkg/py3.9/darwin.txt index eaeabcd3e07..8fdc6306755 100644 --- a/requirements/static/pkg/py3.9/darwin.txt +++ b/requirements/static/pkg/py3.9/darwin.txt @@ -92,7 +92,7 @@ python-gnupg==0.5.0 # via -r requirements/darwin.txt pytz==2023.3 # via tempora -pyyaml==6.0 +pyyaml==6.0.1 # via -r requirements/base.txt pyzmq==25.1.0 # via -r requirements/zeromq.txt diff --git a/requirements/static/pkg/py3.9/freebsd.txt b/requirements/static/pkg/py3.9/freebsd.txt index fda245c8c7d..635b93741d2 100644 --- a/requirements/static/pkg/py3.9/freebsd.txt +++ b/requirements/static/pkg/py3.9/freebsd.txt @@ -85,7 +85,7 @@ python-gnupg==0.5.0 # via -r requirements/static/pkg/freebsd.in pytz==2023.3 # via tempora -pyyaml==6.0 +pyyaml==6.0.1 # via -r requirements/base.txt pyzmq==25.1.0 # via -r requirements/zeromq.txt diff --git a/requirements/static/pkg/py3.9/linux.txt b/requirements/static/pkg/py3.9/linux.txt index 940f3953023..176dece0554 100644 --- a/requirements/static/pkg/py3.9/linux.txt +++ b/requirements/static/pkg/py3.9/linux.txt @@ -82,7 +82,7 @@ python-gnupg==0.5.0 # via -r requirements/static/pkg/linux.in pytz==2023.3 # via tempora -pyyaml==6.0 +pyyaml==6.0.1 # via -r requirements/base.txt pyzmq==25.1.0 # via -r requirements/zeromq.txt diff --git a/requirements/static/pkg/py3.9/windows.txt b/requirements/static/pkg/py3.9/windows.txt index 1d15e16e7fe..93019e26825 100644 --- a/requirements/static/pkg/py3.9/windows.txt +++ b/requirements/static/pkg/py3.9/windows.txt @@ -108,7 +108,7 @@ pywin32==306 # -r requirements/windows.txt # cherrypy # wmi -pyyaml==6.0 +pyyaml==6.0.1 # via -r requirements/base.txt pyzmq==25.1.0 # via -r requirements/zeromq.txt From 2450240d5cec3b049222fd2ac96c8bb64845d3fe Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Tue, 18 Jul 2023 17:38:08 +0100 Subject: [PATCH 130/393] Bump a few requirements that got downgraded in the merge forward Signed-off-by: Pedro Algarvio --- requirements/static/ci/py3.10/cloud.txt | 5 ++--- requirements/static/ci/py3.10/freebsd.txt | 2 +- requirements/static/ci/py3.11/freebsd.txt | 2 +- requirements/static/ci/py3.8/cloud.txt | 5 ++--- requirements/static/ci/py3.8/freebsd.txt | 2 +- requirements/static/ci/py3.9/cloud.txt | 5 ++--- requirements/static/ci/py3.9/freebsd.txt | 2 +- requirements/static/pkg/py3.10/freebsd.txt | 2 +- requirements/static/pkg/py3.11/freebsd.txt | 2 +- requirements/static/pkg/py3.8/freebsd.txt | 2 +- requirements/static/pkg/py3.9/freebsd.txt | 2 +- 11 files changed, 14 insertions(+), 17 deletions(-) diff --git a/requirements/static/ci/py3.10/cloud.txt b/requirements/static/ci/py3.10/cloud.txt index dd36a14a290..345419d5c78 100644 --- a/requirements/static/ci/py3.10/cloud.txt +++ b/requirements/static/ci/py3.10/cloud.txt @@ -34,8 +34,6 @@ netaddr==0.8.0 # via # -c requirements/static/ci/py3.10/linux.txt # -r requirements/static/ci/cloud.in -ntlm-auth==1.5.0 - # via requests-ntlm profitbricks==4.1.3 # via -r requirements/static/ci/cloud.in pycparser==2.21 @@ -47,10 +45,11 @@ pypsexec==0.3.0 pyspnego==0.9.0 # via # -r requirements/static/ci/cloud.in + # requests-ntlm # smbprotocol pywinrm==0.4.3 # via -r requirements/static/ci/cloud.in -requests-ntlm==1.1.0 +requests-ntlm==1.2.0 # via pywinrm requests==2.31.0 # via diff --git a/requirements/static/ci/py3.10/freebsd.txt b/requirements/static/ci/py3.10/freebsd.txt index 7c3360eca33..122f8c948de 100644 --- a/requirements/static/ci/py3.10/freebsd.txt +++ b/requirements/static/ci/py3.10/freebsd.txt @@ -100,7 +100,7 @@ cryptography==41.0.2 # vcert distlib==0.3.6 # via virtualenv -distro==1.5.0 +distro==1.8.0 # via # -c requirements/static/ci/../pkg/py3.10/freebsd.txt # -r requirements/base.txt diff --git a/requirements/static/ci/py3.11/freebsd.txt b/requirements/static/ci/py3.11/freebsd.txt index 8b201cc960e..20e04b2a23b 100644 --- a/requirements/static/ci/py3.11/freebsd.txt +++ b/requirements/static/ci/py3.11/freebsd.txt @@ -100,7 +100,7 @@ cryptography==41.0.2 # vcert distlib==0.3.6 # via virtualenv -distro==1.5.0 +distro==1.8.0 # via # -c requirements/static/ci/../pkg/py3.11/freebsd.txt # -r requirements/base.txt diff --git a/requirements/static/ci/py3.8/cloud.txt b/requirements/static/ci/py3.8/cloud.txt index a56e8d489d4..2e23fd87195 100644 --- a/requirements/static/ci/py3.8/cloud.txt +++ b/requirements/static/ci/py3.8/cloud.txt @@ -34,8 +34,6 @@ netaddr==0.8.0 # via # -c requirements/static/ci/py3.8/linux.txt # -r requirements/static/ci/cloud.in -ntlm-auth==1.5.0 - # via requests-ntlm profitbricks==4.1.3 # via -r requirements/static/ci/cloud.in pycparser==2.21 @@ -47,10 +45,11 @@ pypsexec==0.3.0 pyspnego==0.9.0 # via # -r requirements/static/ci/cloud.in + # requests-ntlm # smbprotocol pywinrm==0.4.3 # via -r requirements/static/ci/cloud.in -requests-ntlm==1.1.0 +requests-ntlm==1.2.0 # via pywinrm requests==2.31.0 # via diff --git a/requirements/static/ci/py3.8/freebsd.txt b/requirements/static/ci/py3.8/freebsd.txt index ea147bf867f..0f9e18f052e 100644 --- a/requirements/static/ci/py3.8/freebsd.txt +++ b/requirements/static/ci/py3.8/freebsd.txt @@ -100,7 +100,7 @@ cryptography==41.0.2 # vcert distlib==0.3.6 # via virtualenv -distro==1.5.0 +distro==1.8.0 # via # -c requirements/static/ci/../pkg/py3.8/freebsd.txt # -r requirements/base.txt diff --git a/requirements/static/ci/py3.9/cloud.txt b/requirements/static/ci/py3.9/cloud.txt index 25b1d1f5532..bd93f13e1fe 100644 --- a/requirements/static/ci/py3.9/cloud.txt +++ b/requirements/static/ci/py3.9/cloud.txt @@ -34,8 +34,6 @@ netaddr==0.8.0 # via # -c requirements/static/ci/py3.9/linux.txt # -r requirements/static/ci/cloud.in -ntlm-auth==1.5.0 - # via requests-ntlm profitbricks==4.1.3 # via -r requirements/static/ci/cloud.in pycparser==2.21 @@ -47,10 +45,11 @@ pypsexec==0.3.0 pyspnego==0.9.0 # via # -r requirements/static/ci/cloud.in + # requests-ntlm # smbprotocol pywinrm==0.4.3 # via -r requirements/static/ci/cloud.in -requests-ntlm==1.1.0 +requests-ntlm==1.2.0 # via pywinrm requests==2.31.0 # via diff --git a/requirements/static/ci/py3.9/freebsd.txt b/requirements/static/ci/py3.9/freebsd.txt index 88524ce88a4..4c198da19f5 100644 --- a/requirements/static/ci/py3.9/freebsd.txt +++ b/requirements/static/ci/py3.9/freebsd.txt @@ -100,7 +100,7 @@ cryptography==41.0.2 # vcert distlib==0.3.6 # via virtualenv -distro==1.5.0 +distro==1.8.0 # via # -c requirements/static/ci/../pkg/py3.9/freebsd.txt # -r requirements/base.txt diff --git a/requirements/static/pkg/py3.10/freebsd.txt b/requirements/static/pkg/py3.10/freebsd.txt index b2db07d02bc..4ad7475dfda 100644 --- a/requirements/static/pkg/py3.10/freebsd.txt +++ b/requirements/static/pkg/py3.10/freebsd.txt @@ -22,7 +22,7 @@ cryptography==41.0.2 # via # -r requirements/crypto.txt # pyopenssl -distro==1.5.0 +distro==1.8.0 # via # -r requirements/base.txt # -r requirements/static/pkg/freebsd.in diff --git a/requirements/static/pkg/py3.11/freebsd.txt b/requirements/static/pkg/py3.11/freebsd.txt index fb3e421f580..d7fc4f50145 100644 --- a/requirements/static/pkg/py3.11/freebsd.txt +++ b/requirements/static/pkg/py3.11/freebsd.txt @@ -22,7 +22,7 @@ cryptography==41.0.2 # via # -r requirements/crypto.txt # pyopenssl -distro==1.5.0 +distro==1.8.0 # via # -r requirements/base.txt # -r requirements/static/pkg/freebsd.in diff --git a/requirements/static/pkg/py3.8/freebsd.txt b/requirements/static/pkg/py3.8/freebsd.txt index 794a7d0c2ea..c3948f2b505 100644 --- a/requirements/static/pkg/py3.8/freebsd.txt +++ b/requirements/static/pkg/py3.8/freebsd.txt @@ -22,7 +22,7 @@ cryptography==41.0.2 # via # -r requirements/crypto.txt # pyopenssl -distro==1.5.0 +distro==1.8.0 # via # -r requirements/base.txt # -r requirements/static/pkg/freebsd.in diff --git a/requirements/static/pkg/py3.9/freebsd.txt b/requirements/static/pkg/py3.9/freebsd.txt index 0e2dd9743f3..f32bed56424 100644 --- a/requirements/static/pkg/py3.9/freebsd.txt +++ b/requirements/static/pkg/py3.9/freebsd.txt @@ -22,7 +22,7 @@ cryptography==41.0.2 # via # -r requirements/crypto.txt # pyopenssl -distro==1.5.0 +distro==1.8.0 # via # -r requirements/base.txt # -r requirements/static/pkg/freebsd.in From 22d7145d4fb33149d5e7e078d334207d0938d1f3 Mon Sep 17 00:00:00 2001 From: ScriptAutomate Date: Tue, 18 Jul 2023 15:40:22 -0500 Subject: [PATCH 131/393] Update Slack invite link and VMware Aria ref --- .github/config.yml | 4 ++-- CONTRIBUTING.rst | 2 +- README.rst | 9 +++++---- SUPPORT.rst | 2 +- doc/conf.py | 2 +- 5 files changed, 10 insertions(+), 9 deletions(-) diff --git a/.github/config.yml b/.github/config.yml index 633569da991..94b18535bce 100644 --- a/.github/config.yml +++ b/.github/config.yml @@ -13,7 +13,7 @@ newIssueWelcomeComment: > - [Community Wiki](https://github.com/saltstack/community/wiki) - [Salt’s Contributor Guide](https://docs.saltproject.io/en/master/topics/development/contributing.html) - - [Join our Community Slack](https://join.slack.com/t/saltstackcommunity/shared_invite/zt-3av8jjyf-oBQ2M0vhXOhJpNpRkPWBvg) + - [Join our Community Slack](https://join.slack.com/t/saltstackcommunity/shared_invite/zt-1zlfxffs1-NuEH~G9TzOeuNGdsfZIl3w) - [IRC on LiberaChat](https://web.libera.chat/#salt) - [Salt Project YouTube channel](https://www.youtube.com/channel/UCpveTIucFx9ljGelW63-BWg) - [Salt Project Twitch channel](https://www.twitch.tv/saltprojectoss) @@ -39,7 +39,7 @@ newPRWelcomeComment: > - [Community Wiki](https://github.com/saltstack/community/wiki) - [Salt’s Contributor Guide](https://docs.saltproject.io/en/master/topics/development/contributing.html) - - [Join our Community Slack](https://join.slack.com/t/saltstackcommunity/shared_invite/zt-3av8jjyf-oBQ2M0vhXOhJpNpRkPWBvg) + - [Join our Community Slack](https://join.slack.com/t/saltstackcommunity/shared_invite/zt-1zlfxffs1-NuEH~G9TzOeuNGdsfZIl3w) - [IRC on LiberaChat](https://web.libera.chat/#salt) - [Salt Project YouTube channel](https://www.youtube.com/channel/UCpveTIucFx9ljGelW63-BWg) - [Salt Project Twitch channel](https://www.twitch.tv/saltprojectoss) diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index 5903a856723..80d03514945 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -8,7 +8,7 @@ in a number of ways: - Use Salt and open well-written bug reports. - Join a `working group `__. - Answer questions on `irc `__, - the `community Slack `__, + the `community Slack `__, the `salt-users mailing list `__, `Server Fault `__, diff --git a/README.rst b/README.rst index f5121f1a74d..6673d59ce9a 100644 --- a/README.rst +++ b/README.rst @@ -12,7 +12,7 @@ .. image:: https://img.shields.io/badge/slack-@saltstackcommunity-blue.svg?logo=slack :alt: Salt Project Slack Community - :target: https://join.slack.com/t/saltstackcommunity/shared_invite/zt-3av8jjyf-oBQ2M0vhXOhJpNpRkPWBvg + :target: https://join.slack.com/t/saltstackcommunity/shared_invite/zt-1zlfxffs1-NuEH~G9TzOeuNGdsfZIl3w .. image:: https://img.shields.io/twitch/status/saltprojectoss :alt: Salt Project Twitch Channel @@ -71,7 +71,8 @@ In addition to configuration management Salt can also: About our sponsors ================== -Salt powers VMware's `vRealize Automation SaltStack Config`_, and can be found +Salt powers VMware's `VMware Aria Automation Config`_ +(previously vRealize Automation SaltStack Config / SaltStack Enterprise), and can be found under the hood of products from Juniper, Cisco, Cloudflare, Nutanix, SUSE, and Tieto, to name a few. @@ -179,8 +180,8 @@ used by external modules. A complete list of attributions and dependencies can be found here: `salt/DEPENDENCIES.md `_ -.. _Salt Project Community Slack: https://join.slack.com/t/saltstackcommunity/shared_invite/zt-3av8jjyf-oBQ2M0vhXOhJpNpRkPWBvg -.. _vRealize Automation SaltStack Config: https://www.vmware.com/products/vrealize-automation/saltstack-config.html +.. _Salt Project Community Slack: https://join.slack.com/t/saltstackcommunity/shared_invite/zt-1zlfxffs1-NuEH~G9TzOeuNGdsfZIl3w +.. _VMware Aria Automation Config: https://www.vmware.com/products/vrealize-automation/saltstack-config.html .. _Latest Salt Documentation: https://docs.saltproject.io/en/latest/ .. _Open an issue: https://github.com/saltstack/salt/issues/new/choose .. _SECURITY.md: https://github.com/saltstack/salt/blob/master/SECURITY.md diff --git a/SUPPORT.rst b/SUPPORT.rst index bfe9d1cbeae..d74336a5ab0 100644 --- a/SUPPORT.rst +++ b/SUPPORT.rst @@ -11,7 +11,7 @@ it may take a few moments for someone to reply. **SaltStack Slack** - Alongside IRC is our SaltStack Community Slack for the SaltStack Working groups. Use the following link to request an invitation. -``_ +``_ **Mailing List** - The SaltStack community users mailing list is hosted by Google groups. Anyone can post to ask questions about SaltStack products and diff --git a/doc/conf.py b/doc/conf.py index 653d912c20d..2a0b6d1125d 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -174,7 +174,7 @@ rst_prolog = """\ .. _`salt-users`: https://groups.google.com/forum/#!forum/salt-users .. _`salt-announce`: https://groups.google.com/forum/#!forum/salt-announce .. _`salt-packagers`: https://groups.google.com/forum/#!forum/salt-packagers -.. _`salt-slack`: https://join.slack.com/t/saltstackcommunity/shared_invite/zt-3av8jjyf-oBQ2M0vhXOhJpNpRkPWBvg +.. _`salt-slack`: https://join.slack.com/t/saltstackcommunity/shared_invite/zt-1zlfxffs1-NuEH~G9TzOeuNGdsfZIl3w .. |windownload| raw:: html

Python3 x86: Date: Mon, 17 Jul 2023 16:59:43 -0400 Subject: [PATCH 132/393] Add `tools vm list` command --- tools/vm.py | 54 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/tools/vm.py b/tools/vm.py index f7b2837ae1b..a52281f74df 100644 --- a/tools/vm.py +++ b/tools/vm.py @@ -563,6 +563,60 @@ def download_artifacts(ctx: Context, name: str): vm.download_artifacts() +@vm.command( + name="list", + arguments={ + "key_name": {"help": "The SSH key name."}, + }, +) +def list_vms( + ctx: Context, + key_name: str = os.environ.get("RUNNER_NAME"), # type: ignore[assignment] +): + """ + List the vms associated with the given key. + """ + if key_name is None: + ctx.exit(1, "We need a key name to filter the instances by.") + ec2 = boto3.resource("ec2", region_name=ctx.parser.options.region) + # First let's get the instances on AWS associated with the key given + filters = [ + {"Name": "key-name", "Values": [key_name]}, + ] + try: + instances = list( + ec2.instances.filter( + Filters=filters, + ) + ) + except ClientError as exc: + if "RequestExpired" not in str(exc): + raise + ctx.error(str(exc)) + ctx.exit(1) + + for instance in instances: + state = instance.state["Name"] + ip_addr = instance.public_ip_address + ami = instance.image_id + vm_name = None + for tag in instance.tags: + if tag.get("Key") == "vm-name": + vm_name = tag.get("Value") + break + + if vm_name is not None: + sep = "\n " + extra_info = { + "IP": ip_addr, + "AMI": ami, + } + extras = sep + sep.join( + [f"{key}: {value}" for key, value in extra_info.items()] + ) + log.info(f"{vm_name} ({state}){extras}") + + @attr.s(frozen=True, kw_only=True) class AMIConfig: ami: str = attr.ib() From 6d5e8ce8874a33131505270315a851587ba7cf2c Mon Sep 17 00:00:00 2001 From: MKLeb Date: Mon, 17 Jul 2023 17:28:56 -0400 Subject: [PATCH 133/393] Add states filtering --- tools/vm.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/tools/vm.py b/tools/vm.py index a52281f74df..6e620e37bea 100644 --- a/tools/vm.py +++ b/tools/vm.py @@ -567,11 +567,17 @@ def download_artifacts(ctx: Context, name: str): name="list", arguments={ "key_name": {"help": "The SSH key name."}, + "states": { + "help": "The instance state to filter by.", + "flags": ["-s", "-state"], + "action": "append", + }, }, ) def list_vms( ctx: Context, key_name: str = os.environ.get("RUNNER_NAME"), # type: ignore[assignment] + states: set[str] = None, ): """ List the vms associated with the given key. @@ -596,7 +602,10 @@ def list_vms( ctx.exit(1) for instance in instances: - state = instance.state["Name"] + vm_state = instance.state["Name"] + # Filter by wanted states + if states and vm_state not in states: + continue ip_addr = instance.public_ip_address ami = instance.image_id vm_name = None @@ -614,7 +623,7 @@ def list_vms( extras = sep + sep.join( [f"{key}: {value}" for key, value in extra_info.items()] ) - log.info(f"{vm_name} ({state}){extras}") + log.info(f"{vm_name} ({vm_state}){extras}") @attr.s(frozen=True, kw_only=True) From 86719a68b5f9c67957a3272a259dfe08e2aa0ae4 Mon Sep 17 00:00:00 2001 From: MKLeb Date: Tue, 18 Jul 2023 15:11:18 -0400 Subject: [PATCH 134/393] Add sync-cache command to make the stored state of the machine match up to what ec2 has for all running machines --- tools/vm.py | 99 +++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 78 insertions(+), 21 deletions(-) diff --git a/tools/vm.py b/tools/vm.py index 6e620e37bea..ea1566fc74d 100644 --- a/tools/vm.py +++ b/tools/vm.py @@ -563,6 +563,52 @@ def download_artifacts(ctx: Context, name: str): vm.download_artifacts() +@vm.command( + name="sync-cache", + arguments={ + "key_name": {"help": "The SSH key name."}, + }, +) +def sync_cache( + ctx: Context, + key_name: str = os.environ.get("RUNNER_NAME"), # type: ignore[assignment] +): + """ + Sync the cache + """ + ec2_instances = _filter_instances_by_state( + _get_instances_by_key(ctx, key_name), + {"running"}, + ) + + cached_instances = {} + if STATE_DIR.exists(): + for state_path in STATE_DIR.iterdir(): + instance_id = (state_path / "instance-id").read_text() + cached_instances[instance_id] = state_path.name + + # Find what instances we are missing in our cached states + to_write = {} + to_remove = cached_instances.copy() + for instance in ec2_instances: + if instance.id not in cached_instances: + for tag in instance.tags: + if tag.get("Key") == "vm-name": + to_write[tag.get("Value")] = instance + break + else: + del to_remove[instance.id] + + for cached_id, vm_name in to_remove.items(): + shutil.rmtree(STATE_DIR / vm_name) + log.info(f"REMOVED {vm_name} ({cached_id}) from cache at {STATE_DIR / vm_name}") + + for name_tag, vm_instance in to_write.items(): + vm_write = VM(ctx=ctx, name=name_tag, region_name=ctx.parser.options.region) + vm_write.instance = vm_instance + vm_write.write_state() + + @vm.command( name="list", arguments={ @@ -582,30 +628,13 @@ def list_vms( """ List the vms associated with the given key. """ - if key_name is None: - ctx.exit(1, "We need a key name to filter the instances by.") - ec2 = boto3.resource("ec2", region_name=ctx.parser.options.region) - # First let's get the instances on AWS associated with the key given - filters = [ - {"Name": "key-name", "Values": [key_name]}, - ] - try: - instances = list( - ec2.instances.filter( - Filters=filters, - ) - ) - except ClientError as exc: - if "RequestExpired" not in str(exc): - raise - ctx.error(str(exc)) - ctx.exit(1) + instances = _filter_instances_by_state( + _get_instances_by_key(ctx, key_name), + states, + ) for instance in instances: vm_state = instance.state["Name"] - # Filter by wanted states - if states and vm_state not in states: - continue ip_addr = instance.public_ip_address ami = instance.image_id vm_name = None @@ -626,6 +655,34 @@ def list_vms( log.info(f"{vm_name} ({vm_state}){extras}") +def _get_instances_by_key(ctx: Context, key_name: str): + if key_name is None: + ctx.exit(1, "We need a key name to filter the instances by.") + ec2 = boto3.resource("ec2", region_name=ctx.parser.options.region) + # First let's get the instances on AWS associated with the key given + filters = [ + {"Name": "key-name", "Values": [key_name]}, + ] + try: + instances = list( + ec2.instances.filter( + Filters=filters, + ) + ) + except ClientError as exc: + if "RequestExpired" not in str(exc): + raise + ctx.error(str(exc)) + ctx.exit(1) + return instances + + +def _filter_instances_by_state(instances: list[Instance], states: set[str] | None): + if states is None: + return instances + return [instance for instance in instances if instance.state["Name"] in states] + + @attr.s(frozen=True, kw_only=True) class AMIConfig: ami: str = attr.ib() From 4e90e0e7fe94913e98ebb9806a35c88a5fb9776b Mon Sep 17 00:00:00 2001 From: MKLeb Date: Tue, 18 Jul 2023 15:41:56 -0400 Subject: [PATCH 135/393] Add `--delete` option to `tools vm sync-cache` to force the user to know that they are deleting cache entries that are no longer valid --- tools/vm.py | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/tools/vm.py b/tools/vm.py index ea1566fc74d..ac03674cd68 100644 --- a/tools/vm.py +++ b/tools/vm.py @@ -567,11 +567,16 @@ def download_artifacts(ctx: Context, name: str): name="sync-cache", arguments={ "key_name": {"help": "The SSH key name."}, + "delete": { + "help": "Delete the entries in the cache that don't align with ec2", + "action": "store_true", + }, }, ) def sync_cache( ctx: Context, key_name: str = os.environ.get("RUNNER_NAME"), # type: ignore[assignment] + delete: bool = False, ): """ Sync the cache @@ -600,8 +605,17 @@ def sync_cache( del to_remove[instance.id] for cached_id, vm_name in to_remove.items(): - shutil.rmtree(STATE_DIR / vm_name) - log.info(f"REMOVED {vm_name} ({cached_id}) from cache at {STATE_DIR / vm_name}") + if delete: + shutil.rmtree(STATE_DIR / vm_name) + log.info( + f"REMOVED {vm_name} ({cached_id.strip()}) from cache at {STATE_DIR / vm_name}" + ) + else: + log.info( + f"Would remove {vm_name} ({cached_id.strip()}) from cache at {STATE_DIR / vm_name}" + ) + if not delete and to_remove: + log.info("To force the removal of the above cache entries, pass --delete") for name_tag, vm_instance in to_write.items(): vm_write = VM(ctx=ctx, name=name_tag, region_name=ctx.parser.options.region) From fd09ab7efb29d83223002dfa3526db36c5b23574 Mon Sep 17 00:00:00 2001 From: Tim Hildebrandt <118898773+TimHiCe@users.noreply.github.com> Date: Tue, 6 Jun 2023 18:18:54 +0200 Subject: [PATCH 136/393] Update chocolatey.py / Search for choco.exe chocolatey.exe was renamed to choco.exe by Chocolatey in Version 2.0.0 --- salt/modules/chocolatey.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/salt/modules/chocolatey.py b/salt/modules/chocolatey.py index caa7b0bae8f..dc3dd62f651 100644 --- a/salt/modules/chocolatey.py +++ b/salt/modules/chocolatey.py @@ -111,6 +111,9 @@ def _find_chocolatey(): os.path.join( os.environ.get("ProgramData"), "Chocolatey", "bin", "chocolatey.exe" ), + os.path.join( + os.environ.get("ProgramData"), "Chocolatey", "bin", "choco.exe" + ), os.path.join( os.environ.get("SystemDrive"), "Chocolatey", "bin", "chocolatey.bat" ), From 52da6c2b589ede50b659031213e8675782ec0e84 Mon Sep 17 00:00:00 2001 From: Tim Hildebrandt <118898773+TimHiCe@users.noreply.github.com> Date: Thu, 8 Jun 2023 18:34:23 +0200 Subject: [PATCH 137/393] Update chocolatey.py Change environ key of new lication to "ProgramDataChoco" to not overwrite the environ of the chocolatey.exe path. --- salt/modules/chocolatey.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/salt/modules/chocolatey.py b/salt/modules/chocolatey.py index dc3dd62f651..ff903632518 100644 --- a/salt/modules/chocolatey.py +++ b/salt/modules/chocolatey.py @@ -112,7 +112,7 @@ def _find_chocolatey(): os.environ.get("ProgramData"), "Chocolatey", "bin", "chocolatey.exe" ), os.path.join( - os.environ.get("ProgramData"), "Chocolatey", "bin", "choco.exe" + os.environ.get("ProgramDataChoco"), "Chocolatey", "bin", "choco.exe" ), os.path.join( os.environ.get("SystemDrive"), "Chocolatey", "bin", "chocolatey.bat" From 45e1ee93688bef5e0eff8c62893a2c7949fe4ef0 Mon Sep 17 00:00:00 2001 From: Tim Hildebrandt <118898773+TimHiCe@users.noreply.github.com> Date: Thu, 8 Jun 2023 18:58:24 +0200 Subject: [PATCH 138/393] Update test_chocolatey.py Add test for choco.exe in ProgramData --- tests/pytests/unit/modules/test_chocolatey.py | 28 +++++++++++++++++-- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/tests/pytests/unit/modules/test_chocolatey.py b/tests/pytests/unit/modules/test_chocolatey.py index e9adc167b70..2d09185b23f 100644 --- a/tests/pytests/unit/modules/test_chocolatey.py +++ b/tests/pytests/unit/modules/test_chocolatey.py @@ -25,12 +25,19 @@ def choco_path(): @pytest.fixture(scope="module") -def choco_path_pd(): +def chocolatey_path_pd(): return os.path.join( os.environ.get("ProgramData"), "Chocolatey", "bin", "chocolatey.exe" ) +@pytest.fixture(scope="module") +def choco_path_pd(): + return os.path.join( + os.environ.get("ProgramData"), "Chocolatey", "bin", "choco.exe" + ) + + @pytest.fixture(scope="module") def choco_path_sd(): return os.path.join( @@ -133,9 +140,24 @@ def test__find_chocolatey_which(choco_path): assert chocolatey.__context__["chocolatey._path"] == expected -def test__find_chocolatey_programdata(mock_false, mock_true, choco_path_pd): +def test__find_chocolatey_programdata(mock_false, mock_true, chocolatey_path_pd): """ - Test _find_chocolatey when found in ProgramData + Test _find_chocolatey when found in ProgramData and named chocolatey.exe + """ + with patch.dict(chocolatey.__salt__, {"cmd.which": mock_false}), patch( + "os.path.isfile", mock_true + ): + result = chocolatey._find_chocolatey() + expected = choco_path_pd + # Does it return the correct path + assert result == expected + # Does it populate __context__ + assert chocolatey.__context__["chocolatey._path"] == expected + + +def test__find_choco_programdata(mock_false, mock_true, choco_path_pd): + """ + Test _find_chocolatey when found in ProgramData and named choco.exe """ with patch.dict(chocolatey.__salt__, {"cmd.which": mock_false}), patch( "os.path.isfile", mock_true From 11b3b913e893cf5b014e718d52c8b2e8f08009c1 Mon Sep 17 00:00:00 2001 From: Tim Hildebrandt <118898773+TimHiCe@users.noreply.github.com> Date: Thu, 8 Jun 2023 20:32:35 +0200 Subject: [PATCH 139/393] Update chocolatey.py Bug Fix the last commit --- salt/modules/chocolatey.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/salt/modules/chocolatey.py b/salt/modules/chocolatey.py index ff903632518..dc3dd62f651 100644 --- a/salt/modules/chocolatey.py +++ b/salt/modules/chocolatey.py @@ -112,7 +112,7 @@ def _find_chocolatey(): os.environ.get("ProgramData"), "Chocolatey", "bin", "chocolatey.exe" ), os.path.join( - os.environ.get("ProgramDataChoco"), "Chocolatey", "bin", "choco.exe" + os.environ.get("ProgramData"), "Chocolatey", "bin", "choco.exe" ), os.path.join( os.environ.get("SystemDrive"), "Chocolatey", "bin", "chocolatey.bat" From 7b07640b32581836cc27cfd618c83cac4f56b7d1 Mon Sep 17 00:00:00 2001 From: Tim Hildebrandt <118898773+TimHiCe@users.noreply.github.com> Date: Thu, 8 Jun 2023 20:40:55 +0200 Subject: [PATCH 140/393] Add changelog --- changelog/64427.fixed.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog/64427.fixed.md diff --git a/changelog/64427.fixed.md b/changelog/64427.fixed.md new file mode 100644 index 00000000000..74f5b125579 --- /dev/null +++ b/changelog/64427.fixed.md @@ -0,0 +1 @@ +Add search for %ProgramData%\Chocolatey\choco.exe to determine if Chocolatey is installed or not From e8ccb262a612b645fb965bc3217b102ad404f467 Mon Sep 17 00:00:00 2001 From: twangboy Date: Thu, 29 Jun 2023 16:13:14 -0600 Subject: [PATCH 141/393] Fix pre-commit --- salt/modules/chocolatey.py | 16 +++++++--------- tests/pytests/unit/modules/test_chocolatey.py | 4 +--- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/salt/modules/chocolatey.py b/salt/modules/chocolatey.py index dc3dd62f651..06794946d55 100644 --- a/salt/modules/chocolatey.py +++ b/salt/modules/chocolatey.py @@ -111,9 +111,7 @@ def _find_chocolatey(): os.path.join( os.environ.get("ProgramData"), "Chocolatey", "bin", "chocolatey.exe" ), - os.path.join( - os.environ.get("ProgramData"), "Chocolatey", "bin", "choco.exe" - ), + os.path.join(os.environ.get("ProgramData"), "Chocolatey", "bin", "choco.exe"), os.path.join( os.environ.get("SystemDrive"), "Chocolatey", "bin", "chocolatey.bat" ), @@ -210,7 +208,7 @@ def bootstrap(force=False, source=None): except CommandExecutionError: choc_path = None if choc_path and not force: - return "Chocolatey found at {}".format(choc_path) + return f"Chocolatey found at {choc_path}" temp_dir = tempfile.gettempdir() @@ -338,7 +336,7 @@ def bootstrap(force=False, source=None): if not os.path.exists(script): raise CommandExecutionError( - "Failed to find Chocolatey installation script: {}".format(script) + f"Failed to find Chocolatey installation script: {script}" ) # Run the Chocolatey bootstrap @@ -380,7 +378,7 @@ def unbootstrap(): if os.path.exists(choco_dir): log.debug("Removing Chocolatey directory: %s", choco_dir) __salt__["file.remove"](path=choco_dir, force=True) - removed.append("Removed Directory: {}".format(choco_dir)) + removed.append(f"Removed Directory: {choco_dir}") else: known_paths = [ os.path.join(os.environ.get("ProgramData"), "Chocolatey"), @@ -390,7 +388,7 @@ def unbootstrap(): if os.path.exists(path): log.debug("Removing Chocolatey directory: %s", path) __salt__["file.remove"](path=path, force=True) - removed.append("Removed Directory: {}".format(path)) + removed.append(f"Removed Directory: {path}") # Delete all Chocolatey environment variables for env_var in __salt__["environ.items"](): @@ -402,14 +400,14 @@ def unbootstrap(): __salt__["environ.setval"]( key=env_var, val=False, false_unsets=True, permanent="HKCU" ) - removed.append("Removed Environment Var: {}".format(env_var)) + removed.append(f"Removed Environment Var: {env_var}") # Remove Chocolatey from the path: for path in __salt__["win_path.get_path"](): if "chocolatey" in path.lower(): log.debug("Removing Chocolatey path item: %s", path) __salt__["win_path.remove"](path=path, rehash=True) - removed.append("Removed Path Item: {}".format(path)) + removed.append(f"Removed Path Item: {path}") return removed diff --git a/tests/pytests/unit/modules/test_chocolatey.py b/tests/pytests/unit/modules/test_chocolatey.py index 2d09185b23f..74c29d36fe8 100644 --- a/tests/pytests/unit/modules/test_chocolatey.py +++ b/tests/pytests/unit/modules/test_chocolatey.py @@ -33,9 +33,7 @@ def chocolatey_path_pd(): @pytest.fixture(scope="module") def choco_path_pd(): - return os.path.join( - os.environ.get("ProgramData"), "Chocolatey", "bin", "choco.exe" - ) + return os.path.join(os.environ.get("ProgramData"), "Chocolatey", "bin", "choco.exe") @pytest.fixture(scope="module") From 1ef90cbdc7203f97775edb7666db86a41eb9fc15 Mon Sep 17 00:00:00 2001 From: twangboy Date: Thu, 29 Jun 2023 17:12:28 -0600 Subject: [PATCH 142/393] Fix failing tests --- tests/pytests/unit/modules/test_chocolatey.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tests/pytests/unit/modules/test_chocolatey.py b/tests/pytests/unit/modules/test_chocolatey.py index 74c29d36fe8..c4b955321d1 100644 --- a/tests/pytests/unit/modules/test_chocolatey.py +++ b/tests/pytests/unit/modules/test_chocolatey.py @@ -146,19 +146,20 @@ def test__find_chocolatey_programdata(mock_false, mock_true, chocolatey_path_pd) "os.path.isfile", mock_true ): result = chocolatey._find_chocolatey() - expected = choco_path_pd + expected = chocolatey_path_pd # Does it return the correct path assert result == expected # Does it populate __context__ assert chocolatey.__context__["chocolatey._path"] == expected -def test__find_choco_programdata(mock_false, mock_true, choco_path_pd): +def test__find_choco_programdata(mock_false, choco_path_pd): """ Test _find_chocolatey when found in ProgramData and named choco.exe """ + mock_is_file = MagicMock(side_effect=[False, True]) with patch.dict(chocolatey.__salt__, {"cmd.which": mock_false}), patch( - "os.path.isfile", mock_true + "os.path.isfile", mock_is_file ): result = chocolatey._find_chocolatey() expected = choco_path_pd @@ -173,7 +174,7 @@ def test__find_chocolatey_systemdrive(mock_false, choco_path_sd): Test _find_chocolatey when found on SystemDrive (older versions) """ with patch.dict(chocolatey.__salt__, {"cmd.which": mock_false}), patch( - "os.path.isfile", MagicMock(side_effect=[False, True]) + "os.path.isfile", MagicMock(side_effect=[False, False, True]) ): result = chocolatey._find_chocolatey() expected = choco_path_sd From 9ea5365a47a6d716aee579e927f169fcf2028a06 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Tue, 18 Jul 2023 17:29:35 +0100 Subject: [PATCH 143/393] Remove unused variables Signed-off-by: Pedro Algarvio --- salt/auth/__init__.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/salt/auth/__init__.py b/salt/auth/__init__.py index 0a93e803229..df2eebe4f85 100644 --- a/salt/auth/__init__.py +++ b/salt/auth/__init__.py @@ -340,8 +340,6 @@ class LoadAuth: load["user"] == self.opts.get("user", "root") or load["user"] == "root" ): for check_key in key: - dgm_user = self.opts.get("user", "root") - dgm_check_key = key[check_key] if auth_key == key[check_key]: return True log.warning( From acb7a3344b878a19e1839cf7fdc1c9322139bd60 Mon Sep 17 00:00:00 2001 From: "Ryan Addessi (raddessi)" Date: Thu, 8 Jun 2023 16:33:00 -0600 Subject: [PATCH 144/393] fix: slack bolt engine name is slack_bolt (cherry picked from commit d05e5469a52737a4e3687620934525ead4179009) --- salt/engines/slack_bolt_engine.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/salt/engines/slack_bolt_engine.py b/salt/engines/slack_bolt_engine.py index 0a0417d160a..67fba0e6b05 100644 --- a/salt/engines/slack_bolt_engine.py +++ b/salt/engines/slack_bolt_engine.py @@ -111,7 +111,7 @@ the desired command. .. code-block:: text engines: - - slack: + - slack_bolt: app_token: "xapp-x-xxxxxxxxxxx-xxxxxxxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" bot_token: 'xoxb-xxxxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxx' control: True @@ -149,7 +149,7 @@ must be quoted, or else PyYAML will fail to load the configuration. .. code-block:: text engines: - - slack: + - slack_bolt: groups_pillar: slack_engine_pillar app_token: "xapp-x-xxxxxxxxxxx-xxxxxxxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" bot_token: 'xoxb-xxxxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxx' From 6f8f32e5e8746a39530f674c7758b321d6dde1dc Mon Sep 17 00:00:00 2001 From: "Ryan Addessi (raddessi)" Date: Fri, 9 Jun 2023 11:00:52 -0600 Subject: [PATCH 145/393] f-strings (cherry picked from commit b381f39024545842dd8a52bc724efb7712cef263) --- salt/engines/slack_bolt_engine.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/salt/engines/slack_bolt_engine.py b/salt/engines/slack_bolt_engine.py index 67fba0e6b05..75eb0909e48 100644 --- a/salt/engines/slack_bolt_engine.py +++ b/salt/engines/slack_bolt_engine.py @@ -234,7 +234,7 @@ class SlackClient: self.msg_queue = collections.deque() - trigger_pattern = "(^{}.*)".format(trigger_string) + trigger_pattern = f"(^{trigger_string}.*)" # Register message_trigger when we see messages that start # with the trigger string @@ -843,7 +843,7 @@ class SlackClient: results = {} for jid in outstanding_jids: # results[jid] = runner.cmd('jobs.lookup_jid', [jid]) - if self.master_minion.returners["{}.get_jid".format(source)](jid): + if self.master_minion.returners[f"{source}.get_jid"](jid): job_result = runner.cmd("jobs.list_job", [jid]) jid_result = job_result.get("Result", {}) jid_function = job_result.get("Function", {}) @@ -954,7 +954,7 @@ class SlackClient: ) ts = time.time() st = datetime.datetime.fromtimestamp(ts).strftime("%Y%m%d%H%M%S%f") - filename = "salt-results-{}.yaml".format(st) + filename = f"salt-results-{st}.yaml" resp = self.app.client.files_upload( channels=channel, filename=filename, @@ -1075,4 +1075,4 @@ def start( ) client.run_commands_from_slack_async(message_generator, fire_all, tag, control) except Exception: # pylint: disable=broad-except - raise Exception("{}".format(traceback.format_exc())) + raise Exception(f"{traceback.format_exc()}") From 006bf1f9cbfaa2dd08904951e67f5c0df852038f Mon Sep 17 00:00:00 2001 From: nicholasmhughes Date: Thu, 20 Apr 2023 14:52:40 -0400 Subject: [PATCH 146/393] fixes saltstack/salt#64122 state_queue type checking does not allow int values (cherry picked from commit 8f0f4f1d3bd912ad2a54c17ebdd4e486748a83e3) --- changelog/64122.fixed.md | 1 + salt/config/__init__.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 changelog/64122.fixed.md diff --git a/changelog/64122.fixed.md b/changelog/64122.fixed.md new file mode 100644 index 00000000000..b9b0b026c94 --- /dev/null +++ b/changelog/64122.fixed.md @@ -0,0 +1 @@ +Fix state_queue type checking to allow int values diff --git a/salt/config/__init__.py b/salt/config/__init__.py index 16326634749..781c5637409 100644 --- a/salt/config/__init__.py +++ b/salt/config/__init__.py @@ -373,7 +373,7 @@ VALID_OPTS = immutabletypes.freeze( # applications that depend on the original format. "unique_jid": bool, # Governs whether state runs will queue or fail to run when a state is already running - "state_queue": bool, + "state_queue": (bool, int), # Tells the highstate outputter to show successful states. False will omit successes. "state_verbose": bool, # Specify the format for state outputs. See highstate outputter for additional details. From 6a6e1d3ec3ae26e21a64bf5fa5a77f24f77375a3 Mon Sep 17 00:00:00 2001 From: Twangboy Date: Mon, 1 May 2023 17:35:34 -0600 Subject: [PATCH 147/393] Write some tests (cherry picked from commit 962f708c92add21d132c74b6ca8ea968850d84f7) --- .../unit/config/test__validate_opts.py | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/tests/pytests/unit/config/test__validate_opts.py b/tests/pytests/unit/config/test__validate_opts.py index 3359a55bd85..a9112efdef1 100644 --- a/tests/pytests/unit/config/test__validate_opts.py +++ b/tests/pytests/unit/config/test__validate_opts.py @@ -401,3 +401,26 @@ def test_dict_bool_none_types(option_value, expected): """ result = salt.config._validate_opts({"ssl": option_value}) assert result is expected + + +@pytest.mark.parametrize( + "option_value,expected", + [ + ([1, 2, 3], False), # list + ((1, 2, 3), False), # tuple + ({"key": "value"}, False), # dict + ("str", False), # str + (True, True), # bool + (1, True), # int + (0.123, False), # float + (None, False), # None + ], +) +def test_bool_int_types(option_value, expected): + """ + Some config settings have three types, dict, bool, and None which should + evaluate as True. All others should return False. + ssl is a dict, bool type config option + """ + result = salt.config._validate_opts({"state_queue": option_value}) + assert result is expected From f2f19771a3d5ccfcf7dc483dd3c92810e51dc5d3 Mon Sep 17 00:00:00 2001 From: Twangboy Date: Mon, 1 May 2023 17:38:55 -0600 Subject: [PATCH 148/393] Fix test description (cherry picked from commit afcd6a8114a0cb2301b325c4bfc60406f640f94b) --- tests/pytests/unit/config/test__validate_opts.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/pytests/unit/config/test__validate_opts.py b/tests/pytests/unit/config/test__validate_opts.py index a9112efdef1..741631e6f81 100644 --- a/tests/pytests/unit/config/test__validate_opts.py +++ b/tests/pytests/unit/config/test__validate_opts.py @@ -418,9 +418,9 @@ def test_dict_bool_none_types(option_value, expected): ) def test_bool_int_types(option_value, expected): """ - Some config settings have three types, dict, bool, and None which should - evaluate as True. All others should return False. - ssl is a dict, bool type config option + Some config settings have two types, bool and int. In that case, bool and + int should evaluate as True. All others should return False. + state_queue is a bool/int config option """ result = salt.config._validate_opts({"state_queue": option_value}) assert result is expected From 1de8d1b18ba6626d0c2dd62496559b0b074856da Mon Sep 17 00:00:00 2001 From: Clay Sweetser Date: Tue, 14 Mar 2023 15:15:14 -0400 Subject: [PATCH 149/393] Update `py` renderer documentation with information on user-provided context Update the `py` renderer's documentation to include information on how user-provided context data is typically presented. (cherry picked from commit e8e033a8f7303135c3a25780caf232d4d7fa4858) --- salt/renderers/py.py | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/salt/renderers/py.py b/salt/renderers/py.py index 0f67d7e62e7..2b102e2ec87 100644 --- a/salt/renderers/py.py +++ b/salt/renderers/py.py @@ -46,8 +46,23 @@ execution functions, grains, pillar, etc. They are: ``/srv/salt/foo/bar/baz.sls``, then ``__sls__`` in that file will be ``foo.bar.baz``. -When writing a reactor SLS file the global context ``data`` (same as context ``{{ data }}`` -for states written with Jinja + YAML) is available. The following YAML + Jinja state declaration: +When used in a scenario where additional user-provided context data is supplied +(such as with :mod:`file.managed `), the additional +data will typically be injected into the script as one or more global +variables: + +.. code-block:: jinja + /etc/http/conf/http.conf: + file.managed: + - source: salt://apache/generate_http_conf.py + - template: py + - context: + # Will be injected as the global variable "site_name". + site_name: {{ site_name }} + +When writing a reactor SLS file the global context ``data`` (same as context +``{{ data }}`` for states written with Jinja + YAML) is available. The +following YAML + Jinja state declaration: .. code-block:: jinja From 9b8f810f88afd7bbd49aa14c20e8560a156a36de Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Mon, 24 Apr 2023 19:28:13 +0100 Subject: [PATCH 150/393] Formatting fix Signed-off-by: Pedro Algarvio (cherry picked from commit 5a7854908fb7095ad08cfbfe314a29f121ffab5d) --- salt/renderers/py.py | 1 + 1 file changed, 1 insertion(+) diff --git a/salt/renderers/py.py b/salt/renderers/py.py index 2b102e2ec87..3ce58ac405c 100644 --- a/salt/renderers/py.py +++ b/salt/renderers/py.py @@ -52,6 +52,7 @@ data will typically be injected into the script as one or more global variables: .. code-block:: jinja + /etc/http/conf/http.conf: file.managed: - source: salt://apache/generate_http_conf.py From 37d4acebd5e265d24f3c9d6698b769935eff3f93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20Su=C3=A1rez=20Hern=C3=A1ndez?= Date: Mon, 26 Jun 2023 13:23:28 +0100 Subject: [PATCH 151/393] Fix detection of Salt codename by salt_version module (cherry picked from commit e6abf4b2d5285a9ef5d98d9eeb80947da82be2df) --- salt/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/salt/version.py b/salt/version.py index 43cb5f86f75..7d608fd14d9 100644 --- a/salt/version.py +++ b/salt/version.py @@ -78,7 +78,7 @@ class SaltVersionsInfo(type): ALUMINIUM = SaltVersion("Aluminium" , info=3003, released=True) SILICON = SaltVersion("Silicon" , info=3004, released=True) PHOSPHORUS = SaltVersion("Phosphorus" , info=3005, released=True) - SULFUR = SaltVersion("Sulfur" , info=(3006, 0), released=True) + SULFUR = SaltVersion("Sulfur" , info=3006, released=True) CHLORINE = SaltVersion("Chlorine" , info=(3007, 0)) ARGON = SaltVersion("Argon" , info=(3008, 0)) POTASSIUM = SaltVersion("Potassium" , info=(3009, 0)) From d14f3becb5863ce740ce76b908cce9686844a9d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20Su=C3=A1rez=20Hern=C3=A1ndez?= Date: Tue, 27 Jun 2023 11:59:06 +0100 Subject: [PATCH 152/393] Fix mess with version detection bad version definition (cherry picked from commit f5861ccb10bbe602f052a5f0d1da58b52f271b91) --- salt/version.py | 208 ++++++++++++++++++++++++------------------------ 1 file changed, 103 insertions(+), 105 deletions(-) diff --git a/salt/version.py b/salt/version.py index 7d608fd14d9..22ba1905c4b 100644 --- a/salt/version.py +++ b/salt/version.py @@ -79,108 +79,108 @@ class SaltVersionsInfo(type): SILICON = SaltVersion("Silicon" , info=3004, released=True) PHOSPHORUS = SaltVersion("Phosphorus" , info=3005, released=True) SULFUR = SaltVersion("Sulfur" , info=3006, released=True) - CHLORINE = SaltVersion("Chlorine" , info=(3007, 0)) - ARGON = SaltVersion("Argon" , info=(3008, 0)) - POTASSIUM = SaltVersion("Potassium" , info=(3009, 0)) - CALCIUM = SaltVersion("Calcium" , info=(3010, 0)) - SCANDIUM = SaltVersion("Scandium" , info=(3011, 0)) - TITANIUM = SaltVersion("Titanium" , info=(3012, 0)) - VANADIUM = SaltVersion("Vanadium" , info=(3013, 0)) - CHROMIUM = SaltVersion("Chromium" , info=(3014, 0)) - MANGANESE = SaltVersion("Manganese" , info=(3015, 0)) - IRON = SaltVersion("Iron" , info=(3016, 0)) - COBALT = SaltVersion("Cobalt" , info=(3017, 0)) - NICKEL = SaltVersion("Nickel" , info=(3018, 0)) - COPPER = SaltVersion("Copper" , info=(3019, 0)) - ZINC = SaltVersion("Zinc" , info=(3020, 0)) - GALLIUM = SaltVersion("Gallium" , info=(3021, 0)) - GERMANIUM = SaltVersion("Germanium" , info=(3022, 0)) - ARSENIC = SaltVersion("Arsenic" , info=(3023, 0)) - SELENIUM = SaltVersion("Selenium" , info=(3024, 0)) - BROMINE = SaltVersion("Bromine" , info=(3025, 0)) - KRYPTON = SaltVersion("Krypton" , info=(3026, 0)) - RUBIDIUM = SaltVersion("Rubidium" , info=(3027, 0)) - STRONTIUM = SaltVersion("Strontium" , info=(3028, 0)) - YTTRIUM = SaltVersion("Yttrium" , info=(3029, 0)) - ZIRCONIUM = SaltVersion("Zirconium" , info=(3030, 0)) - NIOBIUM = SaltVersion("Niobium" , info=(3031, 0)) - MOLYBDENUM = SaltVersion("Molybdenum" , info=(3032, 0)) - TECHNETIUM = SaltVersion("Technetium" , info=(3033, 0)) - RUTHENIUM = SaltVersion("Ruthenium" , info=(3034, 0)) - RHODIUM = SaltVersion("Rhodium" , info=(3035, 0)) - PALLADIUM = SaltVersion("Palladium" , info=(3036, 0)) - SILVER = SaltVersion("Silver" , info=(3037, 0)) - CADMIUM = SaltVersion("Cadmium" , info=(3038, 0)) - INDIUM = SaltVersion("Indium" , info=(3039, 0)) - TIN = SaltVersion("Tin" , info=(3040, 0)) - ANTIMONY = SaltVersion("Antimony" , info=(3041, 0)) - TELLURIUM = SaltVersion("Tellurium" , info=(3042, 0)) - IODINE = SaltVersion("Iodine" , info=(3043, 0)) - XENON = SaltVersion("Xenon" , info=(3044, 0)) - CESIUM = SaltVersion("Cesium" , info=(3045, 0)) - BARIUM = SaltVersion("Barium" , info=(3046, 0)) - LANTHANUM = SaltVersion("Lanthanum" , info=(3047, 0)) - CERIUM = SaltVersion("Cerium" , info=(3048, 0)) - PRASEODYMIUM = SaltVersion("Praseodymium" , info=(3049, 0)) - NEODYMIUM = SaltVersion("Neodymium" , info=(3050, 0)) - PROMETHIUM = SaltVersion("Promethium" , info=(3051, 0)) - SAMARIUM = SaltVersion("Samarium" , info=(3052, 0)) - EUROPIUM = SaltVersion("Europium" , info=(3053, 0)) - GADOLINIUM = SaltVersion("Gadolinium" , info=(3054, 0)) - TERBIUM = SaltVersion("Terbium" , info=(3055, 0)) - DYSPROSIUM = SaltVersion("Dysprosium" , info=(3056, 0)) - HOLMIUM = SaltVersion("Holmium" , info=(3057, 0)) - ERBIUM = SaltVersion("Erbium" , info=(3058, 0)) - THULIUM = SaltVersion("Thulium" , info=(3059, 0)) - YTTERBIUM = SaltVersion("Ytterbium" , info=(3060, 0)) - LUTETIUM = SaltVersion("Lutetium" , info=(3061, 0)) - HAFNIUM = SaltVersion("Hafnium" , info=(3062, 0)) - TANTALUM = SaltVersion("Tantalum" , info=(3063, 0)) - TUNGSTEN = SaltVersion("Tungsten" , info=(3064, 0)) - RHENIUM = SaltVersion("Rhenium" , info=(3065, 0)) - OSMIUM = SaltVersion("Osmium" , info=(3066, 0)) - IRIDIUM = SaltVersion("Iridium" , info=(3067, 0)) - PLATINUM = SaltVersion("Platinum" , info=(3068, 0)) - GOLD = SaltVersion("Gold" , info=(3069, 0)) - MERCURY = SaltVersion("Mercury" , info=(3070, 0)) - THALLIUM = SaltVersion("Thallium" , info=(3071, 0)) - LEAD = SaltVersion("Lead" , info=(3072, 0)) - BISMUTH = SaltVersion("Bismuth" , info=(3073, 0)) - POLONIUM = SaltVersion("Polonium" , info=(3074, 0)) - ASTATINE = SaltVersion("Astatine" , info=(3075, 0)) - RADON = SaltVersion("Radon" , info=(3076, 0)) - FRANCIUM = SaltVersion("Francium" , info=(3077, 0)) - RADIUM = SaltVersion("Radium" , info=(3078, 0)) - ACTINIUM = SaltVersion("Actinium" , info=(3079, 0)) - THORIUM = SaltVersion("Thorium" , info=(3080, 0)) - PROTACTINIUM = SaltVersion("Protactinium" , info=(3081, 0)) - URANIUM = SaltVersion("Uranium" , info=(3082, 0)) - NEPTUNIUM = SaltVersion("Neptunium" , info=(3083, 0)) - PLUTONIUM = SaltVersion("Plutonium" , info=(3084, 0)) - AMERICIUM = SaltVersion("Americium" , info=(3085, 0)) - CURIUM = SaltVersion("Curium" , info=(3086, 0)) - BERKELIUM = SaltVersion("Berkelium" , info=(3087, 0)) - CALIFORNIUM = SaltVersion("Californium" , info=(3088, 0)) - EINSTEINIUM = SaltVersion("Einsteinium" , info=(3089, 0)) - FERMIUM = SaltVersion("Fermium" , info=(3090, 0)) - MENDELEVIUM = SaltVersion("Mendelevium" , info=(3091, 0)) - NOBELIUM = SaltVersion("Nobelium" , info=(3092, 0)) - LAWRENCIUM = SaltVersion("Lawrencium" , info=(3093, 0)) - RUTHERFORDIUM = SaltVersion("Rutherfordium", info=(3094, 0)) - DUBNIUM = SaltVersion("Dubnium" , info=(3095, 0)) - SEABORGIUM = SaltVersion("Seaborgium" , info=(3096, 0)) - BOHRIUM = SaltVersion("Bohrium" , info=(3097, 0)) - HASSIUM = SaltVersion("Hassium" , info=(3098, 0)) - MEITNERIUM = SaltVersion("Meitnerium" , info=(3099, 0)) - DARMSTADTIUM = SaltVersion("Darmstadtium" , info=(3100, 0)) - ROENTGENIUM = SaltVersion("Roentgenium" , info=(3101, 0)) - COPERNICIUM = SaltVersion("Copernicium" , info=(3102, 0)) - NIHONIUM = SaltVersion("Nihonium" , info=(3103, 0)) - FLEROVIUM = SaltVersion("Flerovium" , info=(3104, 0)) - MOSCOVIUM = SaltVersion("Moscovium" , info=(3105, 0)) - LIVERMORIUM = SaltVersion("Livermorium" , info=(3106, 0)) - TENNESSINE = SaltVersion("Tennessine" , info=(3107, 0)) - OGANESSON = SaltVersion("Oganesson" , info=(3108, 0)) + CHLORINE = SaltVersion("Chlorine" , info=3007) + ARGON = SaltVersion("Argon" , info=3008) + POTASSIUM = SaltVersion("Potassium" , info=3009) + CALCIUM = SaltVersion("Calcium" , info=3010) + SCANDIUM = SaltVersion("Scandium" , info=3011) + TITANIUM = SaltVersion("Titanium" , info=3012) + VANADIUM = SaltVersion("Vanadium" , info=3013) + CHROMIUM = SaltVersion("Chromium" , info=3014) + MANGANESE = SaltVersion("Manganese" , info=3015) + IRON = SaltVersion("Iron" , info=3016) + COBALT = SaltVersion("Cobalt" , info=3017) + NICKEL = SaltVersion("Nickel" , info=3018) + COPPER = SaltVersion("Copper" , info=3019) + ZINC = SaltVersion("Zinc" , info=3020) + GALLIUM = SaltVersion("Gallium" , info=3021) + GERMANIUM = SaltVersion("Germanium" , info=3022) + ARSENIC = SaltVersion("Arsenic" , info=3023) + SELENIUM = SaltVersion("Selenium" , info=3024) + BROMINE = SaltVersion("Bromine" , info=3025) + KRYPTON = SaltVersion("Krypton" , info=3026) + RUBIDIUM = SaltVersion("Rubidium" , info=3027) + STRONTIUM = SaltVersion("Strontium" , info=3028) + YTTRIUM = SaltVersion("Yttrium" , info=3029) + ZIRCONIUM = SaltVersion("Zirconium" , info=3030) + NIOBIUM = SaltVersion("Niobium" , info=3031) + MOLYBDENUM = SaltVersion("Molybdenum" , info=3032) + TECHNETIUM = SaltVersion("Technetium" , info=3033) + RUTHENIUM = SaltVersion("Ruthenium" , info=3034) + RHODIUM = SaltVersion("Rhodium" , info=3035) + PALLADIUM = SaltVersion("Palladium" , info=3036) + SILVER = SaltVersion("Silver" , info=3037) + CADMIUM = SaltVersion("Cadmium" , info=3038) + INDIUM = SaltVersion("Indium" , info=3039) + TIN = SaltVersion("Tin" , info=3040) + ANTIMONY = SaltVersion("Antimony" , info=3041) + TELLURIUM = SaltVersion("Tellurium" , info=3042) + IODINE = SaltVersion("Iodine" , info=3043) + XENON = SaltVersion("Xenon" , info=3044) + CESIUM = SaltVersion("Cesium" , info=3045) + BARIUM = SaltVersion("Barium" , info=3046) + LANTHANUM = SaltVersion("Lanthanum" , info=3047) + CERIUM = SaltVersion("Cerium" , info=3048) + PRASEODYMIUM = SaltVersion("Praseodymium" , info=3049) + NEODYMIUM = SaltVersion("Neodymium" , info=3050) + PROMETHIUM = SaltVersion("Promethium" , info=3051) + SAMARIUM = SaltVersion("Samarium" , info=3052) + EUROPIUM = SaltVersion("Europium" , info=3053) + GADOLINIUM = SaltVersion("Gadolinium" , info=3054) + TERBIUM = SaltVersion("Terbium" , info=3055) + DYSPROSIUM = SaltVersion("Dysprosium" , info=3056) + HOLMIUM = SaltVersion("Holmium" , info=3057) + ERBIUM = SaltVersion("Erbium" , info=3058) + THULIUM = SaltVersion("Thulium" , info=3059) + YTTERBIUM = SaltVersion("Ytterbium" , info=3060) + LUTETIUM = SaltVersion("Lutetium" , info=3061) + HAFNIUM = SaltVersion("Hafnium" , info=3062) + TANTALUM = SaltVersion("Tantalum" , info=3063) + TUNGSTEN = SaltVersion("Tungsten" , info=3064) + RHENIUM = SaltVersion("Rhenium" , info=3065) + OSMIUM = SaltVersion("Osmium" , info=3066) + IRIDIUM = SaltVersion("Iridium" , info=3067) + PLATINUM = SaltVersion("Platinum" , info=3068) + GOLD = SaltVersion("Gold" , info=3069) + MERCURY = SaltVersion("Mercury" , info=3070) + THALLIUM = SaltVersion("Thallium" , info=3071) + LEAD = SaltVersion("Lead" , info=3072) + BISMUTH = SaltVersion("Bismuth" , info=3073) + POLONIUM = SaltVersion("Polonium" , info=3074) + ASTATINE = SaltVersion("Astatine" , info=3075) + RADON = SaltVersion("Radon" , info=3076) + FRANCIUM = SaltVersion("Francium" , info=3077) + RADIUM = SaltVersion("Radium" , info=3078) + ACTINIUM = SaltVersion("Actinium" , info=3079) + THORIUM = SaltVersion("Thorium" , info=3080) + PROTACTINIUM = SaltVersion("Protactinium" , info=3081) + URANIUM = SaltVersion("Uranium" , info=3082) + NEPTUNIUM = SaltVersion("Neptunium" , info=3083) + PLUTONIUM = SaltVersion("Plutonium" , info=3084) + AMERICIUM = SaltVersion("Americium" , info=3085) + CURIUM = SaltVersion("Curium" , info=3086) + BERKELIUM = SaltVersion("Berkelium" , info=3087) + CALIFORNIUM = SaltVersion("Californium" , info=3088) + EINSTEINIUM = SaltVersion("Einsteinium" , info=3089) + FERMIUM = SaltVersion("Fermium" , info=3090) + MENDELEVIUM = SaltVersion("Mendelevium" , info=3091) + NOBELIUM = SaltVersion("Nobelium" , info=3092) + LAWRENCIUM = SaltVersion("Lawrencium" , info=3093) + RUTHERFORDIUM = SaltVersion("Rutherfordium", info=3094) + DUBNIUM = SaltVersion("Dubnium" , info=3095) + SEABORGIUM = SaltVersion("Seaborgium" , info=3096) + BOHRIUM = SaltVersion("Bohrium" , info=3097) + HASSIUM = SaltVersion("Hassium" , info=3098) + MEITNERIUM = SaltVersion("Meitnerium" , info=3099) + DARMSTADTIUM = SaltVersion("Darmstadtium" , info=3100) + ROENTGENIUM = SaltVersion("Roentgenium" , info=3101) + COPERNICIUM = SaltVersion("Copernicium" , info=3102) + NIHONIUM = SaltVersion("Nihonium" , info=3103) + FLEROVIUM = SaltVersion("Flerovium" , info=3104) + MOSCOVIUM = SaltVersion("Moscovium" , info=3105) + LIVERMORIUM = SaltVersion("Livermorium" , info=3106) + TENNESSINE = SaltVersion("Tennessine" , info=3107) + OGANESSON = SaltVersion("Oganesson" , info=3108) # <---- Please refrain from fixing whitespace ----------------------------------- # The idea is to keep this readable. # ------------------------------------------------------------------------------- @@ -324,9 +324,7 @@ class SaltStackVersion: self.mbugfix = mbugfix self.pre_type = pre_type self.pre_num = pre_num - if self.can_have_dot_zero(major): - vnames_key = (major, 0) - elif self.new_version(major): + if self.new_version(major): vnames_key = (major,) else: vnames_key = (major, minor) From 8f57078f4cec23183f414256aebfb140e5d6fdfc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20Su=C3=A1rez=20Hern=C3=A1ndez?= Date: Tue, 27 Jun 2023 11:59:41 +0100 Subject: [PATCH 153/393] Add changes suggested by pre-commit (cherry picked from commit 767303a3dc97b0590e2dcdb61eb5a975066f98d0) --- salt/version.py | 42 ++++++++++++++++++++---------------------- 1 file changed, 20 insertions(+), 22 deletions(-) diff --git a/salt/version.py b/salt/version.py index 22ba1905c4b..c99ef9414e7 100644 --- a/salt/version.py +++ b/salt/version.py @@ -355,15 +355,13 @@ class SaltStackVersion: ) match = cls.git_describe_regex.match(vstr) if not match: - raise ValueError( - "Unable to parse version string: '{}'".format(version_string) - ) + raise ValueError(f"Unable to parse version string: '{version_string}'") return cls(*match.groups()) @classmethod def from_name(cls, name): if name.lower() not in cls.LNAMES: - raise ValueError("Named version '{}' is not known".format(name)) + raise ValueError(f"Named version '{name}' is not known") return cls(*cls.LNAMES[name.lower()]) @classmethod @@ -446,22 +444,22 @@ class SaltStackVersion: @property def string(self): if self.new_version(self.major): - version_string = "{}".format(self.major) + version_string = f"{self.major}" if self.minor: - version_string = "{}.{}".format(self.major, self.minor) + version_string = f"{self.major}.{self.minor}" if not self.minor and self.can_have_dot_zero(self.major): - version_string = "{}.{}".format(self.major, self.minor) + version_string = f"{self.major}.{self.minor}" else: - version_string = "{}.{}.{}".format(self.major, self.minor, self.bugfix) + version_string = f"{self.major}.{self.minor}.{self.bugfix}" if self.mbugfix: - version_string += ".{}".format(self.mbugfix) + version_string += f".{self.mbugfix}" if self.pre_type: - version_string += "{}{}".format(self.pre_type, self.pre_num) + version_string += f"{self.pre_type}{self.pre_num}" if self.noc and self.sha: noc = self.noc if noc < 0: noc = "0na" - version_string += "+{}.{}".format(noc, self.sha) + version_string += f"+{noc}.{self.sha}" return version_string @property @@ -476,7 +474,7 @@ class SaltStackVersion: if self.sse: version_string += " Enterprise" if (self.major, self.minor) in self.RMATCH: - version_string += " ({})".format(self.RMATCH[(self.major, self.minor)]) + version_string += f" ({self.RMATCH[(self.major, self.minor)]})" return version_string @property @@ -500,7 +498,7 @@ class SaltStackVersion: other = SaltStackVersion(*other) else: raise ValueError( - "Cannot instantiate Version from type '{}'".format(type(other)) + f"Cannot instantiate Version from type '{type(other)}'" ) pre_type = self.pre_index other_pre_type = other.pre_index @@ -549,24 +547,24 @@ class SaltStackVersion: def __repr__(self): parts = [] if self.name: - parts.append("name='{}'".format(self.name)) - parts.extend(["major={}".format(self.major), "minor={}".format(self.minor)]) + parts.append(f"name='{self.name}'") + parts.extend([f"major={self.major}", f"minor={self.minor}"]) if self.new_version(self.major): if not self.can_have_dot_zero(self.major) and not self.minor: parts.remove("".join([x for x in parts if re.search("^minor*", x)])) else: - parts.extend(["bugfix={}".format(self.bugfix)]) + parts.extend([f"bugfix={self.bugfix}"]) if self.mbugfix: - parts.append("minor-bugfix={}".format(self.mbugfix)) + parts.append(f"minor-bugfix={self.mbugfix}") if self.pre_type: - parts.append("{}={}".format(self.pre_type, self.pre_num)) + parts.append(f"{self.pre_type}={self.pre_num}") noc = self.noc if noc == -1: noc = "0na" if noc and self.sha: - parts.extend(["noc={}".format(noc), "sha={}".format(self.sha)]) + parts.extend([f"noc={noc}", f"sha={self.sha}"]) return "<{} {}>".format(self.__class__.__name__, " ".join(parts)) @@ -613,7 +611,7 @@ def __discover_version(saltstack_version): "v[0-9]*", "--always", ], - **kwargs + **kwargs, ) out, err = process.communicate() @@ -808,7 +806,7 @@ def system_information(): # ie: R2 if re.match(r"^R\d+$", item): release = item - release = "{}Server{}".format(version, release) + release = f"{version}Server{release}" else: for item in product_name.split(" "): # If it's a number, decimal number, Thin or Vista, then it's the @@ -908,7 +906,7 @@ def versions_report(include_salt_cloud=False, include_extensions=True): if ver_type == "Salt Extensions" and ver_type not in ver_info: # No salt Extensions to report continue - info.append("{}:".format(ver_type)) + info.append(f"{ver_type}:") # List dependencies in alphabetical, case insensitive order for name in sorted(ver_info[ver_type], key=lambda x: x.lower()): ver = fmt.format( From c6f5d7e7391436fd162083e23f874ed7e82b334d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20Su=C3=A1rez=20Hern=C3=A1ndez?= Date: Tue, 27 Jun 2023 12:20:50 +0100 Subject: [PATCH 154/393] Add some new and fix unit tests (cherry picked from commit 69696e6fd74bf470524fcc7d67e8c5e1dad890c3) --- .../pytests/unit/modules/test_salt_version.py | 43 ++++++++++++++++++- tests/pytests/unit/test_version.py | 10 +++-- 2 files changed, 48 insertions(+), 5 deletions(-) diff --git a/tests/pytests/unit/modules/test_salt_version.py b/tests/pytests/unit/modules/test_salt_version.py index 6d734f6a764..f6c25630e03 100644 --- a/tests/pytests/unit/modules/test_salt_version.py +++ b/tests/pytests/unit/modules/test_salt_version.py @@ -21,7 +21,7 @@ def test_mocked_objects(): for k, v in salt.version.SaltStackVersion.LNAMES.items(): assert k == k.lower() assert isinstance(v, tuple) - if sv.new_version(major=v[0]) and not sv.can_have_dot_zero(major=v[0]): + if sv.new_version(major=v[0]): assert len(v) == 1 else: assert len(v) == 2 @@ -64,6 +64,13 @@ def test_get_release_number_success_new_version(): assert salt_version.get_release_number("Neon") == "3000" +def test_get_release_number_success_new_version_with_dot(): + """ + Test that a version is returned for new versioning (3006) + """ + assert salt_version.get_release_number("Sulfur") == "3006" + + def test_equal_success(): """ Test that the current version is equal to the codename @@ -83,6 +90,16 @@ def test_equal_success_new_version(): assert salt_version.equal("foo") is True +def test_equal_success_new_version_with_dot(): + """ + Test that the current version is equal to the codename + while using the new versioning + """ + with patch("salt.version.SaltStackVersion", MagicMock(return_value="3006.1")): + with patch("salt.version.SaltStackVersion.LNAMES", {"foo": (3006,)}): + assert salt_version.equal("foo") is True + + def test_equal_older_codename(): """ Test that when an older codename is passed in, the function returns False. @@ -142,6 +159,17 @@ def test_greater_than_success_new_version(): assert salt_version.greater_than("Nitrogen") is True +def test_greater_than_success_new_version_with_dot(): + """ + Test that the current version is newer than the codename + """ + with patch( + "salt.modules.salt_version.get_release_number", MagicMock(return_value="3000") + ): + with patch("salt.version.SaltStackVersion", MagicMock(return_value="3006.0")): + assert salt_version.greater_than("Neon") is True + + def test_greater_than_with_equal_codename(): """ Test that when an equal codename is passed in, the function returns False. @@ -200,6 +228,19 @@ def test_less_than_success_new_version(): assert salt_version.less_than("Fluorine") is True +def test_less_than_success_new_version_with_dot(): + """ + Test that when a newer codename is passed in, the function returns True + using new version + """ + with patch("salt.version.SaltStackVersion", MagicMock(return_value="2018.3.2")): + with patch( + "salt.modules.salt_version.get_release_number", + MagicMock(return_value="3006"), + ): + assert salt_version.less_than("Fluorine") is True + + def test_less_than_with_equal_codename(): """ Test that when an equal codename is passed in, the function returns False. diff --git a/tests/pytests/unit/test_version.py b/tests/pytests/unit/test_version.py index 73befea4cf4..1cb94c619ca 100644 --- a/tests/pytests/unit/test_version.py +++ b/tests/pytests/unit/test_version.py @@ -187,7 +187,7 @@ def test_string_new_version_minor(): ver = SaltStackVersion(major=maj_ver, minor=min_ver) assert ver.minor == min_ver assert not ver.bugfix - assert ver.string == "{}.{}".format(maj_ver, min_ver) + assert ver.string == f"{maj_ver}.{min_ver}" def test_string_new_version_minor_as_string(): @@ -201,13 +201,13 @@ def test_string_new_version_minor_as_string(): ver = SaltStackVersion(major=maj_ver, minor=min_ver) assert ver.minor == int(min_ver) assert not ver.bugfix - assert ver.string == "{}.{}".format(maj_ver, min_ver) + assert ver.string == f"{maj_ver}.{min_ver}" # This only seems to happen on a cloned repo without its tags maj_ver = "3000" min_ver = "" ver = SaltStackVersion(major=maj_ver, minor=min_ver) - assert ver.minor is None, "{!r} is not {!r}".format(ver.minor, min_ver) + assert ver.minor is None, f"{ver.minor!r} is not {min_ver!r}" assert not ver.bugfix assert ver.string == maj_ver @@ -222,7 +222,7 @@ def test_string_old_version(): min_ver = "2" ver = SaltStackVersion(major=maj_ver, minor=min_ver) assert ver.bugfix == 0 - assert ver.string == "{}.{}.0".format(maj_ver, min_ver) + assert ver.string == f"{maj_ver}.{min_ver}.0" @pytest.mark.parametrize( @@ -537,6 +537,8 @@ def test_versions_report_no_extensions_available(): ("3000.1", "3000.1", "Neon"), ("3005", "3005", "Phosphorus"), ("3006", "3006.0", "Sulfur"), + ("3006.0", "3006.0", "Sulfur"), + ("3006.1", "3006.1", "Sulfur"), ("3015.1", "3015.1", "Manganese"), ("3109.3", "3109.3", None), ], From 7f6d61b95455e58eef2630971ca32e956927f89d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20Su=C3=A1rez=20Hern=C3=A1ndez?= Date: Tue, 27 Jun 2023 13:10:05 +0100 Subject: [PATCH 155/393] Add changelog file (cherry picked from commit 4cd8fe14d422be14d22c0f9a41d08b3b45648191) --- changelog/64554.fixed.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog/64554.fixed.md diff --git a/changelog/64554.fixed.md b/changelog/64554.fixed.md new file mode 100644 index 00000000000..56d03053a2c --- /dev/null +++ b/changelog/64554.fixed.md @@ -0,0 +1 @@ +Fix detection of Salt codename by "salt_version" execution module From 6bce148a78ae873d54869b4fcd9f2e83886297c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20Su=C3=A1rez=20Hern=C3=A1ndez?= Date: Wed, 28 Jun 2023 12:38:51 +0100 Subject: [PATCH 156/393] Fix SaltStackVersion string for new versions format (cherry picked from commit a2abb1a4506fd8fab29570592e1b97d5874752c2) --- salt/version.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/salt/version.py b/salt/version.py index c99ef9414e7..e174d8bfb1f 100644 --- a/salt/version.py +++ b/salt/version.py @@ -473,8 +473,12 @@ class SaltStackVersion: version_string = self.string if self.sse: version_string += " Enterprise" - if (self.major, self.minor) in self.RMATCH: - version_string += f" ({self.RMATCH[(self.major, self.minor)]})" + if self.new_version(self.major): + rmatch_key = (self.major,) + else: + rmatch_key = (self.major, self.minor) + if rmatch_key in self.RMATCH: + version_string += f" ({self.RMATCH[rmatch_key]})" return version_string @property From f29674140004aa74cbc9531d703b479f16a7c6b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20Su=C3=A1rez=20Hern=C3=A1ndez?= Date: Wed, 28 Jun 2023 13:24:20 +0100 Subject: [PATCH 157/393] Rename changelog file according to bug report (cherry picked from commit 8540a3fdd43d43d672e8c8a89188ba19c5f7eea6) --- changelog/{64554.fixed.md => 64306.fixed.md} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename changelog/{64554.fixed.md => 64306.fixed.md} (100%) diff --git a/changelog/64554.fixed.md b/changelog/64306.fixed.md similarity index 100% rename from changelog/64554.fixed.md rename to changelog/64306.fixed.md From 0179b39e47a53edaab02d38c6ecdfa55f53ac4c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20Su=C3=A1rez=20Hern=C3=A1ndez?= Date: Wed, 28 Jun 2023 14:11:46 +0100 Subject: [PATCH 158/393] Do not crash when passing numbers to 'salt_version.get_release_number' (cherry picked from commit 3693a0db427a72019076e728fc55e24320356502) --- salt/modules/salt_version.py | 4 ++++ tests/pytests/unit/modules/test_salt_version.py | 12 ++++++++++++ 2 files changed, 16 insertions(+) diff --git a/salt/modules/salt_version.py b/salt/modules/salt_version.py index 1b5421fee4a..3c6b475c840 100644 --- a/salt/modules/salt_version.py +++ b/salt/modules/salt_version.py @@ -35,6 +35,7 @@ import logging import salt.utils.versions import salt.version +from salt.exceptions import CommandExecutionError log = logging.getLogger(__name__) @@ -66,6 +67,9 @@ def get_release_number(name): salt '*' salt_version.get_release_number 'Oxygen' """ + if not isinstance(name, str): + raise CommandExecutionError("'name' argument must be a string") + name = name.lower() version_map = salt.version.SaltStackVersion.LNAMES version = version_map.get(name) diff --git a/tests/pytests/unit/modules/test_salt_version.py b/tests/pytests/unit/modules/test_salt_version.py index f6c25630e03..4b7a7cd0731 100644 --- a/tests/pytests/unit/modules/test_salt_version.py +++ b/tests/pytests/unit/modules/test_salt_version.py @@ -2,8 +2,11 @@ Unit tests for salt/modules/salt_version.py """ +import pytest + import salt.modules.salt_version as salt_version import salt.version +from salt.exceptions import CommandExecutionError from tests.support.mock import MagicMock, patch @@ -241,6 +244,15 @@ def test_less_than_success_new_version_with_dot(): assert salt_version.less_than("Fluorine") is True +def test_less_than_do_not_crash_when_input_is_a_number(): + """ + Test that less_than do not crash when unexpected inputs + """ + with patch("salt.version.SaltStackVersion", MagicMock(return_value="2018.3.2")): + with pytest.raises(CommandExecutionError): + salt_version.less_than(1234) + + def test_less_than_with_equal_codename(): """ Test that when an equal codename is passed in, the function returns False. From ccd07f9d24b751c9db2c377c047fa6112e40763c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20Su=C3=A1rez=20Hern=C3=A1ndez?= Date: Thu, 29 Jun 2023 09:51:07 +0100 Subject: [PATCH 159/393] Fix salt_version execution module documentation (cherry picked from commit a92ddf5a415d0856dd92be28cbb320e508deef89) --- salt/modules/salt_version.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/salt/modules/salt_version.py b/salt/modules/salt_version.py index 3c6b475c840..99dae5f61a5 100644 --- a/salt/modules/salt_version.py +++ b/salt/modules/salt_version.py @@ -20,7 +20,7 @@ A simple example might be something like the following: .. code-block:: jinja {# a boolean check #} - {% set option_deprecated = salt['salt_version.less_than']("3001") %} + {% set option_deprecated = salt['salt_version.less_than']("Sodium") %} {% if option_deprecated %} @@ -52,7 +52,7 @@ def __virtual__(): def get_release_number(name): """ Returns the release number of a given release code name in a - ``MAJOR.PATCH`` format. + ``MAJOR.PATCH`` format (for Salt versions < 3000) or ``MAJOR`` for newer Salt versions. If the release name has not been given an assigned release number, the function returns a string. If the release cannot be found, it returns From 0083c037725daccec0b161aa2c12063bfd7d3fdc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20Su=C3=A1rez=20Hern=C3=A1ndez?= Date: Fri, 30 Jun 2023 12:47:05 +0100 Subject: [PATCH 160/393] Fix test to get proper formatted version (cherry picked from commit db5a9a1b4aac2e0d0841ff3cffac0af3e9564556) --- tests/pytests/functional/cli/test_salt_run_.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/pytests/functional/cli/test_salt_run_.py b/tests/pytests/functional/cli/test_salt_run_.py index 66c28fc3aae..63841f9fb8c 100644 --- a/tests/pytests/functional/cli/test_salt_run_.py +++ b/tests/pytests/functional/cli/test_salt_run_.py @@ -80,6 +80,6 @@ def test_versions_report(salt_run_cli): def test_salt_run_version(salt_run_cli): - expected = salt.version.__version__ + expected = salt.version.__saltstack_version__.formatted_version ret = salt_run_cli.run("--version") assert f"cli_salt_run.py {expected}\n" == ret.stdout From 873e96db5cc40ea385aa5a5dfb587eedd066d418 Mon Sep 17 00:00:00 2001 From: Tim Hildebrandt <118898773+TimHiCe@users.noreply.github.com> Date: Tue, 6 Jun 2023 18:18:54 +0200 Subject: [PATCH 161/393] Update chocolatey.py / Search for choco.exe chocolatey.exe was renamed to choco.exe by Chocolatey in Version 2.0.0 (cherry picked from commit fd09ab7efb29d83223002dfa3526db36c5b23574) --- salt/modules/chocolatey.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/salt/modules/chocolatey.py b/salt/modules/chocolatey.py index caa7b0bae8f..dc3dd62f651 100644 --- a/salt/modules/chocolatey.py +++ b/salt/modules/chocolatey.py @@ -111,6 +111,9 @@ def _find_chocolatey(): os.path.join( os.environ.get("ProgramData"), "Chocolatey", "bin", "chocolatey.exe" ), + os.path.join( + os.environ.get("ProgramData"), "Chocolatey", "bin", "choco.exe" + ), os.path.join( os.environ.get("SystemDrive"), "Chocolatey", "bin", "chocolatey.bat" ), From fc99dfbb790d629075735768a380643c156eaaea Mon Sep 17 00:00:00 2001 From: Tim Hildebrandt <118898773+TimHiCe@users.noreply.github.com> Date: Thu, 8 Jun 2023 18:34:23 +0200 Subject: [PATCH 162/393] Update chocolatey.py Change environ key of new lication to "ProgramDataChoco" to not overwrite the environ of the chocolatey.exe path. (cherry picked from commit 52da6c2b589ede50b659031213e8675782ec0e84) --- salt/modules/chocolatey.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/salt/modules/chocolatey.py b/salt/modules/chocolatey.py index dc3dd62f651..ff903632518 100644 --- a/salt/modules/chocolatey.py +++ b/salt/modules/chocolatey.py @@ -112,7 +112,7 @@ def _find_chocolatey(): os.environ.get("ProgramData"), "Chocolatey", "bin", "chocolatey.exe" ), os.path.join( - os.environ.get("ProgramData"), "Chocolatey", "bin", "choco.exe" + os.environ.get("ProgramDataChoco"), "Chocolatey", "bin", "choco.exe" ), os.path.join( os.environ.get("SystemDrive"), "Chocolatey", "bin", "chocolatey.bat" From f7be8159ff60b4c66b391ec04121727f306d408b Mon Sep 17 00:00:00 2001 From: Tim Hildebrandt <118898773+TimHiCe@users.noreply.github.com> Date: Thu, 8 Jun 2023 18:58:24 +0200 Subject: [PATCH 163/393] Update test_chocolatey.py Add test for choco.exe in ProgramData (cherry picked from commit 45e1ee93688bef5e0eff8c62893a2c7949fe4ef0) --- tests/pytests/unit/modules/test_chocolatey.py | 28 +++++++++++++++++-- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/tests/pytests/unit/modules/test_chocolatey.py b/tests/pytests/unit/modules/test_chocolatey.py index e9adc167b70..2d09185b23f 100644 --- a/tests/pytests/unit/modules/test_chocolatey.py +++ b/tests/pytests/unit/modules/test_chocolatey.py @@ -25,12 +25,19 @@ def choco_path(): @pytest.fixture(scope="module") -def choco_path_pd(): +def chocolatey_path_pd(): return os.path.join( os.environ.get("ProgramData"), "Chocolatey", "bin", "chocolatey.exe" ) +@pytest.fixture(scope="module") +def choco_path_pd(): + return os.path.join( + os.environ.get("ProgramData"), "Chocolatey", "bin", "choco.exe" + ) + + @pytest.fixture(scope="module") def choco_path_sd(): return os.path.join( @@ -133,9 +140,24 @@ def test__find_chocolatey_which(choco_path): assert chocolatey.__context__["chocolatey._path"] == expected -def test__find_chocolatey_programdata(mock_false, mock_true, choco_path_pd): +def test__find_chocolatey_programdata(mock_false, mock_true, chocolatey_path_pd): """ - Test _find_chocolatey when found in ProgramData + Test _find_chocolatey when found in ProgramData and named chocolatey.exe + """ + with patch.dict(chocolatey.__salt__, {"cmd.which": mock_false}), patch( + "os.path.isfile", mock_true + ): + result = chocolatey._find_chocolatey() + expected = choco_path_pd + # Does it return the correct path + assert result == expected + # Does it populate __context__ + assert chocolatey.__context__["chocolatey._path"] == expected + + +def test__find_choco_programdata(mock_false, mock_true, choco_path_pd): + """ + Test _find_chocolatey when found in ProgramData and named choco.exe """ with patch.dict(chocolatey.__salt__, {"cmd.which": mock_false}), patch( "os.path.isfile", mock_true From a2262299db3c5e7ab25022603b5a87ab391452b0 Mon Sep 17 00:00:00 2001 From: Tim Hildebrandt <118898773+TimHiCe@users.noreply.github.com> Date: Thu, 8 Jun 2023 20:32:35 +0200 Subject: [PATCH 164/393] Update chocolatey.py Bug Fix the last commit (cherry picked from commit 11b3b913e893cf5b014e718d52c8b2e8f08009c1) --- salt/modules/chocolatey.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/salt/modules/chocolatey.py b/salt/modules/chocolatey.py index ff903632518..dc3dd62f651 100644 --- a/salt/modules/chocolatey.py +++ b/salt/modules/chocolatey.py @@ -112,7 +112,7 @@ def _find_chocolatey(): os.environ.get("ProgramData"), "Chocolatey", "bin", "chocolatey.exe" ), os.path.join( - os.environ.get("ProgramDataChoco"), "Chocolatey", "bin", "choco.exe" + os.environ.get("ProgramData"), "Chocolatey", "bin", "choco.exe" ), os.path.join( os.environ.get("SystemDrive"), "Chocolatey", "bin", "chocolatey.bat" From 9f0d496e8c1ca0ca47fa42911199213654652057 Mon Sep 17 00:00:00 2001 From: Tim Hildebrandt <118898773+TimHiCe@users.noreply.github.com> Date: Thu, 8 Jun 2023 20:40:55 +0200 Subject: [PATCH 165/393] Add changelog (cherry picked from commit 7b07640b32581836cc27cfd618c83cac4f56b7d1) --- changelog/64427.fixed.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog/64427.fixed.md diff --git a/changelog/64427.fixed.md b/changelog/64427.fixed.md new file mode 100644 index 00000000000..74f5b125579 --- /dev/null +++ b/changelog/64427.fixed.md @@ -0,0 +1 @@ +Add search for %ProgramData%\Chocolatey\choco.exe to determine if Chocolatey is installed or not From 0099f568a124817235996228f7caf2c523be4adf Mon Sep 17 00:00:00 2001 From: twangboy Date: Thu, 29 Jun 2023 16:13:14 -0600 Subject: [PATCH 166/393] Fix pre-commit (cherry picked from commit e8ccb262a612b645fb965bc3217b102ad404f467) --- salt/modules/chocolatey.py | 16 +++++++--------- tests/pytests/unit/modules/test_chocolatey.py | 4 +--- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/salt/modules/chocolatey.py b/salt/modules/chocolatey.py index dc3dd62f651..06794946d55 100644 --- a/salt/modules/chocolatey.py +++ b/salt/modules/chocolatey.py @@ -111,9 +111,7 @@ def _find_chocolatey(): os.path.join( os.environ.get("ProgramData"), "Chocolatey", "bin", "chocolatey.exe" ), - os.path.join( - os.environ.get("ProgramData"), "Chocolatey", "bin", "choco.exe" - ), + os.path.join(os.environ.get("ProgramData"), "Chocolatey", "bin", "choco.exe"), os.path.join( os.environ.get("SystemDrive"), "Chocolatey", "bin", "chocolatey.bat" ), @@ -210,7 +208,7 @@ def bootstrap(force=False, source=None): except CommandExecutionError: choc_path = None if choc_path and not force: - return "Chocolatey found at {}".format(choc_path) + return f"Chocolatey found at {choc_path}" temp_dir = tempfile.gettempdir() @@ -338,7 +336,7 @@ def bootstrap(force=False, source=None): if not os.path.exists(script): raise CommandExecutionError( - "Failed to find Chocolatey installation script: {}".format(script) + f"Failed to find Chocolatey installation script: {script}" ) # Run the Chocolatey bootstrap @@ -380,7 +378,7 @@ def unbootstrap(): if os.path.exists(choco_dir): log.debug("Removing Chocolatey directory: %s", choco_dir) __salt__["file.remove"](path=choco_dir, force=True) - removed.append("Removed Directory: {}".format(choco_dir)) + removed.append(f"Removed Directory: {choco_dir}") else: known_paths = [ os.path.join(os.environ.get("ProgramData"), "Chocolatey"), @@ -390,7 +388,7 @@ def unbootstrap(): if os.path.exists(path): log.debug("Removing Chocolatey directory: %s", path) __salt__["file.remove"](path=path, force=True) - removed.append("Removed Directory: {}".format(path)) + removed.append(f"Removed Directory: {path}") # Delete all Chocolatey environment variables for env_var in __salt__["environ.items"](): @@ -402,14 +400,14 @@ def unbootstrap(): __salt__["environ.setval"]( key=env_var, val=False, false_unsets=True, permanent="HKCU" ) - removed.append("Removed Environment Var: {}".format(env_var)) + removed.append(f"Removed Environment Var: {env_var}") # Remove Chocolatey from the path: for path in __salt__["win_path.get_path"](): if "chocolatey" in path.lower(): log.debug("Removing Chocolatey path item: %s", path) __salt__["win_path.remove"](path=path, rehash=True) - removed.append("Removed Path Item: {}".format(path)) + removed.append(f"Removed Path Item: {path}") return removed diff --git a/tests/pytests/unit/modules/test_chocolatey.py b/tests/pytests/unit/modules/test_chocolatey.py index 2d09185b23f..74c29d36fe8 100644 --- a/tests/pytests/unit/modules/test_chocolatey.py +++ b/tests/pytests/unit/modules/test_chocolatey.py @@ -33,9 +33,7 @@ def chocolatey_path_pd(): @pytest.fixture(scope="module") def choco_path_pd(): - return os.path.join( - os.environ.get("ProgramData"), "Chocolatey", "bin", "choco.exe" - ) + return os.path.join(os.environ.get("ProgramData"), "Chocolatey", "bin", "choco.exe") @pytest.fixture(scope="module") From 84df80accb45e8ee868a932ed44fcd2a137fcfd5 Mon Sep 17 00:00:00 2001 From: twangboy Date: Thu, 29 Jun 2023 17:12:28 -0600 Subject: [PATCH 167/393] Fix failing tests (cherry picked from commit 1ef90cbdc7203f97775edb7666db86a41eb9fc15) --- tests/pytests/unit/modules/test_chocolatey.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tests/pytests/unit/modules/test_chocolatey.py b/tests/pytests/unit/modules/test_chocolatey.py index 74c29d36fe8..c4b955321d1 100644 --- a/tests/pytests/unit/modules/test_chocolatey.py +++ b/tests/pytests/unit/modules/test_chocolatey.py @@ -146,19 +146,20 @@ def test__find_chocolatey_programdata(mock_false, mock_true, chocolatey_path_pd) "os.path.isfile", mock_true ): result = chocolatey._find_chocolatey() - expected = choco_path_pd + expected = chocolatey_path_pd # Does it return the correct path assert result == expected # Does it populate __context__ assert chocolatey.__context__["chocolatey._path"] == expected -def test__find_choco_programdata(mock_false, mock_true, choco_path_pd): +def test__find_choco_programdata(mock_false, choco_path_pd): """ Test _find_chocolatey when found in ProgramData and named choco.exe """ + mock_is_file = MagicMock(side_effect=[False, True]) with patch.dict(chocolatey.__salt__, {"cmd.which": mock_false}), patch( - "os.path.isfile", mock_true + "os.path.isfile", mock_is_file ): result = chocolatey._find_chocolatey() expected = choco_path_pd @@ -173,7 +174,7 @@ def test__find_chocolatey_systemdrive(mock_false, choco_path_sd): Test _find_chocolatey when found on SystemDrive (older versions) """ with patch.dict(chocolatey.__salt__, {"cmd.which": mock_false}), patch( - "os.path.isfile", MagicMock(side_effect=[False, True]) + "os.path.isfile", MagicMock(side_effect=[False, False, True]) ): result = chocolatey._find_chocolatey() expected = choco_path_sd From bba34f19630b5f13db7835b54de1233e4d5c130c Mon Sep 17 00:00:00 2001 From: MKLeb Date: Thu, 29 Jun 2023 16:49:04 -0400 Subject: [PATCH 168/393] Migrate the old service state tests to pytest --- tests/filename_map.yml | 2 +- tests/integration/states/test_service.py | 119 ----------- .../integration/states/test_service.py | 184 ++++++++++++++++++ 3 files changed, 185 insertions(+), 120 deletions(-) delete mode 100644 tests/integration/states/test_service.py create mode 100644 tests/pytests/integration/states/test_service.py diff --git a/tests/filename_map.yml b/tests/filename_map.yml index 968e1f32195..50411596395 100644 --- a/tests/filename_map.yml +++ b/tests/filename_map.yml @@ -31,7 +31,7 @@ salt/modules/(aix_group|groupadd|mac_group|pw_group|solaris_group|win_groupadd)\ salt/modules/(debian_service|freebsdservice|gentoo_service|launchctl_service|mac_service|netbsdservice|openbsdrcctl_service|openbsdservice|rh_service|runit|linux_service|smf_service|systemd_service|upstart_service|win_service)\.py: - pytests.unit.states.test_service - integration.modules.test_service - - integration.states.test_service + - pytests.integration.states.test_service salt/modules/ansiblegate.py: diff --git a/tests/integration/states/test_service.py b/tests/integration/states/test_service.py deleted file mode 100644 index 8607c92b278..00000000000 --- a/tests/integration/states/test_service.py +++ /dev/null @@ -1,119 +0,0 @@ -""" -Tests for the service state -""" - -import re - -import pytest - -import salt.utils.path -import salt.utils.platform -from tests.support.case import ModuleCase -from tests.support.mixins import SaltReturnAssertsMixin - -INIT_DELAY = 5 - - -@pytest.mark.windows_whitelisted -@pytest.mark.destructive_test -class ServiceTest(ModuleCase, SaltReturnAssertsMixin): - """ - Validate the service state - """ - - def setUp(self): - self.service_name = "cron" - cmd_name = "crontab" - os_family = self.run_function("grains.get", ["os_family"]) - os_release = self.run_function("grains.get", ["osrelease"]) - is_systemd = self.run_function("grains.get", ["systemd"]) - self.stopped = False - self.running = True - if os_family == "RedHat": - self.service_name = "crond" - elif os_family == "Arch": - self.service_name = "sshd" - cmd_name = "systemctl" - elif os_family == "MacOS": - self.service_name = "com.apple.AirPlayXPCHelper" - elif os_family == "Windows": - self.service_name = "Spooler" - - self.pre_srv_enabled = ( - True - if self.service_name in self.run_function("service.get_enabled") - else False - ) - self.post_srv_disable = False - if not self.pre_srv_enabled: - self.run_function("service.enable", name=self.service_name) - self.post_srv_disable = True - - if os_family != "Windows" and salt.utils.path.which(cmd_name) is None: - self.skipTest("{} is not installed".format(cmd_name)) - - if is_systemd and self.run_function("service.offline"): - self.skipTest("systemd is OFFLINE") - - def tearDown(self): - if self.post_srv_disable: - self.run_function("service.disable", name=self.service_name) - - def check_service_status(self, exp_return): - """ - helper method to check status of service - """ - check_status = self.run_function("service.status", name=self.service_name) - - try: - if not re.match(exp_return, check_status): - self.fail("status of service is not returning correctly") - except TypeError: - if check_status is not exp_return: - self.fail("status of service is not returning correctly") - - @pytest.mark.slow_test - def test_service_running(self): - """ - test service.running state module - """ - if self.run_function("service.status", name=self.service_name): - stop_service = self.run_function("service.stop", name=self.service_name) - self.assertTrue(stop_service) - self.check_service_status(self.stopped) - - if salt.utils.platform.is_darwin(): - # make sure the service is enabled on macosx - enable = self.run_function("service.enable", name=self.service_name) - - start_service = self.run_state("service.running", name=self.service_name) - self.assertTrue(start_service) - self.check_service_status(self.running) - - @pytest.mark.slow_test - def test_service_dead(self): - """ - test service.dead state module - """ - start_service = self.run_state("service.running", name=self.service_name) - self.assertSaltTrueReturn(start_service) - self.check_service_status(self.running) - - ret = self.run_state("service.dead", name=self.service_name) - self.assertSaltTrueReturn(ret) - self.check_service_status(self.stopped) - - @pytest.mark.slow_test - def test_service_dead_init_delay(self): - """ - test service.dead state module with init_delay arg - """ - start_service = self.run_state("service.running", name=self.service_name) - self.assertSaltTrueReturn(start_service) - self.check_service_status(self.running) - - ret = self.run_state( - "service.dead", name=self.service_name, init_delay=INIT_DELAY - ) - self.assertSaltTrueReturn(ret) - self.check_service_status(self.stopped) diff --git a/tests/pytests/integration/states/test_service.py b/tests/pytests/integration/states/test_service.py new file mode 100644 index 00000000000..2718be3cc45 --- /dev/null +++ b/tests/pytests/integration/states/test_service.py @@ -0,0 +1,184 @@ +""" +Tests for the service state +""" + +import os + +import pytest + +import salt.utils.path +import salt.utils.platform + +INIT_DELAY = 5 + + +pytestmark = [ + pytest.mark.windows_whitelisted, + pytest.mark.destructive_test, + pytest.mark.slow_test, +] + + +STOPPED = False +RUNNING = True + + +@pytest.fixture +def service_name(grains, salt_cli, salt_minion): + # For local testing purposes + env_name = os.environ.get("SALT_SERVICE_STATE_TEST_SERVICE") + if env_name is not None: + return env_name + + service_name = "cron" + cmd_name = "crontab" + os_family = grains["os_family"] + is_systemd = grains["systemd"] + if os_family == "RedHat": + service_name = "crond" + elif os_family == "Arch": + service_name = "sshd" + cmd_name = "systemctl" + elif os_family == "MacOS": + service_name = "com.apple.AirPlayXPCHelper" + elif os_family == "Windows": + service_name = "Spooler" + + if os_family != "Windows" and salt.utils.path.which(cmd_name) is None: + pytest.skip("{} is not installed".format(cmd_name)) + + if is_systemd and salt_cli.run("service.offline", minion_tgt=salt_minion.id): + pytest.skip("systemd is OFFLINE") + + return service_name + + +@pytest.fixture(autouse=True) +def setup_service(service_name, salt_cli, salt_minion): + pre_srv_enabled = ( + True + if service_name + in salt_cli.run("service.get_enabled", minion_tgt=salt_minion.id).stdout + else False + ) + post_srv_disable = False + if not pre_srv_enabled: + salt_cli.run("service.enable", service_name, minion_tgt=salt_minion.id) + post_srv_disable = True + yield post_srv_disable + if post_srv_disable: + salt_cli.run("service.disable", service_name, minion_tgt=salt_minion.id) + + +# def setUp(self): +# self.service_name = "cron" +# cmd_name = "crontab" +# os_family = self.run_function("grains.get", ["os_family"]) +# os_release = self.run_function("grains.get", ["osrelease"]) +# is_systemd = self.run_function("grains.get", ["systemd"]) +# self.stopped = False +# self.running = True +# if os_family == "RedHat": +# self.service_name = "crond" +# elif os_family == "Arch": +# self.service_name = "sshd" +# cmd_name = "systemctl" +# elif os_family == "MacOS": +# self.service_name = "com.apple.AirPlayXPCHelper" +# elif os_family == "Windows": +# self.service_name = "Spooler" + +# self.pre_srv_enabled = ( +# True +# if self.service_name in self.run_function("service.get_enabled") +# else False +# ) +# self.post_srv_disable = False +# if not self.pre_srv_enabled: +# self.run_function("service.enable", name=self.service_name) +# self.post_srv_disable = True + +# if os_family != "Windows" and salt.utils.path.which(cmd_name) is None: +# self.skipTest("{} is not installed".format(cmd_name)) + +# if is_systemd and self.run_function("service.offline"): +# self.skipTest("systemd is OFFLINE") + +# def tearDown(self): +# if self.post_srv_disable: +# self.run_function("service.disable", name=self.service_name) + + +def check_service_status(exp_return, salt_cli, salt_minion, service_name): + """ + helper method to check status of service + """ + check_status = salt_cli.run( + "service.status", service_name, minion_tgt=salt_minion.id + ) + + if check_status.data is not exp_return: + pytest.fail("status of service is not returning correctly") + + +@pytest.mark.slow_test +def test_service_running(service_name, salt_minion, salt_cli): + """ + test service.running state module + """ + if salt_cli.run("service.status", service_name, minion_tgt=salt_minion.id): + stop_service = salt_cli.run( + "service.stop", service_name, minion_tgt=salt_minion.id + ) + assert stop_service.data is True + check_service_status(STOPPED, salt_cli, salt_minion, service_name) + + if salt.utils.platform.is_darwin(): + # make sure the service is enabled on macosx + enable = salt_cli.run("service.enable", service_name, minion_tgt=salt_minion.id) + + start_service = salt_cli.run( + "state.single", "service.running", service_name, minion_tgt=salt_minion.id + ) + assert next(iter(start_service.data.values()))["result"] is True + check_service_status(RUNNING, salt_cli, salt_minion, service_name) + + +@pytest.mark.slow_test +def test_service_dead(service_name, salt_cli, salt_minion): + """ + test service.dead state module + """ + start_service = salt_cli.run( + "state.single", "service.running", service_name, minion_tgt=salt_minion.id + ) + assert next(iter(start_service.data.values()))["result"] is True + check_service_status(RUNNING, salt_cli, salt_minion, service_name) + + ret = salt_cli.run( + "state.single", "service.dead", service_name, minion_tgt=salt_minion.id + ) + assert next(iter(ret.data.values()))["result"] is True + check_service_status(STOPPED, salt_cli, salt_minion, service_name) + + +@pytest.mark.slow_test +def test_service_dead_init_delay(service_name, salt_cli, salt_minion): + """ + test service.dead state module with init_delay arg + """ + start_service = salt_cli.run( + "state.single", "service.running", service_name, minion_tgt=salt_minion.id + ) + assert next(iter(start_service.data.values()))["result"] is True + check_service_status(RUNNING, salt_cli, salt_minion, service_name) + + ret = salt_cli.run( + "state.single", + "service.dead", + service_name, + init_delay=INIT_DELAY, + minion_tgt=salt_minion.id, + ) + assert next(iter(ret.data.values()))["result"] is True + check_service_status(STOPPED, salt_cli, salt_minion, service_name) From cb4f1be42e894a0d556aaf0d56738f25a613c560 Mon Sep 17 00:00:00 2001 From: MKLeb Date: Fri, 30 Jun 2023 16:29:36 -0400 Subject: [PATCH 169/393] Migrate the service module integration tests to pytest --- tests/filename_map.yml | 2 +- tests/integration/modules/test_service.py | 183 ----------------- .../integration/modules/test_service.py | 185 ++++++++++++++++++ .../integration/states/test_service.py | 45 +---- 4 files changed, 188 insertions(+), 227 deletions(-) delete mode 100644 tests/integration/modules/test_service.py create mode 100644 tests/pytests/integration/modules/test_service.py diff --git a/tests/filename_map.yml b/tests/filename_map.yml index 50411596395..caa5e472144 100644 --- a/tests/filename_map.yml +++ b/tests/filename_map.yml @@ -30,7 +30,7 @@ salt/modules/(aix_group|groupadd|mac_group|pw_group|solaris_group|win_groupadd)\ salt/modules/(debian_service|freebsdservice|gentoo_service|launchctl_service|mac_service|netbsdservice|openbsdrcctl_service|openbsdservice|rh_service|runit|linux_service|smf_service|systemd_service|upstart_service|win_service)\.py: - pytests.unit.states.test_service - - integration.modules.test_service + - pytests.integration.modules.test_service - pytests.integration.states.test_service diff --git a/tests/integration/modules/test_service.py b/tests/integration/modules/test_service.py deleted file mode 100644 index 7c070c6e2af..00000000000 --- a/tests/integration/modules/test_service.py +++ /dev/null @@ -1,183 +0,0 @@ -import pytest - -import salt.utils.path -import salt.utils.platform -import salt.utils.systemd -from tests.support.case import ModuleCase - - -@pytest.mark.destructive_test -@pytest.mark.windows_whitelisted -class ServiceModuleTest(ModuleCase): - """ - Module testing the service module - """ - - def setUp(self): - self.service_name = "cron" - cmd_name = "crontab" - os_family = self.run_function("grains.get", ["os_family"]) - os_release = self.run_function("grains.get", ["osrelease"]) - if os_family == "RedHat": - if os_release[0] == "7": - self.skipTest( - "Disabled on CentOS 7 until we can fix SSH connection issues." - ) - self.service_name = "crond" - elif os_family == "Arch": - self.service_name = "sshd" - cmd_name = "systemctl" - elif os_family == "NILinuxRT": - self.service_name = "syslog" - cmd_name = "syslog-ng" - elif os_family == "MacOS": - self.service_name = "com.apple.AirPlayXPCHelper" - elif salt.utils.platform.is_windows(): - self.service_name = "Spooler" - - self.pre_srv_status = self.run_function("service.status", [self.service_name]) - self.pre_srv_enabled = ( - True - if self.service_name in self.run_function("service.get_enabled") - else False - ) - - if ( - salt.utils.path.which(cmd_name) is None - and not salt.utils.platform.is_windows() - ): - self.skipTest("{} is not installed".format(cmd_name)) - - def tearDown(self): - post_srv_status = self.run_function("service.status", [self.service_name]) - post_srv_enabled = ( - True - if self.service_name in self.run_function("service.get_enabled") - else False - ) - - if post_srv_status != self.pre_srv_status: - if self.pre_srv_status: - self.run_function("service.enable", [self.service_name]) - else: - self.run_function("service.disable", [self.service_name]) - - if post_srv_enabled != self.pre_srv_enabled: - if self.pre_srv_enabled: - self.run_function("service.enable", [self.service_name]) - else: - self.run_function("service.disable", [self.service_name]) - del self.service_name - - @pytest.mark.flaky(max_runs=4) - @pytest.mark.slow_test - def test_service_status_running(self): - """ - test service.status execution module - when service is running - """ - self.run_function("service.start", [self.service_name]) - check_service = self.run_function("service.status", [self.service_name]) - self.assertTrue(check_service) - - @pytest.mark.slow_test - def test_service_status_dead(self): - """ - test service.status execution module - when service is dead - """ - self.run_function("service.stop", [self.service_name]) - check_service = self.run_function("service.status", [self.service_name]) - self.assertFalse(check_service) - - @pytest.mark.slow_test - def test_service_restart(self): - """ - test service.restart - """ - self.assertTrue(self.run_function("service.restart", [self.service_name])) - - @pytest.mark.slow_test - def test_service_enable(self): - """ - test service.get_enabled and service.enable module - """ - # disable service before test - self.assertTrue(self.run_function("service.disable", [self.service_name])) - - self.assertTrue(self.run_function("service.enable", [self.service_name])) - self.assertIn(self.service_name, self.run_function("service.get_enabled")) - - @pytest.mark.slow_test - def test_service_disable(self): - """ - test service.get_disabled and service.disable module - """ - # enable service before test - self.assertTrue(self.run_function("service.enable", [self.service_name])) - - self.assertTrue(self.run_function("service.disable", [self.service_name])) - if salt.utils.platform.is_darwin(): - self.assertTrue(self.run_function("service.disabled", [self.service_name])) - else: - self.assertIn(self.service_name, self.run_function("service.get_disabled")) - - @pytest.mark.slow_test - def test_service_disable_doesnot_exist(self): - """ - test service.get_disabled and service.disable module - when service name does not exist - """ - # enable service before test - srv_name = "doesnotexist" - enable = self.run_function("service.enable", [srv_name]) - systemd = salt.utils.systemd.booted() - - # check service was not enabled - try: - self.assertFalse(enable) - except AssertionError: - self.assertIn("ERROR", enable) - - # check service was not disabled - if ( - tuple( - self.run_function("grains.item", ["osrelease_info"])["osrelease_info"] - ) - == (14, 0o4) - and not systemd - ): - # currently upstart does not have a mechanism to report if disabling a service fails if does not exist - self.assertTrue(self.run_function("service.disable", [srv_name])) - elif ( - self.run_function("grains.item", ["os"])["os"] == "Debian" - and self.run_function("grains.item", ["osmajorrelease"])["osmajorrelease"] - < 9 - and systemd - ): - # currently disabling a service via systemd that does not exist - # on Debian 8 results in a True return code - self.assertTrue(self.run_function("service.disable", [srv_name])) - else: - try: - disable = self.run_function("service.disable", [srv_name]) - self.assertFalse(disable) - except AssertionError: - self.assertTrue("error" in disable.lower()) - - if salt.utils.platform.is_darwin(): - self.assertEqual( - self.run_function("service.disabled", [srv_name]), - "ERROR: Service not found: {}".format(srv_name), - ) - else: - self.assertNotIn(srv_name, self.run_function("service.get_disabled")) - - @pytest.mark.skip_unless_on_windows - @pytest.mark.slow_test - def test_service_get_service_name(self): - """ - test service.get_service_name - """ - ret = self.run_function("service.get_service_name") - self.assertIn(self.service_name, ret.values()) diff --git a/tests/pytests/integration/modules/test_service.py b/tests/pytests/integration/modules/test_service.py new file mode 100644 index 00000000000..5a7115fffa2 --- /dev/null +++ b/tests/pytests/integration/modules/test_service.py @@ -0,0 +1,185 @@ +import os + +import pytest + +import salt.utils.path +import salt.utils.platform +import salt.utils.systemd + +pytestmark = [ + pytest.mark.windows_whitelisted, + pytest.mark.destructive_test, + pytest.mark.slow_test, +] + + +@pytest.fixture +def service_name(grains, salt_cli, salt_minion): + # For local testing purposes + env_name = os.environ.get("SALT_INTEGRATION_TEST_SERVICE_NAME") + if env_name is not None: + return env_name + + service_name = "cron" + cmd_name = "crontab" + os_family = grains["os_family"] + is_systemd = grains["systemd"] + if os_family == "RedHat": + service_name = "crond" + elif os_family == "Arch": + service_name = "sshd" + cmd_name = "systemctl" + elif os_family == "MacOS": + service_name = "com.apple.AirPlayXPCHelper" + elif os_family == "Windows": + service_name = "Spooler" + + if os_family != "Windows" and salt.utils.path.which(cmd_name) is None: + pytest.skip("{} is not installed".format(cmd_name)) + + if is_systemd and salt_cli.run("service.offline", minion_tgt=salt_minion.id): + pytest.skip("systemd is OFFLINE") + + return service_name + + +@pytest.fixture(autouse=True) +def setup_service(service_name, salt_cli, salt_minion): + pre_srv_status = salt_cli.run("service.status", minion_tgt=salt_minion.id).data + pre_srv_enabled = ( + service_name + in salt_cli.run("service.get_enabled", minion_tgt=salt_minion.id).data + ) + + yield pre_srv_status + + post_srv_status = salt_cli.run("service.status", minion_tgt=salt_minion.id).data + post_srv_enabled = ( + service_name + in salt_cli.run("service.get_enabled", minion_tgt=salt_minion.id).data + ) + + if post_srv_status != pre_srv_status: + if pre_srv_status: + salt_cli.run("service.enable", service_name, minion_tgt=salt_minion.id) + else: + salt_cli.run("service.disable", service_name, minion_tgt=salt_minion.id) + + if post_srv_enabled != pre_srv_enabled: + if pre_srv_enabled: + salt_cli.run("service.enable", service_name, minion_tgt=salt_minion.id) + else: + salt_cli.run("service.disable", service_name, minion_tgt=salt_minion.id) + + +@pytest.mark.flaky(max_runs=4) +def test_service_status_running(salt_cli, salt_minion, service_name): + """ + test service.status execution module + when service is running + """ + salt_cli.run("service.start", service_name, minion_tgt=salt_minion.id) + check_service = salt_cli.run( + "service.status", service_name, minion_tgt=salt_minion.id + ).data + assert check_service + + +def test_service_status_dead(salt_cli, salt_minion, service_name): + """ + test service.status execution module + when service is dead + """ + salt_cli.run("service.stop", service_name, minion_tgt=salt_minion.id) + check_service = salt_cli.run( + "service.status", service_name, minion_tgt=salt_minion.id + ).data + assert not check_service + + +def test_service_restart(salt_cli, salt_minion, service_name): + """ + test service.restart + """ + assert salt_cli.run("service.stop", service_name, minion_tgt=salt_minion.id).data + + +def test_service_enable(salt_cli, salt_minion, service_name): + """ + test service.get_enabled and service.enable module + """ + # disable service before test + assert salt_cli.run("service.disable", service_name, minion_tgt=salt_minion.id).data + + assert salt_cli.run("service.enable", service_name, minion_tgt=salt_minion.id).data + assert ( + service_name + in salt_cli.run("service.get_enabled", minion_tgt=salt_minion.id).data + ) + + +def test_service_disable(salt_cli, salt_minion, service_name): + """ + test service.get_disabled and service.disable module + """ + # enable service before test + assert salt_cli.run("service.enable", service_name, minion_tgt=salt_minion.id).data + + assert salt_cli.run("service.disable", service_name, minion_tgt=salt_minion.id).data + if salt.utils.platform.is_darwin(): + assert salt_cli.run( + "service.disabled", service_name, minion_tgt=salt_minion.id + ).data + else: + assert ( + service_name + in salt_cli.run("service.get_disabled", minion_tgt=salt_minion.id).data + ) + + +def test_service_disable_doesnot_exist(salt_cli, salt_minion): + """ + test service.get_disabled and service.disable module + when service name does not exist + """ + # enable service before test + srv_name = "doesnotexist" + enable = salt_cli.run("service.enable", srv_name, minion_tgt=salt_minion.id).data + systemd = salt.utils.systemd.booted() + + # check service was not enabled + try: + assert not enable + except AssertionError: + assert "error" in enable.lower() + + else: + try: + disable = salt_cli.run( + "service.disable", srv_name, minion_tgt=salt_minion.id + ).data + assert not disable + except AssertionError: + assert "error" in disable.lower() + + if salt.utils.platform.is_darwin(): + assert ( + "ERROR: Service not found: {}".format(srv_name) + in salt_cli.run( + "service.disabled", srv_name, minion_tgt=salt_minion.id + ).stdout + ) + else: + assert ( + srv_name + not in salt_cli.run("service.get_disabled", minion_tgt=salt_minion.id).data + ) + + +@pytest.mark.skip_unless_on_windows +def test_service_get_service_name(salt_cli, salt_minion, service_name): + """ + test service.get_service_name + """ + ret = salt_cli.run("service.get_service_name", minion_tgt=salt_minion.id).data + assert service_name in ret.data.values() diff --git a/tests/pytests/integration/states/test_service.py b/tests/pytests/integration/states/test_service.py index 2718be3cc45..b68afa856a5 100644 --- a/tests/pytests/integration/states/test_service.py +++ b/tests/pytests/integration/states/test_service.py @@ -9,9 +9,6 @@ import pytest import salt.utils.path import salt.utils.platform -INIT_DELAY = 5 - - pytestmark = [ pytest.mark.windows_whitelisted, pytest.mark.destructive_test, @@ -19,6 +16,7 @@ pytestmark = [ ] +INIT_DELAY = 5 STOPPED = False RUNNING = True @@ -26,7 +24,7 @@ RUNNING = True @pytest.fixture def service_name(grains, salt_cli, salt_minion): # For local testing purposes - env_name = os.environ.get("SALT_SERVICE_STATE_TEST_SERVICE") + env_name = os.environ.get("SALT_INTEGRATION_TEST_SERVICE_NAME") if env_name is not None: return env_name @@ -70,45 +68,6 @@ def setup_service(service_name, salt_cli, salt_minion): salt_cli.run("service.disable", service_name, minion_tgt=salt_minion.id) -# def setUp(self): -# self.service_name = "cron" -# cmd_name = "crontab" -# os_family = self.run_function("grains.get", ["os_family"]) -# os_release = self.run_function("grains.get", ["osrelease"]) -# is_systemd = self.run_function("grains.get", ["systemd"]) -# self.stopped = False -# self.running = True -# if os_family == "RedHat": -# self.service_name = "crond" -# elif os_family == "Arch": -# self.service_name = "sshd" -# cmd_name = "systemctl" -# elif os_family == "MacOS": -# self.service_name = "com.apple.AirPlayXPCHelper" -# elif os_family == "Windows": -# self.service_name = "Spooler" - -# self.pre_srv_enabled = ( -# True -# if self.service_name in self.run_function("service.get_enabled") -# else False -# ) -# self.post_srv_disable = False -# if not self.pre_srv_enabled: -# self.run_function("service.enable", name=self.service_name) -# self.post_srv_disable = True - -# if os_family != "Windows" and salt.utils.path.which(cmd_name) is None: -# self.skipTest("{} is not installed".format(cmd_name)) - -# if is_systemd and self.run_function("service.offline"): -# self.skipTest("systemd is OFFLINE") - -# def tearDown(self): -# if self.post_srv_disable: -# self.run_function("service.disable", name=self.service_name) - - def check_service_status(exp_return, salt_cli, salt_minion, service_name): """ helper method to check status of service From b1fe70ed098842e26c079535cff543631c0a60ce Mon Sep 17 00:00:00 2001 From: MKLeb Date: Fri, 30 Jun 2023 17:52:11 -0400 Subject: [PATCH 170/393] Use `.get()` on grains fixture --- tests/pytests/integration/modules/test_service.py | 4 ++-- tests/pytests/integration/states/test_service.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/pytests/integration/modules/test_service.py b/tests/pytests/integration/modules/test_service.py index 5a7115fffa2..1b4f75a2418 100644 --- a/tests/pytests/integration/modules/test_service.py +++ b/tests/pytests/integration/modules/test_service.py @@ -22,8 +22,8 @@ def service_name(grains, salt_cli, salt_minion): service_name = "cron" cmd_name = "crontab" - os_family = grains["os_family"] - is_systemd = grains["systemd"] + os_family = grains.get("os_family") + is_systemd = grains.get("systemd") if os_family == "RedHat": service_name = "crond" elif os_family == "Arch": diff --git a/tests/pytests/integration/states/test_service.py b/tests/pytests/integration/states/test_service.py index b68afa856a5..c6ac99d7306 100644 --- a/tests/pytests/integration/states/test_service.py +++ b/tests/pytests/integration/states/test_service.py @@ -30,8 +30,8 @@ def service_name(grains, salt_cli, salt_minion): service_name = "cron" cmd_name = "crontab" - os_family = grains["os_family"] - is_systemd = grains["systemd"] + os_family = grains.get("os_family") + is_systemd = grains.get("systemd") if os_family == "RedHat": service_name = "crond" elif os_family == "Arch": From ed299d9d7010b4d75585a26a399acb1a0a60c419 Mon Sep 17 00:00:00 2001 From: MKLeb Date: Thu, 13 Jul 2023 15:10:16 -0400 Subject: [PATCH 171/393] Move the service module and state integration tests to be functional tests --- tests/filename_map.yml | 4 +- .../functional/modules/test_service.py | 157 +++++++++++++++ .../pytests/functional/states/test_service.py | 120 ++++++++++++ .../integration/modules/test_service.py | 185 ------------------ .../integration/states/test_service.py | 143 -------------- 5 files changed, 279 insertions(+), 330 deletions(-) create mode 100644 tests/pytests/functional/modules/test_service.py create mode 100644 tests/pytests/functional/states/test_service.py delete mode 100644 tests/pytests/integration/modules/test_service.py delete mode 100644 tests/pytests/integration/states/test_service.py diff --git a/tests/filename_map.yml b/tests/filename_map.yml index caa5e472144..6e5da60df43 100644 --- a/tests/filename_map.yml +++ b/tests/filename_map.yml @@ -30,8 +30,8 @@ salt/modules/(aix_group|groupadd|mac_group|pw_group|solaris_group|win_groupadd)\ salt/modules/(debian_service|freebsdservice|gentoo_service|launchctl_service|mac_service|netbsdservice|openbsdrcctl_service|openbsdservice|rh_service|runit|linux_service|smf_service|systemd_service|upstart_service|win_service)\.py: - pytests.unit.states.test_service - - pytests.integration.modules.test_service - - pytests.integration.states.test_service + - pytests.functional.modules.test_service + - pytests.functional.states.test_service salt/modules/ansiblegate.py: diff --git a/tests/pytests/functional/modules/test_service.py b/tests/pytests/functional/modules/test_service.py new file mode 100644 index 00000000000..234da77a95b --- /dev/null +++ b/tests/pytests/functional/modules/test_service.py @@ -0,0 +1,157 @@ +import os + +import pytest + +import salt.utils.path +import salt.utils.platform +import salt.utils.systemd +from salt.exceptions import CommandExecutionError + +pytestmark = [ + pytest.mark.windows_whitelisted, + pytest.mark.destructive_test, + pytest.mark.slow_test, +] + + +@pytest.fixture +def service_name(grains, modules): + # For local testing purposes + env_name = os.environ.get("SALT_FUNCTIONAL_TEST_SERVICE_NAME") + if env_name is not None: + return env_name + + service_name = "cron" + cmd_name = "crontab" + os_family = grains.get("os_family") + is_systemd = grains.get("systemd") + if os_family == "RedHat": + service_name = "crond" + elif os_family == "Arch": + service_name = "sshd" + cmd_name = "systemctl" + elif os_family == "MacOS": + service_name = "com.apple.AirPlayXPCHelper" + elif os_family == "Windows": + service_name = "Spooler" + + if os_family != "Windows" and salt.utils.path.which(cmd_name) is None: + pytest.skip("{} is not installed".format(cmd_name)) + + if is_systemd and modules.service.offline(): + pytest.skip("systemd is OFFLINE") + + return service_name + + +@pytest.fixture(autouse=True) +def setup_service(service_name, modules): + pre_srv_status = modules.service.status(service_name) + pre_srv_enabled = service_name in modules.service.get_enabled() + + yield pre_srv_status + + post_srv_status = modules.service.status(service_name) + post_srv_enabled = service_name in modules.service.get_enabled() + + if post_srv_status != pre_srv_status: + if pre_srv_status: + modules.service.enable(service_name) + else: + modules.service.disable(service_name) + + if post_srv_enabled != pre_srv_enabled: + if pre_srv_enabled: + modules.service.enable(service_name) + else: + modules.service.disable(service_name) + + +@pytest.mark.flaky(max_runs=4) +def test_service_status_running(modules, service_name): + """ + test service.status execution module + when service is running + """ + modules.service.start(service_name) + check_service = modules.service.status(service_name) + assert check_service + + +def test_service_status_dead(modules, service_name): + """ + test service.status execution module + when service is dead + """ + modules.service.stop(service_name) + check_service = modules.service.status(service_name) + assert not check_service + + +def test_service_restart(modules, service_name): + """ + test service.restart + """ + assert modules.service.stop(service_name) + + +def test_service_enable(modules, service_name): + """ + test service.get_enabled and service.enable module + """ + # disable service before test + assert modules.service.disable(service_name) + + assert modules.service.enable(service_name) + assert service_name in modules.service.get_enabled() + + +def test_service_disable(modules, service_name): + """ + test service.get_disabled and service.disable module + """ + # enable service before test + assert modules.service.enable(service_name) + + assert modules.service.disable(service_name) + if salt.utils.platform.is_darwin(): + assert modules.service.disabled(service_name) + else: + assert service_name in modules.service.get_disabled() + + +def test_service_disable_doesnot_exist(modules): + """ + test service.get_disabled and service.disable module + when service name does not exist + """ + # enable service before test + srv_name = "doesnotexist" + try: + enable = modules.service.enable(srv_name) + assert not enable + except CommandExecutionError as exc: + assert srv_name in exc.error + + try: + disable = modules.service.disable(srv_name) + assert not disable + except CommandExecutionError as exc: + assert srv_name in exc.error + + if salt.utils.platform.is_darwin(): + with pytest.raises( + CommandExecutionError, match=f"Service not found: {srv_name}" + ): + modules.service.disabled(srv_name) + else: + assert srv_name not in modules.service.get_disabled() + + +@pytest.mark.skip_unless_on_windows +def test_service_get_service_name(modules, service_name): + """ + test service.get_service_name + """ + ret = modules.service.get_service_name() + assert service_name in ret.data.values() diff --git a/tests/pytests/functional/states/test_service.py b/tests/pytests/functional/states/test_service.py new file mode 100644 index 00000000000..8d577b3d97f --- /dev/null +++ b/tests/pytests/functional/states/test_service.py @@ -0,0 +1,120 @@ +""" +Tests for the service state +""" + +import os + +import pytest + +import salt.utils.path +import salt.utils.platform + +pytestmark = [ + pytest.mark.windows_whitelisted, + pytest.mark.destructive_test, + pytest.mark.slow_test, +] + + +INIT_DELAY = 5 +STOPPED = False +RUNNING = True + + +@pytest.fixture +def service_name(grains, modules): + # For local testing purposes + env_name = os.environ.get("SALT_FUNCTIONAL_TEST_SERVICE_NAME") + if env_name is not None: + return env_name + + service_name = "cron" + cmd_name = "crontab" + os_family = grains.get("os_family") + is_systemd = grains.get("systemd") + if os_family == "RedHat": + service_name = "crond" + elif os_family == "Arch": + service_name = "sshd" + cmd_name = "systemctl" + elif os_family == "MacOS": + service_name = "com.apple.AirPlayXPCHelper" + elif os_family == "Windows": + service_name = "Spooler" + + if os_family != "Windows" and salt.utils.path.which(cmd_name) is None: + pytest.skip("{} is not installed".format(cmd_name)) + + if is_systemd and modules.service.offline(): + pytest.skip("systemd is OFFLINE") + + return service_name + + +@pytest.fixture(autouse=True) +def setup_service(service_name, modules): + pre_srv_enabled = True if service_name in modules.service.get_enabled() else False + post_srv_disable = False + if not pre_srv_enabled: + modules.service.enable(service_name) + post_srv_disable = True + yield post_srv_disable + if post_srv_disable: + modules.service.disable(service_name) + + +def check_service_status(exp_return, modules, service_name): + """ + helper method to check status of service + """ + check_status = modules.service.status(service_name) + + if check_status is not exp_return: + pytest.fail("status of service is not returning correctly") + + +@pytest.mark.slow_test +def test_service_running(service_name, modules, states): + """ + test service.running state module + """ + if modules.service.status(service_name): + stop_service = modules.service.stop(service_name) + assert stop_service is True + check_service_status(STOPPED, modules, service_name) + + if salt.utils.platform.is_darwin(): + # make sure the service is enabled on macosx + enable = modules.service.enable(service_name) + + start_service = states.service.running(service_name) + assert start_service.full_return["result"] is True + check_service_status(RUNNING, modules, service_name) + + +@pytest.mark.slow_test +def test_service_dead(service_name, modules, states): + """ + test service.dead state module + """ + start_service = states.service.running(service_name) + assert start_service.full_return["result"] is True + check_service_status(RUNNING, modules, service_name) + + ret = states.service.dead(service_name) + assert ret.full_return["result"] is True + check_service_status(STOPPED, modules, service_name) + + +@pytest.mark.slow_test +def test_service_dead_init_delay(service_name, modules, states): + """ + test service.dead state module + """ + start_service = states.service.running(service_name) + assert start_service.full_return["result"] is True + check_service_status(RUNNING, modules, service_name) + + ret = states.service.dead(service_name, init_delay=INIT_DELAY) + assert ret.full_return["result"] is True + check_service_status(STOPPED, modules, service_name) diff --git a/tests/pytests/integration/modules/test_service.py b/tests/pytests/integration/modules/test_service.py deleted file mode 100644 index 1b4f75a2418..00000000000 --- a/tests/pytests/integration/modules/test_service.py +++ /dev/null @@ -1,185 +0,0 @@ -import os - -import pytest - -import salt.utils.path -import salt.utils.platform -import salt.utils.systemd - -pytestmark = [ - pytest.mark.windows_whitelisted, - pytest.mark.destructive_test, - pytest.mark.slow_test, -] - - -@pytest.fixture -def service_name(grains, salt_cli, salt_minion): - # For local testing purposes - env_name = os.environ.get("SALT_INTEGRATION_TEST_SERVICE_NAME") - if env_name is not None: - return env_name - - service_name = "cron" - cmd_name = "crontab" - os_family = grains.get("os_family") - is_systemd = grains.get("systemd") - if os_family == "RedHat": - service_name = "crond" - elif os_family == "Arch": - service_name = "sshd" - cmd_name = "systemctl" - elif os_family == "MacOS": - service_name = "com.apple.AirPlayXPCHelper" - elif os_family == "Windows": - service_name = "Spooler" - - if os_family != "Windows" and salt.utils.path.which(cmd_name) is None: - pytest.skip("{} is not installed".format(cmd_name)) - - if is_systemd and salt_cli.run("service.offline", minion_tgt=salt_minion.id): - pytest.skip("systemd is OFFLINE") - - return service_name - - -@pytest.fixture(autouse=True) -def setup_service(service_name, salt_cli, salt_minion): - pre_srv_status = salt_cli.run("service.status", minion_tgt=salt_minion.id).data - pre_srv_enabled = ( - service_name - in salt_cli.run("service.get_enabled", minion_tgt=salt_minion.id).data - ) - - yield pre_srv_status - - post_srv_status = salt_cli.run("service.status", minion_tgt=salt_minion.id).data - post_srv_enabled = ( - service_name - in salt_cli.run("service.get_enabled", minion_tgt=salt_minion.id).data - ) - - if post_srv_status != pre_srv_status: - if pre_srv_status: - salt_cli.run("service.enable", service_name, minion_tgt=salt_minion.id) - else: - salt_cli.run("service.disable", service_name, minion_tgt=salt_minion.id) - - if post_srv_enabled != pre_srv_enabled: - if pre_srv_enabled: - salt_cli.run("service.enable", service_name, minion_tgt=salt_minion.id) - else: - salt_cli.run("service.disable", service_name, minion_tgt=salt_minion.id) - - -@pytest.mark.flaky(max_runs=4) -def test_service_status_running(salt_cli, salt_minion, service_name): - """ - test service.status execution module - when service is running - """ - salt_cli.run("service.start", service_name, minion_tgt=salt_minion.id) - check_service = salt_cli.run( - "service.status", service_name, minion_tgt=salt_minion.id - ).data - assert check_service - - -def test_service_status_dead(salt_cli, salt_minion, service_name): - """ - test service.status execution module - when service is dead - """ - salt_cli.run("service.stop", service_name, minion_tgt=salt_minion.id) - check_service = salt_cli.run( - "service.status", service_name, minion_tgt=salt_minion.id - ).data - assert not check_service - - -def test_service_restart(salt_cli, salt_minion, service_name): - """ - test service.restart - """ - assert salt_cli.run("service.stop", service_name, minion_tgt=salt_minion.id).data - - -def test_service_enable(salt_cli, salt_minion, service_name): - """ - test service.get_enabled and service.enable module - """ - # disable service before test - assert salt_cli.run("service.disable", service_name, minion_tgt=salt_minion.id).data - - assert salt_cli.run("service.enable", service_name, minion_tgt=salt_minion.id).data - assert ( - service_name - in salt_cli.run("service.get_enabled", minion_tgt=salt_minion.id).data - ) - - -def test_service_disable(salt_cli, salt_minion, service_name): - """ - test service.get_disabled and service.disable module - """ - # enable service before test - assert salt_cli.run("service.enable", service_name, minion_tgt=salt_minion.id).data - - assert salt_cli.run("service.disable", service_name, minion_tgt=salt_minion.id).data - if salt.utils.platform.is_darwin(): - assert salt_cli.run( - "service.disabled", service_name, minion_tgt=salt_minion.id - ).data - else: - assert ( - service_name - in salt_cli.run("service.get_disabled", minion_tgt=salt_minion.id).data - ) - - -def test_service_disable_doesnot_exist(salt_cli, salt_minion): - """ - test service.get_disabled and service.disable module - when service name does not exist - """ - # enable service before test - srv_name = "doesnotexist" - enable = salt_cli.run("service.enable", srv_name, minion_tgt=salt_minion.id).data - systemd = salt.utils.systemd.booted() - - # check service was not enabled - try: - assert not enable - except AssertionError: - assert "error" in enable.lower() - - else: - try: - disable = salt_cli.run( - "service.disable", srv_name, minion_tgt=salt_minion.id - ).data - assert not disable - except AssertionError: - assert "error" in disable.lower() - - if salt.utils.platform.is_darwin(): - assert ( - "ERROR: Service not found: {}".format(srv_name) - in salt_cli.run( - "service.disabled", srv_name, minion_tgt=salt_minion.id - ).stdout - ) - else: - assert ( - srv_name - not in salt_cli.run("service.get_disabled", minion_tgt=salt_minion.id).data - ) - - -@pytest.mark.skip_unless_on_windows -def test_service_get_service_name(salt_cli, salt_minion, service_name): - """ - test service.get_service_name - """ - ret = salt_cli.run("service.get_service_name", minion_tgt=salt_minion.id).data - assert service_name in ret.data.values() diff --git a/tests/pytests/integration/states/test_service.py b/tests/pytests/integration/states/test_service.py deleted file mode 100644 index c6ac99d7306..00000000000 --- a/tests/pytests/integration/states/test_service.py +++ /dev/null @@ -1,143 +0,0 @@ -""" -Tests for the service state -""" - -import os - -import pytest - -import salt.utils.path -import salt.utils.platform - -pytestmark = [ - pytest.mark.windows_whitelisted, - pytest.mark.destructive_test, - pytest.mark.slow_test, -] - - -INIT_DELAY = 5 -STOPPED = False -RUNNING = True - - -@pytest.fixture -def service_name(grains, salt_cli, salt_minion): - # For local testing purposes - env_name = os.environ.get("SALT_INTEGRATION_TEST_SERVICE_NAME") - if env_name is not None: - return env_name - - service_name = "cron" - cmd_name = "crontab" - os_family = grains.get("os_family") - is_systemd = grains.get("systemd") - if os_family == "RedHat": - service_name = "crond" - elif os_family == "Arch": - service_name = "sshd" - cmd_name = "systemctl" - elif os_family == "MacOS": - service_name = "com.apple.AirPlayXPCHelper" - elif os_family == "Windows": - service_name = "Spooler" - - if os_family != "Windows" and salt.utils.path.which(cmd_name) is None: - pytest.skip("{} is not installed".format(cmd_name)) - - if is_systemd and salt_cli.run("service.offline", minion_tgt=salt_minion.id): - pytest.skip("systemd is OFFLINE") - - return service_name - - -@pytest.fixture(autouse=True) -def setup_service(service_name, salt_cli, salt_minion): - pre_srv_enabled = ( - True - if service_name - in salt_cli.run("service.get_enabled", minion_tgt=salt_minion.id).stdout - else False - ) - post_srv_disable = False - if not pre_srv_enabled: - salt_cli.run("service.enable", service_name, minion_tgt=salt_minion.id) - post_srv_disable = True - yield post_srv_disable - if post_srv_disable: - salt_cli.run("service.disable", service_name, minion_tgt=salt_minion.id) - - -def check_service_status(exp_return, salt_cli, salt_minion, service_name): - """ - helper method to check status of service - """ - check_status = salt_cli.run( - "service.status", service_name, minion_tgt=salt_minion.id - ) - - if check_status.data is not exp_return: - pytest.fail("status of service is not returning correctly") - - -@pytest.mark.slow_test -def test_service_running(service_name, salt_minion, salt_cli): - """ - test service.running state module - """ - if salt_cli.run("service.status", service_name, minion_tgt=salt_minion.id): - stop_service = salt_cli.run( - "service.stop", service_name, minion_tgt=salt_minion.id - ) - assert stop_service.data is True - check_service_status(STOPPED, salt_cli, salt_minion, service_name) - - if salt.utils.platform.is_darwin(): - # make sure the service is enabled on macosx - enable = salt_cli.run("service.enable", service_name, minion_tgt=salt_minion.id) - - start_service = salt_cli.run( - "state.single", "service.running", service_name, minion_tgt=salt_minion.id - ) - assert next(iter(start_service.data.values()))["result"] is True - check_service_status(RUNNING, salt_cli, salt_minion, service_name) - - -@pytest.mark.slow_test -def test_service_dead(service_name, salt_cli, salt_minion): - """ - test service.dead state module - """ - start_service = salt_cli.run( - "state.single", "service.running", service_name, minion_tgt=salt_minion.id - ) - assert next(iter(start_service.data.values()))["result"] is True - check_service_status(RUNNING, salt_cli, salt_minion, service_name) - - ret = salt_cli.run( - "state.single", "service.dead", service_name, minion_tgt=salt_minion.id - ) - assert next(iter(ret.data.values()))["result"] is True - check_service_status(STOPPED, salt_cli, salt_minion, service_name) - - -@pytest.mark.slow_test -def test_service_dead_init_delay(service_name, salt_cli, salt_minion): - """ - test service.dead state module with init_delay arg - """ - start_service = salt_cli.run( - "state.single", "service.running", service_name, minion_tgt=salt_minion.id - ) - assert next(iter(start_service.data.values()))["result"] is True - check_service_status(RUNNING, salt_cli, salt_minion, service_name) - - ret = salt_cli.run( - "state.single", - "service.dead", - service_name, - init_delay=INIT_DELAY, - minion_tgt=salt_minion.id, - ) - assert next(iter(ret.data.values()))["result"] is True - check_service_status(STOPPED, salt_cli, salt_minion, service_name) From 65a6c47c8147b8b9b5180caeced5061e47302e25 Mon Sep 17 00:00:00 2001 From: MKLeb Date: Fri, 14 Jul 2023 09:41:08 -0400 Subject: [PATCH 172/393] Fix some failing systemd-based tests and remove old `data` reference --- tests/pytests/functional/modules/test_service.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/pytests/functional/modules/test_service.py b/tests/pytests/functional/modules/test_service.py index 234da77a95b..e5e9f47b11b 100644 --- a/tests/pytests/functional/modules/test_service.py +++ b/tests/pytests/functional/modules/test_service.py @@ -137,7 +137,7 @@ def test_service_disable_doesnot_exist(modules): disable = modules.service.disable(srv_name) assert not disable except CommandExecutionError as exc: - assert srv_name in exc.error + assert srv_name in exc.error or "no such file or directory" in exc.error.lower() if salt.utils.platform.is_darwin(): with pytest.raises( @@ -154,4 +154,4 @@ def test_service_get_service_name(modules, service_name): test service.get_service_name """ ret = modules.service.get_service_name() - assert service_name in ret.data.values() + assert service_name in ret.values() From 04a8b334ad04fff678bad37cb69a46693a287671 Mon Sep 17 00:00:00 2001 From: MKLeb Date: Fri, 14 Jul 2023 16:21:49 -0400 Subject: [PATCH 173/393] Also check for `no such file or directory` during the enablement check --- tests/pytests/functional/modules/test_service.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/pytests/functional/modules/test_service.py b/tests/pytests/functional/modules/test_service.py index e5e9f47b11b..64c29a5b631 100644 --- a/tests/pytests/functional/modules/test_service.py +++ b/tests/pytests/functional/modules/test_service.py @@ -131,7 +131,7 @@ def test_service_disable_doesnot_exist(modules): enable = modules.service.enable(srv_name) assert not enable except CommandExecutionError as exc: - assert srv_name in exc.error + assert srv_name in exc.error or "no such file or directory" in exc.error.lower() try: disable = modules.service.disable(srv_name) From 2a33abaf6cdf38df2c6e929793bb0f1cbda7bdcf Mon Sep 17 00:00:00 2001 From: MKLeb Date: Mon, 17 Jul 2023 12:47:19 -0400 Subject: [PATCH 174/393] Remove `flaky` decorator from `test_service_status_running` --- tests/pytests/functional/modules/test_service.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/pytests/functional/modules/test_service.py b/tests/pytests/functional/modules/test_service.py index 64c29a5b631..8f8b1fc2349 100644 --- a/tests/pytests/functional/modules/test_service.py +++ b/tests/pytests/functional/modules/test_service.py @@ -67,7 +67,6 @@ def setup_service(service_name, modules): modules.service.disable(service_name) -@pytest.mark.flaky(max_runs=4) def test_service_status_running(modules, service_name): """ test service.status execution module From a40d5afcac510dded33feeccd05e70f39ad8d3a1 Mon Sep 17 00:00:00 2001 From: MKLeb Date: Mon, 17 Jul 2023 12:50:41 -0400 Subject: [PATCH 175/393] Switch to `try/finally` blocks in `setup_service` fixtures --- .../functional/modules/test_service.py | 29 ++++++++++--------- .../pytests/functional/states/test_service.py | 8 +++-- 2 files changed, 20 insertions(+), 17 deletions(-) diff --git a/tests/pytests/functional/modules/test_service.py b/tests/pytests/functional/modules/test_service.py index 8f8b1fc2349..8001eb45e43 100644 --- a/tests/pytests/functional/modules/test_service.py +++ b/tests/pytests/functional/modules/test_service.py @@ -49,22 +49,23 @@ def setup_service(service_name, modules): pre_srv_status = modules.service.status(service_name) pre_srv_enabled = service_name in modules.service.get_enabled() - yield pre_srv_status + try: + yield pre_srv_status + finally: + post_srv_status = modules.service.status(service_name) + post_srv_enabled = service_name in modules.service.get_enabled() - post_srv_status = modules.service.status(service_name) - post_srv_enabled = service_name in modules.service.get_enabled() + if post_srv_status != pre_srv_status: + if pre_srv_status: + modules.service.enable(service_name) + else: + modules.service.disable(service_name) - if post_srv_status != pre_srv_status: - if pre_srv_status: - modules.service.enable(service_name) - else: - modules.service.disable(service_name) - - if post_srv_enabled != pre_srv_enabled: - if pre_srv_enabled: - modules.service.enable(service_name) - else: - modules.service.disable(service_name) + if post_srv_enabled != pre_srv_enabled: + if pre_srv_enabled: + modules.service.enable(service_name) + else: + modules.service.disable(service_name) def test_service_status_running(modules, service_name): diff --git a/tests/pytests/functional/states/test_service.py b/tests/pytests/functional/states/test_service.py index 8d577b3d97f..82006a22a1f 100644 --- a/tests/pytests/functional/states/test_service.py +++ b/tests/pytests/functional/states/test_service.py @@ -58,9 +58,11 @@ def setup_service(service_name, modules): if not pre_srv_enabled: modules.service.enable(service_name) post_srv_disable = True - yield post_srv_disable - if post_srv_disable: - modules.service.disable(service_name) + try: + yield post_srv_disable + finally: + if post_srv_disable: + modules.service.disable(service_name) def check_service_status(exp_return, modules, service_name): From 4d6ac22edea37f213fad2caa4417bc34a023047d Mon Sep 17 00:00:00 2001 From: MKLeb Date: Wed, 19 Jul 2023 10:21:28 -0400 Subject: [PATCH 176/393] Make sure the service is in the state it started at after running the service module tests --- .../functional/modules/test_service.py | 4 +-- .../pytests/functional/states/test_service.py | 26 +++++++++++++------ 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/tests/pytests/functional/modules/test_service.py b/tests/pytests/functional/modules/test_service.py index 8001eb45e43..51ce7f1cc0b 100644 --- a/tests/pytests/functional/modules/test_service.py +++ b/tests/pytests/functional/modules/test_service.py @@ -57,9 +57,9 @@ def setup_service(service_name, modules): if post_srv_status != pre_srv_status: if pre_srv_status: - modules.service.enable(service_name) + modules.service.start(service_name) else: - modules.service.disable(service_name) + modules.service.stop(service_name) if post_srv_enabled != pre_srv_enabled: if pre_srv_enabled: diff --git a/tests/pytests/functional/states/test_service.py b/tests/pytests/functional/states/test_service.py index 82006a22a1f..a1e9673653b 100644 --- a/tests/pytests/functional/states/test_service.py +++ b/tests/pytests/functional/states/test_service.py @@ -53,16 +53,26 @@ def service_name(grains, modules): @pytest.fixture(autouse=True) def setup_service(service_name, modules): - pre_srv_enabled = True if service_name in modules.service.get_enabled() else False - post_srv_disable = False - if not pre_srv_enabled: - modules.service.enable(service_name) - post_srv_disable = True + pre_srv_status = modules.service.status(service_name) + pre_srv_enabled = service_name in modules.service.get_enabled() + try: - yield post_srv_disable + yield pre_srv_status finally: - if post_srv_disable: - modules.service.disable(service_name) + post_srv_status = modules.service.status(service_name) + post_srv_enabled = service_name in modules.service.get_enabled() + + if post_srv_status != pre_srv_status: + if pre_srv_status: + modules.service.start(service_name) + else: + modules.service.stop(service_name) + + if post_srv_enabled != pre_srv_enabled: + if pre_srv_enabled: + modules.service.enable(service_name) + else: + modules.service.disable(service_name) def check_service_status(exp_return, modules, service_name): From 5613db440811430d5610befbe952f75dffa52290 Mon Sep 17 00:00:00 2001 From: "Daniel A. Wozniak" Date: Sun, 16 Jul 2023 15:03:06 -0700 Subject: [PATCH 177/393] Clarify rejected_retry option docs --- doc/ref/configuration/minion.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/ref/configuration/minion.rst b/doc/ref/configuration/minion.rst index 69c7afbde84..b614376d136 100644 --- a/doc/ref/configuration/minion.rst +++ b/doc/ref/configuration/minion.rst @@ -1197,8 +1197,8 @@ seconds each iteration. Default: ``False`` -If the master rejects the minion's public key, retry instead of exiting. -Rejected keys will be handled the same as waiting on acceptance. +If the master denies or rejects the minion's public key, retry instead of +exiting. These keys will be handled the same as waiting on acceptance. .. code-block:: yaml From 5fa7a865ab376f24b09bbe47157d99b1fe6a0847 Mon Sep 17 00:00:00 2001 From: David Murphy < dmurphy@saltstack.com> Date: Wed, 19 Jul 2023 18:13:57 -0600 Subject: [PATCH 178/393] Added support for dnf5 for Fedora --- salt/modules/yumpkg.py | 38 +++++++++++++++-------- tests/pytests/unit/modules/test_yumpkg.py | 14 +++++++-- 2 files changed, 36 insertions(+), 16 deletions(-) diff --git a/salt/modules/yumpkg.py b/salt/modules/yumpkg.py index 413c0e12f77..08a7d7d0586 100644 --- a/salt/modules/yumpkg.py +++ b/salt/modules/yumpkg.py @@ -14,6 +14,8 @@ Support for YUM/DNF .. versionadded:: 3003 Support for ``tdnf`` on Photon OS. +.. versionadded:: 3007.0 + Support for ``dnf5``` on Fedora 39 """ @@ -122,12 +124,12 @@ def _get_hold(line, pattern=__HOLD_PATTERN, full=True): dnf ==> vim-enhanced-2:7.4.827-1.fc22.* """ if full: - if _yum() == "dnf": + if _yum() == "dnf" or _yum() == "dnf5": lock_re = rf"({pattern}-\S+)" else: lock_re = rf"(\d+:{pattern}-\S+)" else: - if _yum() == "dnf": + if _yum() == "dnf" or _yum() == "dnf5": lock_re = rf"({pattern}-\S+)" else: lock_re = rf"\d+:({pattern}-\S+)" @@ -145,7 +147,7 @@ def _get_hold(line, pattern=__HOLD_PATTERN, full=True): def _yum(): """ - Determine package manager name (yum or dnf), + Determine package manager name (yum or dnf[5]), depending on the executable existence in $PATH. """ @@ -168,7 +170,10 @@ def _yum(): contextkey = "yum_bin" if contextkey not in context: for dir in os.environ.get("PATH", os.defpath).split(os.pathsep): - if _check(os.path.join(dir, "dnf")): + if _check(os.path.join(dir, "dnf5")): + context[contextkey] = "dnf5" + break + elif _check(os.path.join(dir, "dnf")): context[contextkey] = "dnf" break elif _check(os.path.join(dir, "tdnf")): @@ -245,7 +250,8 @@ def _versionlock_pkg(grains=None): """ if grains is None: grains = __grains__ - if _yum() == "dnf": + + if _yum() == "dnf" or _yum() == "dnf5": if grains["os"].lower() == "fedora": return ( "python3-dnf-plugin-versionlock" @@ -272,10 +278,11 @@ def _check_versionlock(): def _get_options(**kwargs): """ - Returns a list of options to be used in the yum/dnf command, based on the + Returns a list of options to be used in the yum/dnf[5] command, based on the kwargs passed. """ # Get repo options from the kwargs + # dnf5 aliases dnf options, so no need to change fromrepo = kwargs.pop("fromrepo", "") repo = kwargs.pop("repo", "") disablerepo = kwargs.pop("disablerepo", "") @@ -1053,7 +1060,9 @@ def list_upgrades(refresh=True, **kwargs): cmd = ["--quiet"] cmd.extend(options) - cmd.extend(["list", "upgrades" if _yum() == "dnf" else "updates"]) + cmd.extend( + ["list", "upgrades" if (_yum() == "dnf" or _yum() == "dnf5") else "updates"] + ) out = _call_yum(cmd, ignore_retcode=True) if out["retcode"] != 0 and "Error:" in out: return {} @@ -1708,7 +1717,8 @@ def install( if skip_verify: cmd.append("--nogpgcheck") if downloadonly: - cmd.append("--downloadonly") + if _yum() != "dnf5": + cmd.append("--downloadonly") try: holds = list_holds(full=False) @@ -1769,6 +1779,8 @@ def install( cmd.extend(["--best", "--allowerasing"]) _add_common_args(cmd) cmd.append("install" if pkg_type != "advisory" else "update") + if _yum() == "dnf5": + cmd.extend(["--best", "--allowerasing"]) cmd.extend(targets) out = _call_yum(cmd, ignore_retcode=False, redirect_stderr=True) if out["retcode"] != 0: @@ -2002,7 +2014,7 @@ def upgrade( salt '*' pkg.upgrade security=True exclude='kernel*' """ - if _yum() == "dnf" and not obsoletes: + if (_yum() == "dnf" or _yum() == "dnf5") and not obsoletes: # for dnf we can just disable obsoletes _setopt = [ opt @@ -2040,7 +2052,7 @@ def upgrade( cmd.append("upgrade" if not minimal else "upgrade-minimal") else: # do not force the removal of obsolete packages - if _yum() == "dnf": + if _yum() == "dnf" or _yum() == "dnf5": cmd.append("upgrade" if not minimal else "upgrade-minimal") else: # for yum we have to use update instead of upgrade @@ -2396,7 +2408,7 @@ def unhold(name=None, pkgs=None, sources=None, **kwargs): # pylint: disable=W06 ret[target] = {"name": target, "changes": {}, "result": False, "comment": ""} - if _yum() == "dnf": + if _yum() == "dnf" or _yum() == "dnf5": search_locks = [x for x in current_locks if x == target] else: # To accommodate yum versionlock's lack of support for removing @@ -3032,7 +3044,7 @@ def mod_repo(repo, basedir=None, **kwargs): if use_copr: # Is copr plugin installed? copr_plugin_name = "" - if _yum() == "dnf": + if _yum() == "dnf" or _yum() == "dnf5": copr_plugin_name = "dnf-plugins-core" else: copr_plugin_name = "yum-plugin-copr" @@ -3493,7 +3505,7 @@ def services_need_restart(**kwargs): salt '*' pkg.services_need_restart """ - if _yum() != "dnf": + if _yum() == "dnf": raise CommandExecutionError("dnf is required to list outdated services.") if not salt.utils.systemd.booted(__context__): raise CommandExecutionError("systemd is required to list outdated services.") diff --git a/tests/pytests/unit/modules/test_yumpkg.py b/tests/pytests/unit/modules/test_yumpkg.py index 1354ee5d2d0..1b1992daf47 100644 --- a/tests/pytests/unit/modules/test_yumpkg.py +++ b/tests/pytests/unit/modules/test_yumpkg.py @@ -72,7 +72,7 @@ def list_repos_var(): @pytest.fixture( - ids=["yum", "dnf"], + ids=["yum", "dnf", "dnf5"], params=[ { "context": {"yum_bin": "yum"}, @@ -84,6 +84,11 @@ def list_repos_var(): "grains": {"os": "Fedora", "osrelease": 27}, "cmd": ["dnf", "-y", "--best", "--allowerasing"], }, + { + "context": {"yum_bin": "dnf5"}, + "grains": {"os": "Fedora", "osrelease": 39}, + "cmd": ["dnf5", "-y"], + }, ], ) def yum_and_dnf(request): @@ -692,7 +697,7 @@ def test_list_repo_pkgs_with_options(list_repos_var): except AssertionError: continue else: - pytest.fail("repo '{}' not checked".format(repo)) + pytest.fail(f"repo '{repo}' not checked") def test_list_upgrades_dnf(): @@ -2085,7 +2090,10 @@ def test_59705_version_as_accidental_float_should_become_text( new, full_pkg_string, yum_and_dnf ): name = "fnord" - expected_cmd = yum_and_dnf + ["install", full_pkg_string] + expected_cmd = yum_and_dnf + ["install"] + if expected_cmd[0] == "dnf5": + expected_cmd += ["--best", "--allowerasing"] + expected_cmd += [full_pkg_string] cmd_mock = MagicMock( return_value={"pid": 12345, "retcode": 0, "stdout": "", "stderr": ""} ) From c81c7b3f7097bac370b857ff5bce9d6a5691cfb0 Mon Sep 17 00:00:00 2001 From: David Murphy < dmurphy@saltstack.com> Date: Wed, 19 Jul 2023 18:29:51 -0600 Subject: [PATCH 179/393] Added changelog entry --- changelog/64532.added.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog/64532.added.md diff --git a/changelog/64532.added.md b/changelog/64532.added.md new file mode 100644 index 00000000000..53595d69280 --- /dev/null +++ b/changelog/64532.added.md @@ -0,0 +1 @@ +Added support for dnf5 and its new command syntax From 6a256a59a1b738c891d4228a852c742e447c5ce4 Mon Sep 17 00:00:00 2001 From: David Murphy Date: Thu, 20 Jul 2023 09:38:37 -0600 Subject: [PATCH 180/393] Update salt/modules/yumpkg.py Co-authored-by: Pedro Algarvio --- salt/modules/yumpkg.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/salt/modules/yumpkg.py b/salt/modules/yumpkg.py index 08a7d7d0586..3e7f169d34e 100644 --- a/salt/modules/yumpkg.py +++ b/salt/modules/yumpkg.py @@ -124,7 +124,7 @@ def _get_hold(line, pattern=__HOLD_PATTERN, full=True): dnf ==> vim-enhanced-2:7.4.827-1.fc22.* """ if full: - if _yum() == "dnf" or _yum() == "dnf5": + if _yum() in ("dnf", "dnf5"): lock_re = rf"({pattern}-\S+)" else: lock_re = rf"(\d+:{pattern}-\S+)" From 27844363dd26d0c7febccb23367964037943f4cf Mon Sep 17 00:00:00 2001 From: David Murphy Date: Thu, 20 Jul 2023 09:38:51 -0600 Subject: [PATCH 181/393] Update salt/modules/yumpkg.py Co-authored-by: Pedro Algarvio --- salt/modules/yumpkg.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/salt/modules/yumpkg.py b/salt/modules/yumpkg.py index 3e7f169d34e..9b52507d284 100644 --- a/salt/modules/yumpkg.py +++ b/salt/modules/yumpkg.py @@ -129,7 +129,7 @@ def _get_hold(line, pattern=__HOLD_PATTERN, full=True): else: lock_re = rf"(\d+:{pattern}-\S+)" else: - if _yum() == "dnf" or _yum() == "dnf5": + if _yum() in ("dnf", "dnf5"): lock_re = rf"({pattern}-\S+)" else: lock_re = rf"\d+:({pattern}-\S+)" From 33f11e71078f3d3b16061b47328031cede105036 Mon Sep 17 00:00:00 2001 From: David Murphy Date: Thu, 20 Jul 2023 09:38:58 -0600 Subject: [PATCH 182/393] Update salt/modules/yumpkg.py Co-authored-by: Pedro Algarvio --- salt/modules/yumpkg.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/salt/modules/yumpkg.py b/salt/modules/yumpkg.py index 9b52507d284..3ab033361c0 100644 --- a/salt/modules/yumpkg.py +++ b/salt/modules/yumpkg.py @@ -251,7 +251,7 @@ def _versionlock_pkg(grains=None): if grains is None: grains = __grains__ - if _yum() == "dnf" or _yum() == "dnf5": + if _yum() in ("dnf", "dnf5"): if grains["os"].lower() == "fedora": return ( "python3-dnf-plugin-versionlock" From da2897e9bf60c18f941632d464b980ed079fee12 Mon Sep 17 00:00:00 2001 From: David Murphy Date: Thu, 20 Jul 2023 09:39:11 -0600 Subject: [PATCH 183/393] Update salt/modules/yumpkg.py Co-authored-by: Pedro Algarvio --- salt/modules/yumpkg.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/salt/modules/yumpkg.py b/salt/modules/yumpkg.py index 3ab033361c0..6d4ab469165 100644 --- a/salt/modules/yumpkg.py +++ b/salt/modules/yumpkg.py @@ -1061,7 +1061,7 @@ def list_upgrades(refresh=True, **kwargs): cmd = ["--quiet"] cmd.extend(options) cmd.extend( - ["list", "upgrades" if (_yum() == "dnf" or _yum() == "dnf5") else "updates"] + ["list", "upgrades" if _yum() in ("dnf", "dnf5") else "updates"] ) out = _call_yum(cmd, ignore_retcode=True) if out["retcode"] != 0 and "Error:" in out: From 0cbee0f790ba83607895a0e9679035f88992e9e6 Mon Sep 17 00:00:00 2001 From: David Murphy Date: Thu, 20 Jul 2023 09:39:23 -0600 Subject: [PATCH 184/393] Update salt/modules/yumpkg.py Co-authored-by: Pedro Algarvio --- salt/modules/yumpkg.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/salt/modules/yumpkg.py b/salt/modules/yumpkg.py index 6d4ab469165..6ebd9ce4acf 100644 --- a/salt/modules/yumpkg.py +++ b/salt/modules/yumpkg.py @@ -2014,7 +2014,7 @@ def upgrade( salt '*' pkg.upgrade security=True exclude='kernel*' """ - if (_yum() == "dnf" or _yum() == "dnf5") and not obsoletes: + if _yum() in ("dnf", "dnf5") and not obsoletes: # for dnf we can just disable obsoletes _setopt = [ opt From 0ab67261b23f72a685095764e56893386b725fe2 Mon Sep 17 00:00:00 2001 From: David Murphy Date: Thu, 20 Jul 2023 09:39:41 -0600 Subject: [PATCH 185/393] Update salt/modules/yumpkg.py Co-authored-by: Pedro Algarvio --- salt/modules/yumpkg.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/salt/modules/yumpkg.py b/salt/modules/yumpkg.py index 6ebd9ce4acf..c67c18d5b84 100644 --- a/salt/modules/yumpkg.py +++ b/salt/modules/yumpkg.py @@ -2052,7 +2052,7 @@ def upgrade( cmd.append("upgrade" if not minimal else "upgrade-minimal") else: # do not force the removal of obsolete packages - if _yum() == "dnf" or _yum() == "dnf5": + if _yum() in ("dnf", "dnf5"): cmd.append("upgrade" if not minimal else "upgrade-minimal") else: # for yum we have to use update instead of upgrade From bf27a19c96009a294568647ea2d8bd8b55c5230a Mon Sep 17 00:00:00 2001 From: David Murphy Date: Thu, 20 Jul 2023 09:39:48 -0600 Subject: [PATCH 186/393] Update salt/modules/yumpkg.py Co-authored-by: Pedro Algarvio --- salt/modules/yumpkg.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/salt/modules/yumpkg.py b/salt/modules/yumpkg.py index c67c18d5b84..c5725cdc8c4 100644 --- a/salt/modules/yumpkg.py +++ b/salt/modules/yumpkg.py @@ -2408,7 +2408,7 @@ def unhold(name=None, pkgs=None, sources=None, **kwargs): # pylint: disable=W06 ret[target] = {"name": target, "changes": {}, "result": False, "comment": ""} - if _yum() == "dnf" or _yum() == "dnf5": + if _yum() in ("dnf", "dnf5"): search_locks = [x for x in current_locks if x == target] else: # To accommodate yum versionlock's lack of support for removing From bea424c18de4d392b01c2d42ef08b67951df4c5a Mon Sep 17 00:00:00 2001 From: David Murphy Date: Thu, 20 Jul 2023 09:39:59 -0600 Subject: [PATCH 187/393] Update salt/modules/yumpkg.py Co-authored-by: Pedro Algarvio --- salt/modules/yumpkg.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/salt/modules/yumpkg.py b/salt/modules/yumpkg.py index c5725cdc8c4..a3688c8c57d 100644 --- a/salt/modules/yumpkg.py +++ b/salt/modules/yumpkg.py @@ -3044,7 +3044,7 @@ def mod_repo(repo, basedir=None, **kwargs): if use_copr: # Is copr plugin installed? copr_plugin_name = "" - if _yum() == "dnf" or _yum() == "dnf5": + if _yum() in ("dnf", "dnf5"): copr_plugin_name = "dnf-plugins-core" else: copr_plugin_name = "yum-plugin-copr" From 75269c4ae22cce7cef1e681e2b1625368d6e18f5 Mon Sep 17 00:00:00 2001 From: David Murphy < dmurphy@saltstack.com> Date: Thu, 20 Jul 2023 09:46:20 -0600 Subject: [PATCH 188/393] Updates due to reviewer suggestions --- salt/modules/yumpkg.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/salt/modules/yumpkg.py b/salt/modules/yumpkg.py index a3688c8c57d..31129855fc7 100644 --- a/salt/modules/yumpkg.py +++ b/salt/modules/yumpkg.py @@ -1060,9 +1060,7 @@ def list_upgrades(refresh=True, **kwargs): cmd = ["--quiet"] cmd.extend(options) - cmd.extend( - ["list", "upgrades" if _yum() in ("dnf", "dnf5") else "updates"] - ) + cmd.extend(["list", "upgrades" if _yum() in ("dnf", "dnf5") else "updates"]) out = _call_yum(cmd, ignore_retcode=True) if out["retcode"] != 0 and "Error:" in out: return {} @@ -3505,7 +3503,7 @@ def services_need_restart(**kwargs): salt '*' pkg.services_need_restart """ - if _yum() == "dnf": + if _yum() != "dnf": raise CommandExecutionError("dnf is required to list outdated services.") if not salt.utils.systemd.booted(__context__): raise CommandExecutionError("systemd is required to list outdated services.") From 145a0ed6fcb8b85d867e682bf2c47239f0412f19 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Fri, 21 Jul 2023 10:14:13 +0100 Subject: [PATCH 189/393] Bump to `aiohttp==3.8.5` due to https://github.com/advisories/GHSA-45c4-8wx5-qw6w Signed-off-by: Pedro Algarvio --- changelog/64687.security.md | 1 + requirements/static/ci/py3.10/cloud.txt | 2 +- requirements/static/ci/py3.10/darwin.txt | 2 +- requirements/static/ci/py3.10/freebsd.txt | 2 +- requirements/static/ci/py3.10/lint.txt | 2 +- requirements/static/ci/py3.10/linux.txt | 2 +- requirements/static/ci/py3.10/windows.txt | 2 +- requirements/static/ci/py3.7/cloud.txt | 2 +- requirements/static/ci/py3.7/freebsd.txt | 2 +- requirements/static/ci/py3.7/lint.txt | 2 +- requirements/static/ci/py3.7/linux.txt | 2 +- requirements/static/ci/py3.7/windows.txt | 2 +- requirements/static/ci/py3.8/cloud.txt | 2 +- requirements/static/ci/py3.8/freebsd.txt | 2 +- requirements/static/ci/py3.8/lint.txt | 2 +- requirements/static/ci/py3.8/linux.txt | 2 +- requirements/static/ci/py3.8/windows.txt | 2 +- requirements/static/ci/py3.9/cloud.txt | 2 +- requirements/static/ci/py3.9/darwin.txt | 2 +- requirements/static/ci/py3.9/freebsd.txt | 2 +- requirements/static/ci/py3.9/lint.txt | 2 +- requirements/static/ci/py3.9/linux.txt | 2 +- requirements/static/ci/py3.9/windows.txt | 2 +- 23 files changed, 23 insertions(+), 22 deletions(-) create mode 100644 changelog/64687.security.md diff --git a/changelog/64687.security.md b/changelog/64687.security.md new file mode 100644 index 00000000000..5b227c33bb3 --- /dev/null +++ b/changelog/64687.security.md @@ -0,0 +1 @@ +Bump to `aiohttp==3.8.5` due to https://github.com/advisories/GHSA-45c4-8wx5-qw6w diff --git a/requirements/static/ci/py3.10/cloud.txt b/requirements/static/ci/py3.10/cloud.txt index 2af515324f4..b18ec4f09c0 100644 --- a/requirements/static/ci/py3.10/cloud.txt +++ b/requirements/static/ci/py3.10/cloud.txt @@ -8,7 +8,7 @@ adal==1.2.7 # via # azure-datalake-store # msrestazure -aiohttp==3.8.1 +aiohttp==3.8.5 # via etcd3-py aiosignal==1.2.0 # via aiohttp diff --git a/requirements/static/ci/py3.10/darwin.txt b/requirements/static/ci/py3.10/darwin.txt index 73f4def8791..c0975217c25 100644 --- a/requirements/static/ci/py3.10/darwin.txt +++ b/requirements/static/ci/py3.10/darwin.txt @@ -8,7 +8,7 @@ adal==1.2.5 # via # azure-datalake-store # msrestazure -aiohttp==3.8.1 +aiohttp==3.8.5 # via etcd3-py aiosignal==1.2.0 # via aiohttp diff --git a/requirements/static/ci/py3.10/freebsd.txt b/requirements/static/ci/py3.10/freebsd.txt index 3739dcb0e73..baaf1233d53 100644 --- a/requirements/static/ci/py3.10/freebsd.txt +++ b/requirements/static/ci/py3.10/freebsd.txt @@ -8,7 +8,7 @@ adal==1.2.5 # via # azure-datalake-store # msrestazure -aiohttp==3.8.1 +aiohttp==3.8.5 # via etcd3-py aiosignal==1.2.0 # via aiohttp diff --git a/requirements/static/ci/py3.10/lint.txt b/requirements/static/ci/py3.10/lint.txt index c88948c6d8a..dc2efbcb0f7 100644 --- a/requirements/static/ci/py3.10/lint.txt +++ b/requirements/static/ci/py3.10/lint.txt @@ -8,7 +8,7 @@ adal==1.2.7 # via # azure-datalake-store # msrestazure -aiohttp==3.8.1 +aiohttp==3.8.5 # via etcd3-py aiosignal==1.2.0 # via aiohttp diff --git a/requirements/static/ci/py3.10/linux.txt b/requirements/static/ci/py3.10/linux.txt index 9edac4588d2..973d015842a 100644 --- a/requirements/static/ci/py3.10/linux.txt +++ b/requirements/static/ci/py3.10/linux.txt @@ -8,7 +8,7 @@ adal==1.2.3 # via # azure-datalake-store # msrestazure -aiohttp==3.8.1 +aiohttp==3.8.5 # via etcd3-py aiosignal==1.2.0 # via aiohttp diff --git a/requirements/static/ci/py3.10/windows.txt b/requirements/static/ci/py3.10/windows.txt index ecccb3335b0..2417941f38e 100644 --- a/requirements/static/ci/py3.10/windows.txt +++ b/requirements/static/ci/py3.10/windows.txt @@ -4,7 +4,7 @@ # # pip-compile --output-file=requirements/static/ci/py3.10/windows.txt --pip-args='--constraint=requirements/static/pkg/py3.10/windows.txt' requirements/pytest.txt requirements/static/ci/common.in requirements/static/ci/windows.in requirements/static/pkg/windows.in requirements/windows.txt # -aiohttp==3.8.3 +aiohttp==3.8.5 # via etcd3-py aiosignal==1.3.1 # via aiohttp diff --git a/requirements/static/ci/py3.7/cloud.txt b/requirements/static/ci/py3.7/cloud.txt index bbbabcd11fc..6eaf60aa529 100644 --- a/requirements/static/ci/py3.7/cloud.txt +++ b/requirements/static/ci/py3.7/cloud.txt @@ -8,7 +8,7 @@ adal==1.2.7 # via # azure-datalake-store # msrestazure -aiohttp==3.8.1 +aiohttp==3.8.5 # via etcd3-py aiosignal==1.2.0 # via aiohttp diff --git a/requirements/static/ci/py3.7/freebsd.txt b/requirements/static/ci/py3.7/freebsd.txt index 8a3346af2c3..cb2a33a878a 100644 --- a/requirements/static/ci/py3.7/freebsd.txt +++ b/requirements/static/ci/py3.7/freebsd.txt @@ -8,7 +8,7 @@ adal==1.2.5 # via # azure-datalake-store # msrestazure -aiohttp==3.8.1 +aiohttp==3.8.5 # via etcd3-py aiosignal==1.2.0 # via aiohttp diff --git a/requirements/static/ci/py3.7/lint.txt b/requirements/static/ci/py3.7/lint.txt index 28cff6fb6d6..84fb45bda87 100644 --- a/requirements/static/ci/py3.7/lint.txt +++ b/requirements/static/ci/py3.7/lint.txt @@ -8,7 +8,7 @@ adal==1.2.7 # via # azure-datalake-store # msrestazure -aiohttp==3.8.1 +aiohttp==3.8.5 # via etcd3-py aiosignal==1.2.0 # via aiohttp diff --git a/requirements/static/ci/py3.7/linux.txt b/requirements/static/ci/py3.7/linux.txt index f93050ab932..4572c8bdbf3 100644 --- a/requirements/static/ci/py3.7/linux.txt +++ b/requirements/static/ci/py3.7/linux.txt @@ -8,7 +8,7 @@ adal==1.2.3 # via # azure-datalake-store # msrestazure -aiohttp==3.8.1 +aiohttp==3.8.5 # via etcd3-py aiosignal==1.2.0 # via aiohttp diff --git a/requirements/static/ci/py3.7/windows.txt b/requirements/static/ci/py3.7/windows.txt index 1f67dcfba0c..8959a773789 100644 --- a/requirements/static/ci/py3.7/windows.txt +++ b/requirements/static/ci/py3.7/windows.txt @@ -4,7 +4,7 @@ # # pip-compile --output-file=requirements/static/ci/py3.7/windows.txt --pip-args='--constraint=requirements/static/pkg/py3.7/windows.txt' requirements/pytest.txt requirements/static/ci/common.in requirements/static/ci/windows.in requirements/static/pkg/windows.in requirements/windows.txt # -aiohttp==3.8.1 +aiohttp==3.8.5 # via etcd3-py aiosignal==1.2.0 # via aiohttp diff --git a/requirements/static/ci/py3.8/cloud.txt b/requirements/static/ci/py3.8/cloud.txt index bd0e08a58b1..0efdfc4ddb6 100644 --- a/requirements/static/ci/py3.8/cloud.txt +++ b/requirements/static/ci/py3.8/cloud.txt @@ -8,7 +8,7 @@ adal==1.2.7 # via # azure-datalake-store # msrestazure -aiohttp==3.8.1 +aiohttp==3.8.5 # via etcd3-py aiosignal==1.2.0 # via aiohttp diff --git a/requirements/static/ci/py3.8/freebsd.txt b/requirements/static/ci/py3.8/freebsd.txt index c5405765a61..5bc0834aa96 100644 --- a/requirements/static/ci/py3.8/freebsd.txt +++ b/requirements/static/ci/py3.8/freebsd.txt @@ -8,7 +8,7 @@ adal==1.2.5 # via # azure-datalake-store # msrestazure -aiohttp==3.8.1 +aiohttp==3.8.5 # via etcd3-py aiosignal==1.2.0 # via aiohttp diff --git a/requirements/static/ci/py3.8/lint.txt b/requirements/static/ci/py3.8/lint.txt index 6817761f343..75cae1cbec6 100644 --- a/requirements/static/ci/py3.8/lint.txt +++ b/requirements/static/ci/py3.8/lint.txt @@ -8,7 +8,7 @@ adal==1.2.7 # via # azure-datalake-store # msrestazure -aiohttp==3.8.1 +aiohttp==3.8.5 # via etcd3-py aiosignal==1.2.0 # via aiohttp diff --git a/requirements/static/ci/py3.8/linux.txt b/requirements/static/ci/py3.8/linux.txt index 71621406fc1..f9bf547397f 100644 --- a/requirements/static/ci/py3.8/linux.txt +++ b/requirements/static/ci/py3.8/linux.txt @@ -8,7 +8,7 @@ adal==1.2.3 # via # azure-datalake-store # msrestazure -aiohttp==3.8.1 +aiohttp==3.8.5 # via etcd3-py aiosignal==1.2.0 # via aiohttp diff --git a/requirements/static/ci/py3.8/windows.txt b/requirements/static/ci/py3.8/windows.txt index a4ab2b0e0c2..63b94d8153c 100644 --- a/requirements/static/ci/py3.8/windows.txt +++ b/requirements/static/ci/py3.8/windows.txt @@ -4,7 +4,7 @@ # # pip-compile --output-file=requirements/static/ci/py3.8/windows.txt --pip-args='--constraint=requirements/static/pkg/py3.8/windows.txt' requirements/pytest.txt requirements/static/ci/common.in requirements/static/ci/windows.in requirements/static/pkg/windows.in requirements/windows.txt # -aiohttp==3.8.1 +aiohttp==3.8.5 # via etcd3-py aiosignal==1.2.0 # via aiohttp diff --git a/requirements/static/ci/py3.9/cloud.txt b/requirements/static/ci/py3.9/cloud.txt index 0edf98cbeed..284da11446c 100644 --- a/requirements/static/ci/py3.9/cloud.txt +++ b/requirements/static/ci/py3.9/cloud.txt @@ -8,7 +8,7 @@ adal==1.2.7 # via # azure-datalake-store # msrestazure -aiohttp==3.8.1 +aiohttp==3.8.5 # via etcd3-py aiosignal==1.2.0 # via aiohttp diff --git a/requirements/static/ci/py3.9/darwin.txt b/requirements/static/ci/py3.9/darwin.txt index 26ad2584cd8..cd6ea9161f0 100644 --- a/requirements/static/ci/py3.9/darwin.txt +++ b/requirements/static/ci/py3.9/darwin.txt @@ -8,7 +8,7 @@ adal==1.2.5 # via # azure-datalake-store # msrestazure -aiohttp==3.8.1 +aiohttp==3.8.5 # via etcd3-py aiosignal==1.2.0 # via aiohttp diff --git a/requirements/static/ci/py3.9/freebsd.txt b/requirements/static/ci/py3.9/freebsd.txt index f86158df323..6a6eecc62de 100644 --- a/requirements/static/ci/py3.9/freebsd.txt +++ b/requirements/static/ci/py3.9/freebsd.txt @@ -8,7 +8,7 @@ adal==1.2.5 # via # azure-datalake-store # msrestazure -aiohttp==3.8.1 +aiohttp==3.8.5 # via etcd3-py aiosignal==1.2.0 # via aiohttp diff --git a/requirements/static/ci/py3.9/lint.txt b/requirements/static/ci/py3.9/lint.txt index 097b21c0876..0797e729902 100644 --- a/requirements/static/ci/py3.9/lint.txt +++ b/requirements/static/ci/py3.9/lint.txt @@ -8,7 +8,7 @@ adal==1.2.7 # via # azure-datalake-store # msrestazure -aiohttp==3.8.1 +aiohttp==3.8.5 # via etcd3-py aiosignal==1.2.0 # via aiohttp diff --git a/requirements/static/ci/py3.9/linux.txt b/requirements/static/ci/py3.9/linux.txt index 064f9fbac6e..24cd91c4204 100644 --- a/requirements/static/ci/py3.9/linux.txt +++ b/requirements/static/ci/py3.9/linux.txt @@ -8,7 +8,7 @@ adal==1.2.3 # via # azure-datalake-store # msrestazure -aiohttp==3.8.1 +aiohttp==3.8.5 # via etcd3-py aiosignal==1.2.0 # via aiohttp diff --git a/requirements/static/ci/py3.9/windows.txt b/requirements/static/ci/py3.9/windows.txt index d2c6aba824b..282303ad60b 100644 --- a/requirements/static/ci/py3.9/windows.txt +++ b/requirements/static/ci/py3.9/windows.txt @@ -4,7 +4,7 @@ # # pip-compile --output-file=requirements/static/ci/py3.9/windows.txt --pip-args='--constraint=requirements/static/pkg/py3.9/windows.txt' requirements/pytest.txt requirements/static/ci/common.in requirements/static/ci/windows.in requirements/static/pkg/windows.in requirements/windows.txt # -aiohttp==3.8.1 +aiohttp==3.8.5 # via etcd3-py aiosignal==1.2.0 # via aiohttp From 4dd85f9fb6ba9e3b14dbfd559eb279f28d56d6c4 Mon Sep 17 00:00:00 2001 From: twangboy Date: Wed, 19 Jul 2023 13:40:50 -0600 Subject: [PATCH 190/393] Use search with choco v2+ --- salt/modules/chocolatey.py | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/salt/modules/chocolatey.py b/salt/modules/chocolatey.py index 06794946d55..ee6b48a031b 100644 --- a/salt/modules/chocolatey.py +++ b/salt/modules/chocolatey.py @@ -460,7 +460,11 @@ def list_( salt '*' chocolatey.list all_versions=True """ choc_path = _find_chocolatey() - cmd = [choc_path, "list"] + # https://docs.chocolatey.org/en-us/guides/upgrading-to-chocolatey-v2-v6 + if Version(chocolatey_version()) <= Version("2.0.0"): + cmd = [choc_path, "list"] + else: + cmd = [choc_path, "search"] if narrow: cmd.append(narrow) if salt.utils.data.is_true(all_versions): @@ -518,7 +522,11 @@ def list_webpi(): salt '*' chocolatey.list_webpi """ choc_path = _find_chocolatey() - cmd = [choc_path, "list", "--source", "webpi"] + # https://docs.chocolatey.org/en-us/guides/upgrading-to-chocolatey-v2-v6 + if Version(chocolatey_version()) <= Version("2.0.0"): + cmd = [choc_path, "list", "--source", "webpi"] + else: + cmd = [choc_path, "search", "--source", "webpi"] result = __salt__["cmd.run_all"](cmd, python_shell=False) if result["retcode"] != 0: @@ -543,7 +551,11 @@ def list_windowsfeatures(): salt '*' chocolatey.list_windowsfeatures """ choc_path = _find_chocolatey() - cmd = [choc_path, "list", "--source", "windowsfeatures"] + # https://docs.chocolatey.org/en-us/guides/upgrading-to-chocolatey-v2-v6 + if Version(chocolatey_version()) <= Version("2.0.0"): + cmd = [choc_path, "list", "--source", "windowsfeatures"] + else: + cmd = [choc_path, "search", "--source", "windowsfeatures"] result = __salt__["cmd.run_all"](cmd, python_shell=False) if result["retcode"] != 0: From 279e133643bd38d56d74ce05f41aed9b33eee298 Mon Sep 17 00:00:00 2001 From: twangboy Date: Wed, 19 Jul 2023 13:46:32 -0600 Subject: [PATCH 191/393] Add changelog --- changelog/64622.fixed.md | 1 + salt/modules/chocolatey.py | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) create mode 100644 changelog/64622.fixed.md diff --git a/changelog/64622.fixed.md b/changelog/64622.fixed.md new file mode 100644 index 00000000000..e46dbeb0ff6 --- /dev/null +++ b/changelog/64622.fixed.md @@ -0,0 +1 @@ +Added support for Chocolatey 2.0.0+ diff --git a/salt/modules/chocolatey.py b/salt/modules/chocolatey.py index ee6b48a031b..2dab74da497 100644 --- a/salt/modules/chocolatey.py +++ b/salt/modules/chocolatey.py @@ -461,7 +461,7 @@ def list_( """ choc_path = _find_chocolatey() # https://docs.chocolatey.org/en-us/guides/upgrading-to-chocolatey-v2-v6 - if Version(chocolatey_version()) <= Version("2.0.0"): + if Version(chocolatey_version()) < Version("2.0.0"): cmd = [choc_path, "list"] else: cmd = [choc_path, "search"] @@ -523,7 +523,7 @@ def list_webpi(): """ choc_path = _find_chocolatey() # https://docs.chocolatey.org/en-us/guides/upgrading-to-chocolatey-v2-v6 - if Version(chocolatey_version()) <= Version("2.0.0"): + if Version(chocolatey_version()) < Version("2.0.0"): cmd = [choc_path, "list", "--source", "webpi"] else: cmd = [choc_path, "search", "--source", "webpi"] @@ -552,7 +552,7 @@ def list_windowsfeatures(): """ choc_path = _find_chocolatey() # https://docs.chocolatey.org/en-us/guides/upgrading-to-chocolatey-v2-v6 - if Version(chocolatey_version()) <= Version("2.0.0"): + if Version(chocolatey_version()) < Version("2.0.0"): cmd = [choc_path, "list", "--source", "windowsfeatures"] else: cmd = [choc_path, "search", "--source", "windowsfeatures"] From 4a4312159c3ae82aa3f347b0ee09b3f14dfc0137 Mon Sep 17 00:00:00 2001 From: twangboy Date: Thu, 20 Jul 2023 17:51:09 -0600 Subject: [PATCH 192/393] Add some unit tests --- tests/pytests/unit/modules/test_chocolatey.py | 72 +++++++++++++++++++ 1 file changed, 72 insertions(+) diff --git a/tests/pytests/unit/modules/test_chocolatey.py b/tests/pytests/unit/modules/test_chocolatey.py index c4b955321d1..ac553ceba63 100644 --- a/tests/pytests/unit/modules/test_chocolatey.py +++ b/tests/pytests/unit/modules/test_chocolatey.py @@ -262,3 +262,75 @@ def test_add_source(choco_path): "source_name", "source_location", priority="priority" ) cmd_run_all_mock.assert_called_with(expected_call, python_shell=False) + + +def test_list_pre_2_0_0(): + mock_version = MagicMock(return_value="1.2.1") + mock_find = MagicMock(return_value=choco_path) + mock_run = MagicMock(return_value={"stdout": "No packages", "retcode": 0}) + with patch.object(chocolatey, "chocolatey_version", mock_version), patch.object( + chocolatey, "_find_chocolatey", mock_find + ), patch.dict(chocolatey.__salt__, {"cmd.run_all": mock_run}): + chocolatey.list_() + expected_call = [choco_path, "list", "--limit-output"] + mock_run.assert_called_with(expected_call, python_shell=False) + + +def test_list_post_2_0_0(): + mock_version = MagicMock(return_value="2.0.1") + mock_find = MagicMock(return_value=choco_path) + mock_run = MagicMock(return_value={"stdout": "No packages", "retcode": 0}) + with patch.object(chocolatey, "chocolatey_version", mock_version), patch.object( + chocolatey, "_find_chocolatey", mock_find + ), patch.dict(chocolatey.__salt__, {"cmd.run_all": mock_run}): + chocolatey.list_() + expected_call = [choco_path, "search", "--limit-output"] + mock_run.assert_called_with(expected_call, python_shell=False) + + +def test_list_webpi_pre_2_0_0(): + mock_version = MagicMock(return_value="1.2.1") + mock_find = MagicMock(return_value=choco_path) + mock_run = MagicMock(return_value={"stdout": "No packages", "retcode": 0}) + with patch.object(chocolatey, "chocolatey_version", mock_version), patch.object( + chocolatey, "_find_chocolatey", mock_find + ), patch.dict(chocolatey.__salt__, {"cmd.run_all": mock_run}): + chocolatey.list_webpi() + expected_call = [choco_path, "list", "--source", "webpi"] + mock_run.assert_called_with(expected_call, python_shell=False) + + +def test_list_webpi_post_2_0_0(): + mock_version = MagicMock(return_value="2.0.1") + mock_find = MagicMock(return_value=choco_path) + mock_run = MagicMock(return_value={"stdout": "No packages", "retcode": 0}) + with patch.object(chocolatey, "chocolatey_version", mock_version), patch.object( + chocolatey, "_find_chocolatey", mock_find + ), patch.dict(chocolatey.__salt__, {"cmd.run_all": mock_run}): + chocolatey.list_webpi() + expected_call = [choco_path, "search", "--source", "webpi"] + mock_run.assert_called_with(expected_call, python_shell=False) + + +def test_list_windowsfeatures_pre_2_0_0(): + mock_version = MagicMock(return_value="1.2.1") + mock_find = MagicMock(return_value=choco_path) + mock_run = MagicMock(return_value={"stdout": "No packages", "retcode": 0}) + with patch.object(chocolatey, "chocolatey_version", mock_version), patch.object( + chocolatey, "_find_chocolatey", mock_find + ), patch.dict(chocolatey.__salt__, {"cmd.run_all": mock_run}): + chocolatey.list_windowsfeatures() + expected_call = [choco_path, "list", "--source", "windowsfeatures"] + mock_run.assert_called_with(expected_call, python_shell=False) + + +def test_list_windowsfeatures_post_2_0_0(): + mock_version = MagicMock(return_value="2.0.1") + mock_find = MagicMock(return_value=choco_path) + mock_run = MagicMock(return_value={"stdout": "No packages", "retcode": 0}) + with patch.object(chocolatey, "chocolatey_version", mock_version), patch.object( + chocolatey, "_find_chocolatey", mock_find + ), patch.dict(chocolatey.__salt__, {"cmd.run_all": mock_run}): + chocolatey.list_windowsfeatures() + expected_call = [choco_path, "search", "--source", "windowsfeatures"] + mock_run.assert_called_with(expected_call, python_shell=False) From c06f94523a22884a6440adc871548fe0a96fd73a Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Fri, 21 Jul 2023 18:16:37 +0100 Subject: [PATCH 193/393] Bump a few dependency versions that got downgraded on the merge forward Signed-off-by: Pedro Algarvio --- requirements/static/ci/py3.10/linux.txt | 2 +- requirements/static/ci/py3.11/darwin.txt | 2 +- requirements/static/ci/py3.11/freebsd.txt | 2 +- requirements/static/ci/py3.11/linux.txt | 2 +- requirements/static/ci/py3.8/linux.txt | 2 +- requirements/static/ci/py3.9/linux.txt | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/requirements/static/ci/py3.10/linux.txt b/requirements/static/ci/py3.10/linux.txt index 0f0faa86348..b7ab4f2d0f3 100644 --- a/requirements/static/ci/py3.10/linux.txt +++ b/requirements/static/ci/py3.10/linux.txt @@ -11,7 +11,7 @@ aiohttp==3.8.5 # aiohttp-retry # etcd3-py # twilio -aiosignal==1.2.0 +aiosignal==1.3.1 # via aiohttp ansible-core==2.15.0 # via ansible diff --git a/requirements/static/ci/py3.11/darwin.txt b/requirements/static/ci/py3.11/darwin.txt index a1159fe23b8..fd5deacb7a0 100644 --- a/requirements/static/ci/py3.11/darwin.txt +++ b/requirements/static/ci/py3.11/darwin.txt @@ -4,7 +4,7 @@ # # pip-compile --output-file=requirements/static/ci/py3.11/darwin.txt requirements/darwin.txt requirements/pytest.txt requirements/static/ci/common.in requirements/static/ci/darwin.in requirements/static/pkg/darwin.in # -aiohttp==3.8.4 +aiohttp==3.8.5 # via etcd3-py aiosignal==1.3.1 # via aiohttp diff --git a/requirements/static/ci/py3.11/freebsd.txt b/requirements/static/ci/py3.11/freebsd.txt index 20e04b2a23b..3bc3a8c2e96 100644 --- a/requirements/static/ci/py3.11/freebsd.txt +++ b/requirements/static/ci/py3.11/freebsd.txt @@ -4,7 +4,7 @@ # # pip-compile --no-emit-index-url --output-file=requirements/static/ci/py3.11/freebsd.txt requirements/base.txt requirements/pytest.txt requirements/static/ci/common.in requirements/static/ci/freebsd.in requirements/static/pkg/freebsd.in requirements/zeromq.txt # -aiohttp==3.8.4 +aiohttp==3.8.5 # via etcd3-py aiosignal==1.3.1 # via aiohttp diff --git a/requirements/static/ci/py3.11/linux.txt b/requirements/static/ci/py3.11/linux.txt index d9bd3aa189e..19be3c22072 100644 --- a/requirements/static/ci/py3.11/linux.txt +++ b/requirements/static/ci/py3.11/linux.txt @@ -6,7 +6,7 @@ # aiohttp-retry==2.8.3 # via twilio -aiohttp==3.8.4 +aiohttp==3.8.5 # via # aiohttp-retry # etcd3-py diff --git a/requirements/static/ci/py3.8/linux.txt b/requirements/static/ci/py3.8/linux.txt index 4290692470d..392df3942ab 100644 --- a/requirements/static/ci/py3.8/linux.txt +++ b/requirements/static/ci/py3.8/linux.txt @@ -11,7 +11,7 @@ aiohttp==3.8.5 # aiohttp-retry # etcd3-py # twilio -aiosignal==1.2.0 +aiosignal==1.3.1 # via aiohttp ansible-core==2.11.12 # via ansible diff --git a/requirements/static/ci/py3.9/linux.txt b/requirements/static/ci/py3.9/linux.txt index bba8b36f856..76b5486ab88 100644 --- a/requirements/static/ci/py3.9/linux.txt +++ b/requirements/static/ci/py3.9/linux.txt @@ -11,7 +11,7 @@ aiohttp==3.8.5 # aiohttp-retry # etcd3-py # twilio -aiosignal==1.2.0 +aiosignal==1.3.1 # via aiohttp ansible-core==2.15.0 # via ansible From 23e96fdc6d6a2d066b21e1a80ac17e00c458123c Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Fri, 21 Jul 2023 20:06:53 +0100 Subject: [PATCH 194/393] Run `pyupgrade` on the changes from the merge-forward Signed-off-by: Pedro Algarvio --- tests/pytests/functional/modules/test_service.py | 2 +- tests/pytests/functional/states/test_service.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/pytests/functional/modules/test_service.py b/tests/pytests/functional/modules/test_service.py index 51ce7f1cc0b..a54ff1fbe6c 100644 --- a/tests/pytests/functional/modules/test_service.py +++ b/tests/pytests/functional/modules/test_service.py @@ -36,7 +36,7 @@ def service_name(grains, modules): service_name = "Spooler" if os_family != "Windows" and salt.utils.path.which(cmd_name) is None: - pytest.skip("{} is not installed".format(cmd_name)) + pytest.skip(f"{cmd_name} is not installed") if is_systemd and modules.service.offline(): pytest.skip("systemd is OFFLINE") diff --git a/tests/pytests/functional/states/test_service.py b/tests/pytests/functional/states/test_service.py index a1e9673653b..fd023df0637 100644 --- a/tests/pytests/functional/states/test_service.py +++ b/tests/pytests/functional/states/test_service.py @@ -43,7 +43,7 @@ def service_name(grains, modules): service_name = "Spooler" if os_family != "Windows" and salt.utils.path.which(cmd_name) is None: - pytest.skip("{} is not installed".format(cmd_name)) + pytest.skip(f"{cmd_name} is not installed") if is_systemd and modules.service.offline(): pytest.skip("systemd is OFFLINE") From 0a983597763985ead07bfcbfbc56b74381501ddc Mon Sep 17 00:00:00 2001 From: Megan Wilhite Date: Fri, 21 Jul 2023 12:51:45 -0600 Subject: [PATCH 195/393] Add documentation for external pillar cmd json --- salt/pillar/cmd_json.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/salt/pillar/cmd_json.py b/salt/pillar/cmd_json.py index 11101dbeb7c..50fbdee27f4 100644 --- a/salt/pillar/cmd_json.py +++ b/salt/pillar/cmd_json.py @@ -1,5 +1,23 @@ """ Execute a command and read the output as JSON. The JSON data is then directly overlaid onto the minion's Pillar data. + + +Configuring the CMD_JSON ext_pillar +==================================== + +Set the following Salt config to setup cmd json result as external pillar source: + +.. code-block:: yaml + + ext_pillar: + - cmd_json: 'echo {\"arg\":\"value\"}' + +This will run the command ``echo {arg: value}`` on the master. + + +Module Documentation +==================== + """ import logging From a9bbfd0e47301e612401c040e54ffbef4b36e85a Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Thu, 27 Jul 2023 13:43:12 +0100 Subject: [PATCH 196/393] Properly upgrade Debian based systems unattended Signed-off-by: Pedro Algarvio --- pkg/tests/conftest.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/pkg/tests/conftest.py b/pkg/tests/conftest.py index 5eba84bb4aa..b7d908f32d5 100644 --- a/pkg/tests/conftest.py +++ b/pkg/tests/conftest.py @@ -52,7 +52,18 @@ def _system_up_to_date( if grains["os_family"] == "Debian": ret = shell.run("apt", "update") assert ret.returncode == 0 - ret = shell.run("apt", "upgrade", "-y") + env = os.environ.copy() + env["DEBIAN_FRONTEND"] = "noninteractive" + ret = shell.run( + "apt", + "upgrade", + "-y", + "-o", + "DPkg::Options::=--force-confdef", + "-o", + "DPkg::Options::=--force-confold", + env=env, + ) assert ret.returncode == 0 elif grains["os_family"] == "Redhat": ret = shell.run("yum", "update", "-y") From 3877900698a52f6f0a36fb6c07ea2107c497cf34 Mon Sep 17 00:00:00 2001 From: "Daniel A. Wozniak" Date: Wed, 26 Jul 2023 16:29:02 +0100 Subject: [PATCH 197/393] Upgrade `relenv` to `0.13.2` and Python to `3.10.12`. Addresses multiple CVEs in dependencies: https://docs.python.org/release/3.10.12/whatsnew/changelog.html#python-3-10-12 Signed-off-by: Pedro Algarvio --- .github/actions/setup-relenv/action.yml | 2 +- .github/workflows/build-deps-onedir.yml | 4 +- .github/workflows/build-salt-onedir.yml | 4 +- .github/workflows/ci.yml | 110 +++++++-------- .github/workflows/nightly.yml | 110 +++++++-------- .github/workflows/release.yml | 64 ++++----- .github/workflows/scheduled.yml | 110 +++++++-------- .github/workflows/staging.yml | 174 ++++++++++++------------ changelog/64719.security.md | 3 + cicd/shared-gh-workflows-context.yml | 4 +- pkg/macos/build_python.sh | 4 +- pkg/windows/build.ps1 | 6 +- pkg/windows/build_python.ps1 | 6 +- 13 files changed, 298 insertions(+), 303 deletions(-) create mode 100644 changelog/64719.security.md diff --git a/.github/actions/setup-relenv/action.yml b/.github/actions/setup-relenv/action.yml index 1f228fd1822..50ade327764 100644 --- a/.github/actions/setup-relenv/action.yml +++ b/.github/actions/setup-relenv/action.yml @@ -22,7 +22,7 @@ inputs: required: false type: string description: The version of relenv to use - default: 0.12.3 + default: 0.13.2 outputs: version: diff --git a/.github/workflows/build-deps-onedir.yml b/.github/workflows/build-deps-onedir.yml index 6197ebc0333..c0371734bb7 100644 --- a/.github/workflows/build-deps-onedir.yml +++ b/.github/workflows/build-deps-onedir.yml @@ -21,12 +21,12 @@ on: relenv-version: required: false type: string - default: 0.12.3 + default: 0.13.2 description: The version of relenv to use python-version: required: false type: string - default: 3.10.9 + default: 3.10.12 description: The version of python to use with relenv env: diff --git a/.github/workflows/build-salt-onedir.yml b/.github/workflows/build-salt-onedir.yml index 972176c8cee..bc89e8bb1e4 100644 --- a/.github/workflows/build-salt-onedir.yml +++ b/.github/workflows/build-salt-onedir.yml @@ -21,12 +21,12 @@ on: relenv-version: required: false type: string - default: 0.12.3 + default: 0.13.2 description: The version of relenv to use python-version: required: false type: string - default: 3.10.9 + default: 3.10.12 description: The version of python to use with relenv env: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a49625ba1f1..d00cac63b63 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -442,8 +442,8 @@ jobs: salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" 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.10.11" + relenv-version: "0.13.2" + python-version: "3.10.12" build-salt-onedir: name: Build Salt Onedir @@ -458,8 +458,8 @@ jobs: salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" 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.10.11" + relenv-version: "0.13.2" + python-version: "3.10.12" build-rpm-pkgs: name: Build RPM Packages @@ -470,8 +470,8 @@ jobs: uses: ./.github/workflows/build-rpm-packages.yml with: salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" - relenv-version: "0.12.3" - python-version: "3.10.11" + relenv-version: "0.13.2" + python-version: "3.10.12" build-deb-pkgs: name: Build DEB Packages @@ -482,8 +482,8 @@ jobs: uses: ./.github/workflows/build-deb-packages.yml with: salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" - relenv-version: "0.12.3" - python-version: "3.10.11" + relenv-version: "0.13.2" + python-version: "3.10.12" build-windows-pkgs: name: Build Windows Packages @@ -494,8 +494,8 @@ jobs: uses: ./.github/workflows/build-windows-packages.yml with: salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" - relenv-version: "0.12.3" - python-version: "3.10.11" + relenv-version: "0.13.2" + python-version: "3.10.12" build-macos-pkgs: name: Build macOS Packages @@ -506,8 +506,8 @@ jobs: uses: ./.github/workflows/build-macos-packages.yml with: salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" - relenv-version: "0.12.3" - python-version: "3.10.11" + relenv-version: "0.13.2" + python-version: "3.10.12" amazonlinux-2-pkg-tests: name: Amazon Linux 2 Package Tests @@ -522,7 +522,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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -540,7 +540,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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -558,7 +558,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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -576,7 +576,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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -594,7 +594,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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -612,7 +612,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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -630,7 +630,7 @@ jobs: arch: aarch64 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" pkg-type: deb - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -648,7 +648,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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -666,7 +666,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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -684,7 +684,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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -702,7 +702,7 @@ jobs: arch: aarch64 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" pkg-type: deb - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -720,7 +720,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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -738,7 +738,7 @@ jobs: arch: aarch64 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" pkg-type: deb - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -756,7 +756,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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -774,7 +774,7 @@ jobs: arch: amd64 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" pkg-type: NSIS - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -792,7 +792,7 @@ jobs: arch: amd64 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" pkg-type: MSI - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -810,7 +810,7 @@ jobs: arch: amd64 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" pkg-type: NSIS - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -828,7 +828,7 @@ jobs: arch: amd64 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" pkg-type: MSI - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -864,7 +864,7 @@ jobs: arch: amd64 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" pkg-type: MSI - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -883,7 +883,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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} @@ -901,7 +901,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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} @@ -919,7 +919,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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} @@ -937,7 +937,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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} @@ -955,7 +955,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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} @@ -973,7 +973,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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} @@ -991,7 +991,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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} @@ -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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} @@ -1027,7 +1027,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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} @@ -1045,7 +1045,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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} @@ -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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} @@ -1081,7 +1081,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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} 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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} @@ -1117,7 +1117,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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} @@ -1135,7 +1135,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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} @@ -1153,7 +1153,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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} @@ -1171,7 +1171,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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} @@ -1189,7 +1189,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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} @@ -1207,7 +1207,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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} @@ -1225,7 +1225,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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} @@ -1243,7 +1243,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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} @@ -1261,7 +1261,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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} @@ -1279,7 +1279,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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: ${{ fromJSON(needs.prepare-workflow.outputs.testrun)['skip_code_coverage'] }} skip-junit-reports: ${{ github.event_name == 'pull_request' }} diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 0ba1a998f5d..6413ea0cae6 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -493,8 +493,8 @@ jobs: salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" 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.10.11" + relenv-version: "0.13.2" + python-version: "3.10.12" build-salt-onedir: name: Build Salt Onedir @@ -509,8 +509,8 @@ jobs: salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" 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.10.11" + relenv-version: "0.13.2" + python-version: "3.10.12" build-rpm-pkgs: name: Build RPM Packages @@ -521,8 +521,8 @@ jobs: uses: ./.github/workflows/build-rpm-packages.yml with: salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" - relenv-version: "0.12.3" - python-version: "3.10.11" + relenv-version: "0.13.2" + python-version: "3.10.12" build-deb-pkgs: name: Build DEB Packages @@ -533,8 +533,8 @@ jobs: uses: ./.github/workflows/build-deb-packages.yml with: salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" - relenv-version: "0.12.3" - python-version: "3.10.11" + relenv-version: "0.13.2" + python-version: "3.10.12" build-windows-pkgs: name: Build Windows Packages @@ -545,8 +545,8 @@ jobs: uses: ./.github/workflows/build-windows-packages.yml with: salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" - relenv-version: "0.12.3" - python-version: "3.10.11" + relenv-version: "0.13.2" + python-version: "3.10.12" environment: nightly sign-packages: false secrets: inherit @@ -560,8 +560,8 @@ jobs: uses: ./.github/workflows/build-macos-packages.yml with: salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" - relenv-version: "0.12.3" - python-version: "3.10.11" + relenv-version: "0.13.2" + python-version: "3.10.12" environment: nightly sign-packages: true secrets: inherit @@ -579,7 +579,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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: false skip-junit-reports: false testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -597,7 +597,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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: false skip-junit-reports: false testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: false skip-junit-reports: false testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -633,7 +633,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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: false skip-junit-reports: false testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -651,7 +651,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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: false skip-junit-reports: false testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -669,7 +669,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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: false skip-junit-reports: false testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -687,7 +687,7 @@ jobs: arch: aarch64 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" pkg-type: deb - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: false skip-junit-reports: false testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -705,7 +705,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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: false skip-junit-reports: false testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -723,7 +723,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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: false skip-junit-reports: false testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -741,7 +741,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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: false skip-junit-reports: false testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -759,7 +759,7 @@ jobs: arch: aarch64 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" pkg-type: deb - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: false skip-junit-reports: false testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -777,7 +777,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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: false skip-junit-reports: false testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -795,7 +795,7 @@ jobs: arch: aarch64 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" pkg-type: deb - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: false skip-junit-reports: false testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: false skip-junit-reports: false testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -831,7 +831,7 @@ jobs: arch: amd64 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" pkg-type: NSIS - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: false skip-junit-reports: false testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -849,7 +849,7 @@ jobs: arch: amd64 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" pkg-type: MSI - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: false skip-junit-reports: false testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -867,7 +867,7 @@ jobs: arch: amd64 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" pkg-type: NSIS - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: false skip-junit-reports: false testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -885,7 +885,7 @@ jobs: arch: amd64 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" pkg-type: MSI - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: false skip-junit-reports: false testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -903,7 +903,7 @@ jobs: arch: amd64 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" pkg-type: NSIS - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: false skip-junit-reports: false testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: false skip-junit-reports: false testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -940,7 +940,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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: false skip-junit-reports: false @@ -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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: false skip-junit-reports: false @@ -976,7 +976,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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: false skip-junit-reports: false @@ -994,7 +994,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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: false skip-junit-reports: false @@ -1012,7 +1012,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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: false skip-junit-reports: false @@ -1030,7 +1030,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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: false skip-junit-reports: false @@ -1048,7 +1048,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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: false skip-junit-reports: false @@ -1084,7 +1084,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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: false skip-junit-reports: false @@ -1102,7 +1102,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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: false skip-junit-reports: false @@ -1138,7 +1138,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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: false skip-junit-reports: false @@ -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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: false skip-junit-reports: false @@ -1174,7 +1174,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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: false skip-junit-reports: false @@ -1192,7 +1192,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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: false skip-junit-reports: false @@ -1210,7 +1210,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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: false skip-junit-reports: false @@ -1228,7 +1228,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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: false skip-junit-reports: false @@ -1246,7 +1246,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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: false skip-junit-reports: false @@ -1264,7 +1264,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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: false skip-junit-reports: false @@ -1282,7 +1282,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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: false skip-junit-reports: false @@ -1300,7 +1300,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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: false skip-junit-reports: false @@ -1318,7 +1318,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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: false skip-junit-reports: false @@ -1336,7 +1336,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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: false skip-junit-reports: false diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index fa0a019a496..cdd66daf1af 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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 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 9bd70b42e00..c9cdcc7db46 100644 --- a/.github/workflows/scheduled.yml +++ b/.github/workflows/scheduled.yml @@ -478,8 +478,8 @@ jobs: salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" 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.10.11" + relenv-version: "0.13.2" + python-version: "3.10.12" build-salt-onedir: name: Build Salt Onedir @@ -494,8 +494,8 @@ jobs: salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" 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.10.11" + relenv-version: "0.13.2" + python-version: "3.10.12" build-rpm-pkgs: name: Build RPM Packages @@ -506,8 +506,8 @@ jobs: uses: ./.github/workflows/build-rpm-packages.yml with: salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" - relenv-version: "0.12.3" - python-version: "3.10.11" + relenv-version: "0.13.2" + python-version: "3.10.12" build-deb-pkgs: name: Build DEB Packages @@ -518,8 +518,8 @@ jobs: uses: ./.github/workflows/build-deb-packages.yml with: salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" - relenv-version: "0.12.3" - python-version: "3.10.11" + relenv-version: "0.13.2" + python-version: "3.10.12" build-windows-pkgs: name: Build Windows Packages @@ -530,8 +530,8 @@ jobs: uses: ./.github/workflows/build-windows-packages.yml with: salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" - relenv-version: "0.12.3" - python-version: "3.10.11" + relenv-version: "0.13.2" + python-version: "3.10.12" build-macos-pkgs: name: Build macOS Packages @@ -542,8 +542,8 @@ jobs: uses: ./.github/workflows/build-macos-packages.yml with: salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" - relenv-version: "0.12.3" - python-version: "3.10.11" + relenv-version: "0.13.2" + python-version: "3.10.12" amazonlinux-2-pkg-tests: name: Amazon Linux 2 Package Tests @@ -558,7 +558,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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: false skip-junit-reports: false testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -576,7 +576,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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: false skip-junit-reports: false testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -594,7 +594,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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: false skip-junit-reports: false testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -612,7 +612,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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: false skip-junit-reports: false testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -630,7 +630,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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: false skip-junit-reports: false testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -648,7 +648,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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: false skip-junit-reports: false testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -666,7 +666,7 @@ jobs: arch: aarch64 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" pkg-type: deb - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: false skip-junit-reports: false testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -684,7 +684,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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: false skip-junit-reports: false testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -702,7 +702,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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: false skip-junit-reports: false testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -720,7 +720,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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: false skip-junit-reports: false testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -738,7 +738,7 @@ jobs: arch: aarch64 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" pkg-type: deb - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: false skip-junit-reports: false testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -756,7 +756,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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: false skip-junit-reports: false testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -774,7 +774,7 @@ jobs: arch: aarch64 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" pkg-type: deb - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: false skip-junit-reports: false testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -792,7 +792,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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: false skip-junit-reports: false testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -810,7 +810,7 @@ jobs: arch: amd64 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" pkg-type: NSIS - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: false skip-junit-reports: false testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -828,7 +828,7 @@ jobs: arch: amd64 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" pkg-type: MSI - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: false skip-junit-reports: false testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: false skip-junit-reports: false testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -864,7 +864,7 @@ jobs: arch: amd64 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" pkg-type: MSI - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: false skip-junit-reports: false testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -882,7 +882,7 @@ jobs: arch: amd64 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" pkg-type: NSIS - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: false skip-junit-reports: false testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -900,7 +900,7 @@ jobs: arch: amd64 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" pkg-type: MSI - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: false skip-junit-reports: false testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -919,7 +919,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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: false skip-junit-reports: false @@ -937,7 +937,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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: false skip-junit-reports: false @@ -955,7 +955,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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: false skip-junit-reports: false @@ -973,7 +973,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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: false skip-junit-reports: false @@ -991,7 +991,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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: false skip-junit-reports: false @@ -1027,7 +1027,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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: false skip-junit-reports: false @@ -1045,7 +1045,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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: false skip-junit-reports: false @@ -1081,7 +1081,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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: false skip-junit-reports: false @@ -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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: false skip-junit-reports: false @@ -1117,7 +1117,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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: false skip-junit-reports: false @@ -1135,7 +1135,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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: false skip-junit-reports: false @@ -1153,7 +1153,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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: false skip-junit-reports: false @@ -1171,7 +1171,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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: false skip-junit-reports: false @@ -1189,7 +1189,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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: false skip-junit-reports: false @@ -1207,7 +1207,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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: false skip-junit-reports: false @@ -1225,7 +1225,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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: false skip-junit-reports: false @@ -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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: false skip-junit-reports: false @@ -1261,7 +1261,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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: false skip-junit-reports: false @@ -1279,7 +1279,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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: false skip-junit-reports: false @@ -1297,7 +1297,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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: false skip-junit-reports: false @@ -1315,7 +1315,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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: false skip-junit-reports: false diff --git a/.github/workflows/staging.yml b/.github/workflows/staging.yml index cbcbd42e9c0..cf914e0943a 100644 --- a/.github/workflows/staging.yml +++ b/.github/workflows/staging.yml @@ -478,8 +478,8 @@ jobs: salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" 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.10.11" + relenv-version: "0.13.2" + python-version: "3.10.12" build-salt-onedir: name: Build Salt Onedir @@ -494,8 +494,8 @@ jobs: salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" 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.10.11" + relenv-version: "0.13.2" + python-version: "3.10.12" build-rpm-pkgs: name: Build RPM Packages @@ -506,8 +506,8 @@ jobs: uses: ./.github/workflows/build-rpm-packages.yml with: salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" - relenv-version: "0.12.3" - python-version: "3.10.11" + relenv-version: "0.13.2" + python-version: "3.10.12" build-deb-pkgs: name: Build DEB Packages @@ -518,8 +518,8 @@ jobs: uses: ./.github/workflows/build-deb-packages.yml with: salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" - relenv-version: "0.12.3" - python-version: "3.10.11" + relenv-version: "0.13.2" + python-version: "3.10.12" build-windows-pkgs: name: Build Windows Packages @@ -530,8 +530,8 @@ jobs: uses: ./.github/workflows/build-windows-packages.yml with: salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" - relenv-version: "0.12.3" - python-version: "3.10.11" + relenv-version: "0.13.2" + python-version: "3.10.12" environment: staging sign-packages: ${{ inputs.sign-windows-packages }} secrets: inherit @@ -545,8 +545,8 @@ jobs: uses: ./.github/workflows/build-macos-packages.yml with: salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" - relenv-version: "0.12.3" - python-version: "3.10.11" + relenv-version: "0.13.2" + python-version: "3.10.12" environment: staging sign-packages: true secrets: inherit @@ -564,7 +564,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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: true skip-junit-reports: true testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -582,7 +582,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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: true skip-junit-reports: true testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: true skip-junit-reports: true testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -618,7 +618,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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: true skip-junit-reports: true testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -636,7 +636,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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: true skip-junit-reports: true testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -654,7 +654,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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: true skip-junit-reports: true testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -672,7 +672,7 @@ jobs: arch: aarch64 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" pkg-type: deb - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: true skip-junit-reports: true testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -690,7 +690,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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: true skip-junit-reports: true testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -708,7 +708,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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: true skip-junit-reports: true testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -726,7 +726,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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: true skip-junit-reports: true testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -744,7 +744,7 @@ jobs: arch: aarch64 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" pkg-type: deb - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: true skip-junit-reports: true testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -762,7 +762,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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: true skip-junit-reports: true testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -780,7 +780,7 @@ jobs: arch: aarch64 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" pkg-type: deb - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: true skip-junit-reports: true testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -798,7 +798,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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: true skip-junit-reports: true testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -816,7 +816,7 @@ jobs: arch: amd64 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" pkg-type: NSIS - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: true skip-junit-reports: true testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -834,7 +834,7 @@ jobs: arch: amd64 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" pkg-type: MSI - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: true skip-junit-reports: true testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -852,7 +852,7 @@ jobs: arch: amd64 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" pkg-type: NSIS - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: true skip-junit-reports: true testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -870,7 +870,7 @@ jobs: arch: amd64 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" pkg-type: MSI - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: true skip-junit-reports: true testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -888,7 +888,7 @@ jobs: arch: amd64 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" pkg-type: NSIS - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: true skip-junit-reports: true testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -906,7 +906,7 @@ jobs: arch: amd64 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" pkg-type: MSI - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: true skip-junit-reports: true testing-releases: ${{ needs.prepare-workflow.outputs.testing-releases }} @@ -925,7 +925,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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: true skip-junit-reports: true @@ -943,7 +943,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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: true skip-junit-reports: true @@ -961,7 +961,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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: true skip-junit-reports: true @@ -979,7 +979,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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: true skip-junit-reports: true @@ -997,7 +997,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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: true skip-junit-reports: true @@ -1033,7 +1033,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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: true skip-junit-reports: true @@ -1051,7 +1051,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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: true skip-junit-reports: true @@ -1069,7 +1069,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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: true skip-junit-reports: true @@ -1087,7 +1087,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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: true skip-junit-reports: true @@ -1105,7 +1105,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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: true skip-junit-reports: true @@ -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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: true skip-junit-reports: true @@ -1141,7 +1141,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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: true skip-junit-reports: true @@ -1159,7 +1159,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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: true skip-junit-reports: true @@ -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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: true skip-junit-reports: true @@ -1195,7 +1195,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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: true skip-junit-reports: true @@ -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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: true skip-junit-reports: true @@ -1231,7 +1231,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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: true skip-junit-reports: true @@ -1249,7 +1249,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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: true skip-junit-reports: true @@ -1267,7 +1267,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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: true skip-junit-reports: true @@ -1285,7 +1285,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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: true skip-junit-reports: true @@ -1303,7 +1303,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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: true skip-junit-reports: true @@ -1321,7 +1321,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.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 skip-code-coverage: true skip-junit-reports: true @@ -2083,7 +2083,7 @@ jobs: distro-slug: almalinux-8 platform: linux arch: x86_64 - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" environment: staging skip-code-coverage: true @@ -2102,7 +2102,7 @@ jobs: distro-slug: almalinux-8-arm64 platform: linux arch: aarch64 - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" environment: staging skip-code-coverage: true @@ -2121,7 +2121,7 @@ jobs: distro-slug: almalinux-9 platform: linux arch: x86_64 - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" environment: staging skip-code-coverage: true @@ -2140,7 +2140,7 @@ jobs: distro-slug: almalinux-9-arm64 platform: linux arch: aarch64 - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" environment: staging skip-code-coverage: true @@ -2159,7 +2159,7 @@ jobs: distro-slug: amazonlinux-2 platform: linux arch: x86_64 - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" environment: staging skip-code-coverage: true @@ -2178,7 +2178,7 @@ jobs: distro-slug: amazonlinux-2-arm64 platform: linux arch: aarch64 - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" environment: staging skip-code-coverage: true @@ -2197,7 +2197,7 @@ jobs: distro-slug: centos-7 platform: linux arch: x86_64 - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" environment: staging skip-code-coverage: true @@ -2216,7 +2216,7 @@ jobs: distro-slug: centos-7-arm64 platform: linux arch: aarch64 - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" environment: staging skip-code-coverage: true @@ -2235,7 +2235,7 @@ jobs: distro-slug: centosstream-8 platform: linux arch: x86_64 - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" environment: staging skip-code-coverage: true @@ -2254,7 +2254,7 @@ jobs: distro-slug: centosstream-8-arm64 platform: linux arch: aarch64 - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" environment: staging skip-code-coverage: true @@ -2273,7 +2273,7 @@ jobs: distro-slug: centosstream-9 platform: linux arch: x86_64 - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" environment: staging skip-code-coverage: true @@ -2292,7 +2292,7 @@ jobs: distro-slug: centosstream-9-arm64 platform: linux arch: aarch64 - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" environment: staging skip-code-coverage: true @@ -2311,7 +2311,7 @@ jobs: distro-slug: debian-10 platform: linux arch: x86_64 - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" environment: staging skip-code-coverage: true @@ -2330,7 +2330,7 @@ jobs: distro-slug: debian-11 platform: linux arch: x86_64 - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" environment: staging skip-code-coverage: true @@ -2349,7 +2349,7 @@ jobs: distro-slug: debian-11-arm64 platform: linux arch: aarch64 - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" environment: staging skip-code-coverage: true @@ -2368,7 +2368,7 @@ jobs: distro-slug: fedora-37 platform: linux arch: x86_64 - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" environment: staging skip-code-coverage: true @@ -2387,7 +2387,7 @@ jobs: distro-slug: fedora-37-arm64 platform: linux arch: aarch64 - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" environment: staging skip-code-coverage: true @@ -2406,7 +2406,7 @@ jobs: distro-slug: fedora-38 platform: linux arch: x86_64 - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" environment: staging skip-code-coverage: true @@ -2425,7 +2425,7 @@ jobs: distro-slug: fedora-38-arm64 platform: linux arch: aarch64 - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" environment: staging skip-code-coverage: true @@ -2444,7 +2444,7 @@ jobs: distro-slug: photonos-3 platform: linux arch: x86_64 - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" environment: staging skip-code-coverage: true @@ -2463,7 +2463,7 @@ jobs: distro-slug: photonos-4 platform: linux arch: x86_64 - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" environment: staging skip-code-coverage: true @@ -2482,7 +2482,7 @@ jobs: distro-slug: ubuntu-20.04 platform: linux arch: x86_64 - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" environment: staging skip-code-coverage: true @@ -2501,7 +2501,7 @@ jobs: distro-slug: ubuntu-20.04-arm64 platform: linux arch: aarch64 - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" environment: staging skip-code-coverage: true @@ -2520,7 +2520,7 @@ jobs: distro-slug: ubuntu-22.04 platform: linux arch: x86_64 - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" environment: staging skip-code-coverage: true @@ -2539,7 +2539,7 @@ jobs: distro-slug: ubuntu-22.04-arm64 platform: linux arch: aarch64 - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" environment: staging skip-code-coverage: true @@ -2558,7 +2558,7 @@ jobs: distro-slug: ubuntu-22.04 platform: linux arch: x86_64 - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" environment: staging skip-code-coverage: true @@ -2577,7 +2577,7 @@ jobs: distro-slug: ubuntu-22.04-arm64 platform: linux arch: aarch64 - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" environment: staging skip-code-coverage: true @@ -2596,7 +2596,7 @@ jobs: distro-slug: macos-12 platform: darwin arch: x86_64 - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" environment: staging skip-code-coverage: true @@ -2615,7 +2615,7 @@ jobs: distro-slug: macos-12 platform: darwin arch: x86_64 - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" environment: staging skip-code-coverage: true @@ -2635,7 +2635,7 @@ jobs: platform: windows arch: amd64 pkg-type: nsis - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" environment: staging skip-code-coverage: true @@ -2654,7 +2654,7 @@ jobs: platform: windows arch: amd64 pkg-type: msi - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" environment: staging skip-code-coverage: true @@ -2673,7 +2673,7 @@ jobs: platform: windows arch: amd64 pkg-type: onedir - cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.11 + cache-prefix: ${{ needs.prepare-workflow.outputs.cache-seed }}|3.10.12 salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}" environment: staging skip-code-coverage: true diff --git a/changelog/64719.security.md b/changelog/64719.security.md new file mode 100644 index 00000000000..3476499d3d7 --- /dev/null +++ b/changelog/64719.security.md @@ -0,0 +1,3 @@ +Upgrade `relenv` to `0.13.2` and Python to `3.10.12` + +Addresses multiple CVEs in Python's dependencies: https://docs.python.org/release/3.10.12/whatsnew/changelog.html#python-3-10-12 diff --git a/cicd/shared-gh-workflows-context.yml b/cicd/shared-gh-workflows-context.yml index b554b57aafa..846d5625320 100644 --- a/cicd/shared-gh-workflows-context.yml +++ b/cicd/shared-gh-workflows-context.yml @@ -1,2 +1,2 @@ -python_version: "3.10.11" -relenv_version: "0.12.3" +python_version: "3.10.12" +relenv_version: "0.13.2" diff --git a/pkg/macos/build_python.sh b/pkg/macos/build_python.sh index be179b7b166..7d65dca843b 100755 --- a/pkg/macos/build_python.sh +++ b/pkg/macos/build_python.sh @@ -48,8 +48,8 @@ _usage() { echo " -v, --version version of python to install, must be available with relenv" echo " -r, --relenv-version version of python to install, must be available with relenv" echo "" - echo " To build python 3.10.11:" - echo " example: $0 --version 3.10.11" + echo " To build python 3.10.12:" + echo " example: $0 --version 3.10.12" } # _msg diff --git a/pkg/windows/build.ps1 b/pkg/windows/build.ps1 index 6c5cac2ac17..ac273a6c163 100644 --- a/pkg/windows/build.ps1 +++ b/pkg/windows/build.ps1 @@ -38,12 +38,8 @@ param( [Parameter(Mandatory=$false)] [ValidatePattern("^\d{1,2}.\d{1,2}.\d{1,2}$")] - [ValidateSet( - "3.11.3", - "3.10.11" - )] [Alias("p")] - [String] $PythonVersion = "3.10.11", + [String] $PythonVersion = "3.10.12", [Parameter(Mandatory=$false)] [Alias("r")] diff --git a/pkg/windows/build_python.ps1 b/pkg/windows/build_python.ps1 index e91f41fea00..90a2b053a92 100644 --- a/pkg/windows/build_python.ps1 +++ b/pkg/windows/build_python.ps1 @@ -17,12 +17,8 @@ build_python.ps1 -Version 3.10.9 -Architecture x86 param( [Parameter(Mandatory=$false)] [ValidatePattern("^\d{1,2}.\d{1,2}.\d{1,2}$")] - [ValidateSet( - "3.11.3", - "3.10.11" - )] [Alias("v")] - [String] $Version = "3.10.11", + [String] $Version = "3.10.12", [Parameter(Mandatory=$false)] [Alias("r")] From 301df340e7c123bb70cfe4bf4b3472b4e5a74408 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Wed, 26 Jul 2023 12:17:13 +0100 Subject: [PATCH 198/393] Bump to `certifi==2023.07.22` due to https://github.com/advisories/GHSA-xqr8-7jwr-rhp7 Signed-off-by: Pedro Algarvio --- changelog/64718.security.md | 1 + requirements/static/ci/py3.10/cloud.txt | 2 +- requirements/static/ci/py3.10/darwin.txt | 2 +- requirements/static/ci/py3.10/docs.txt | 2 +- requirements/static/ci/py3.10/freebsd.txt | 2 +- requirements/static/ci/py3.10/lint.txt | 2 +- requirements/static/ci/py3.10/linux.txt | 2 +- requirements/static/ci/py3.10/pkgtests-windows.txt | 2 +- requirements/static/ci/py3.10/pkgtests.txt | 2 +- requirements/static/ci/py3.10/tools.txt | 2 +- requirements/static/ci/py3.10/windows.txt | 2 +- requirements/static/ci/py3.11/tools.txt | 2 +- requirements/static/ci/py3.7/cloud.txt | 2 +- requirements/static/ci/py3.7/docs.txt | 2 +- requirements/static/ci/py3.7/freebsd.txt | 2 +- requirements/static/ci/py3.7/lint.txt | 2 +- requirements/static/ci/py3.7/linux.txt | 2 +- requirements/static/ci/py3.7/windows.txt | 2 +- requirements/static/ci/py3.8/cloud.txt | 2 +- requirements/static/ci/py3.8/docs.txt | 2 +- requirements/static/ci/py3.8/freebsd.txt | 2 +- requirements/static/ci/py3.8/lint.txt | 2 +- requirements/static/ci/py3.8/linux.txt | 2 +- requirements/static/ci/py3.8/windows.txt | 2 +- requirements/static/ci/py3.9/cloud.txt | 2 +- requirements/static/ci/py3.9/darwin.txt | 2 +- requirements/static/ci/py3.9/docs.txt | 2 +- requirements/static/ci/py3.9/freebsd.txt | 2 +- requirements/static/ci/py3.9/lint.txt | 2 +- requirements/static/ci/py3.9/linux.txt | 2 +- requirements/static/ci/py3.9/tools.txt | 2 +- requirements/static/ci/py3.9/windows.txt | 2 +- requirements/static/pkg/py3.10/darwin.txt | 2 +- requirements/static/pkg/py3.10/freebsd.txt | 2 +- requirements/static/pkg/py3.10/linux.txt | 2 +- requirements/static/pkg/py3.10/windows.txt | 2 +- requirements/static/pkg/py3.7/freebsd.txt | 2 +- requirements/static/pkg/py3.7/linux.txt | 2 +- requirements/static/pkg/py3.7/windows.txt | 2 +- requirements/static/pkg/py3.8/freebsd.txt | 2 +- requirements/static/pkg/py3.8/linux.txt | 2 +- requirements/static/pkg/py3.8/windows.txt | 2 +- requirements/static/pkg/py3.9/darwin.txt | 2 +- requirements/static/pkg/py3.9/freebsd.txt | 2 +- requirements/static/pkg/py3.9/linux.txt | 2 +- requirements/static/pkg/py3.9/windows.txt | 2 +- 46 files changed, 46 insertions(+), 45 deletions(-) create mode 100644 changelog/64718.security.md diff --git a/changelog/64718.security.md b/changelog/64718.security.md new file mode 100644 index 00000000000..b40aef1ad85 --- /dev/null +++ b/changelog/64718.security.md @@ -0,0 +1 @@ +Bump to `certifi==2023.07.22` due to https://github.com/advisories/GHSA-xqr8-7jwr-rhp7 diff --git a/requirements/static/ci/py3.10/cloud.txt b/requirements/static/ci/py3.10/cloud.txt index b18ec4f09c0..1862a07681f 100644 --- a/requirements/static/ci/py3.10/cloud.txt +++ b/requirements/static/ci/py3.10/cloud.txt @@ -350,7 +350,7 @@ cachetools==4.2.2 # via google-auth cassandra-driver==3.25.0 # via -r requirements/static/ci/common.in -certifi==2022.12.7 +certifi==2023.07.22 # via # -r requirements/static/ci/common.in # kubernetes diff --git a/requirements/static/ci/py3.10/darwin.txt b/requirements/static/ci/py3.10/darwin.txt index c0975217c25..8a284e31b47 100644 --- a/requirements/static/ci/py3.10/darwin.txt +++ b/requirements/static/ci/py3.10/darwin.txt @@ -350,7 +350,7 @@ cachetools==3.1.0 # via google-auth cassandra-driver==3.23.0 # via -r requirements/static/ci/common.in -certifi==2022.12.7 +certifi==2023.07.22 # via # -r requirements/static/ci/common.in # kubernetes diff --git a/requirements/static/ci/py3.10/docs.txt b/requirements/static/ci/py3.10/docs.txt index ce07a3a5061..588b8682f56 100644 --- a/requirements/static/ci/py3.10/docs.txt +++ b/requirements/static/ci/py3.10/docs.txt @@ -8,7 +8,7 @@ alabaster==0.7.12 # via sphinx babel==2.9.1 # via sphinx -certifi==2022.12.7 +certifi==2023.07.22 # via # -c requirements/static/ci/py3.10/linux.txt # requests diff --git a/requirements/static/ci/py3.10/freebsd.txt b/requirements/static/ci/py3.10/freebsd.txt index baaf1233d53..69dc466b7a4 100644 --- a/requirements/static/ci/py3.10/freebsd.txt +++ b/requirements/static/ci/py3.10/freebsd.txt @@ -348,7 +348,7 @@ cachetools==3.1.0 # via google-auth cassandra-driver==3.24.0 # via -r requirements/static/ci/common.in -certifi==2022.12.7 +certifi==2023.07.22 # via # -r requirements/static/ci/common.in # kubernetes diff --git a/requirements/static/ci/py3.10/lint.txt b/requirements/static/ci/py3.10/lint.txt index dc2efbcb0f7..4d56f17f2bc 100644 --- a/requirements/static/ci/py3.10/lint.txt +++ b/requirements/static/ci/py3.10/lint.txt @@ -353,7 +353,7 @@ cachetools==4.2.2 # python-telegram-bot cassandra-driver==3.25.0 # via -r requirements/static/ci/common.in -certifi==2022.12.7 +certifi==2023.07.22 # via # -r requirements/static/ci/common.in # kubernetes diff --git a/requirements/static/ci/py3.10/linux.txt b/requirements/static/ci/py3.10/linux.txt index 973d015842a..950e88180a5 100644 --- a/requirements/static/ci/py3.10/linux.txt +++ b/requirements/static/ci/py3.10/linux.txt @@ -361,7 +361,7 @@ cachetools==4.2.2 # python-telegram-bot cassandra-driver==3.23.0 # via -r requirements/static/ci/common.in -certifi==2022.12.7 +certifi==2023.07.22 # via # -r requirements/static/ci/common.in # kubernetes diff --git a/requirements/static/ci/py3.10/pkgtests-windows.txt b/requirements/static/ci/py3.10/pkgtests-windows.txt index fc22d0a9805..de7ee93e182 100644 --- a/requirements/static/ci/py3.10/pkgtests-windows.txt +++ b/requirements/static/ci/py3.10/pkgtests-windows.txt @@ -13,7 +13,7 @@ attrs==22.2.0 # pytest-system-statistics autocommand==2.2.2 # via jaraco.text -certifi==2022.12.7 +certifi==2023.07.22 # via requests cffi==1.15.1 # via clr-loader diff --git a/requirements/static/ci/py3.10/pkgtests.txt b/requirements/static/ci/py3.10/pkgtests.txt index bb18c792933..127e64a8857 100644 --- a/requirements/static/ci/py3.10/pkgtests.txt +++ b/requirements/static/ci/py3.10/pkgtests.txt @@ -13,7 +13,7 @@ attrs==22.2.0 # pytest-system-statistics autocommand==2.2.2 # via jaraco.text -certifi==2022.12.7 +certifi==2023.07.22 # via requests charset-normalizer==3.0.1 # via requests diff --git a/requirements/static/ci/py3.10/tools.txt b/requirements/static/ci/py3.10/tools.txt index 4981fc3c640..13305fb83a5 100644 --- a/requirements/static/ci/py3.10/tools.txt +++ b/requirements/static/ci/py3.10/tools.txt @@ -14,7 +14,7 @@ botocore==1.24.46 # via # boto3 # s3transfer -certifi==2022.12.7 +certifi==2023.07.22 # via requests charset-normalizer==3.0.1 # via requests diff --git a/requirements/static/ci/py3.10/windows.txt b/requirements/static/ci/py3.10/windows.txt index 2417941f38e..b345f558795 100644 --- a/requirements/static/ci/py3.10/windows.txt +++ b/requirements/static/ci/py3.10/windows.txt @@ -36,7 +36,7 @@ cachetools==3.1.0 # via google-auth cassandra-driver==3.23.0 # via -r requirements/static/ci/common.in -certifi==2022.12.7 +certifi==2023.07.22 # via # -r requirements/static/ci/common.in # -r requirements/windows.txt diff --git a/requirements/static/ci/py3.11/tools.txt b/requirements/static/ci/py3.11/tools.txt index 556718941f1..733d7d186c6 100644 --- a/requirements/static/ci/py3.11/tools.txt +++ b/requirements/static/ci/py3.11/tools.txt @@ -14,7 +14,7 @@ botocore==1.24.46 # via # boto3 # s3transfer -certifi==2022.12.7 +certifi==2023.07.22 # via requests charset-normalizer==3.0.1 # via requests diff --git a/requirements/static/ci/py3.7/cloud.txt b/requirements/static/ci/py3.7/cloud.txt index 6eaf60aa529..0823fc8ff75 100644 --- a/requirements/static/ci/py3.7/cloud.txt +++ b/requirements/static/ci/py3.7/cloud.txt @@ -352,7 +352,7 @@ cachetools==4.2.2 # via google-auth cassandra-driver==3.25.0 # via -r requirements/static/ci/common.in -certifi==2022.12.7 +certifi==2023.07.22 # via # -r requirements/static/ci/common.in # kubernetes diff --git a/requirements/static/ci/py3.7/docs.txt b/requirements/static/ci/py3.7/docs.txt index 96093a63491..31209a994b2 100644 --- a/requirements/static/ci/py3.7/docs.txt +++ b/requirements/static/ci/py3.7/docs.txt @@ -8,7 +8,7 @@ alabaster==0.7.12 # via sphinx babel==2.9.1 # via sphinx -certifi==2022.12.7 +certifi==2023.07.22 # via # -c requirements/static/ci/py3.7/linux.txt # requests diff --git a/requirements/static/ci/py3.7/freebsd.txt b/requirements/static/ci/py3.7/freebsd.txt index cb2a33a878a..25fb5d4857e 100644 --- a/requirements/static/ci/py3.7/freebsd.txt +++ b/requirements/static/ci/py3.7/freebsd.txt @@ -350,7 +350,7 @@ cachetools==3.1.0 # via google-auth cassandra-driver==3.24.0 # via -r requirements/static/ci/common.in -certifi==2022.12.7 +certifi==2023.07.22 # via # -r requirements/static/ci/common.in # kubernetes diff --git a/requirements/static/ci/py3.7/lint.txt b/requirements/static/ci/py3.7/lint.txt index 84fb45bda87..b7f48d8b01a 100644 --- a/requirements/static/ci/py3.7/lint.txt +++ b/requirements/static/ci/py3.7/lint.txt @@ -357,7 +357,7 @@ cachetools==4.2.2 # python-telegram-bot cassandra-driver==3.25.0 # via -r requirements/static/ci/common.in -certifi==2022.12.7 +certifi==2023.07.22 # via # -r requirements/static/ci/common.in # kubernetes diff --git a/requirements/static/ci/py3.7/linux.txt b/requirements/static/ci/py3.7/linux.txt index 4572c8bdbf3..b06cf80b7b6 100644 --- a/requirements/static/ci/py3.7/linux.txt +++ b/requirements/static/ci/py3.7/linux.txt @@ -363,7 +363,7 @@ cachetools==4.2.2 # python-telegram-bot cassandra-driver==3.23.0 # via -r requirements/static/ci/common.in -certifi==2022.12.7 +certifi==2023.07.22 # via # -r requirements/static/ci/common.in # kubernetes diff --git a/requirements/static/ci/py3.7/windows.txt b/requirements/static/ci/py3.7/windows.txt index 8959a773789..548a60f8f9d 100644 --- a/requirements/static/ci/py3.7/windows.txt +++ b/requirements/static/ci/py3.7/windows.txt @@ -42,7 +42,7 @@ cachetools==3.1.0 # via google-auth cassandra-driver==3.23.0 # via -r requirements/static/ci/common.in -certifi==2022.12.7 +certifi==2023.07.22 # via # -r requirements/static/ci/common.in # -r requirements/windows.txt diff --git a/requirements/static/ci/py3.8/cloud.txt b/requirements/static/ci/py3.8/cloud.txt index 0efdfc4ddb6..7393b82c4c8 100644 --- a/requirements/static/ci/py3.8/cloud.txt +++ b/requirements/static/ci/py3.8/cloud.txt @@ -350,7 +350,7 @@ cachetools==4.2.2 # via google-auth cassandra-driver==3.25.0 # via -r requirements/static/ci/common.in -certifi==2022.12.7 +certifi==2023.07.22 # via # -r requirements/static/ci/common.in # kubernetes diff --git a/requirements/static/ci/py3.8/docs.txt b/requirements/static/ci/py3.8/docs.txt index 3f7c81f3f36..da96a0c3bfb 100644 --- a/requirements/static/ci/py3.8/docs.txt +++ b/requirements/static/ci/py3.8/docs.txt @@ -8,7 +8,7 @@ alabaster==0.7.12 # via sphinx babel==2.9.1 # via sphinx -certifi==2022.12.7 +certifi==2023.07.22 # via # -c requirements/static/ci/py3.8/linux.txt # requests diff --git a/requirements/static/ci/py3.8/freebsd.txt b/requirements/static/ci/py3.8/freebsd.txt index 5bc0834aa96..c6b357d4173 100644 --- a/requirements/static/ci/py3.8/freebsd.txt +++ b/requirements/static/ci/py3.8/freebsd.txt @@ -348,7 +348,7 @@ cachetools==3.1.0 # via google-auth cassandra-driver==3.24.0 # via -r requirements/static/ci/common.in -certifi==2022.12.7 +certifi==2023.07.22 # via # -r requirements/static/ci/common.in # kubernetes diff --git a/requirements/static/ci/py3.8/lint.txt b/requirements/static/ci/py3.8/lint.txt index 75cae1cbec6..85cd7200930 100644 --- a/requirements/static/ci/py3.8/lint.txt +++ b/requirements/static/ci/py3.8/lint.txt @@ -355,7 +355,7 @@ cachetools==4.2.2 # python-telegram-bot cassandra-driver==3.25.0 # via -r requirements/static/ci/common.in -certifi==2022.12.7 +certifi==2023.07.22 # via # -r requirements/static/ci/common.in # kubernetes diff --git a/requirements/static/ci/py3.8/linux.txt b/requirements/static/ci/py3.8/linux.txt index f9bf547397f..7aeac2980c8 100644 --- a/requirements/static/ci/py3.8/linux.txt +++ b/requirements/static/ci/py3.8/linux.txt @@ -361,7 +361,7 @@ cachetools==4.2.2 # python-telegram-bot cassandra-driver==3.23.0 # via -r requirements/static/ci/common.in -certifi==2022.12.7 +certifi==2023.07.22 # via # -r requirements/static/ci/common.in # kubernetes diff --git a/requirements/static/ci/py3.8/windows.txt b/requirements/static/ci/py3.8/windows.txt index 63b94d8153c..e5bdaa0a625 100644 --- a/requirements/static/ci/py3.8/windows.txt +++ b/requirements/static/ci/py3.8/windows.txt @@ -38,7 +38,7 @@ cachetools==3.1.0 # via google-auth cassandra-driver==3.23.0 # via -r requirements/static/ci/common.in -certifi==2022.12.7 +certifi==2023.07.22 # via # -r requirements/static/ci/common.in # -r requirements/windows.txt diff --git a/requirements/static/ci/py3.9/cloud.txt b/requirements/static/ci/py3.9/cloud.txt index 284da11446c..dd9b361d956 100644 --- a/requirements/static/ci/py3.9/cloud.txt +++ b/requirements/static/ci/py3.9/cloud.txt @@ -350,7 +350,7 @@ cachetools==4.2.2 # via google-auth cassandra-driver==3.25.0 # via -r requirements/static/ci/common.in -certifi==2022.12.7 +certifi==2023.07.22 # via # -r requirements/static/ci/common.in # kubernetes diff --git a/requirements/static/ci/py3.9/darwin.txt b/requirements/static/ci/py3.9/darwin.txt index cd6ea9161f0..3b2a0993068 100644 --- a/requirements/static/ci/py3.9/darwin.txt +++ b/requirements/static/ci/py3.9/darwin.txt @@ -350,7 +350,7 @@ cachetools==3.1.0 # via google-auth cassandra-driver==3.23.0 # via -r requirements/static/ci/common.in -certifi==2022.12.7 +certifi==2023.07.22 # via # -r requirements/static/ci/common.in # kubernetes diff --git a/requirements/static/ci/py3.9/docs.txt b/requirements/static/ci/py3.9/docs.txt index 96c88b70650..772a37c357a 100644 --- a/requirements/static/ci/py3.9/docs.txt +++ b/requirements/static/ci/py3.9/docs.txt @@ -8,7 +8,7 @@ alabaster==0.7.12 # via sphinx babel==2.9.1 # via sphinx -certifi==2022.12.7 +certifi==2023.07.22 # via # -c requirements/static/ci/py3.9/linux.txt # requests diff --git a/requirements/static/ci/py3.9/freebsd.txt b/requirements/static/ci/py3.9/freebsd.txt index 6a6eecc62de..0937c4827bf 100644 --- a/requirements/static/ci/py3.9/freebsd.txt +++ b/requirements/static/ci/py3.9/freebsd.txt @@ -348,7 +348,7 @@ cachetools==3.1.0 # via google-auth cassandra-driver==3.24.0 # via -r requirements/static/ci/common.in -certifi==2022.12.7 +certifi==2023.07.22 # via # -r requirements/static/ci/common.in # kubernetes diff --git a/requirements/static/ci/py3.9/lint.txt b/requirements/static/ci/py3.9/lint.txt index 0797e729902..7fdb2b8b3fe 100644 --- a/requirements/static/ci/py3.9/lint.txt +++ b/requirements/static/ci/py3.9/lint.txt @@ -353,7 +353,7 @@ cachetools==4.2.2 # python-telegram-bot cassandra-driver==3.25.0 # via -r requirements/static/ci/common.in -certifi==2022.12.7 +certifi==2023.07.22 # via # -r requirements/static/ci/common.in # kubernetes diff --git a/requirements/static/ci/py3.9/linux.txt b/requirements/static/ci/py3.9/linux.txt index 24cd91c4204..d2720993b2e 100644 --- a/requirements/static/ci/py3.9/linux.txt +++ b/requirements/static/ci/py3.9/linux.txt @@ -363,7 +363,7 @@ cachetools==4.2.2 # python-telegram-bot cassandra-driver==3.23.0 # via -r requirements/static/ci/common.in -certifi==2022.12.7 +certifi==2023.07.22 # via # -r requirements/static/ci/common.in # kubernetes diff --git a/requirements/static/ci/py3.9/tools.txt b/requirements/static/ci/py3.9/tools.txt index 36efc836b96..245b5fcffcd 100644 --- a/requirements/static/ci/py3.9/tools.txt +++ b/requirements/static/ci/py3.9/tools.txt @@ -14,7 +14,7 @@ botocore==1.24.46 # via # boto3 # s3transfer -certifi==2022.12.7 +certifi==2023.07.22 # via requests charset-normalizer==3.0.1 # via requests diff --git a/requirements/static/ci/py3.9/windows.txt b/requirements/static/ci/py3.9/windows.txt index 282303ad60b..cd5f59e18de 100644 --- a/requirements/static/ci/py3.9/windows.txt +++ b/requirements/static/ci/py3.9/windows.txt @@ -38,7 +38,7 @@ cachetools==3.1.0 # via google-auth cassandra-driver==3.23.0 # via -r requirements/static/ci/common.in -certifi==2022.12.7 +certifi==2023.07.22 # via # -r requirements/static/ci/common.in # -r requirements/windows.txt diff --git a/requirements/static/pkg/py3.10/darwin.txt b/requirements/static/pkg/py3.10/darwin.txt index 754590ec08c..e2667937927 100644 --- a/requirements/static/pkg/py3.10/darwin.txt +++ b/requirements/static/pkg/py3.10/darwin.txt @@ -6,7 +6,7 @@ # apache-libcloud==2.5.0 # via -r requirements/darwin.txt -certifi==2022.12.7 +certifi==2023.07.22 # via requests cffi==1.14.6 # via cryptography diff --git a/requirements/static/pkg/py3.10/freebsd.txt b/requirements/static/pkg/py3.10/freebsd.txt index deb75954935..8d2fe56ad5a 100644 --- a/requirements/static/pkg/py3.10/freebsd.txt +++ b/requirements/static/pkg/py3.10/freebsd.txt @@ -4,7 +4,7 @@ # # pip-compile --output-file=requirements/static/pkg/py3.10/freebsd.txt requirements/base.txt requirements/static/pkg/freebsd.in requirements/zeromq.txt # -certifi==2022.12.7 +certifi==2023.07.22 # via requests cffi==1.14.6 # via cryptography diff --git a/requirements/static/pkg/py3.10/linux.txt b/requirements/static/pkg/py3.10/linux.txt index 3297db360e7..2219e99e56a 100644 --- a/requirements/static/pkg/py3.10/linux.txt +++ b/requirements/static/pkg/py3.10/linux.txt @@ -4,7 +4,7 @@ # # pip-compile --output-file=requirements/static/pkg/py3.10/linux.txt requirements/base.txt requirements/static/pkg/linux.in requirements/zeromq.txt # -certifi==2022.12.7 +certifi==2023.07.22 # via requests cffi==1.14.6 # via cryptography diff --git a/requirements/static/pkg/py3.10/windows.txt b/requirements/static/pkg/py3.10/windows.txt index 00e2e6afb64..889f1288b18 100644 --- a/requirements/static/pkg/py3.10/windows.txt +++ b/requirements/static/pkg/py3.10/windows.txt @@ -4,7 +4,7 @@ # # pip-compile --output-file=requirements/static/pkg/py3.10/windows.txt requirements/static/pkg/windows.in requirements/windows.txt # -certifi==2022.12.7 +certifi==2023.07.22 # via # -r requirements/windows.txt # requests diff --git a/requirements/static/pkg/py3.7/freebsd.txt b/requirements/static/pkg/py3.7/freebsd.txt index 9ec3d70b083..af258097ffd 100644 --- a/requirements/static/pkg/py3.7/freebsd.txt +++ b/requirements/static/pkg/py3.7/freebsd.txt @@ -4,7 +4,7 @@ # # pip-compile --output-file=requirements/static/pkg/py3.7/freebsd.txt requirements/base.txt requirements/static/pkg/freebsd.in requirements/zeromq.txt # -certifi==2022.12.7 +certifi==2023.07.22 # via requests cffi==1.14.6 # via cryptography diff --git a/requirements/static/pkg/py3.7/linux.txt b/requirements/static/pkg/py3.7/linux.txt index 1d99400bc04..376d4300a45 100644 --- a/requirements/static/pkg/py3.7/linux.txt +++ b/requirements/static/pkg/py3.7/linux.txt @@ -4,7 +4,7 @@ # # pip-compile --output-file=requirements/static/pkg/py3.7/linux.txt requirements/base.txt requirements/static/pkg/linux.in requirements/zeromq.txt # -certifi==2022.12.7 +certifi==2023.07.22 # via requests cffi==1.14.6 # via cryptography diff --git a/requirements/static/pkg/py3.7/windows.txt b/requirements/static/pkg/py3.7/windows.txt index b2ca9952545..9b12b209653 100644 --- a/requirements/static/pkg/py3.7/windows.txt +++ b/requirements/static/pkg/py3.7/windows.txt @@ -4,7 +4,7 @@ # # pip-compile --output-file=requirements/static/pkg/py3.7/windows.txt requirements/static/pkg/windows.in requirements/windows.txt # -certifi==2022.12.7 +certifi==2023.07.22 # via # -r requirements/windows.txt # requests diff --git a/requirements/static/pkg/py3.8/freebsd.txt b/requirements/static/pkg/py3.8/freebsd.txt index bbf7ee1d199..d95e3798e96 100644 --- a/requirements/static/pkg/py3.8/freebsd.txt +++ b/requirements/static/pkg/py3.8/freebsd.txt @@ -4,7 +4,7 @@ # # pip-compile --output-file=requirements/static/pkg/py3.8/freebsd.txt requirements/base.txt requirements/static/pkg/freebsd.in requirements/zeromq.txt # -certifi==2022.12.7 +certifi==2023.07.22 # via requests cffi==1.14.6 # via cryptography diff --git a/requirements/static/pkg/py3.8/linux.txt b/requirements/static/pkg/py3.8/linux.txt index ebce5bb275e..59c1f49d169 100644 --- a/requirements/static/pkg/py3.8/linux.txt +++ b/requirements/static/pkg/py3.8/linux.txt @@ -4,7 +4,7 @@ # # pip-compile --output-file=requirements/static/pkg/py3.8/linux.txt requirements/base.txt requirements/static/pkg/linux.in requirements/zeromq.txt # -certifi==2022.12.7 +certifi==2023.07.22 # via requests cffi==1.14.6 # via cryptography diff --git a/requirements/static/pkg/py3.8/windows.txt b/requirements/static/pkg/py3.8/windows.txt index 3c0d8d61c7e..96d4e217b1a 100644 --- a/requirements/static/pkg/py3.8/windows.txt +++ b/requirements/static/pkg/py3.8/windows.txt @@ -4,7 +4,7 @@ # # pip-compile --output-file=requirements/static/pkg/py3.8/windows.txt requirements/static/pkg/windows.in requirements/windows.txt # -certifi==2022.12.7 +certifi==2023.07.22 # via # -r requirements/windows.txt # requests diff --git a/requirements/static/pkg/py3.9/darwin.txt b/requirements/static/pkg/py3.9/darwin.txt index 44efe7b101c..89449fc9055 100644 --- a/requirements/static/pkg/py3.9/darwin.txt +++ b/requirements/static/pkg/py3.9/darwin.txt @@ -6,7 +6,7 @@ # apache-libcloud==2.5.0 # via -r requirements/darwin.txt -certifi==2022.12.7 +certifi==2023.07.22 # via requests cffi==1.14.6 # via cryptography diff --git a/requirements/static/pkg/py3.9/freebsd.txt b/requirements/static/pkg/py3.9/freebsd.txt index 0320950393d..739271e590e 100644 --- a/requirements/static/pkg/py3.9/freebsd.txt +++ b/requirements/static/pkg/py3.9/freebsd.txt @@ -4,7 +4,7 @@ # # pip-compile --output-file=requirements/static/pkg/py3.9/freebsd.txt requirements/base.txt requirements/static/pkg/freebsd.in requirements/zeromq.txt # -certifi==2022.12.7 +certifi==2023.07.22 # via requests cffi==1.14.6 # via cryptography diff --git a/requirements/static/pkg/py3.9/linux.txt b/requirements/static/pkg/py3.9/linux.txt index 6b378323c49..6c5fed38051 100644 --- a/requirements/static/pkg/py3.9/linux.txt +++ b/requirements/static/pkg/py3.9/linux.txt @@ -4,7 +4,7 @@ # # pip-compile --output-file=requirements/static/pkg/py3.9/linux.txt requirements/base.txt requirements/static/pkg/linux.in requirements/zeromq.txt # -certifi==2022.12.7 +certifi==2023.07.22 # via requests cffi==1.14.6 # via cryptography diff --git a/requirements/static/pkg/py3.9/windows.txt b/requirements/static/pkg/py3.9/windows.txt index c3a11718dd9..42ca414ea99 100644 --- a/requirements/static/pkg/py3.9/windows.txt +++ b/requirements/static/pkg/py3.9/windows.txt @@ -4,7 +4,7 @@ # # pip-compile --output-file=requirements/static/pkg/py3.9/windows.txt requirements/static/pkg/windows.in requirements/windows.txt # -certifi==2022.12.7 +certifi==2023.07.22 # via # -r requirements/windows.txt # requests From 897360029e03d61916804710e41b6c481178346c Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Thu, 27 Jul 2023 20:49:17 +0100 Subject: [PATCH 199/393] Starting VM's on developer machines now requires VPN access Choose the `prod` or `test` VPN depending on what kind of environment is being targeted. Signed-off-by: Pedro Algarvio --- tools/vm.py | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/tools/vm.py b/tools/vm.py index ac03674cd68..c62f05750f1 100644 --- a/tools/vm.py +++ b/tools/vm.py @@ -649,7 +649,7 @@ def list_vms( for instance in instances: vm_state = instance.state["Name"] - ip_addr = instance.public_ip_address + ip_addr = instance.private_ip_address ami = instance.image_id vm_name = None for tag in instance.tags: @@ -812,7 +812,7 @@ class VM: ssh_config = textwrap.dedent( f"""\ Host {self.name} - Hostname {self.instance.public_ip_address or self.instance.private_ip_address} + Hostname {self.instance.private_ip_address} User {self.config.ssh_username} ControlMaster=no Compression=yes @@ -837,7 +837,7 @@ class VM: self.get_ec2_resource.cache_clear() if environment is None: - environment = "prod" + environment = tools.utils.SPB_ENVIRONMENT create_timeout = self.config.create_timeout create_timeout_progress = 0 @@ -928,11 +928,7 @@ class VM: if tag["Key"] != "Name": continue private_value = f"-{environment}-vpc-private-" - if started_in_ci and private_value in tag["Value"]: - subnets[subnet.id] = subnet.available_ip_address_count - break - public_value = f"-{environment}-vpc-public-" - if started_in_ci is False and public_value in tag["Value"]: + if private_value in tag["Value"]: subnets[subnet.id] = subnet.available_ip_address_count break if subnets: @@ -1104,7 +1100,7 @@ class VM: return error # Wait until we can SSH into the VM - host = self.instance.public_ip_address or self.instance.private_ip_address + host = self.instance.private_ip_address progress = create_progress_bar() connect_task = progress.add_task( From 4cc13e2a0c3ce4ee846cbbeac598761c5f274681 Mon Sep 17 00:00:00 2001 From: "Daniel A. Wozniak" Date: Tue, 30 May 2023 22:27:29 -0700 Subject: [PATCH 200/393] Replace libnacl with PyNaCl --- changelog/64372.fixed.md | 1 + salt/cloud/deploy/bootstrap-salt.sh | 2 +- salt/modules/nacl.py | 8 +++--- salt/renderers/nacl.py | 3 +- salt/runners/nacl.py | 2 +- salt/utils/nacl.py | 43 ++++++++++++++++------------- tests/unit/utils/test_nacl.py | 11 ++------ 7 files changed, 35 insertions(+), 35 deletions(-) create mode 100644 changelog/64372.fixed.md diff --git a/changelog/64372.fixed.md b/changelog/64372.fixed.md new file mode 100644 index 00000000000..c821da578dc --- /dev/null +++ b/changelog/64372.fixed.md @@ -0,0 +1 @@ +Replace libnacl with PyNaCl diff --git a/salt/cloud/deploy/bootstrap-salt.sh b/salt/cloud/deploy/bootstrap-salt.sh index 1cf46c774df..022f1b09849 100644 --- a/salt/cloud/deploy/bootstrap-salt.sh +++ b/salt/cloud/deploy/bootstrap-salt.sh @@ -8614,7 +8614,7 @@ install_gentoo_git_deps() { sys-apps/pciutils dev-python/pyyaml dev-python/pyzmq - dev-python/libnacl + dev-python/pynacl dev-python/pycryptodome dev-python/py dev-python/requests diff --git a/salt/modules/nacl.py b/salt/modules/nacl.py index d62d389718c..ef0e1774548 100644 --- a/salt/modules/nacl.py +++ b/salt/modules/nacl.py @@ -1,7 +1,7 @@ """ This module helps include encrypted passwords in pillars, grains and salt state files. -:depends: libnacl, https://github.com/saltstack/libnacl +:depends: PyNaCl, https://github.com/pyca/pynacl This is often useful if you wish to store your pillars in source control or share your pillar data with others that you trust. I don't advise making your pillars public @@ -137,9 +137,9 @@ Optional small program to encrypt data without needing salt modules. .. code-block:: python #!/bin/python3 - import sys, base64, libnacl.sealed + import sys, base64, nacl.public pk = base64.b64decode('YOURPUBKEY') - b = libnacl.sealed.SealedBox(pk) + b = nacl.public.SealedBox(pk) data = sys.stdin.buffer.read() print(base64.b64encode(b.encrypt(data)).decode()) @@ -163,7 +163,7 @@ def __virtual__(): def keygen(sk_file=None, pk_file=None, **kwargs): """ - Use libnacl to generate a keypair. + Use PyNaCl to generate a keypair. If no `sk_file` is defined return a keypair. diff --git a/salt/renderers/nacl.py b/salt/renderers/nacl.py index 156913150e2..9cd2ba0f46b 100644 --- a/salt/renderers/nacl.py +++ b/salt/renderers/nacl.py @@ -10,8 +10,7 @@ The typical use-case would be to use ciphers in your pillar data, and keep a secret key on your master. You can put the public key in source control so that developers can add new secrets quickly and easily. -This renderer requires the libsodium library binary and libnacl >= 1.5.1 -python package (support for sealed boxes came in 1.5.1 version). +This renderer requires the libsodium library binary and PyNacl >= 1.0 Setup diff --git a/salt/runners/nacl.py b/salt/runners/nacl.py index d0291871f8d..24ce5f4918c 100644 --- a/salt/runners/nacl.py +++ b/salt/runners/nacl.py @@ -1,7 +1,7 @@ """ This module helps include encrypted passwords in pillars, grains and salt state files. -:depends: libnacl, https://github.com/saltstack/libnacl +:depends: PyNaCl, https://github.com/pyca/pynacl This is often useful if you wish to store your pillars in source control or share your pillar data with others that you trust. I don't advise making your pillars public diff --git a/salt/utils/nacl.py b/salt/utils/nacl.py index d86292a2c41..20239ff35f7 100644 --- a/salt/utils/nacl.py +++ b/salt/utils/nacl.py @@ -17,13 +17,14 @@ import salt.utils.win_functions log = logging.getLogger(__name__) + REQ_ERROR = None try: - import libnacl.sealed - import libnacl.secret + import nacl.public + import nacl.secret except (ImportError, OSError) as e: REQ_ERROR = ( - "libnacl import error, perhaps missing python libnacl package or should update." + "PyNaCl import error, perhaps missing python PyNaCl package or should update." ) __virtualname__ = "nacl" @@ -113,7 +114,7 @@ def _get_pk(**kwargs): def keygen(sk_file=None, pk_file=None, **kwargs): """ - Use libnacl to generate a keypair. + Use PyNaCl to generate a keypair. If no `sk_file` is defined return a keypair. @@ -143,17 +144,20 @@ def keygen(sk_file=None, pk_file=None, **kwargs): sk_file = kwargs["keyfile"] if sk_file is None: - kp = libnacl.public.SecretKey() - return {"sk": base64.b64encode(kp.sk), "pk": base64.b64encode(kp.pk)} + kp = nacl.public.PrivateKey.generate() + return { + "sk": base64.b64encode(kp.encode()), + "pk": base64.b64encode(kp.public_key.encode()), + } if pk_file is None: pk_file = "{}.pub".format(sk_file) if sk_file and pk_file is None: if not os.path.isfile(sk_file): - kp = libnacl.public.SecretKey() + kp = nacl.public.PrivateKey.generate() with salt.utils.files.fopen(sk_file, "wb") as keyf: - keyf.write(base64.b64encode(kp.sk)) + keyf.write(base64.b64encode(kp.encode())) if salt.utils.platform.is_windows(): cur_user = salt.utils.win_functions.get_current_user() salt.utils.win_dacl.set_owner(sk_file, cur_user) @@ -185,14 +189,14 @@ def keygen(sk_file=None, pk_file=None, **kwargs): with salt.utils.files.fopen(sk_file, "rb") as keyf: sk = salt.utils.stringutils.to_unicode(keyf.read()).rstrip("\n") sk = base64.b64decode(sk) - kp = libnacl.public.SecretKey(sk) + kp = nacl.public.PublicKey(sk) with salt.utils.files.fopen(pk_file, "wb") as keyf: - keyf.write(base64.b64encode(kp.pk)) + keyf.write(base64.b64encode(kp.encode())) return "saved pk_file: {}".format(pk_file) - kp = libnacl.public.SecretKey() + kp = nacl.public.PublicKey.generate() with salt.utils.files.fopen(sk_file, "wb") as keyf: - keyf.write(base64.b64encode(kp.sk)) + keyf.write(base64.b64encode(kp.encode())) if salt.utils.platform.is_windows(): cur_user = salt.utils.win_functions.get_current_user() salt.utils.win_dacl.set_owner(sk_file, cur_user) @@ -203,7 +207,7 @@ def keygen(sk_file=None, pk_file=None, **kwargs): # chmod 0600 file os.chmod(sk_file, 1536) with salt.utils.files.fopen(pk_file, "wb") as keyf: - keyf.write(base64.b64encode(kp.pk)) + keyf.write(base64.b64encode(kp.encode())) return "saved sk_file:{} pk_file: {}".format(sk_file, pk_file) @@ -313,6 +317,7 @@ def dec(data, **kwargs): box_type = _get_config(**kwargs)["box_type"] if box_type == "secretbox": return secretbox_decrypt(data, **kwargs) + return sealedbox_decrypt(data, **kwargs) @@ -366,7 +371,8 @@ def sealedbox_encrypt(data, **kwargs): data = salt.utils.stringutils.to_bytes(data) pk = _get_pk(**kwargs) - b = libnacl.sealed.SealedBox(pk) + keypair = nacl.public.PublicKey(pk) + b = nacl.public.SealedBox(keypair) return base64.b64encode(b.encrypt(data)) @@ -389,8 +395,8 @@ def sealedbox_decrypt(data, **kwargs): data = salt.utils.stringutils.to_bytes(data) sk = _get_sk(**kwargs) - keypair = libnacl.public.SecretKey(sk) - b = libnacl.sealed.SealedBox(keypair) + keypair = nacl.public.PrivateKey(sk) + b = nacl.public.SealedBox(keypair) return b.decrypt(base64.b64decode(data)) @@ -411,7 +417,7 @@ def secretbox_encrypt(data, **kwargs): data = salt.utils.stringutils.to_bytes(data) sk = _get_sk(**kwargs) - b = libnacl.secret.SecretBox(sk) + b = nacl.secret.SecretBox(sk) return base64.b64encode(b.encrypt(data)) @@ -435,6 +441,5 @@ def secretbox_decrypt(data, **kwargs): data = salt.utils.stringutils.to_bytes(data) key = _get_sk(**kwargs) - b = libnacl.secret.SecretBox(key=key) - + b = nacl.secret.SecretBox(key=key) return b.decrypt(base64.b64decode(data)) diff --git a/tests/unit/utils/test_nacl.py b/tests/unit/utils/test_nacl.py index 0501c1fa4f5..d26682dfd4f 100644 --- a/tests/unit/utils/test_nacl.py +++ b/tests/unit/utils/test_nacl.py @@ -10,19 +10,14 @@ from tests.support.mixins import LoaderModuleMockMixin from tests.support.unit import TestCase try: - import libnacl.sealed # pylint: disable=unused-import - import libnacl.secret # pylint: disable=unused-import - import salt.utils.nacl as nacl - - HAS_LIBNACL = True + HAS_PYNACL = nacl.check_requirements() except (ImportError, OSError, AttributeError): - HAS_LIBNACL = False + HAS_PYNACL = False -@pytest.mark.skipif(sys.version_info >= (3, 10), reason="Segfaults with python 3.10") @pytest.mark.skipif( - not HAS_LIBNACL, reason="skipping test_nacl, reason=libnacl is unavailable" + not HAS_PYNACL, reason="skipping test_nacl, reason=libnacl is unavailable" ) class NaclUtilsTests(TestCase, LoaderModuleMockMixin): def setup_loader_modules(self): From 2824bb9263ee72edf75e3a08325c51c916dd5d01 Mon Sep 17 00:00:00 2001 From: David Murphy < dmurphy@saltstack.com> Date: Thu, 13 Jul 2023 11:26:36 -0600 Subject: [PATCH 201/393] Updates due to rebase --- requirements/static/ci/common.in | 1 + requirements/static/ci/py3.10/cloud.txt | 4 +++- requirements/static/ci/py3.10/darwin.txt | 4 +++- requirements/static/ci/py3.10/freebsd.txt | 4 +++- requirements/static/ci/py3.10/lint.txt | 4 +++- requirements/static/ci/py3.10/linux.txt | 4 +++- requirements/static/ci/py3.10/windows.txt | 3 +++ requirements/static/ci/py3.7/cloud.txt | 4 +++- requirements/static/ci/py3.7/freebsd.txt | 4 +++- requirements/static/ci/py3.7/lint.txt | 4 +++- requirements/static/ci/py3.7/linux.txt | 4 +++- requirements/static/ci/py3.7/windows.txt | 3 +++ requirements/static/ci/py3.8/cloud.txt | 4 +++- requirements/static/ci/py3.8/freebsd.txt | 4 +++- requirements/static/ci/py3.8/lint.txt | 4 +++- requirements/static/ci/py3.8/linux.txt | 4 +++- requirements/static/ci/py3.8/windows.txt | 3 +++ requirements/static/ci/py3.9/cloud.txt | 4 +++- requirements/static/ci/py3.9/darwin.txt | 4 +++- requirements/static/ci/py3.9/freebsd.txt | 4 +++- requirements/static/ci/py3.9/lint.txt | 4 +++- requirements/static/ci/py3.9/linux.txt | 4 +++- requirements/static/ci/py3.9/windows.txt | 3 +++ 23 files changed, 67 insertions(+), 18 deletions(-) diff --git a/requirements/static/ci/common.in b/requirements/static/ci/common.in index 0740a5af592..7ca2cebe159 100644 --- a/requirements/static/ci/common.in +++ b/requirements/static/ci/common.in @@ -30,6 +30,7 @@ moto>=2.0.0 ; python_version >= '3.6' napalm; sys_platform != 'win32' and python_version > '3.6' and python_version < '3.10' paramiko>=2.10.1; sys_platform != 'win32' and sys_platform != 'darwin' passlib[bcrypt]>=1.7.4 +pynacl pycparser>=2.21; python_version >= '3.9' pyinotify>=0.9.6; sys_platform != 'win32' and sys_platform != 'darwin' and platform_system != "openbsd" python-etcd>0.4.2 diff --git a/requirements/static/ci/py3.10/cloud.txt b/requirements/static/ci/py3.10/cloud.txt index 1862a07681f..dcaf3b9fa9c 100644 --- a/requirements/static/ci/py3.10/cloud.txt +++ b/requirements/static/ci/py3.10/cloud.txt @@ -668,7 +668,9 @@ pyinotify==0.9.6 ; sys_platform != "win32" and sys_platform != "darwin" and plat pyjwt==2.4.0 # via adal pynacl==1.4.0 - # via paramiko + # via + # -r requirements/static/ci/common.in + # paramiko pyopenssl==23.2.0 # via # -r requirements/static/pkg/linux.in diff --git a/requirements/static/ci/py3.10/darwin.txt b/requirements/static/ci/py3.10/darwin.txt index 8a284e31b47..fd12cc561a2 100644 --- a/requirements/static/ci/py3.10/darwin.txt +++ b/requirements/static/ci/py3.10/darwin.txt @@ -669,7 +669,9 @@ pygit2==1.9.1 ; python_version >= "3.7" pyjwt==2.4.0 # via adal pynacl==1.3.0 - # via paramiko + # via + # -r requirements/static/ci/common.in + # paramiko pyopenssl==23.2.0 # via # -r requirements/darwin.txt diff --git a/requirements/static/ci/py3.10/freebsd.txt b/requirements/static/ci/py3.10/freebsd.txt index 69dc466b7a4..497a0f21d81 100644 --- a/requirements/static/ci/py3.10/freebsd.txt +++ b/requirements/static/ci/py3.10/freebsd.txt @@ -668,7 +668,9 @@ pyinotify==0.9.6 ; sys_platform != "win32" and sys_platform != "darwin" and plat pyjwt==2.4.0 # via adal pynacl==1.3.0 - # via paramiko + # via + # -r requirements/static/ci/common.in + # paramiko pyopenssl==23.2.0 # via # -r requirements/static/pkg/freebsd.in diff --git a/requirements/static/ci/py3.10/lint.txt b/requirements/static/ci/py3.10/lint.txt index 4d56f17f2bc..3df8b098ce3 100644 --- a/requirements/static/ci/py3.10/lint.txt +++ b/requirements/static/ci/py3.10/lint.txt @@ -674,7 +674,9 @@ pylint==2.4.4 pymysql==1.0.2 ; python_version > "3.5" # via -r requirements/static/ci/linux.in pynacl==1.4.0 - # via paramiko + # via + # -r requirements/static/ci/common.in + # paramiko pyopenssl==23.2.0 # via # -r requirements/static/pkg/linux.in diff --git a/requirements/static/ci/py3.10/linux.txt b/requirements/static/ci/py3.10/linux.txt index 950e88180a5..477989641b1 100644 --- a/requirements/static/ci/py3.10/linux.txt +++ b/requirements/static/ci/py3.10/linux.txt @@ -688,7 +688,9 @@ pyjwt==2.4.0 pymysql==1.0.2 ; python_version > "3.5" # via -r requirements/static/ci/linux.in pynacl==1.3.0 - # via paramiko + # via + # -r requirements/static/ci/common.in + # paramiko pyopenssl==23.2.0 # via # -r requirements/static/pkg/linux.in diff --git a/requirements/static/ci/py3.10/windows.txt b/requirements/static/ci/py3.10/windows.txt index b345f558795..3ee2dfb867d 100644 --- a/requirements/static/ci/py3.10/windows.txt +++ b/requirements/static/ci/py3.10/windows.txt @@ -49,6 +49,7 @@ cffi==1.14.6 # clr-loader # cryptography # pygit2 + # pynacl charset-normalizer==2.1.1 # via # aiohttp @@ -237,6 +238,8 @@ pymssql==2.2.7 # via -r requirements/windows.txt pymysql==1.0.2 # via -r requirements/windows.txt +pynacl==1.5.0 + # via -r requirements/static/ci/common.in pyopenssl==23.2.0 # via # -r requirements/windows.txt diff --git a/requirements/static/ci/py3.7/cloud.txt b/requirements/static/ci/py3.7/cloud.txt index 0823fc8ff75..5523fbd69db 100644 --- a/requirements/static/ci/py3.7/cloud.txt +++ b/requirements/static/ci/py3.7/cloud.txt @@ -710,7 +710,9 @@ pyinotify==0.9.6 ; sys_platform != "win32" and sys_platform != "darwin" and plat pyjwt==2.4.0 # via adal pynacl==1.4.0 - # via paramiko + # via + # -r requirements/static/ci/common.in + # paramiko pyopenssl==23.2.0 # via # -r requirements/static/pkg/linux.in diff --git a/requirements/static/ci/py3.7/freebsd.txt b/requirements/static/ci/py3.7/freebsd.txt index 25fb5d4857e..0b11878d2d4 100644 --- a/requirements/static/ci/py3.7/freebsd.txt +++ b/requirements/static/ci/py3.7/freebsd.txt @@ -704,7 +704,9 @@ pyinotify==0.9.6 ; sys_platform != "win32" and sys_platform != "darwin" and plat pyjwt==2.4.0 # via adal pynacl==1.3.0 - # via paramiko + # via + # -r requirements/static/ci/common.in + # paramiko pyopenssl==23.2.0 # via # -r requirements/static/pkg/freebsd.in diff --git a/requirements/static/ci/py3.7/lint.txt b/requirements/static/ci/py3.7/lint.txt index b7f48d8b01a..b1b66604b6c 100644 --- a/requirements/static/ci/py3.7/lint.txt +++ b/requirements/static/ci/py3.7/lint.txt @@ -717,7 +717,9 @@ pylint==2.4.4 pymysql==1.0.2 ; python_version > "3.5" # via -r requirements/static/ci/linux.in pynacl==1.4.0 - # via paramiko + # via + # -r requirements/static/ci/common.in + # paramiko pyopenssl==23.2.0 # via # -r requirements/static/pkg/linux.in diff --git a/requirements/static/ci/py3.7/linux.txt b/requirements/static/ci/py3.7/linux.txt index b06cf80b7b6..72aaa919785 100644 --- a/requirements/static/ci/py3.7/linux.txt +++ b/requirements/static/ci/py3.7/linux.txt @@ -724,7 +724,9 @@ pyjwt==2.4.0 pymysql==1.0.2 ; python_version > "3.5" # via -r requirements/static/ci/linux.in pynacl==1.3.0 - # via paramiko + # via + # -r requirements/static/ci/common.in + # paramiko pyopenssl==23.2.0 # via # -r requirements/static/pkg/linux.in diff --git a/requirements/static/ci/py3.7/windows.txt b/requirements/static/ci/py3.7/windows.txt index 548a60f8f9d..e5fc3ed81f5 100644 --- a/requirements/static/ci/py3.7/windows.txt +++ b/requirements/static/ci/py3.7/windows.txt @@ -55,6 +55,7 @@ cffi==1.14.6 # clr-loader # cryptography # pygit2 + # pynacl charset-normalizer==2.0.12 # via # aiohttp @@ -250,6 +251,8 @@ pymssql==2.2.1 # via -r requirements/windows.txt pymysql==1.0.2 # via -r requirements/windows.txt +pynacl==1.5.0 + # via -r requirements/static/ci/common.in pyopenssl==23.2.0 # via # -r requirements/windows.txt diff --git a/requirements/static/ci/py3.8/cloud.txt b/requirements/static/ci/py3.8/cloud.txt index 7393b82c4c8..a58dec920dd 100644 --- a/requirements/static/ci/py3.8/cloud.txt +++ b/requirements/static/ci/py3.8/cloud.txt @@ -699,7 +699,9 @@ pyinotify==0.9.6 ; sys_platform != "win32" and sys_platform != "darwin" and plat pyjwt==2.4.0 # via adal pynacl==1.4.0 - # via paramiko + # via + # -r requirements/static/ci/common.in + # paramiko pyopenssl==23.2.0 # via # -r requirements/static/pkg/linux.in diff --git a/requirements/static/ci/py3.8/freebsd.txt b/requirements/static/ci/py3.8/freebsd.txt index c6b357d4173..14b9b3204d6 100644 --- a/requirements/static/ci/py3.8/freebsd.txt +++ b/requirements/static/ci/py3.8/freebsd.txt @@ -694,7 +694,9 @@ pyinotify==0.9.6 ; sys_platform != "win32" and sys_platform != "darwin" and plat pyjwt==2.4.0 # via adal pynacl==1.3.0 - # via paramiko + # via + # -r requirements/static/ci/common.in + # paramiko pyopenssl==23.2.0 # via # -r requirements/static/pkg/freebsd.in diff --git a/requirements/static/ci/py3.8/lint.txt b/requirements/static/ci/py3.8/lint.txt index 85cd7200930..36ced882863 100644 --- a/requirements/static/ci/py3.8/lint.txt +++ b/requirements/static/ci/py3.8/lint.txt @@ -708,7 +708,9 @@ pylint==2.4.4 pymysql==1.0.2 ; python_version > "3.5" # via -r requirements/static/ci/linux.in pynacl==1.4.0 - # via paramiko + # via + # -r requirements/static/ci/common.in + # paramiko pyopenssl==23.2.0 # via # -r requirements/static/pkg/linux.in diff --git a/requirements/static/ci/py3.8/linux.txt b/requirements/static/ci/py3.8/linux.txt index 7aeac2980c8..089df020e05 100644 --- a/requirements/static/ci/py3.8/linux.txt +++ b/requirements/static/ci/py3.8/linux.txt @@ -714,7 +714,9 @@ pyjwt==2.4.0 pymysql==1.0.2 ; python_version > "3.5" # via -r requirements/static/ci/linux.in pynacl==1.3.0 - # via paramiko + # via + # -r requirements/static/ci/common.in + # paramiko pyopenssl==23.2.0 # via # -r requirements/static/pkg/linux.in diff --git a/requirements/static/ci/py3.8/windows.txt b/requirements/static/ci/py3.8/windows.txt index e5bdaa0a625..ce6b8142a7d 100644 --- a/requirements/static/ci/py3.8/windows.txt +++ b/requirements/static/ci/py3.8/windows.txt @@ -51,6 +51,7 @@ cffi==1.14.6 # clr-loader # cryptography # pygit2 + # pynacl charset-normalizer==2.0.12 # via # aiohttp @@ -238,6 +239,8 @@ pymssql==2.2.1 # via -r requirements/windows.txt pymysql==1.0.2 # via -r requirements/windows.txt +pynacl==1.5.0 + # via -r requirements/static/ci/common.in pyopenssl==23.2.0 # via # -r requirements/windows.txt diff --git a/requirements/static/ci/py3.9/cloud.txt b/requirements/static/ci/py3.9/cloud.txt index dd9b361d956..e64010d73fc 100644 --- a/requirements/static/ci/py3.9/cloud.txt +++ b/requirements/static/ci/py3.9/cloud.txt @@ -702,7 +702,9 @@ pyinotify==0.9.6 ; sys_platform != "win32" and sys_platform != "darwin" and plat pyjwt==2.4.0 # via adal pynacl==1.4.0 - # via paramiko + # via + # -r requirements/static/ci/common.in + # paramiko pyopenssl==23.2.0 # via # -r requirements/static/pkg/linux.in diff --git a/requirements/static/ci/py3.9/darwin.txt b/requirements/static/ci/py3.9/darwin.txt index 3b2a0993068..b8e6f50b115 100644 --- a/requirements/static/ci/py3.9/darwin.txt +++ b/requirements/static/ci/py3.9/darwin.txt @@ -698,7 +698,9 @@ pygit2==1.9.1 ; python_version >= "3.7" pyjwt==2.4.0 # via adal pynacl==1.3.0 - # via paramiko + # via + # -r requirements/static/ci/common.in + # paramiko pyopenssl==23.2.0 # via # -r requirements/darwin.txt diff --git a/requirements/static/ci/py3.9/freebsd.txt b/requirements/static/ci/py3.9/freebsd.txt index 0937c4827bf..944885c2216 100644 --- a/requirements/static/ci/py3.9/freebsd.txt +++ b/requirements/static/ci/py3.9/freebsd.txt @@ -697,7 +697,9 @@ pyinotify==0.9.6 ; sys_platform != "win32" and sys_platform != "darwin" and plat pyjwt==2.4.0 # via adal pynacl==1.3.0 - # via paramiko + # via + # -r requirements/static/ci/common.in + # paramiko pyopenssl==23.2.0 # via # -r requirements/static/pkg/freebsd.in diff --git a/requirements/static/ci/py3.9/lint.txt b/requirements/static/ci/py3.9/lint.txt index 7fdb2b8b3fe..2fd1f2527c2 100644 --- a/requirements/static/ci/py3.9/lint.txt +++ b/requirements/static/ci/py3.9/lint.txt @@ -709,7 +709,9 @@ pylint==2.4.4 pymysql==1.0.2 ; python_version > "3.5" # via -r requirements/static/ci/linux.in pynacl==1.4.0 - # via paramiko + # via + # -r requirements/static/ci/common.in + # paramiko pyopenssl==23.2.0 # via # -r requirements/static/pkg/linux.in diff --git a/requirements/static/ci/py3.9/linux.txt b/requirements/static/ci/py3.9/linux.txt index d2720993b2e..cf198dcff83 100644 --- a/requirements/static/ci/py3.9/linux.txt +++ b/requirements/static/ci/py3.9/linux.txt @@ -719,7 +719,9 @@ pyjwt==2.4.0 pymysql==1.0.2 ; python_version > "3.5" # via -r requirements/static/ci/linux.in pynacl==1.3.0 - # via paramiko + # via + # -r requirements/static/ci/common.in + # paramiko pyopenssl==23.2.0 # via # -r requirements/static/pkg/linux.in diff --git a/requirements/static/ci/py3.9/windows.txt b/requirements/static/ci/py3.9/windows.txt index cd5f59e18de..5533dae6d5c 100644 --- a/requirements/static/ci/py3.9/windows.txt +++ b/requirements/static/ci/py3.9/windows.txt @@ -51,6 +51,7 @@ cffi==1.14.6 # clr-loader # cryptography # pygit2 + # pynacl charset-normalizer==2.0.12 # via # aiohttp @@ -239,6 +240,8 @@ pymssql==2.2.1 # via -r requirements/windows.txt pymysql==1.0.2 # via -r requirements/windows.txt +pynacl==1.5.0 + # via -r requirements/static/ci/common.in pyopenssl==23.2.0 # via # -r requirements/windows.txt From ec5b05cb86521d6536e2f20fb207e90d6c626993 Mon Sep 17 00:00:00 2001 From: David Murphy < dmurphy@saltstack.com> Date: Fri, 2 Jun 2023 15:05:00 -0600 Subject: [PATCH 202/393] Migrate nacl unittests to pytests, and update for PyNaCl --- salt/cloud/deploy/bootstrap-salt.sh | 2 +- salt/runners/nacl.py | 2 +- tests/integration/runners/test_nacl.py | 200 ------------------ .../pytests/integration/runners/test_nacl.py | 170 +++++++++++++++ tests/pytests/unit/modules/test_nacl.py | 91 +++++++- tests/pytests/unit/utils/test_nacl.py | 162 +++++++++++++- tests/unit/modules/test_nacl.py | 91 -------- tests/unit/utils/test_nacl.py | 144 ------------- 8 files changed, 423 insertions(+), 439 deletions(-) delete mode 100644 tests/integration/runners/test_nacl.py create mode 100644 tests/pytests/integration/runners/test_nacl.py delete mode 100644 tests/unit/modules/test_nacl.py delete mode 100644 tests/unit/utils/test_nacl.py diff --git a/salt/cloud/deploy/bootstrap-salt.sh b/salt/cloud/deploy/bootstrap-salt.sh index 022f1b09849..1cf46c774df 100644 --- a/salt/cloud/deploy/bootstrap-salt.sh +++ b/salt/cloud/deploy/bootstrap-salt.sh @@ -8614,7 +8614,7 @@ install_gentoo_git_deps() { sys-apps/pciutils dev-python/pyyaml dev-python/pyzmq - dev-python/pynacl + dev-python/libnacl dev-python/pycryptodome dev-python/py dev-python/requests diff --git a/salt/runners/nacl.py b/salt/runners/nacl.py index 24ce5f4918c..3c097604bad 100644 --- a/salt/runners/nacl.py +++ b/salt/runners/nacl.py @@ -125,7 +125,7 @@ def __virtual__(): def keygen(sk_file=None, pk_file=None, **kwargs): """ - Use libnacl to generate a keypair. + Use PyNaCL to generate a keypair. If no `sk_file` is defined return a keypair. diff --git a/tests/integration/runners/test_nacl.py b/tests/integration/runners/test_nacl.py deleted file mode 100644 index 0be360b893d..00000000000 --- a/tests/integration/runners/test_nacl.py +++ /dev/null @@ -1,200 +0,0 @@ -""" -Tests for the salt-run command -""" - -import logging -import sys - -import pytest - -from tests.support.case import ShellCase - -try: - import libnacl.sealed # pylint: disable=unused-import - import libnacl.secret # pylint: disable=unused-import - - HAS_LIBNACL = True -except (ImportError, OSError, AttributeError): - HAS_LIBNACL = False - -log = logging.getLogger(__name__) - - -@pytest.mark.skipif( - not HAS_LIBNACL, reason="skipping test_nacl, reason=libnacl is unavailable" -) -@pytest.mark.skipif(sys.version_info >= (3, 10), reason="Segfaults with python 3") -@pytest.mark.windows_whitelisted -class NaclTest(ShellCase): - """ - Test the nacl runner - """ - - @pytest.mark.slow_test - def test_keygen(self): - """ - Test keygen - """ - # Store the data - ret = self.run_run_plus( - "nacl.keygen", - ) - self.assertIn("pk", ret["return"]) - self.assertIn("sk", ret["return"]) - - @pytest.mark.slow_test - def test_enc(self): - """ - Test keygen - """ - # Store the data - ret = self.run_run_plus( - "nacl.keygen", - ) - self.assertIn("pk", ret["return"]) - self.assertIn("sk", ret["return"]) - pk = ret["return"]["pk"] - sk = ret["return"]["sk"] - - unencrypted_data = "hello" - - # Encrypt with pk - ret = self.run_run_plus( - "nacl.enc", - data=unencrypted_data, - pk=pk, - ) - self.assertIn("return", ret) - - @pytest.mark.slow_test - def test_enc_dec(self): - """ - Store, list, fetch, then flush data - """ - # Store the data - ret = self.run_run_plus( - "nacl.keygen", - ) - self.assertIn("pk", ret["return"]) - self.assertIn("sk", ret["return"]) - pk = ret["return"]["pk"] - sk = ret["return"]["sk"] - - unencrypted_data = b"hello" - - # Encrypt with pk - ret = self.run_run_plus( - "nacl.enc", - data=unencrypted_data, - pk=pk, - ) - self.assertIn("return", ret) - encrypted_data = ret["return"] - - # Decrypt with sk - ret = self.run_run_plus( - "nacl.dec", - data=encrypted_data, - sk=sk, - ) - self.assertIn("return", ret) - self.assertEqual(unencrypted_data, ret["return"]) - - @pytest.mark.slow_test - def test_sealedbox_enc_dec(self): - """ - Generate keys, encrypt, then decrypt. - """ - # Store the data - ret = self.run_run_plus( - "nacl.keygen", - ) - self.assertIn("pk", ret["return"]) - self.assertIn("sk", ret["return"]) - pk = ret["return"]["pk"] - sk = ret["return"]["sk"] - - unencrypted_data = b"hello" - - # Encrypt with pk - ret = self.run_run_plus( - "nacl.sealedbox_encrypt", - data=unencrypted_data, - pk=pk, - ) - encrypted_data = ret["return"] - - # Decrypt with sk - ret = self.run_run_plus( - "nacl.sealedbox_decrypt", - data=encrypted_data, - sk=sk, - ) - self.assertEqual(unencrypted_data, ret["return"]) - - @pytest.mark.slow_test - def test_secretbox_enc_dec(self): - """ - Generate keys, encrypt, then decrypt. - """ - # Store the data - ret = self.run_run_plus( - "nacl.keygen", - ) - self.assertIn("pk", ret["return"]) - self.assertIn("sk", ret["return"]) - pk = ret["return"]["pk"] - sk = ret["return"]["sk"] - - unencrypted_data = b"hello" - - # Encrypt with pk - ret = self.run_run_plus( - "nacl.secretbox_encrypt", - data=unencrypted_data, - sk=sk, - ) - encrypted_data = ret["return"] - - # Decrypt with sk - ret = self.run_run_plus( - "nacl.secretbox_decrypt", - data=encrypted_data, - sk=sk, - ) - self.assertEqual(unencrypted_data, ret["return"]) - - @pytest.mark.slow_test - def test_enc_dec_no_pk_no_sk(self): - """ - Store, list, fetch, then flush data - """ - # Store the data - ret = self.run_run_plus( - "nacl.keygen", - ) - self.assertIn("pk", ret["return"]) - self.assertIn("sk", ret["return"]) - pk = ret["return"]["pk"] - sk = ret["return"]["sk"] - - unencrypted_data = b"hello" - - # Encrypt with pk - ret = self.run_run_plus( - "nacl.enc", - data=unencrypted_data, - pk=None, - ) - self.assertIn("Exception: no pubkey or pk_file found", ret["return"]) - - self.assertIn("return", ret) - encrypted_data = ret["return"] - - # Decrypt with sk - ret = self.run_run_plus( - "nacl.dec", - data=encrypted_data, - sk=None, - ) - self.assertIn("Exception: no key or sk_file found", ret["return"]) diff --git a/tests/pytests/integration/runners/test_nacl.py b/tests/pytests/integration/runners/test_nacl.py new file mode 100644 index 00000000000..ff2880bc7e6 --- /dev/null +++ b/tests/pytests/integration/runners/test_nacl.py @@ -0,0 +1,170 @@ +""" +Tests for the nacl runner +""" + +import pytest + +import salt.config +import salt.utils.stringutils +from tests.support.mock import patch + +try: + import salt.runners.nacl as nacl + + HAS_PYNACL = True +except (ImportError, OSError, AttributeError): + HAS_PYNACL = False + +pytestmark = [ + pytest.mark.windows_whitelisted, +] + + +@pytest.mark.skipif( + not HAS_PYNACL, reason="skipping test_nacl, reason=PyNaCl is unavailable" +) +@pytest.fixture(scope="module") +def minion_opts(): + return salt.config.minion_config(None) + + +@pytest.fixture +def test_data(): + unencrypted_data = salt.utils.stringutils.to_bytes("hello") + return unencrypted_data + + +def test_keygen(minion_opts): + """ + Test keygen + """ + # Store the data + with patch("salt.runners.nacl.__opts__", minion_opts, create=True): + ret = nacl.keygen() + assert "pk" in ret + assert "sk" in ret + + +def test_enc(test_data, minion_opts): + """ + Test keygen + """ + # Store the data + with patch("salt.runners.nacl.__opts__", minion_opts, create=True): + ret = nacl.keygen() + assert "pk" in ret + assert "sk" in ret + pk = ret["pk"] + sk = ret["sk"] + + # Encrypt with pk + ret = nacl.enc( + data=test_data, + pk=pk, + ) + + +def test_enc_dec(test_data, minion_opts): + """ + Store, list, fetch, then flush data + """ + # Store the data + with patch("salt.runners.nacl.__opts__", minion_opts, create=True): + ret = nacl.keygen() + assert "pk" in ret + assert "sk" in ret + pk = ret["pk"] + sk = ret["sk"] + + # Encrypt with pk + encrypted_data = nacl.enc( + data=test_data, + pk=pk, + ) + + # Decrypt with sk + ret = nacl.dec( + data=encrypted_data, + sk=sk, + ) + assert test_data == ret + + +def test_sealedbox_enc_dec(test_data, minion_opts): + """ + Generate keys, encrypt, then decrypt. + """ + # Store the data + with patch("salt.runners.nacl.__opts__", minion_opts, create=True): + ret = nacl.keygen() + assert "pk" in ret + assert "sk" in ret + pk = ret["pk"] + sk = ret["sk"] + + # Encrypt with pk + encrypted_data = nacl.sealedbox_encrypt( + data=test_data, + pk=pk, + ) + + # Decrypt with sk + ret = nacl.sealedbox_decrypt( + data=encrypted_data, + sk=sk, + ) + assert test_data == ret + + +def test_secretbox_enc_dec(test_data, minion_opts): + """ + Generate keys, encrypt, then decrypt. + """ + # Store the data + with patch("salt.runners.nacl.__opts__", minion_opts, create=True): + ret = nacl.keygen() + assert "pk" in ret + assert "sk" in ret + pk = ret["pk"] + sk = ret["sk"] + + # Encrypt with pk + encrypted_data = nacl.secretbox_encrypt( + data=test_data, + sk=sk, + ) + + # Decrypt with sk + ret = nacl.secretbox_decrypt( + data=encrypted_data, + sk=sk, + ) + assert test_data == ret + + +def test_enc_dec_no_pk_no_sk(test_data, minion_opts): + """ + Store, list, fetch, then flush data + """ + # Store the data + with patch("salt.runners.nacl.__opts__", minion_opts, create=True): + ret = nacl.keygen() + assert "pk" in ret + assert "sk" in ret + pk = ret["pk"] + sk = ret["sk"] + + # Encrypt with pk + with pytest.raises(Exception, match="no pubkey or pk_file found"): + ret = nacl.enc( + data=test_data, + pk=None, + ) + + encrypted_data = test_data # dummy data, should get exception + # Decrypt with sk + with pytest.raises(Exception, match="no key or sk_file found"): + ret = nacl.dec( + data=encrypted_data, + sk=None, + ) diff --git a/tests/pytests/unit/modules/test_nacl.py b/tests/pytests/unit/modules/test_nacl.py index b60dabb3018..9e4e4796842 100644 --- a/tests/pytests/unit/modules/test_nacl.py +++ b/tests/pytests/unit/modules/test_nacl.py @@ -1,10 +1,49 @@ """ Unit tests for the salt.modules.nacl module """ +import pytest -import salt.modules.nacl +import salt.utils.stringutils from tests.support.mock import patch +try: + import salt.modules.nacl as nacl + + HAS_PYNACL = True +except (ImportError, OSError, AttributeError): + HAS_PYNACL = False + + +@pytest.mark.skipif( + not HAS_PYNACL, reason="skipping test_nacl, reason=PyNaCl is unavailable" +) +@pytest.fixture +def configure_loader_modules(minion_opts): + utils = salt.loader.utils(minion_opts) + funcs = salt.loader.minion_mods(minion_opts, utils=utils) + return { + nacl: { + "__opts__": minion_opts, + "__utils__": utils, + "__salt__": funcs, + }, + } + + +@pytest.fixture +def test_keys(): + # Generate the keys + ret = nacl.keygen() + assert "pk" in ret + assert "sk" in ret + return ret["pk"], ret["sk"] + + +@pytest.fixture +def test_data(): + unencrypted_data = salt.utils.stringutils.to_bytes("hello") + return unencrypted_data + def test_fips_mode(): """ @@ -14,3 +53,53 @@ def test_fips_mode(): with patch("salt.modules.nacl.__opts__", opts, create=True): ret = salt.modules.nacl.__virtual__() assert ret == (False, "nacl module not available in FIPS mode") + + +def test_keygen(test_keys): + """ + Test keygen + """ + test_pk, test_sk = test_keys + assert len(test_pk) == 44 + assert len(test_sk) == 44 + + +def test_enc_dec(test_data, test_keys): + """ + Generate keys, encrypt, then decrypt. + """ + # Encrypt with pk + test_pk, test_sk = test_keys + encrypted_data = nacl.enc(data=test_data, pk=test_pk) + + # Decrypt with sk + decrypted_data = nacl.dec(data=encrypted_data, sk=test_sk) + assert test_data == decrypted_data + + +def test_sealedbox_enc_dec(test_data, test_keys): + """ + Generate keys, encrypt, then decrypt. + """ + # Encrypt with pk + test_pk, test_sk = test_keys + encrypted_data = nacl.sealedbox_encrypt(data=test_data, pk=test_pk) + + # Decrypt with sk + decrypted_data = nacl.sealedbox_decrypt(data=encrypted_data, sk=test_sk) + + assert test_data == decrypted_data + + +def test_secretbox_enc_dec(test_data, test_keys): + """ + Generate keys, encrypt, then decrypt. + """ + # Encrypt with sk + test_pk, test_sk = test_keys + encrypted_data = nacl.secretbox_encrypt(data=test_data, sk=test_sk) + + # Decrypt with sk + decrypted_data = nacl.secretbox_decrypt(data=encrypted_data, sk=test_sk) + + assert test_data == decrypted_data diff --git a/tests/pytests/unit/utils/test_nacl.py b/tests/pytests/unit/utils/test_nacl.py index baf4024b819..2fdec9b8d52 100644 --- a/tests/pytests/unit/utils/test_nacl.py +++ b/tests/pytests/unit/utils/test_nacl.py @@ -1,10 +1,43 @@ """ Unit tests for the salt.utils.nacl module """ +import os -import salt.utils.nacl +import pytest +from saltfactories.utils.tempfiles import temp_file + +import salt.modules.config as config +import salt.utils.files from tests.support.mock import patch +try: + import salt.utils.nacl as nacl + + HAS_PYNACL = nacl.check_requirements +except (ImportError, OSError, AttributeError): + HAS_PYNACL = False + + +@pytest.mark.skipif( + not HAS_PYNACL, reason="skipping test_nacl, reason=PyNaCl is unavailable" +) +@pytest.fixture +def configure_loader_modules(): + return { + nacl: {"__salt__": {"config.get": config.get}}, + config: {"__opts__": {}}, + } + + +@pytest.fixture(scope="module") +def test_key(): + return "C16NxgBhw8cqbhvPCDAn2pirwW1A1WEVLUexCsoUD2Y=" + + +@pytest.fixture(scope="module") +def test_pub(): + return "+XWFfZXnfItS++a4gQf8Adu1aUlTgHWyTfsglbTdXyg=" + def test_fips_mode(): """ @@ -14,3 +47,130 @@ def test_fips_mode(): with patch("salt.utils.nacl.__opts__", opts, create=True): ret = salt.utils.nacl.__virtual__() assert ret == (False, "nacl utils not available in FIPS mode") + + +def test_keygen(): + """ + test nacl.keygen function + """ + ret = nacl.keygen() + assert all(key in ret for key in ret.keys()) + + +def test_keygen_sk_file(test_key): + """ + test nacl.keygen function + with sk_file set + """ + with temp_file("test_keygen_sk_file") as fpath: + with salt.utils.files.fopen(fpath, "w") as wfh: + wfh.write(test_key) + + # test sk_file + ret = nacl.keygen(sk_file=fpath) + assert "saved pk_file: {}.pub".format(fpath) == ret + salt.utils.files.remove(str(fpath) + ".pub") + + +def test_keygen_keyfile(test_key): + """ + test nacl.keygen function + with keyfile set + """ + with temp_file("test_keygen_keyfile") as fpath: + with salt.utils.files.fopen(fpath, "w") as wfh: + wfh.write(test_key) + + ret = nacl.keygen(keyfile=fpath) + assert "saved pk_file: {}.pub".format(fpath) == ret + salt.utils.files.remove(str(fpath) + ".pub") + + +def test_enc_keyfile(test_key, test_pub): + """ + test nacl.enc function + with keyfile and pk_file set + """ + with temp_file("test_enc_keyfile") as fpath: + with salt.utils.files.fopen(fpath, "w") as wfh: + wfh.write(test_key) + with salt.utils.files.fopen(str(fpath) + ".pub", "w") as wfhpub: + wfhpub.write(test_pub) + + kwargs = { + "opts": {"pki_dir": os.path.dirname(fpath)}, + "keyfile": str(fpath), + "pk_file": str(fpath) + ".pub", + } + ret = nacl.enc("blah", **kwargs) + assert isinstance(ret, bytes) + salt.utils.files.remove(str(fpath) + ".pub") + + +def test_enc_sk_file(test_key, test_pub): + """ + test nacl.enc function + with sk_file and pk_file set + """ + with temp_file("test_enc_sk_file") as fpath: + with salt.utils.files.fopen(fpath, "w") as wfh: + wfh.write(test_key) + with salt.utils.files.fopen(str(fpath) + ".pub", "w") as wfhpub: + wfhpub.write(test_pub) + + kwargs = { + "opts": {"pki_dir": os.path.dirname(fpath)}, + "sk_file": str(fpath), + "pk_file": str(fpath) + ".pub", + } + ret = nacl.enc("blah", **kwargs) + assert isinstance(ret, bytes) + salt.utils.files.remove(str(fpath) + ".pub") + + +def test_dec_keyfile(test_key, test_pub): + """ + test nacl.dec function + with keyfile and pk_file set + """ + with temp_file("test_dec_keyfile") as fpath: + with salt.utils.files.fopen(fpath, "w") as wfh: + wfh.write(test_key) + with salt.utils.files.fopen(str(fpath) + ".pub", "w") as wfhpub: + wfhpub.write(test_pub) + + kwargs = { + "opts": {"pki_dir": os.path.dirname(fpath)}, + "keyfile": str(fpath), + "pk_file": str(fpath) + ".pub", + } + + enc_data = nacl.enc("blah", **kwargs) + ret = nacl.dec(enc_data, **kwargs) + assert isinstance(ret, bytes) + assert ret == b"blah" + salt.utils.files.remove(str(fpath) + ".pub") + + +def test_dec_sk_file(test_key, test_pub): + """ + test nacl.dec function + with sk_file and pk_file set + """ + with temp_file("test_dec_sk_file") as fpath: + with salt.utils.files.fopen(fpath, "w") as wfh: + wfh.write(test_key) + with salt.utils.files.fopen(str(fpath) + ".pub", "w") as wfhpub: + wfhpub.write(test_pub) + + kwargs = { + "opts": {"pki_dir": os.path.dirname(fpath)}, + "sk_file": str(fpath), + "pk_file": str(fpath) + ".pub", + } + + enc_data = nacl.enc("blah", **kwargs) + ret = nacl.dec(enc_data, **kwargs) + assert isinstance(ret, bytes) + assert ret == b"blah" + salt.utils.files.remove(str(fpath) + ".pub") diff --git a/tests/unit/modules/test_nacl.py b/tests/unit/modules/test_nacl.py deleted file mode 100644 index c283f264e56..00000000000 --- a/tests/unit/modules/test_nacl.py +++ /dev/null @@ -1,91 +0,0 @@ -""" -Tests for the nacl execution module -""" - -import sys - -import pytest - -import salt.utils.stringutils -from tests.support.mixins import LoaderModuleMockMixin -from tests.support.unit import TestCase - -try: - import libnacl.sealed # pylint: disable=unused-import - import libnacl.secret # pylint: disable=unused-import - - import salt.modules.nacl as nacl - - HAS_LIBNACL = True -except (ImportError, OSError, AttributeError): - HAS_LIBNACL = False - - -@pytest.mark.skipif(sys.version_info >= (3, 10), reason="Segfaults with python 3.10") -@pytest.mark.skipif( - not HAS_LIBNACL, reason="skipping test_nacl, reason=libnacl is unavailable" -) -class NaclTest(TestCase, LoaderModuleMockMixin): - """ - Test the nacl runner - """ - - def setup_loader_modules(self): - self.unencrypted_data = salt.utils.stringutils.to_bytes("hello") - self.opts = salt.config.DEFAULT_MINION_OPTS.copy() - utils = salt.loader.utils(self.opts) - funcs = salt.loader.minion_mods(self.opts, utils=utils, whitelist=["nacl"]) - - return { - nacl: {"__opts__": self.opts, "__utils__": utils, "__salt__": funcs}, - } - - def setUp(self): - # Generate the keys - ret = nacl.keygen() - self.assertIn("pk", ret) - self.assertIn("sk", ret) - self.pk = ret["pk"] - self.sk = ret["sk"] - - def test_keygen(self): - """ - Test keygen - """ - self.assertEqual(len(self.pk), 44) - self.assertEqual(len(self.sk), 44) - - def test_enc_dec(self): - """ - Generate keys, encrypt, then decrypt. - """ - # Encrypt with pk - encrypted_data = nacl.enc(data=self.unencrypted_data, pk=self.pk) - - # Decrypt with sk - decrypted_data = nacl.dec(data=encrypted_data, sk=self.sk) - self.assertEqual(self.unencrypted_data, decrypted_data) - - def test_sealedbox_enc_dec(self): - """ - Generate keys, encrypt, then decrypt. - """ - # Encrypt with pk - encrypted_data = nacl.sealedbox_encrypt(data=self.unencrypted_data, pk=self.pk) - - # Decrypt with sk - decrypted_data = nacl.sealedbox_decrypt(data=encrypted_data, sk=self.sk) - - self.assertEqual(self.unencrypted_data, decrypted_data) - - def test_secretbox_enc_dec(self): - """ - Generate keys, encrypt, then decrypt. - """ - # Encrypt with sk - encrypted_data = nacl.secretbox_encrypt(data=self.unencrypted_data, sk=self.sk) - - # Decrypt with sk - decrypted_data = nacl.secretbox_decrypt(data=encrypted_data, sk=self.sk) - - self.assertEqual(self.unencrypted_data, decrypted_data) diff --git a/tests/unit/utils/test_nacl.py b/tests/unit/utils/test_nacl.py deleted file mode 100644 index d26682dfd4f..00000000000 --- a/tests/unit/utils/test_nacl.py +++ /dev/null @@ -1,144 +0,0 @@ -import os -import sys - -import pytest - -import salt.modules.config as config -import salt.utils.files -from tests.support.helpers import with_tempfile -from tests.support.mixins import LoaderModuleMockMixin -from tests.support.unit import TestCase - -try: - import salt.utils.nacl as nacl - HAS_PYNACL = nacl.check_requirements() -except (ImportError, OSError, AttributeError): - HAS_PYNACL = False - - -@pytest.mark.skipif( - not HAS_PYNACL, reason="skipping test_nacl, reason=libnacl is unavailable" -) -class NaclUtilsTests(TestCase, LoaderModuleMockMixin): - def setup_loader_modules(self): - return { - nacl: {"__salt__": {"config.get": config.get}}, - config: {"__opts__": {}}, - } - - def setUp(self): - self.key = "C16NxgBhw8cqbhvPCDAn2pirwW1A1WEVLUexCsoUD2Y=" - self.pub = "+XWFfZXnfItS++a4gQf8Adu1aUlTgHWyTfsglbTdXyg=" - - def test_keygen(self): - """ - test nacl.keygen function - """ - ret = nacl.keygen() - assert all(key in ret for key in ret.keys()) - - @with_tempfile() - def test_keygen_sk_file(self, fpath): - """ - test nacl.keygen function - with sk_file set - """ - with salt.utils.files.fopen(fpath, "w") as wfh: - wfh.write(self.key) - # test sk_file - ret = nacl.keygen(sk_file=fpath) - assert "saved pk_file: {}.pub".format(fpath) == ret - - @with_tempfile() - def test_keygen_keyfile(self, fpath): - """ - test nacl.keygen function - with keyfile set - """ - with salt.utils.files.fopen(fpath, "w") as wfh: - wfh.write(self.key) - - ret = nacl.keygen(keyfile=fpath) - assert "saved pk_file: {}.pub".format(fpath) == ret - - @with_tempfile() - def test_enc_keyfile(self, fpath): - """ - test nacl.enc function - with keyfile and pk_file set - """ - with salt.utils.files.fopen(fpath, "w") as wfh: - wfh.write(self.key) - with salt.utils.files.fopen(fpath + ".pub", "w") as wfh: - wfh.write(self.pub) - - kwargs = { - "opts": {"pki_dir": os.path.dirname(fpath)}, - "keyfile": fpath, - "pk_file": fpath + ".pub", - } - ret = nacl.enc("blah", **kwargs) - assert isinstance(ret, bytes) - - @with_tempfile() - def test_enc_sk_file(self, fpath): - """ - test nacl.enc function - with sk_file and pk_file set - """ - with salt.utils.files.fopen(fpath, "w") as wfh: - wfh.write(self.key) - with salt.utils.files.fopen(fpath + ".pub", "w") as wfh: - wfh.write(self.pub) - - kwargs = { - "opts": {"pki_dir": os.path.dirname(fpath)}, - "sk_file": fpath, - "pk_file": fpath + ".pub", - } - ret = nacl.enc("blah", **kwargs) - assert isinstance(ret, bytes) - - @with_tempfile() - def test_dec_keyfile(self, fpath): - """ - test nacl.dec function - with keyfile and pk_file set - """ - with salt.utils.files.fopen(fpath, "w") as wfh: - wfh.write(self.key) - with salt.utils.files.fopen(fpath + ".pub", "w") as wfh: - wfh.write(self.pub) - - kwargs = { - "opts": {"pki_dir": os.path.dirname(fpath)}, - "keyfile": fpath, - "pk_file": fpath + ".pub", - } - - enc_data = nacl.enc("blah", **kwargs) - ret = nacl.dec(enc_data, **kwargs) - assert isinstance(ret, bytes) - assert ret == b"blah" - - @with_tempfile() - def test_dec_sk_file(self, fpath): - """ - test nacl.dec function - with sk_file and pk_file set - """ - with salt.utils.files.fopen(fpath, "w") as wfh: - wfh.write(self.key) - with salt.utils.files.fopen(fpath + ".pub", "w") as wfh: - wfh.write(self.pub) - - kwargs = { - "opts": {"pki_dir": os.path.dirname(fpath)}, - "sk_file": fpath, - "pk_file": fpath + ".pub", - } - - enc_data = nacl.enc("blah", **kwargs) - ret = nacl.dec(enc_data, **kwargs) - assert isinstance(ret, bytes) - assert ret == b"blah" From 36563723f14529aa9608dda69bd5af1b661dd6d6 Mon Sep 17 00:00:00 2001 From: David Murphy < dmurphy@saltstack.com> Date: Fri, 9 Jun 2023 16:33:37 -0600 Subject: [PATCH 203/393] Adjusted test_nacl.py for utils --- tests/pytests/unit/utils/test_nacl.py | 83 ++++++++++++++------------- 1 file changed, 43 insertions(+), 40 deletions(-) diff --git a/tests/pytests/unit/utils/test_nacl.py b/tests/pytests/unit/utils/test_nacl.py index 2fdec9b8d52..2413116c4df 100644 --- a/tests/pytests/unit/utils/test_nacl.py +++ b/tests/pytests/unit/utils/test_nacl.py @@ -1,6 +1,7 @@ """ Unit tests for the salt.utils.nacl module """ +import logging import os import pytest @@ -17,6 +18,8 @@ try: except (ImportError, OSError, AttributeError): HAS_PYNACL = False +log = logging.getLogger(__name__) + @pytest.mark.skipif( not HAS_PYNACL, reason="skipping test_nacl, reason=PyNaCl is unavailable" @@ -30,13 +33,17 @@ def configure_loader_modules(): @pytest.fixture(scope="module") -def test_key(): - return "C16NxgBhw8cqbhvPCDAn2pirwW1A1WEVLUexCsoUD2Y=" +def test_keygen(): + """ + test nacl.keygen function - -@pytest.fixture(scope="module") -def test_pub(): - return "+XWFfZXnfItS++a4gQf8Adu1aUlTgHWyTfsglbTdXyg=" + Note: nacl.keygen returns base64 encoded values + """ + ret = nacl.keygen() + log.warning(f"DGM test_keygen ret '{ret}'") + assert "sk" in ret + assert "pk" in ret + return ret def test_fips_mode(): @@ -49,22 +56,14 @@ def test_fips_mode(): assert ret == (False, "nacl utils not available in FIPS mode") -def test_keygen(): - """ - test nacl.keygen function - """ - ret = nacl.keygen() - assert all(key in ret for key in ret.keys()) - - -def test_keygen_sk_file(test_key): +def test_keygen_sk_file(test_keygen): """ test nacl.keygen function with sk_file set """ with temp_file("test_keygen_sk_file") as fpath: - with salt.utils.files.fopen(fpath, "w") as wfh: - wfh.write(test_key) + with salt.utils.files.fopen(fpath, "wb") as wfh: + wfh.write(test_keygen["sk"]) # test sk_file ret = nacl.keygen(sk_file=fpath) @@ -72,72 +71,76 @@ def test_keygen_sk_file(test_key): salt.utils.files.remove(str(fpath) + ".pub") -def test_keygen_keyfile(test_key): +def test_keygen_keyfile(test_keygen): """ test nacl.keygen function with keyfile set """ with temp_file("test_keygen_keyfile") as fpath: - with salt.utils.files.fopen(fpath, "w") as wfh: - wfh.write(test_key) + with salt.utils.files.fopen(fpath, "wb") as wfh: + wfh.write(test_keygen["sk"]) ret = nacl.keygen(keyfile=fpath) assert "saved pk_file: {}.pub".format(fpath) == ret salt.utils.files.remove(str(fpath) + ".pub") -def test_enc_keyfile(test_key, test_pub): +def test_enc_keyfile(test_keygen): """ test nacl.enc function with keyfile and pk_file set """ + log.warning(f"DGM test_enc_keyfile test_keygen '{test_keygen}'") with temp_file("test_enc_keyfile") as fpath: - with salt.utils.files.fopen(fpath, "w") as wfh: - wfh.write(test_key) - with salt.utils.files.fopen(str(fpath) + ".pub", "w") as wfhpub: - wfhpub.write(test_pub) + with salt.utils.files.fopen(fpath, "wb") as wfh: + wfh.write(test_keygen["sk"]) + with salt.utils.files.fopen(str(fpath) + ".pub", "wb") as wfhpub: + wfhpub.write(test_keygen["pk"]) kwargs = { "opts": {"pki_dir": os.path.dirname(fpath)}, "keyfile": str(fpath), "pk_file": str(fpath) + ".pub", } + log.warning(f"DGM test_enc_keyfile nacl enc with kwargs '{kwargs}'") ret = nacl.enc("blah", **kwargs) assert isinstance(ret, bytes) salt.utils.files.remove(str(fpath) + ".pub") -def test_enc_sk_file(test_key, test_pub): +def test_enc_sk_file(test_keygen): """ test nacl.enc function with sk_file and pk_file set """ + log.warning(f"DGM test_enc_sk_file test_keygen '{test_keygen}'") with temp_file("test_enc_sk_file") as fpath: - with salt.utils.files.fopen(fpath, "w") as wfh: - wfh.write(test_key) - with salt.utils.files.fopen(str(fpath) + ".pub", "w") as wfhpub: - wfhpub.write(test_pub) + with salt.utils.files.fopen(fpath, "wb") as wfh: + wfh.write(test_keygen["sk"]) + with salt.utils.files.fopen(str(fpath) + ".pub", "wb") as wfhpub: + wfhpub.write(test_keygen["pk"]) kwargs = { "opts": {"pki_dir": os.path.dirname(fpath)}, "sk_file": str(fpath), "pk_file": str(fpath) + ".pub", } + log.warning(f"DGM test_enc_sk_file nacl enc with kwargs '{kwargs}'") ret = nacl.enc("blah", **kwargs) assert isinstance(ret, bytes) salt.utils.files.remove(str(fpath) + ".pub") -def test_dec_keyfile(test_key, test_pub): +def test_dec_keyfile(test_keygen): """ test nacl.dec function with keyfile and pk_file set """ with temp_file("test_dec_keyfile") as fpath: - with salt.utils.files.fopen(fpath, "w") as wfh: - wfh.write(test_key) - with salt.utils.files.fopen(str(fpath) + ".pub", "w") as wfhpub: - wfhpub.write(test_pub) + with salt.utils.files.fopen(fpath, "wb") as wfh: + wfh.write(test_keygen["sk"]) + with salt.utils.files.fopen(str(fpath) + ".pub", "wb") as wfhpub: + wfhpub.write(test_keygen["pk"]) kwargs = { "opts": {"pki_dir": os.path.dirname(fpath)}, @@ -152,16 +155,16 @@ def test_dec_keyfile(test_key, test_pub): salt.utils.files.remove(str(fpath) + ".pub") -def test_dec_sk_file(test_key, test_pub): +def test_dec_sk_file(test_keygen): """ test nacl.dec function with sk_file and pk_file set """ with temp_file("test_dec_sk_file") as fpath: - with salt.utils.files.fopen(fpath, "w") as wfh: - wfh.write(test_key) - with salt.utils.files.fopen(str(fpath) + ".pub", "w") as wfhpub: - wfhpub.write(test_pub) + with salt.utils.files.fopen(fpath, "wb") as wfh: + wfh.write(test_keygen["sk"]) + with salt.utils.files.fopen(str(fpath) + ".pub", "wb") as wfhpub: + wfhpub.write(test_keygen["pk"]) kwargs = { "opts": {"pki_dir": os.path.dirname(fpath)}, From d2f1900bd944c3ab61ba9b33f39ed2eda583c631 Mon Sep 17 00:00:00 2001 From: David Murphy < dmurphy@saltstack.com> Date: Tue, 13 Jun 2023 14:41:12 -0600 Subject: [PATCH 204/393] Adjusted pynacl version per python version --- requirements/static/ci/common.in | 4 +++- requirements/static/ci/py3.10/cloud.txt | 3 +-- requirements/static/ci/py3.10/darwin.txt | 3 +-- requirements/static/ci/py3.10/freebsd.txt | 3 +-- requirements/static/ci/py3.10/lint.txt | 3 +-- requirements/static/ci/py3.10/linux.txt | 3 +-- requirements/static/ci/py3.10/windows.txt | 2 +- requirements/static/ci/py3.7/cloud.txt | 2 +- requirements/static/ci/py3.7/freebsd.txt | 2 +- requirements/static/ci/py3.7/lint.txt | 2 +- requirements/static/ci/py3.7/linux.txt | 2 +- requirements/static/ci/py3.7/windows.txt | 3 ++- requirements/static/ci/py3.8/cloud.txt | 2 +- requirements/static/ci/py3.8/freebsd.txt | 2 +- requirements/static/ci/py3.8/lint.txt | 2 +- requirements/static/ci/py3.8/linux.txt | 2 +- requirements/static/ci/py3.8/windows.txt | 3 ++- requirements/static/ci/py3.9/cloud.txt | 3 +-- requirements/static/ci/py3.9/darwin.txt | 3 +-- requirements/static/ci/py3.9/freebsd.txt | 3 +-- requirements/static/ci/py3.9/lint.txt | 3 +-- requirements/static/ci/py3.9/linux.txt | 3 +-- requirements/static/ci/py3.9/windows.txt | 2 +- 23 files changed, 27 insertions(+), 33 deletions(-) diff --git a/requirements/static/ci/common.in b/requirements/static/ci/common.in index 7ca2cebe159..d9ac10b2892 100644 --- a/requirements/static/ci/common.in +++ b/requirements/static/ci/common.in @@ -30,7 +30,9 @@ moto>=2.0.0 ; python_version >= '3.6' napalm; sys_platform != 'win32' and python_version > '3.6' and python_version < '3.10' paramiko>=2.10.1; sys_platform != 'win32' and sys_platform != 'darwin' passlib[bcrypt]>=1.7.4 -pynacl +pynacl==1.3.0; python_version <= '3.7' +pynacl==1.4.0; python_version == '3.8' +pynacl>=1.5.0; python_version >= '3.9' pycparser>=2.21; python_version >= '3.9' pyinotify>=0.9.6; sys_platform != 'win32' and sys_platform != 'darwin' and platform_system != "openbsd" python-etcd>0.4.2 diff --git a/requirements/static/ci/py3.10/cloud.txt b/requirements/static/ci/py3.10/cloud.txt index dcaf3b9fa9c..c58e6cef54e 100644 --- a/requirements/static/ci/py3.10/cloud.txt +++ b/requirements/static/ci/py3.10/cloud.txt @@ -667,7 +667,7 @@ pyinotify==0.9.6 ; sys_platform != "win32" and sys_platform != "darwin" and plat # via -r requirements/static/ci/common.in pyjwt==2.4.0 # via adal -pynacl==1.4.0 +pynacl==1.5.0 ; python_version >= "3.9" # via # -r requirements/static/ci/common.in # paramiko @@ -824,7 +824,6 @@ six==1.16.0 # ncclient # paramiko # profitbricks - # pynacl # pypsexec # python-dateutil # pyvmomi diff --git a/requirements/static/ci/py3.10/darwin.txt b/requirements/static/ci/py3.10/darwin.txt index fd12cc561a2..4f4890e6ad3 100644 --- a/requirements/static/ci/py3.10/darwin.txt +++ b/requirements/static/ci/py3.10/darwin.txt @@ -668,7 +668,7 @@ pygit2==1.9.1 ; python_version >= "3.7" # via -r requirements/static/ci/darwin.in pyjwt==2.4.0 # via adal -pynacl==1.3.0 +pynacl==1.5.0 ; python_version >= "3.9" # via # -r requirements/static/ci/common.in # paramiko @@ -812,7 +812,6 @@ six==1.16.0 # msrestazure # ncclient # paramiko - # pynacl # python-dateutil # pyvmomi # responses diff --git a/requirements/static/ci/py3.10/freebsd.txt b/requirements/static/ci/py3.10/freebsd.txt index 497a0f21d81..ca69951e1f6 100644 --- a/requirements/static/ci/py3.10/freebsd.txt +++ b/requirements/static/ci/py3.10/freebsd.txt @@ -667,7 +667,7 @@ pyinotify==0.9.6 ; sys_platform != "win32" and sys_platform != "darwin" and plat # via -r requirements/static/ci/common.in pyjwt==2.4.0 # via adal -pynacl==1.3.0 +pynacl==1.5.0 ; python_version >= "3.9" # via # -r requirements/static/ci/common.in # paramiko @@ -812,7 +812,6 @@ six==1.16.0 # msrestazure # ncclient # paramiko - # pynacl # python-dateutil # pyvmomi # responses diff --git a/requirements/static/ci/py3.10/lint.txt b/requirements/static/ci/py3.10/lint.txt index 3df8b098ce3..d73906f8398 100644 --- a/requirements/static/ci/py3.10/lint.txt +++ b/requirements/static/ci/py3.10/lint.txt @@ -673,7 +673,7 @@ pylint==2.4.4 # saltpylint pymysql==1.0.2 ; python_version > "3.5" # via -r requirements/static/ci/linux.in -pynacl==1.4.0 +pynacl==1.5.0 ; python_version >= "3.9" # via # -r requirements/static/ci/common.in # paramiko @@ -795,7 +795,6 @@ six==1.16.0 # msrestazure # ncclient # paramiko - # pynacl # python-consul # python-dateutil # pyvmomi diff --git a/requirements/static/ci/py3.10/linux.txt b/requirements/static/ci/py3.10/linux.txt index 477989641b1..29d53ec9dfa 100644 --- a/requirements/static/ci/py3.10/linux.txt +++ b/requirements/static/ci/py3.10/linux.txt @@ -687,7 +687,7 @@ pyjwt==2.4.0 # twilio pymysql==1.0.2 ; python_version > "3.5" # via -r requirements/static/ci/linux.in -pynacl==1.3.0 +pynacl==1.5.0 ; python_version >= "3.9" # via # -r requirements/static/ci/common.in # paramiko @@ -849,7 +849,6 @@ six==1.16.0 # more-itertools # ncclient # paramiko - # pynacl # python-consul # python-dateutil # pyvmomi diff --git a/requirements/static/ci/py3.10/windows.txt b/requirements/static/ci/py3.10/windows.txt index 3ee2dfb867d..5e6092a6866 100644 --- a/requirements/static/ci/py3.10/windows.txt +++ b/requirements/static/ci/py3.10/windows.txt @@ -238,7 +238,7 @@ pymssql==2.2.7 # via -r requirements/windows.txt pymysql==1.0.2 # via -r requirements/windows.txt -pynacl==1.5.0 +pynacl==1.5.0 ; python_version >= "3.9" # via -r requirements/static/ci/common.in pyopenssl==23.2.0 # via diff --git a/requirements/static/ci/py3.7/cloud.txt b/requirements/static/ci/py3.7/cloud.txt index 5523fbd69db..4ddd3d95604 100644 --- a/requirements/static/ci/py3.7/cloud.txt +++ b/requirements/static/ci/py3.7/cloud.txt @@ -709,7 +709,7 @@ pyinotify==0.9.6 ; sys_platform != "win32" and sys_platform != "darwin" and plat # via -r requirements/static/ci/common.in pyjwt==2.4.0 # via adal -pynacl==1.4.0 +pynacl==1.3.0 ; python_version <= "3.7" # via # -r requirements/static/ci/common.in # paramiko diff --git a/requirements/static/ci/py3.7/freebsd.txt b/requirements/static/ci/py3.7/freebsd.txt index 0b11878d2d4..23838ea0e5d 100644 --- a/requirements/static/ci/py3.7/freebsd.txt +++ b/requirements/static/ci/py3.7/freebsd.txt @@ -703,7 +703,7 @@ pyinotify==0.9.6 ; sys_platform != "win32" and sys_platform != "darwin" and plat # via -r requirements/static/ci/common.in pyjwt==2.4.0 # via adal -pynacl==1.3.0 +pynacl==1.3.0 ; python_version <= "3.7" # via # -r requirements/static/ci/common.in # paramiko diff --git a/requirements/static/ci/py3.7/lint.txt b/requirements/static/ci/py3.7/lint.txt index b1b66604b6c..7f03c376f20 100644 --- a/requirements/static/ci/py3.7/lint.txt +++ b/requirements/static/ci/py3.7/lint.txt @@ -716,7 +716,7 @@ pylint==2.4.4 # saltpylint pymysql==1.0.2 ; python_version > "3.5" # via -r requirements/static/ci/linux.in -pynacl==1.4.0 +pynacl==1.3.0 ; python_version <= "3.7" # via # -r requirements/static/ci/common.in # paramiko diff --git a/requirements/static/ci/py3.7/linux.txt b/requirements/static/ci/py3.7/linux.txt index 72aaa919785..f5a3826ec4d 100644 --- a/requirements/static/ci/py3.7/linux.txt +++ b/requirements/static/ci/py3.7/linux.txt @@ -723,7 +723,7 @@ pyjwt==2.4.0 # twilio pymysql==1.0.2 ; python_version > "3.5" # via -r requirements/static/ci/linux.in -pynacl==1.3.0 +pynacl==1.3.0 ; python_version <= "3.7" # via # -r requirements/static/ci/common.in # paramiko diff --git a/requirements/static/ci/py3.7/windows.txt b/requirements/static/ci/py3.7/windows.txt index e5fc3ed81f5..e5deabea3ab 100644 --- a/requirements/static/ci/py3.7/windows.txt +++ b/requirements/static/ci/py3.7/windows.txt @@ -251,7 +251,7 @@ pymssql==2.2.1 # via -r requirements/windows.txt pymysql==1.0.2 # via -r requirements/windows.txt -pynacl==1.5.0 +pynacl==1.3.0 ; python_version <= "3.7" # via -r requirements/static/ci/common.in pyopenssl==23.2.0 # via @@ -379,6 +379,7 @@ six==1.15.0 # jsonschema # kubernetes # mock + # pynacl # python-dateutil # pyvmomi # pywinrm diff --git a/requirements/static/ci/py3.8/cloud.txt b/requirements/static/ci/py3.8/cloud.txt index a58dec920dd..7236c768c55 100644 --- a/requirements/static/ci/py3.8/cloud.txt +++ b/requirements/static/ci/py3.8/cloud.txt @@ -698,7 +698,7 @@ pyinotify==0.9.6 ; sys_platform != "win32" and sys_platform != "darwin" and plat # via -r requirements/static/ci/common.in pyjwt==2.4.0 # via adal -pynacl==1.4.0 +pynacl==1.4.0 ; python_version == "3.8" # via # -r requirements/static/ci/common.in # paramiko diff --git a/requirements/static/ci/py3.8/freebsd.txt b/requirements/static/ci/py3.8/freebsd.txt index 14b9b3204d6..009fefb10a8 100644 --- a/requirements/static/ci/py3.8/freebsd.txt +++ b/requirements/static/ci/py3.8/freebsd.txt @@ -693,7 +693,7 @@ pyinotify==0.9.6 ; sys_platform != "win32" and sys_platform != "darwin" and plat # via -r requirements/static/ci/common.in pyjwt==2.4.0 # via adal -pynacl==1.3.0 +pynacl==1.4.0 ; python_version == "3.8" # via # -r requirements/static/ci/common.in # paramiko diff --git a/requirements/static/ci/py3.8/lint.txt b/requirements/static/ci/py3.8/lint.txt index 36ced882863..44c86d542fd 100644 --- a/requirements/static/ci/py3.8/lint.txt +++ b/requirements/static/ci/py3.8/lint.txt @@ -707,7 +707,7 @@ pylint==2.4.4 # saltpylint pymysql==1.0.2 ; python_version > "3.5" # via -r requirements/static/ci/linux.in -pynacl==1.4.0 +pynacl==1.4.0 ; python_version == "3.8" # via # -r requirements/static/ci/common.in # paramiko diff --git a/requirements/static/ci/py3.8/linux.txt b/requirements/static/ci/py3.8/linux.txt index 089df020e05..59ec8dacb1a 100644 --- a/requirements/static/ci/py3.8/linux.txt +++ b/requirements/static/ci/py3.8/linux.txt @@ -713,7 +713,7 @@ pyjwt==2.4.0 # twilio pymysql==1.0.2 ; python_version > "3.5" # via -r requirements/static/ci/linux.in -pynacl==1.3.0 +pynacl==1.4.0 ; python_version == "3.8" # via # -r requirements/static/ci/common.in # paramiko diff --git a/requirements/static/ci/py3.8/windows.txt b/requirements/static/ci/py3.8/windows.txt index ce6b8142a7d..92c4152005a 100644 --- a/requirements/static/ci/py3.8/windows.txt +++ b/requirements/static/ci/py3.8/windows.txt @@ -239,7 +239,7 @@ pymssql==2.2.1 # via -r requirements/windows.txt pymysql==1.0.2 # via -r requirements/windows.txt -pynacl==1.5.0 +pynacl==1.4.0 ; python_version == "3.8" # via -r requirements/static/ci/common.in pyopenssl==23.2.0 # via @@ -367,6 +367,7 @@ six==1.15.0 # jsonschema # kubernetes # mock + # pynacl # python-dateutil # pyvmomi # pywinrm diff --git a/requirements/static/ci/py3.9/cloud.txt b/requirements/static/ci/py3.9/cloud.txt index e64010d73fc..d7422a67ab4 100644 --- a/requirements/static/ci/py3.9/cloud.txt +++ b/requirements/static/ci/py3.9/cloud.txt @@ -701,7 +701,7 @@ pyinotify==0.9.6 ; sys_platform != "win32" and sys_platform != "darwin" and plat # via -r requirements/static/ci/common.in pyjwt==2.4.0 # via adal -pynacl==1.4.0 +pynacl==1.5.0 ; python_version >= "3.9" # via # -r requirements/static/ci/common.in # paramiko @@ -865,7 +865,6 @@ six==1.16.0 # ncclient # paramiko # profitbricks - # pynacl # pypsexec # python-dateutil # pyvmomi diff --git a/requirements/static/ci/py3.9/darwin.txt b/requirements/static/ci/py3.9/darwin.txt index b8e6f50b115..93eada5d3e4 100644 --- a/requirements/static/ci/py3.9/darwin.txt +++ b/requirements/static/ci/py3.9/darwin.txt @@ -697,7 +697,7 @@ pygit2==1.9.1 ; python_version >= "3.7" # via -r requirements/static/ci/darwin.in pyjwt==2.4.0 # via adal -pynacl==1.3.0 +pynacl==1.5.0 ; python_version >= "3.9" # via # -r requirements/static/ci/common.in # paramiko @@ -848,7 +848,6 @@ six==1.16.0 # msrestazure # ncclient # paramiko - # pynacl # python-dateutil # pyvmomi # responses diff --git a/requirements/static/ci/py3.9/freebsd.txt b/requirements/static/ci/py3.9/freebsd.txt index 944885c2216..311b4555ddb 100644 --- a/requirements/static/ci/py3.9/freebsd.txt +++ b/requirements/static/ci/py3.9/freebsd.txt @@ -696,7 +696,7 @@ pyinotify==0.9.6 ; sys_platform != "win32" and sys_platform != "darwin" and plat # via -r requirements/static/ci/common.in pyjwt==2.4.0 # via adal -pynacl==1.3.0 +pynacl==1.5.0 ; python_version >= "3.9" # via # -r requirements/static/ci/common.in # paramiko @@ -848,7 +848,6 @@ six==1.16.0 # msrestazure # ncclient # paramiko - # pynacl # python-dateutil # pyvmomi # responses diff --git a/requirements/static/ci/py3.9/lint.txt b/requirements/static/ci/py3.9/lint.txt index 2fd1f2527c2..9b327b776de 100644 --- a/requirements/static/ci/py3.9/lint.txt +++ b/requirements/static/ci/py3.9/lint.txt @@ -708,7 +708,7 @@ pylint==2.4.4 # saltpylint pymysql==1.0.2 ; python_version > "3.5" # via -r requirements/static/ci/linux.in -pynacl==1.4.0 +pynacl==1.5.0 ; python_version >= "3.9" # via # -r requirements/static/ci/common.in # paramiko @@ -837,7 +837,6 @@ six==1.16.0 # msrestazure # ncclient # paramiko - # pynacl # python-consul # python-dateutil # pyvmomi diff --git a/requirements/static/ci/py3.9/linux.txt b/requirements/static/ci/py3.9/linux.txt index cf198dcff83..ead0f1242d7 100644 --- a/requirements/static/ci/py3.9/linux.txt +++ b/requirements/static/ci/py3.9/linux.txt @@ -718,7 +718,7 @@ pyjwt==2.4.0 # twilio pymysql==1.0.2 ; python_version > "3.5" # via -r requirements/static/ci/linux.in -pynacl==1.3.0 +pynacl==1.5.0 ; python_version >= "3.9" # via # -r requirements/static/ci/common.in # paramiko @@ -887,7 +887,6 @@ six==1.16.0 # more-itertools # ncclient # paramiko - # pynacl # python-consul # python-dateutil # pyvmomi diff --git a/requirements/static/ci/py3.9/windows.txt b/requirements/static/ci/py3.9/windows.txt index 5533dae6d5c..d081309887f 100644 --- a/requirements/static/ci/py3.9/windows.txt +++ b/requirements/static/ci/py3.9/windows.txt @@ -240,7 +240,7 @@ pymssql==2.2.1 # via -r requirements/windows.txt pymysql==1.0.2 # via -r requirements/windows.txt -pynacl==1.5.0 +pynacl==1.5.0 ; python_version >= "3.9" # via -r requirements/static/ci/common.in pyopenssl==23.2.0 # via From c6b4671b86b9061269dee7993ebe1d06f23553cc Mon Sep 17 00:00:00 2001 From: David Murphy < dmurphy@saltstack.com> Date: Thu, 15 Jun 2023 09:59:47 -0600 Subject: [PATCH 205/393] Updated versions of cffi used --- requirements/static/ci/common.in | 3 ++- requirements/static/ci/py3.10/cloud.txt | 2 +- requirements/static/ci/py3.10/darwin.txt | 2 +- requirements/static/ci/py3.10/freebsd.txt | 2 +- requirements/static/ci/py3.10/lint.txt | 2 +- requirements/static/ci/py3.10/linux.txt | 2 +- requirements/static/ci/py3.10/windows.txt | 2 +- requirements/static/ci/py3.7/cloud.txt | 1 - requirements/static/ci/py3.7/freebsd.txt | 1 - requirements/static/ci/py3.7/lint.txt | 1 - requirements/static/ci/py3.7/linux.txt | 1 - requirements/static/ci/py3.7/windows.txt | 1 - requirements/static/ci/py3.8/cloud.txt | 2 +- requirements/static/ci/py3.8/freebsd.txt | 2 +- requirements/static/ci/py3.8/lint.txt | 2 +- requirements/static/ci/py3.8/linux.txt | 2 +- requirements/static/ci/py3.8/windows.txt | 2 +- requirements/static/ci/py3.9/cloud.txt | 2 +- requirements/static/ci/py3.9/darwin.txt | 2 +- requirements/static/ci/py3.9/freebsd.txt | 2 +- requirements/static/ci/py3.9/lint.txt | 2 +- requirements/static/ci/py3.9/linux.txt | 2 +- requirements/static/ci/py3.9/windows.txt | 2 +- 23 files changed, 19 insertions(+), 23 deletions(-) diff --git a/requirements/static/ci/common.in b/requirements/static/ci/common.in index d9ac10b2892..ba08f698854 100644 --- a/requirements/static/ci/common.in +++ b/requirements/static/ci/common.in @@ -8,7 +8,8 @@ boto3>=1.17.67; python_version >= '3.6' boto>=2.46.0 cassandra-driver>=2.0 certifi>=2022.12.07 -cffi>=1.12.2 +cffi>=1.12.2, <= 1.14.6; python_version < '3.7' +cffi>=1.15.1; python_version > '3.7' cherrypy>=17.4.1 clustershell croniter>=0.3.0,!=0.3.22"; sys_platform != 'win32' diff --git a/requirements/static/ci/py3.10/cloud.txt b/requirements/static/ci/py3.10/cloud.txt index c58e6cef54e..1fee2a7de6a 100644 --- a/requirements/static/ci/py3.10/cloud.txt +++ b/requirements/static/ci/py3.10/cloud.txt @@ -358,7 +358,7 @@ certifi==2023.07.22 # requests certvalidator==0.11.1 # via vcert -cffi==1.14.6 +cffi==1.15.1 ; python_version > "3.7" # via # -r requirements/static/ci/common.in # azure-datalake-store diff --git a/requirements/static/ci/py3.10/darwin.txt b/requirements/static/ci/py3.10/darwin.txt index 4f4890e6ad3..034d8bcdd4d 100644 --- a/requirements/static/ci/py3.10/darwin.txt +++ b/requirements/static/ci/py3.10/darwin.txt @@ -358,7 +358,7 @@ certifi==2023.07.22 # requests certvalidator==0.11.1 # via vcert -cffi==1.14.6 +cffi==1.15.1 ; python_version > "3.7" # via # -r requirements/static/ci/common.in # azure-datalake-store diff --git a/requirements/static/ci/py3.10/freebsd.txt b/requirements/static/ci/py3.10/freebsd.txt index ca69951e1f6..600c4657380 100644 --- a/requirements/static/ci/py3.10/freebsd.txt +++ b/requirements/static/ci/py3.10/freebsd.txt @@ -356,7 +356,7 @@ certifi==2023.07.22 # requests certvalidator==0.11.1 # via vcert -cffi==1.14.6 +cffi==1.15.1 ; python_version > "3.7" # via # -r requirements/static/ci/common.in # azure-datalake-store diff --git a/requirements/static/ci/py3.10/lint.txt b/requirements/static/ci/py3.10/lint.txt index d73906f8398..2f0f5367e7e 100644 --- a/requirements/static/ci/py3.10/lint.txt +++ b/requirements/static/ci/py3.10/lint.txt @@ -362,7 +362,7 @@ certifi==2023.07.22 # requests certvalidator==0.11.1 # via vcert -cffi==1.14.6 +cffi==1.15.1 ; python_version > "3.7" # via # -r requirements/static/ci/common.in # azure-datalake-store diff --git a/requirements/static/ci/py3.10/linux.txt b/requirements/static/ci/py3.10/linux.txt index 29d53ec9dfa..42b2e9ed7bb 100644 --- a/requirements/static/ci/py3.10/linux.txt +++ b/requirements/static/ci/py3.10/linux.txt @@ -370,7 +370,7 @@ certifi==2023.07.22 # requests certvalidator==0.11.1 # via vcert -cffi==1.14.6 +cffi==1.15.1 ; python_version > "3.7" # via # -r requirements/static/ci/common.in # azure-datalake-store diff --git a/requirements/static/ci/py3.10/windows.txt b/requirements/static/ci/py3.10/windows.txt index 5e6092a6866..654f358af88 100644 --- a/requirements/static/ci/py3.10/windows.txt +++ b/requirements/static/ci/py3.10/windows.txt @@ -42,7 +42,7 @@ certifi==2023.07.22 # -r requirements/windows.txt # kubernetes # requests -cffi==1.14.6 +cffi==1.15.1 ; python_version > "3.7" # via # -r requirements/static/ci/common.in # -r requirements/windows.txt diff --git a/requirements/static/ci/py3.7/cloud.txt b/requirements/static/ci/py3.7/cloud.txt index 4ddd3d95604..33547d20175 100644 --- a/requirements/static/ci/py3.7/cloud.txt +++ b/requirements/static/ci/py3.7/cloud.txt @@ -362,7 +362,6 @@ certvalidator==0.11.1 # via vcert cffi==1.14.6 # via - # -r requirements/static/ci/common.in # azure-datalake-store # bcrypt # cryptography diff --git a/requirements/static/ci/py3.7/freebsd.txt b/requirements/static/ci/py3.7/freebsd.txt index 23838ea0e5d..8b0fa6828af 100644 --- a/requirements/static/ci/py3.7/freebsd.txt +++ b/requirements/static/ci/py3.7/freebsd.txt @@ -360,7 +360,6 @@ certvalidator==0.11.1 # via vcert cffi==1.14.6 # via - # -r requirements/static/ci/common.in # azure-datalake-store # bcrypt # cryptography diff --git a/requirements/static/ci/py3.7/lint.txt b/requirements/static/ci/py3.7/lint.txt index 7f03c376f20..c66d61860e0 100644 --- a/requirements/static/ci/py3.7/lint.txt +++ b/requirements/static/ci/py3.7/lint.txt @@ -368,7 +368,6 @@ certvalidator==0.11.1 # via vcert cffi==1.14.6 # via - # -r requirements/static/ci/common.in # azure-datalake-store # bcrypt # cryptography diff --git a/requirements/static/ci/py3.7/linux.txt b/requirements/static/ci/py3.7/linux.txt index f5a3826ec4d..ec04e48a41a 100644 --- a/requirements/static/ci/py3.7/linux.txt +++ b/requirements/static/ci/py3.7/linux.txt @@ -374,7 +374,6 @@ certvalidator==0.11.1 # via vcert cffi==1.14.6 # via - # -r requirements/static/ci/common.in # azure-datalake-store # bcrypt # cryptography diff --git a/requirements/static/ci/py3.7/windows.txt b/requirements/static/ci/py3.7/windows.txt index e5deabea3ab..f0fae401318 100644 --- a/requirements/static/ci/py3.7/windows.txt +++ b/requirements/static/ci/py3.7/windows.txt @@ -50,7 +50,6 @@ certifi==2023.07.22 # requests cffi==1.14.6 # via - # -r requirements/static/ci/common.in # -r requirements/windows.txt # clr-loader # cryptography diff --git a/requirements/static/ci/py3.8/cloud.txt b/requirements/static/ci/py3.8/cloud.txt index 7236c768c55..83db00c3dc0 100644 --- a/requirements/static/ci/py3.8/cloud.txt +++ b/requirements/static/ci/py3.8/cloud.txt @@ -358,7 +358,7 @@ certifi==2023.07.22 # requests certvalidator==0.11.1 # via vcert -cffi==1.14.6 +cffi==1.15.1 ; python_version > "3.7" # via # -r requirements/static/ci/common.in # azure-datalake-store diff --git a/requirements/static/ci/py3.8/freebsd.txt b/requirements/static/ci/py3.8/freebsd.txt index 009fefb10a8..e0c84876c57 100644 --- a/requirements/static/ci/py3.8/freebsd.txt +++ b/requirements/static/ci/py3.8/freebsd.txt @@ -356,7 +356,7 @@ certifi==2023.07.22 # requests certvalidator==0.11.1 # via vcert -cffi==1.14.6 +cffi==1.15.1 ; python_version > "3.7" # via # -r requirements/static/ci/common.in # azure-datalake-store diff --git a/requirements/static/ci/py3.8/lint.txt b/requirements/static/ci/py3.8/lint.txt index 44c86d542fd..cb505238dd9 100644 --- a/requirements/static/ci/py3.8/lint.txt +++ b/requirements/static/ci/py3.8/lint.txt @@ -364,7 +364,7 @@ certifi==2023.07.22 # requests certvalidator==0.11.1 # via vcert -cffi==1.14.6 +cffi==1.15.1 ; python_version > "3.7" # via # -r requirements/static/ci/common.in # azure-datalake-store diff --git a/requirements/static/ci/py3.8/linux.txt b/requirements/static/ci/py3.8/linux.txt index 59ec8dacb1a..8c068b8ee1e 100644 --- a/requirements/static/ci/py3.8/linux.txt +++ b/requirements/static/ci/py3.8/linux.txt @@ -370,7 +370,7 @@ certifi==2023.07.22 # requests certvalidator==0.11.1 # via vcert -cffi==1.14.6 +cffi==1.15.1 ; python_version > "3.7" # via # -r requirements/static/ci/common.in # azure-datalake-store diff --git a/requirements/static/ci/py3.8/windows.txt b/requirements/static/ci/py3.8/windows.txt index 92c4152005a..8206b905138 100644 --- a/requirements/static/ci/py3.8/windows.txt +++ b/requirements/static/ci/py3.8/windows.txt @@ -44,7 +44,7 @@ certifi==2023.07.22 # -r requirements/windows.txt # kubernetes # requests -cffi==1.14.6 +cffi==1.15.1 ; python_version > "3.7" # via # -r requirements/static/ci/common.in # -r requirements/windows.txt diff --git a/requirements/static/ci/py3.9/cloud.txt b/requirements/static/ci/py3.9/cloud.txt index d7422a67ab4..89c23c15d59 100644 --- a/requirements/static/ci/py3.9/cloud.txt +++ b/requirements/static/ci/py3.9/cloud.txt @@ -358,7 +358,7 @@ certifi==2023.07.22 # requests certvalidator==0.11.1 # via vcert -cffi==1.14.6 +cffi==1.15.1 ; python_version > "3.7" # via # -r requirements/static/ci/common.in # azure-datalake-store diff --git a/requirements/static/ci/py3.9/darwin.txt b/requirements/static/ci/py3.9/darwin.txt index 93eada5d3e4..609e1623e07 100644 --- a/requirements/static/ci/py3.9/darwin.txt +++ b/requirements/static/ci/py3.9/darwin.txt @@ -358,7 +358,7 @@ certifi==2023.07.22 # requests certvalidator==0.11.1 # via vcert -cffi==1.14.6 +cffi==1.15.1 ; python_version > "3.7" # via # -r requirements/static/ci/common.in # azure-datalake-store diff --git a/requirements/static/ci/py3.9/freebsd.txt b/requirements/static/ci/py3.9/freebsd.txt index 311b4555ddb..6c7c62d8a65 100644 --- a/requirements/static/ci/py3.9/freebsd.txt +++ b/requirements/static/ci/py3.9/freebsd.txt @@ -356,7 +356,7 @@ certifi==2023.07.22 # requests certvalidator==0.11.1 # via vcert -cffi==1.14.6 +cffi==1.15.1 ; python_version > "3.7" # via # -r requirements/static/ci/common.in # azure-datalake-store diff --git a/requirements/static/ci/py3.9/lint.txt b/requirements/static/ci/py3.9/lint.txt index 9b327b776de..6b0791b6efc 100644 --- a/requirements/static/ci/py3.9/lint.txt +++ b/requirements/static/ci/py3.9/lint.txt @@ -362,7 +362,7 @@ certifi==2023.07.22 # requests certvalidator==0.11.1 # via vcert -cffi==1.14.6 +cffi==1.15.1 ; python_version > "3.7" # via # -r requirements/static/ci/common.in # azure-datalake-store diff --git a/requirements/static/ci/py3.9/linux.txt b/requirements/static/ci/py3.9/linux.txt index ead0f1242d7..f46c58999e3 100644 --- a/requirements/static/ci/py3.9/linux.txt +++ b/requirements/static/ci/py3.9/linux.txt @@ -372,7 +372,7 @@ certifi==2023.07.22 # requests certvalidator==0.11.1 # via vcert -cffi==1.14.6 +cffi==1.15.1 ; python_version > "3.7" # via # -r requirements/static/ci/common.in # azure-datalake-store diff --git a/requirements/static/ci/py3.9/windows.txt b/requirements/static/ci/py3.9/windows.txt index d081309887f..38cfc73db51 100644 --- a/requirements/static/ci/py3.9/windows.txt +++ b/requirements/static/ci/py3.9/windows.txt @@ -44,7 +44,7 @@ certifi==2023.07.22 # -r requirements/windows.txt # kubernetes # requests -cffi==1.14.6 +cffi==1.15.1 ; python_version > "3.7" # via # -r requirements/static/ci/common.in # -r requirements/windows.txt From 1153e4d349469ce2dc1cb08df23a8e471ceb7ed6 Mon Sep 17 00:00:00 2001 From: "Daniel A. Wozniak" Date: Sat, 17 Jun 2023 02:33:46 -0700 Subject: [PATCH 206/393] Import nacl with dlopen RTLD_DEEPBIND flag --- salt/utils/nacl.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/salt/utils/nacl.py b/salt/utils/nacl.py index 20239ff35f7..52e92180b2c 100644 --- a/salt/utils/nacl.py +++ b/salt/utils/nacl.py @@ -6,6 +6,7 @@ Common code shared between the nacl module and runner. import base64 import logging import os +import sys import salt.syspaths import salt.utils.files @@ -19,6 +20,16 @@ log = logging.getLogger(__name__) REQ_ERROR = None +dlopen = hasattr(sys, "getdlopenflags") +if dlopen: + dlflags = sys.getdlopenflags() + # Use RTDL_DEEPBIND in case pyzmq was compiled with ZMQ_USE_TWEETNACL. This is + # needed because pyzmq imports libzmq with RTLD_GLOBAL. + if hasattr(os, "RTLD_DEEPBIND"): + flags = os.RTLD_DEEPBIND | dlflags + else: + flags = dlflags + sys.setdlopenflags(dlflags) try: import nacl.public import nacl.secret @@ -26,6 +37,9 @@ except (ImportError, OSError) as e: REQ_ERROR = ( "PyNaCl import error, perhaps missing python PyNaCl package or should update." ) +finally: + if dlopen: + sys.setdlopenflags(dlflags) __virtualname__ = "nacl" From 8d8834428af9f56afd480366baef1c6075836d7c Mon Sep 17 00:00:00 2001 From: "Daniel A. Wozniak" Date: Mon, 19 Jun 2023 16:14:11 -0700 Subject: [PATCH 207/393] Add import hook for nacl --- salt/__init__.py | 56 ++++++++++++++++++++++++++++++++++++++++------ salt/utils/nacl.py | 13 ----------- 2 files changed, 49 insertions(+), 20 deletions(-) diff --git a/salt/__init__.py b/salt/__init__.py index 30880b10acc..d843a5cc5f7 100644 --- a/salt/__init__.py +++ b/salt/__init__.py @@ -5,6 +5,8 @@ Salt package import importlib import sys import warnings +import logging +log = logging.getLogger() if sys.version_info < (3,): sys.stderr.write( @@ -16,6 +18,7 @@ USE_VENDORED_TORNADO = True class TornadoImporter: + def find_module(self, module_name, package_path=None): if USE_VENDORED_TORNADO: if module_name.startswith("tornado"): @@ -25,24 +28,63 @@ class TornadoImporter: return self return None - def load_module(self, name): + def create_module(self, spec): if USE_VENDORED_TORNADO: - mod = importlib.import_module("salt.ext.{}".format(name)) + mod = importlib.import_module("salt.ext.{}".format(sepc.name)) else: # Remove 'salt.ext.' from the module - mod = importlib.import_module(name[9:]) + mod = importlib.import_module(sepc.name[9:]) sys.modules[name] = mod return mod - def create_module(self, spec): - return self.load_module(spec.name) - def exec_module(self, module): + log.error("exec_module %r", module) return None +class NaclImporter: + """ + Import hook to force PyNaCl to perform dlopen on libsodium with the + RTLD_DEEPBIND flag. This is to work around an issue where pyzmq does a dlopen + with RTLD_GLOBAL which the causes calls to libsodium to resolve to + tweetnacl when it's been bundled with pyzmq. + + See: https://github.com/zeromq/pyzmq/issues/1878 + """ + loading = False + + def find_module(self, module_name, package_path=None): + if not NaclImporter.loading and module_name == "nacl": + NaclImporter.loading = True + return self + return None + + def create_module(self, spec): + dlopen = hasattr(sys, "getdlopenflags") + if dlopen: + dlflags = sys.getdlopenflags() + # Use RTDL_DEEPBIND in case pyzmq was compiled with ZMQ_USE_TWEETNACL. This is + # needed because pyzmq imports libzmq with RTLD_GLOBAL. + if hasattr(os, "RTLD_DEEPBIND"): + flags = os.RTLD_DEEPBIND | dlflags + else: + flags = dlflags + sys.setdlopenflags(dlflags) + try: + mod = importlib.import_module(spec.name) + finally: + if dlopen: + sys.setdlopenflags(dlflags) + NaclImporter.loading = False + sys.modules[name] = mod + return mod + + def exec_module(self, module): + log.error("exec_module %r", module) + return None + # Try our importer first -sys.meta_path = [TornadoImporter()] + sys.meta_path +sys.meta_path = [TornadoImporter(), NaclImporter] + sys.meta_path # All salt related deprecation warnings should be shown once each! diff --git a/salt/utils/nacl.py b/salt/utils/nacl.py index 52e92180b2c..7ab66d09ad4 100644 --- a/salt/utils/nacl.py +++ b/salt/utils/nacl.py @@ -20,16 +20,6 @@ log = logging.getLogger(__name__) REQ_ERROR = None -dlopen = hasattr(sys, "getdlopenflags") -if dlopen: - dlflags = sys.getdlopenflags() - # Use RTDL_DEEPBIND in case pyzmq was compiled with ZMQ_USE_TWEETNACL. This is - # needed because pyzmq imports libzmq with RTLD_GLOBAL. - if hasattr(os, "RTLD_DEEPBIND"): - flags = os.RTLD_DEEPBIND | dlflags - else: - flags = dlflags - sys.setdlopenflags(dlflags) try: import nacl.public import nacl.secret @@ -37,9 +27,6 @@ except (ImportError, OSError) as e: REQ_ERROR = ( "PyNaCl import error, perhaps missing python PyNaCl package or should update." ) -finally: - if dlopen: - sys.setdlopenflags(dlflags) __virtualname__ = "nacl" From 678ff5a2c372a72ef634ee046ac76b24b88f811c Mon Sep 17 00:00:00 2001 From: "Daniel A. Wozniak" Date: Tue, 20 Jun 2023 08:42:39 -0700 Subject: [PATCH 208/393] Add import hook for nacl --- salt/__init__.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/salt/__init__.py b/salt/__init__.py index d843a5cc5f7..8968a70da98 100644 --- a/salt/__init__.py +++ b/salt/__init__.py @@ -3,9 +3,11 @@ Salt package """ import importlib +import logging +import os import sys import warnings -import logging + log = logging.getLogger() if sys.version_info < (3,): @@ -18,7 +20,6 @@ USE_VENDORED_TORNADO = True class TornadoImporter: - def find_module(self, module_name, package_path=None): if USE_VENDORED_TORNADO: if module_name.startswith("tornado"): @@ -30,11 +31,11 @@ class TornadoImporter: def create_module(self, spec): if USE_VENDORED_TORNADO: - mod = importlib.import_module("salt.ext.{}".format(sepc.name)) + mod = importlib.import_module("salt.ext.{}".format(spec.name)) else: # Remove 'salt.ext.' from the module - mod = importlib.import_module(sepc.name[9:]) - sys.modules[name] = mod + mod = importlib.import_module(spec.name[9:]) + sys.modules[spec.name] = mod return mod def exec_module(self, module): @@ -51,6 +52,7 @@ class NaclImporter: See: https://github.com/zeromq/pyzmq/issues/1878 """ + loading = False def find_module(self, module_name, package_path=None): @@ -76,13 +78,14 @@ class NaclImporter: if dlopen: sys.setdlopenflags(dlflags) NaclImporter.loading = False - sys.modules[name] = mod + sys.modules[spec.name] = mod return mod def exec_module(self, module): log.error("exec_module %r", module) return None + # Try our importer first sys.meta_path = [TornadoImporter(), NaclImporter] + sys.meta_path From ae65e160ba8e7d2cb0277935bae7df910d23ad12 Mon Sep 17 00:00:00 2001 From: "Daniel A. Wozniak" Date: Tue, 20 Jun 2023 08:53:34 -0700 Subject: [PATCH 209/393] Fix typo --- salt/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/salt/__init__.py b/salt/__init__.py index 8968a70da98..651145d02e7 100644 --- a/salt/__init__.py +++ b/salt/__init__.py @@ -71,7 +71,7 @@ class NaclImporter: flags = os.RTLD_DEEPBIND | dlflags else: flags = dlflags - sys.setdlopenflags(dlflags) + sys.setdlopenflags(flags) try: mod = importlib.import_module(spec.name) finally: From 48359504f4c87ecf1ce8150d30dfab4fedca1798 Mon Sep 17 00:00:00 2001 From: "Daniel A. Wozniak" Date: Tue, 20 Jun 2023 13:55:59 -0700 Subject: [PATCH 210/393] Fix warts in patch and linter errors --- salt/__init__.py | 5 +++-- salt/utils/nacl.py | 1 - 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/salt/__init__.py b/salt/__init__.py index 651145d02e7..29b290d1512 100644 --- a/salt/__init__.py +++ b/salt/__init__.py @@ -56,7 +56,8 @@ class NaclImporter: loading = False def find_module(self, module_name, package_path=None): - if not NaclImporter.loading and module_name == "nacl": + print(f"{self} {module_name}") + if not NaclImporter.loading and module_name.startswith("nacl"): NaclImporter.loading = True return self return None @@ -87,7 +88,7 @@ class NaclImporter: # Try our importer first -sys.meta_path = [TornadoImporter(), NaclImporter] + sys.meta_path +sys.meta_path = [TornadoImporter(), NaclImporter()] + sys.meta_path # All salt related deprecation warnings should be shown once each! diff --git a/salt/utils/nacl.py b/salt/utils/nacl.py index 7ab66d09ad4..20239ff35f7 100644 --- a/salt/utils/nacl.py +++ b/salt/utils/nacl.py @@ -6,7 +6,6 @@ Common code shared between the nacl module and runner. import base64 import logging import os -import sys import salt.syspaths import salt.utils.files From 28e2ac4e601c2037d552944dfeec013192f04020 Mon Sep 17 00:00:00 2001 From: "Daniel A. Wozniak" Date: Wed, 21 Jun 2023 09:10:12 -0700 Subject: [PATCH 211/393] Remove debug print --- salt/__init__.py | 1 - 1 file changed, 1 deletion(-) diff --git a/salt/__init__.py b/salt/__init__.py index 29b290d1512..14c7235268f 100644 --- a/salt/__init__.py +++ b/salt/__init__.py @@ -56,7 +56,6 @@ class NaclImporter: loading = False def find_module(self, module_name, package_path=None): - print(f"{self} {module_name}") if not NaclImporter.loading and module_name.startswith("nacl"): NaclImporter.loading = True return self From 497b9b117d720b4e9e5a2892d7107ca4180bb286 Mon Sep 17 00:00:00 2001 From: David Murphy < dmurphy@saltstack.com> Date: Wed, 21 Jun 2023 13:24:52 -0600 Subject: [PATCH 212/393] Remove debig log statements and update immutables version used --- requirements/static/ci/common.in | 1 + requirements/static/ci/py3.10/cloud.txt | 4 +++- requirements/static/ci/py3.10/darwin.txt | 6 ++++-- requirements/static/ci/py3.10/docs.txt | 2 +- requirements/static/ci/py3.10/freebsd.txt | 6 ++++-- requirements/static/ci/py3.10/lint.txt | 4 +++- requirements/static/ci/py3.10/linux.txt | 6 ++++-- requirements/static/ci/py3.10/windows.txt | 6 ++++-- requirements/static/ci/py3.7/cloud.txt | 4 +++- requirements/static/ci/py3.7/docs.txt | 3 ++- requirements/static/ci/py3.7/freebsd.txt | 7 +++++-- requirements/static/ci/py3.7/lint.txt | 4 +++- requirements/static/ci/py3.7/linux.txt | 7 +++++-- requirements/static/ci/py3.7/windows.txt | 7 +++++-- requirements/static/ci/py3.8/cloud.txt | 4 +++- requirements/static/ci/py3.8/docs.txt | 2 +- requirements/static/ci/py3.8/freebsd.txt | 6 ++++-- requirements/static/ci/py3.8/lint.txt | 4 +++- requirements/static/ci/py3.8/linux.txt | 6 ++++-- requirements/static/ci/py3.8/windows.txt | 6 ++++-- requirements/static/ci/py3.9/cloud.txt | 4 +++- requirements/static/ci/py3.9/darwin.txt | 6 ++++-- requirements/static/ci/py3.9/docs.txt | 2 +- requirements/static/ci/py3.9/freebsd.txt | 6 ++++-- requirements/static/ci/py3.9/lint.txt | 4 +++- requirements/static/ci/py3.9/linux.txt | 6 ++++-- requirements/static/ci/py3.9/windows.txt | 6 ++++-- tests/pytests/unit/utils/test_nacl.py | 8 -------- 28 files changed, 89 insertions(+), 48 deletions(-) diff --git a/requirements/static/ci/common.in b/requirements/static/ci/common.in index ba08f698854..eb4a6cfb615 100644 --- a/requirements/static/ci/common.in +++ b/requirements/static/ci/common.in @@ -17,6 +17,7 @@ dnspython docker etcd3-py==0.1.6 ; python_version >= '3.6' gitpython>=3.1.30; python_version >= '3.7' +immutables>=0.19 jmespath jsonschema junos-eznc; sys_platform != 'win32' and python_version <= '3.10' diff --git a/requirements/static/ci/py3.10/cloud.txt b/requirements/static/ci/py3.10/cloud.txt index 1fee2a7de6a..a64c17d4c04 100644 --- a/requirements/static/ci/py3.10/cloud.txt +++ b/requirements/static/ci/py3.10/cloud.txt @@ -442,7 +442,9 @@ idna==2.8 # requests # yarl immutables==0.19 - # via contextvars + # via + # -r requirements/static/ci/common.in + # contextvars importlib-metadata==6.0.0 # via -r requirements/static/pkg/linux.in iniconfig==1.1.1 diff --git a/requirements/static/ci/py3.10/darwin.txt b/requirements/static/ci/py3.10/darwin.txt index 034d8bcdd4d..bfa407c3547 100644 --- a/requirements/static/ci/py3.10/darwin.txt +++ b/requirements/static/ci/py3.10/darwin.txt @@ -444,8 +444,10 @@ idna==2.8 # etcd3-py # requests # yarl -immutables==0.15 - # via contextvars +immutables==0.19 + # via + # -r requirements/static/ci/common.in + # contextvars importlib-metadata==6.0.0 # via -r requirements/darwin.txt iniconfig==1.0.1 diff --git a/requirements/static/ci/py3.10/docs.txt b/requirements/static/ci/py3.10/docs.txt index 588b8682f56..f7e45290bec 100644 --- a/requirements/static/ci/py3.10/docs.txt +++ b/requirements/static/ci/py3.10/docs.txt @@ -40,7 +40,7 @@ idna==2.8 # requests imagesize==1.4.1 # via sphinx -immutables==0.15 +immutables==0.19 # via # -c requirements/static/ci/py3.10/linux.txt # contextvars diff --git a/requirements/static/ci/py3.10/freebsd.txt b/requirements/static/ci/py3.10/freebsd.txt index 600c4657380..6fc2305b345 100644 --- a/requirements/static/ci/py3.10/freebsd.txt +++ b/requirements/static/ci/py3.10/freebsd.txt @@ -439,8 +439,10 @@ idna==2.8 # etcd3-py # requests # yarl -immutables==0.15 - # via contextvars +immutables==0.19 + # via + # -r requirements/static/ci/common.in + # contextvars importlib-metadata==6.0.0 # via -r requirements/static/pkg/freebsd.in iniconfig==1.0.1 diff --git a/requirements/static/ci/py3.10/lint.txt b/requirements/static/ci/py3.10/lint.txt index 2f0f5367e7e..fa3c194494b 100644 --- a/requirements/static/ci/py3.10/lint.txt +++ b/requirements/static/ci/py3.10/lint.txt @@ -439,7 +439,9 @@ idna==3.2 # requests # yarl immutables==0.19 - # via contextvars + # via + # -r requirements/static/ci/common.in + # contextvars importlib-metadata==6.0.0 # via -r requirements/static/pkg/linux.in ipaddress==1.0.23 diff --git a/requirements/static/ci/py3.10/linux.txt b/requirements/static/ci/py3.10/linux.txt index 42b2e9ed7bb..0210afbab54 100644 --- a/requirements/static/ci/py3.10/linux.txt +++ b/requirements/static/ci/py3.10/linux.txt @@ -454,8 +454,10 @@ idna==2.8 # etcd3-py # requests # yarl -immutables==0.15 - # via contextvars +immutables==0.19 + # via + # -r requirements/static/ci/common.in + # contextvars importlib-metadata==6.0.0 # via -r requirements/static/pkg/linux.in iniconfig==1.0.1 diff --git a/requirements/static/ci/py3.10/windows.txt b/requirements/static/ci/py3.10/windows.txt index 654f358af88..e08e1f5a113 100644 --- a/requirements/static/ci/py3.10/windows.txt +++ b/requirements/static/ci/py3.10/windows.txt @@ -124,8 +124,10 @@ idna==2.8 # etcd3-py # requests # yarl -immutables==0.15 - # via contextvars +immutables==0.19 + # via + # -r requirements/static/ci/common.in + # contextvars importlib-metadata==6.0.0 # via -r requirements/windows.txt iniconfig==1.0.1 diff --git a/requirements/static/ci/py3.7/cloud.txt b/requirements/static/ci/py3.7/cloud.txt index 33547d20175..94d849e0427 100644 --- a/requirements/static/ci/py3.7/cloud.txt +++ b/requirements/static/ci/py3.7/cloud.txt @@ -453,7 +453,9 @@ idna==2.8 # requests # yarl immutables==0.19 - # via contextvars + # via + # -r requirements/static/ci/common.in + # contextvars importlib-metadata==4.8.1 # via # -r requirements/static/pkg/linux.in diff --git a/requirements/static/ci/py3.7/docs.txt b/requirements/static/ci/py3.7/docs.txt index 31209a994b2..c623580e104 100644 --- a/requirements/static/ci/py3.7/docs.txt +++ b/requirements/static/ci/py3.7/docs.txt @@ -40,7 +40,7 @@ idna==2.8 # requests imagesize==1.2.0 # via sphinx -immutables==0.15 +immutables==0.19 # via # -c requirements/static/ci/py3.7/linux.txt # contextvars @@ -188,6 +188,7 @@ tempora==4.1.1 typing-extensions==3.10.0.0 # via # -c requirements/static/ci/py3.7/linux.txt + # immutables # importlib-metadata # markdown-it-py # myst-docutils diff --git a/requirements/static/ci/py3.7/freebsd.txt b/requirements/static/ci/py3.7/freebsd.txt index 8b0fa6828af..2e017a96077 100644 --- a/requirements/static/ci/py3.7/freebsd.txt +++ b/requirements/static/ci/py3.7/freebsd.txt @@ -450,8 +450,10 @@ idna==2.8 # etcd3-py # requests # yarl -immutables==0.15 - # via contextvars +immutables==0.19 + # via + # -r requirements/static/ci/common.in + # contextvars importlib-metadata==4.6.4 # via # -r requirements/static/pkg/freebsd.in @@ -891,6 +893,7 @@ typing-extensions==3.10.0.0 # aiohttp # async-timeout # gitpython + # immutables # importlib-metadata # pytest-shell-utilities # pytest-system-statistics diff --git a/requirements/static/ci/py3.7/lint.txt b/requirements/static/ci/py3.7/lint.txt index c66d61860e0..71ecaa8fd9c 100644 --- a/requirements/static/ci/py3.7/lint.txt +++ b/requirements/static/ci/py3.7/lint.txt @@ -452,7 +452,9 @@ idna==3.2 # requests # yarl immutables==0.19 - # via contextvars + # via + # -r requirements/static/ci/common.in + # contextvars importlib-metadata==4.6.4 # via # -r requirements/static/pkg/linux.in diff --git a/requirements/static/ci/py3.7/linux.txt b/requirements/static/ci/py3.7/linux.txt index ec04e48a41a..f61f282aec7 100644 --- a/requirements/static/ci/py3.7/linux.txt +++ b/requirements/static/ci/py3.7/linux.txt @@ -465,8 +465,10 @@ idna==2.8 # etcd3-py # requests # yarl -immutables==0.15 - # via contextvars +immutables==0.19 + # via + # -r requirements/static/ci/common.in + # contextvars importlib-metadata==4.6.4 # via # -r requirements/static/pkg/linux.in @@ -939,6 +941,7 @@ typing-extensions==3.10.0.0 # aiohttp # async-timeout # gitpython + # immutables # importlib-metadata # pytest-shell-utilities # pytest-system-statistics diff --git a/requirements/static/ci/py3.7/windows.txt b/requirements/static/ci/py3.7/windows.txt index f0fae401318..adc89147097 100644 --- a/requirements/static/ci/py3.7/windows.txt +++ b/requirements/static/ci/py3.7/windows.txt @@ -129,8 +129,10 @@ idna==2.8 # etcd3-py # requests # yarl -immutables==0.15 - # via contextvars +immutables==0.19 + # via + # -r requirements/static/ci/common.in + # contextvars importlib-metadata==4.6.4 # via # -r requirements/windows.txt @@ -404,6 +406,7 @@ typing-extensions==4.2.0 # aiohttp # async-timeout # gitpython + # immutables # importlib-metadata # pytest-shell-utilities # pytest-system-statistics diff --git a/requirements/static/ci/py3.8/cloud.txt b/requirements/static/ci/py3.8/cloud.txt index 83db00c3dc0..91fe5a6c732 100644 --- a/requirements/static/ci/py3.8/cloud.txt +++ b/requirements/static/ci/py3.8/cloud.txt @@ -452,7 +452,9 @@ idna==2.8 # requests # yarl immutables==0.19 - # via contextvars + # via + # -r requirements/static/ci/common.in + # contextvars importlib-metadata==4.8.1 # via -r requirements/static/pkg/linux.in iniconfig==1.1.1 diff --git a/requirements/static/ci/py3.8/docs.txt b/requirements/static/ci/py3.8/docs.txt index da96a0c3bfb..5f7b7d17d02 100644 --- a/requirements/static/ci/py3.8/docs.txt +++ b/requirements/static/ci/py3.8/docs.txt @@ -40,7 +40,7 @@ idna==2.8 # requests imagesize==1.2.0 # via sphinx -immutables==0.15 +immutables==0.19 # via # -c requirements/static/ci/py3.8/linux.txt # contextvars diff --git a/requirements/static/ci/py3.8/freebsd.txt b/requirements/static/ci/py3.8/freebsd.txt index e0c84876c57..f918c019285 100644 --- a/requirements/static/ci/py3.8/freebsd.txt +++ b/requirements/static/ci/py3.8/freebsd.txt @@ -449,8 +449,10 @@ idna==2.8 # etcd3-py # requests # yarl -immutables==0.15 - # via contextvars +immutables==0.19 + # via + # -r requirements/static/ci/common.in + # contextvars importlib-metadata==4.6.4 # via -r requirements/static/pkg/freebsd.in iniconfig==1.0.1 diff --git a/requirements/static/ci/py3.8/lint.txt b/requirements/static/ci/py3.8/lint.txt index cb505238dd9..485371d0803 100644 --- a/requirements/static/ci/py3.8/lint.txt +++ b/requirements/static/ci/py3.8/lint.txt @@ -451,7 +451,9 @@ idna==3.2 # requests # yarl immutables==0.19 - # via contextvars + # via + # -r requirements/static/ci/common.in + # contextvars importlib-metadata==4.6.4 # via -r requirements/static/pkg/linux.in ipaddress==1.0.23 diff --git a/requirements/static/ci/py3.8/linux.txt b/requirements/static/ci/py3.8/linux.txt index 8c068b8ee1e..e20e8814c6b 100644 --- a/requirements/static/ci/py3.8/linux.txt +++ b/requirements/static/ci/py3.8/linux.txt @@ -464,8 +464,10 @@ idna==2.8 # etcd3-py # requests # yarl -immutables==0.15 - # via contextvars +immutables==0.19 + # via + # -r requirements/static/ci/common.in + # contextvars importlib-metadata==4.6.4 # via -r requirements/static/pkg/linux.in iniconfig==1.0.1 diff --git a/requirements/static/ci/py3.8/windows.txt b/requirements/static/ci/py3.8/windows.txt index 8206b905138..30cbe6e463b 100644 --- a/requirements/static/ci/py3.8/windows.txt +++ b/requirements/static/ci/py3.8/windows.txt @@ -126,8 +126,10 @@ idna==2.8 # etcd3-py # requests # yarl -immutables==0.15 - # via contextvars +immutables==0.19 + # via + # -r requirements/static/ci/common.in + # contextvars importlib-metadata==4.6.4 # via -r requirements/windows.txt iniconfig==1.0.1 diff --git a/requirements/static/ci/py3.9/cloud.txt b/requirements/static/ci/py3.9/cloud.txt index 89c23c15d59..33bb5204b5d 100644 --- a/requirements/static/ci/py3.9/cloud.txt +++ b/requirements/static/ci/py3.9/cloud.txt @@ -452,7 +452,9 @@ idna==2.8 # requests # yarl immutables==0.19 - # via contextvars + # via + # -r requirements/static/ci/common.in + # contextvars importlib-metadata==6.0.0 # via -r requirements/static/pkg/linux.in iniconfig==1.1.1 diff --git a/requirements/static/ci/py3.9/darwin.txt b/requirements/static/ci/py3.9/darwin.txt index 609e1623e07..d9f41bfa599 100644 --- a/requirements/static/ci/py3.9/darwin.txt +++ b/requirements/static/ci/py3.9/darwin.txt @@ -454,8 +454,10 @@ idna==2.8 # etcd3-py # requests # yarl -immutables==0.15 - # via contextvars +immutables==0.19 + # via + # -r requirements/static/ci/common.in + # contextvars importlib-metadata==6.0.0 # via -r requirements/darwin.txt iniconfig==1.0.1 diff --git a/requirements/static/ci/py3.9/docs.txt b/requirements/static/ci/py3.9/docs.txt index 772a37c357a..ff85f0537d8 100644 --- a/requirements/static/ci/py3.9/docs.txt +++ b/requirements/static/ci/py3.9/docs.txt @@ -40,7 +40,7 @@ idna==2.8 # requests imagesize==1.4.1 # via sphinx -immutables==0.15 +immutables==0.19 # via # -c requirements/static/ci/py3.9/linux.txt # contextvars diff --git a/requirements/static/ci/py3.9/freebsd.txt b/requirements/static/ci/py3.9/freebsd.txt index 6c7c62d8a65..d10713b1f08 100644 --- a/requirements/static/ci/py3.9/freebsd.txt +++ b/requirements/static/ci/py3.9/freebsd.txt @@ -449,8 +449,10 @@ idna==2.8 # etcd3-py # requests # yarl -immutables==0.15 - # via contextvars +immutables==0.19 + # via + # -r requirements/static/ci/common.in + # contextvars importlib-metadata==6.0.0 # via -r requirements/static/pkg/freebsd.in iniconfig==1.0.1 diff --git a/requirements/static/ci/py3.9/lint.txt b/requirements/static/ci/py3.9/lint.txt index 6b0791b6efc..06b369a679b 100644 --- a/requirements/static/ci/py3.9/lint.txt +++ b/requirements/static/ci/py3.9/lint.txt @@ -449,7 +449,9 @@ idna==3.2 # requests # yarl immutables==0.19 - # via contextvars + # via + # -r requirements/static/ci/common.in + # contextvars importlib-metadata==6.0.0 # via -r requirements/static/pkg/linux.in ipaddress==1.0.23 diff --git a/requirements/static/ci/py3.9/linux.txt b/requirements/static/ci/py3.9/linux.txt index f46c58999e3..e62627f4f80 100644 --- a/requirements/static/ci/py3.9/linux.txt +++ b/requirements/static/ci/py3.9/linux.txt @@ -466,8 +466,10 @@ idna==2.8 # etcd3-py # requests # yarl -immutables==0.15 - # via contextvars +immutables==0.19 + # via + # -r requirements/static/ci/common.in + # contextvars importlib-metadata==6.0.0 # via -r requirements/static/pkg/linux.in iniconfig==1.0.1 diff --git a/requirements/static/ci/py3.9/windows.txt b/requirements/static/ci/py3.9/windows.txt index 38cfc73db51..b166cb729aa 100644 --- a/requirements/static/ci/py3.9/windows.txt +++ b/requirements/static/ci/py3.9/windows.txt @@ -126,8 +126,10 @@ idna==2.8 # etcd3-py # requests # yarl -immutables==0.15 - # via contextvars +immutables==0.19 + # via + # -r requirements/static/ci/common.in + # contextvars importlib-metadata==6.0.0 # via -r requirements/windows.txt iniconfig==1.0.1 diff --git a/tests/pytests/unit/utils/test_nacl.py b/tests/pytests/unit/utils/test_nacl.py index 2413116c4df..78b77e0f1f1 100644 --- a/tests/pytests/unit/utils/test_nacl.py +++ b/tests/pytests/unit/utils/test_nacl.py @@ -1,7 +1,6 @@ """ Unit tests for the salt.utils.nacl module """ -import logging import os import pytest @@ -18,8 +17,6 @@ try: except (ImportError, OSError, AttributeError): HAS_PYNACL = False -log = logging.getLogger(__name__) - @pytest.mark.skipif( not HAS_PYNACL, reason="skipping test_nacl, reason=PyNaCl is unavailable" @@ -40,7 +37,6 @@ def test_keygen(): Note: nacl.keygen returns base64 encoded values """ ret = nacl.keygen() - log.warning(f"DGM test_keygen ret '{ret}'") assert "sk" in ret assert "pk" in ret return ret @@ -90,7 +86,6 @@ def test_enc_keyfile(test_keygen): test nacl.enc function with keyfile and pk_file set """ - log.warning(f"DGM test_enc_keyfile test_keygen '{test_keygen}'") with temp_file("test_enc_keyfile") as fpath: with salt.utils.files.fopen(fpath, "wb") as wfh: wfh.write(test_keygen["sk"]) @@ -102,7 +97,6 @@ def test_enc_keyfile(test_keygen): "keyfile": str(fpath), "pk_file": str(fpath) + ".pub", } - log.warning(f"DGM test_enc_keyfile nacl enc with kwargs '{kwargs}'") ret = nacl.enc("blah", **kwargs) assert isinstance(ret, bytes) salt.utils.files.remove(str(fpath) + ".pub") @@ -113,7 +107,6 @@ def test_enc_sk_file(test_keygen): test nacl.enc function with sk_file and pk_file set """ - log.warning(f"DGM test_enc_sk_file test_keygen '{test_keygen}'") with temp_file("test_enc_sk_file") as fpath: with salt.utils.files.fopen(fpath, "wb") as wfh: wfh.write(test_keygen["sk"]) @@ -125,7 +118,6 @@ def test_enc_sk_file(test_keygen): "sk_file": str(fpath), "pk_file": str(fpath) + ".pub", } - log.warning(f"DGM test_enc_sk_file nacl enc with kwargs '{kwargs}'") ret = nacl.enc("blah", **kwargs) assert isinstance(ret, bytes) salt.utils.files.remove(str(fpath) + ".pub") From 4f868389ae8d36fcf36ea88877b8c7ec18908307 Mon Sep 17 00:00:00 2001 From: David Murphy < dmurphy@saltstack.com> Date: Thu, 22 Jun 2023 14:27:59 -0600 Subject: [PATCH 213/393] Updated pylint to 2.17.4 from 2.4.4, needs support for later versions of Python 3 --- requirements/static/ci/lint.in | 2 +- requirements/static/ci/py3.10/lint.txt | 17 +++++++++++++---- requirements/static/ci/py3.7/lint.txt | 19 ++++++++++++++----- requirements/static/ci/py3.8/lint.txt | 19 +++++++++++++++---- requirements/static/ci/py3.9/lint.txt | 19 +++++++++++++++---- 5 files changed, 58 insertions(+), 18 deletions(-) diff --git a/requirements/static/ci/lint.in b/requirements/static/ci/lint.in index 7b568d61d38..1727d54d952 100644 --- a/requirements/static/ci/lint.in +++ b/requirements/static/ci/lint.in @@ -1,4 +1,4 @@ # Lint requirements -pylint==2.4.4 +pylint==2.17.4 SaltPyLint>=v2020.9.28 toml diff --git a/requirements/static/ci/py3.10/lint.txt b/requirements/static/ci/py3.10/lint.txt index fa3c194494b..25f94d0941d 100644 --- a/requirements/static/ci/py3.10/lint.txt +++ b/requirements/static/ci/py3.10/lint.txt @@ -24,7 +24,7 @@ asn1crypto==1.4.0 # via # certvalidator # oscrypto -astroid==2.3.3 +astroid==2.15.5 # via pylint async-timeout==4.0.2 # via aiohttp @@ -403,6 +403,8 @@ cryptography==41.0.2 # paramiko # pyopenssl # vcert +dill==0.3.6 + # via pylint distlib==0.3.2 # via virtualenv distro==1.6.0 @@ -639,7 +641,9 @@ passlib[bcrypt]==1.7.4 pathspec==0.9.0 # via yamllint platformdirs==2.2.0 - # via virtualenv + # via + # pylint + # virtualenv portend==2.7.1 # via cherrypy psutil==5.8.0 @@ -669,7 +673,7 @@ pyjwt==2.4.0 # via # adal # twilio -pylint==2.4.4 +pylint==2.17.4 # via # -r requirements/static/ci/lint.in # saltpylint @@ -782,7 +786,6 @@ setproctitle==1.3.2 six==1.16.0 # via # apscheduler - # astroid # bcrypt # cassandra-driver # cheroot @@ -823,12 +826,18 @@ toml==0.10.2 # via # -r requirements/static/ci/common.in # -r requirements/static/ci/lint.in +tomli==2.0.1 + # via pylint +tomlkit==0.11.8 + # via pylint tornado==6.1 # via python-telegram-bot transitions==0.8.8 # via junos-eznc twilio==7.9.2 # via -r requirements/static/ci/linux.in +typing-extensions==4.6.3 + # via astroid tzlocal==3.0 # via apscheduler urllib3==1.26.6 diff --git a/requirements/static/ci/py3.7/lint.txt b/requirements/static/ci/py3.7/lint.txt index 71ecaa8fd9c..9549b66f203 100644 --- a/requirements/static/ci/py3.7/lint.txt +++ b/requirements/static/ci/py3.7/lint.txt @@ -24,7 +24,7 @@ asn1crypto==1.4.0 # via # certvalidator # oscrypto -astroid==2.3.3 +astroid==2.15.5 # via pylint async-timeout==4.0.2 # via aiohttp @@ -411,6 +411,8 @@ cryptography==41.0.2 # paramiko # pyopenssl # vcert +dill==0.3.6 + # via pylint distlib==0.3.2 # via virtualenv distro==1.6.0 @@ -682,7 +684,9 @@ passlib[bcrypt]==1.7.4 pathspec==0.9.0 # via yamllint platformdirs==2.2.0 - # via virtualenv + # via + # pylint + # virtualenv portend==2.7.1 # via cherrypy psutil==5.8.0 @@ -711,7 +715,7 @@ pyjwt==2.4.0 # via # adal # twilio -pylint==2.4.4 +pylint==2.17.4 # via # -r requirements/static/ci/lint.in # saltpylint @@ -831,7 +835,6 @@ setproctitle==1.3.2 six==1.16.0 # via # apscheduler - # astroid # bcrypt # cassandra-driver # cheroot @@ -880,6 +883,10 @@ toml==0.10.2 # via # -r requirements/static/ci/common.in # -r requirements/static/ci/lint.in +tomli==2.0.1 + # via pylint +tomlkit==0.11.8 + # via pylint tornado==6.1 # via python-telegram-bot transitions==0.8.8 @@ -888,13 +895,15 @@ twilio==7.9.2 # via -r requirements/static/ci/linux.in typed-ast==1.4.1 # via astroid -typing-extensions==3.10.0.0 +typing-extensions==4.6.3 # via # aiohttp + # astroid # async-timeout # gitpython # immutables # importlib-metadata + # pylint # yarl tzlocal==3.0 # via apscheduler diff --git a/requirements/static/ci/py3.8/lint.txt b/requirements/static/ci/py3.8/lint.txt index 485371d0803..ee5748273ab 100644 --- a/requirements/static/ci/py3.8/lint.txt +++ b/requirements/static/ci/py3.8/lint.txt @@ -24,7 +24,7 @@ asn1crypto==1.4.0 # via # certvalidator # oscrypto -astroid==2.3.3 +astroid==2.15.5 # via pylint async-timeout==4.0.2 # via aiohttp @@ -410,6 +410,8 @@ cryptography==41.0.2 # paramiko # pyopenssl # vcert +dill==0.3.6 + # via pylint distlib==0.3.2 # via virtualenv distro==1.6.0 @@ -674,7 +676,9 @@ passlib[bcrypt]==1.7.4 pathspec==0.9.0 # via yamllint platformdirs==2.2.0 - # via virtualenv + # via + # pylint + # virtualenv portend==2.7.1 # via cherrypy psutil==5.8.0 @@ -703,7 +707,7 @@ pyjwt==2.4.0 # via # adal # twilio -pylint==2.4.4 +pylint==2.17.4 # via # -r requirements/static/ci/lint.in # saltpylint @@ -823,7 +827,6 @@ setproctitle==1.3.2 six==1.16.0 # via # apscheduler - # astroid # bcrypt # cassandra-driver # cheroot @@ -872,12 +875,20 @@ toml==0.10.2 # via # -r requirements/static/ci/common.in # -r requirements/static/ci/lint.in +tomli==2.0.1 + # via pylint +tomlkit==0.11.8 + # via pylint tornado==6.1 # via python-telegram-bot transitions==0.8.8 # via junos-eznc twilio==7.9.2 # via -r requirements/static/ci/linux.in +typing-extensions==4.6.3 + # via + # astroid + # pylint tzlocal==3.0 # via apscheduler urllib3==1.26.6 diff --git a/requirements/static/ci/py3.9/lint.txt b/requirements/static/ci/py3.9/lint.txt index 06b369a679b..d2785193076 100644 --- a/requirements/static/ci/py3.9/lint.txt +++ b/requirements/static/ci/py3.9/lint.txt @@ -24,7 +24,7 @@ asn1crypto==1.4.0 # via # certvalidator # oscrypto -astroid==2.3.3 +astroid==2.15.5 # via pylint async-timeout==4.0.2 # via aiohttp @@ -408,6 +408,8 @@ cryptography==41.0.2 # paramiko # pyopenssl # vcert +dill==0.3.6 + # via pylint distlib==0.3.2 # via virtualenv distro==1.6.0 @@ -672,7 +674,9 @@ passlib[bcrypt]==1.7.4 pathspec==0.9.0 # via yamllint platformdirs==2.2.0 - # via virtualenv + # via + # pylint + # virtualenv portend==2.7.1 # via cherrypy psutil==5.8.0 @@ -704,7 +708,7 @@ pyjwt==2.4.0 # via # adal # twilio -pylint==2.4.4 +pylint==2.17.4 # via # -r requirements/static/ci/lint.in # saltpylint @@ -824,7 +828,6 @@ setproctitle==1.3.2 six==1.16.0 # via # apscheduler - # astroid # bcrypt # cassandra-driver # cheroot @@ -872,12 +875,20 @@ toml==0.10.2 # via # -r requirements/static/ci/common.in # -r requirements/static/ci/lint.in +tomli==2.0.1 + # via pylint +tomlkit==0.11.8 + # via pylint tornado==6.1 # via python-telegram-bot transitions==0.8.8 # via junos-eznc twilio==7.9.2 # via -r requirements/static/ci/linux.in +typing-extensions==4.6.3 + # via + # astroid + # pylint tzlocal==3.0 # via apscheduler urllib3==1.26.6 From 664bce9d0177af2863f692103279bb399192f9c2 Mon Sep 17 00:00:00 2001 From: David Murphy < dmurphy@saltstack.com> Date: Thu, 22 Jun 2023 14:47:33 -0600 Subject: [PATCH 214/393] Trying different versions of pylint to get past py3.8 issue --- requirements/static/ci/lint.in | 2 +- requirements/static/ci/py3.10/lint.txt | 17 ++++------------- requirements/static/ci/py3.7/lint.txt | 17 ++++------------- requirements/static/ci/py3.8/lint.txt | 19 ++++--------------- requirements/static/ci/py3.9/lint.txt | 19 ++++--------------- 5 files changed, 17 insertions(+), 57 deletions(-) diff --git a/requirements/static/ci/lint.in b/requirements/static/ci/lint.in index 1727d54d952..9c5a2fbce20 100644 --- a/requirements/static/ci/lint.in +++ b/requirements/static/ci/lint.in @@ -1,4 +1,4 @@ # Lint requirements -pylint==2.17.4 +pylint==2.5.3 SaltPyLint>=v2020.9.28 toml diff --git a/requirements/static/ci/py3.10/lint.txt b/requirements/static/ci/py3.10/lint.txt index 25f94d0941d..6237bcdbd29 100644 --- a/requirements/static/ci/py3.10/lint.txt +++ b/requirements/static/ci/py3.10/lint.txt @@ -24,7 +24,7 @@ asn1crypto==1.4.0 # via # certvalidator # oscrypto -astroid==2.15.5 +astroid==2.5 # via pylint async-timeout==4.0.2 # via aiohttp @@ -403,8 +403,6 @@ cryptography==41.0.2 # paramiko # pyopenssl # vcert -dill==0.3.6 - # via pylint distlib==0.3.2 # via virtualenv distro==1.6.0 @@ -641,9 +639,7 @@ passlib[bcrypt]==1.7.4 pathspec==0.9.0 # via yamllint platformdirs==2.2.0 - # via - # pylint - # virtualenv + # via virtualenv portend==2.7.1 # via cherrypy psutil==5.8.0 @@ -673,7 +669,7 @@ pyjwt==2.4.0 # via # adal # twilio -pylint==2.17.4 +pylint==2.5.3 # via # -r requirements/static/ci/lint.in # saltpylint @@ -826,18 +822,13 @@ toml==0.10.2 # via # -r requirements/static/ci/common.in # -r requirements/static/ci/lint.in -tomli==2.0.1 - # via pylint -tomlkit==0.11.8 - # via pylint + # pylint tornado==6.1 # via python-telegram-bot transitions==0.8.8 # via junos-eznc twilio==7.9.2 # via -r requirements/static/ci/linux.in -typing-extensions==4.6.3 - # via astroid tzlocal==3.0 # via apscheduler urllib3==1.26.6 diff --git a/requirements/static/ci/py3.7/lint.txt b/requirements/static/ci/py3.7/lint.txt index 9549b66f203..6fffbe6aca9 100644 --- a/requirements/static/ci/py3.7/lint.txt +++ b/requirements/static/ci/py3.7/lint.txt @@ -24,7 +24,7 @@ asn1crypto==1.4.0 # via # certvalidator # oscrypto -astroid==2.15.5 +astroid==2.5 # via pylint async-timeout==4.0.2 # via aiohttp @@ -411,8 +411,6 @@ cryptography==41.0.2 # paramiko # pyopenssl # vcert -dill==0.3.6 - # via pylint distlib==0.3.2 # via virtualenv distro==1.6.0 @@ -684,9 +682,7 @@ passlib[bcrypt]==1.7.4 pathspec==0.9.0 # via yamllint platformdirs==2.2.0 - # via - # pylint - # virtualenv + # via virtualenv portend==2.7.1 # via cherrypy psutil==5.8.0 @@ -715,7 +711,7 @@ pyjwt==2.4.0 # via # adal # twilio -pylint==2.17.4 +pylint==2.5.3 # via # -r requirements/static/ci/lint.in # saltpylint @@ -883,10 +879,7 @@ toml==0.10.2 # via # -r requirements/static/ci/common.in # -r requirements/static/ci/lint.in -tomli==2.0.1 - # via pylint -tomlkit==0.11.8 - # via pylint + # pylint tornado==6.1 # via python-telegram-bot transitions==0.8.8 @@ -898,12 +891,10 @@ typed-ast==1.4.1 typing-extensions==4.6.3 # via # aiohttp - # astroid # async-timeout # gitpython # immutables # importlib-metadata - # pylint # yarl tzlocal==3.0 # via apscheduler diff --git a/requirements/static/ci/py3.8/lint.txt b/requirements/static/ci/py3.8/lint.txt index ee5748273ab..23e5157087b 100644 --- a/requirements/static/ci/py3.8/lint.txt +++ b/requirements/static/ci/py3.8/lint.txt @@ -24,7 +24,7 @@ asn1crypto==1.4.0 # via # certvalidator # oscrypto -astroid==2.15.5 +astroid==2.5 # via pylint async-timeout==4.0.2 # via aiohttp @@ -410,8 +410,6 @@ cryptography==41.0.2 # paramiko # pyopenssl # vcert -dill==0.3.6 - # via pylint distlib==0.3.2 # via virtualenv distro==1.6.0 @@ -676,9 +674,7 @@ passlib[bcrypt]==1.7.4 pathspec==0.9.0 # via yamllint platformdirs==2.2.0 - # via - # pylint - # virtualenv + # via virtualenv portend==2.7.1 # via cherrypy psutil==5.8.0 @@ -707,7 +703,7 @@ pyjwt==2.4.0 # via # adal # twilio -pylint==2.17.4 +pylint==2.5.3 # via # -r requirements/static/ci/lint.in # saltpylint @@ -875,20 +871,13 @@ toml==0.10.2 # via # -r requirements/static/ci/common.in # -r requirements/static/ci/lint.in -tomli==2.0.1 - # via pylint -tomlkit==0.11.8 - # via pylint + # pylint tornado==6.1 # via python-telegram-bot transitions==0.8.8 # via junos-eznc twilio==7.9.2 # via -r requirements/static/ci/linux.in -typing-extensions==4.6.3 - # via - # astroid - # pylint tzlocal==3.0 # via apscheduler urllib3==1.26.6 diff --git a/requirements/static/ci/py3.9/lint.txt b/requirements/static/ci/py3.9/lint.txt index d2785193076..f0dd1a6036a 100644 --- a/requirements/static/ci/py3.9/lint.txt +++ b/requirements/static/ci/py3.9/lint.txt @@ -24,7 +24,7 @@ asn1crypto==1.4.0 # via # certvalidator # oscrypto -astroid==2.15.5 +astroid==2.5 # via pylint async-timeout==4.0.2 # via aiohttp @@ -408,8 +408,6 @@ cryptography==41.0.2 # paramiko # pyopenssl # vcert -dill==0.3.6 - # via pylint distlib==0.3.2 # via virtualenv distro==1.6.0 @@ -674,9 +672,7 @@ passlib[bcrypt]==1.7.4 pathspec==0.9.0 # via yamllint platformdirs==2.2.0 - # via - # pylint - # virtualenv + # via virtualenv portend==2.7.1 # via cherrypy psutil==5.8.0 @@ -708,7 +704,7 @@ pyjwt==2.4.0 # via # adal # twilio -pylint==2.17.4 +pylint==2.5.3 # via # -r requirements/static/ci/lint.in # saltpylint @@ -875,20 +871,13 @@ toml==0.10.2 # via # -r requirements/static/ci/common.in # -r requirements/static/ci/lint.in -tomli==2.0.1 - # via pylint -tomlkit==0.11.8 - # via pylint + # pylint tornado==6.1 # via python-telegram-bot transitions==0.8.8 # via junos-eznc twilio==7.9.2 # via -r requirements/static/ci/linux.in -typing-extensions==4.6.3 - # via - # astroid - # pylint tzlocal==3.0 # via apscheduler urllib3==1.26.6 From 016861ddaae9c89f60d67532f94b364440bee6c5 Mon Sep 17 00:00:00 2001 From: David Murphy < dmurphy@saltstack.com> Date: Thu, 22 Jun 2023 15:04:22 -0600 Subject: [PATCH 215/393] Revert pylint to version 2.4.4 --- requirements/static/ci/lint.in | 2 +- requirements/static/ci/py3.10/lint.txt | 6 +++--- requirements/static/ci/py3.7/lint.txt | 6 +++--- requirements/static/ci/py3.8/lint.txt | 6 +++--- requirements/static/ci/py3.9/lint.txt | 6 +++--- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/requirements/static/ci/lint.in b/requirements/static/ci/lint.in index 9c5a2fbce20..7b568d61d38 100644 --- a/requirements/static/ci/lint.in +++ b/requirements/static/ci/lint.in @@ -1,4 +1,4 @@ # Lint requirements -pylint==2.5.3 +pylint==2.4.4 SaltPyLint>=v2020.9.28 toml diff --git a/requirements/static/ci/py3.10/lint.txt b/requirements/static/ci/py3.10/lint.txt index 6237bcdbd29..fa3c194494b 100644 --- a/requirements/static/ci/py3.10/lint.txt +++ b/requirements/static/ci/py3.10/lint.txt @@ -24,7 +24,7 @@ asn1crypto==1.4.0 # via # certvalidator # oscrypto -astroid==2.5 +astroid==2.3.3 # via pylint async-timeout==4.0.2 # via aiohttp @@ -669,7 +669,7 @@ pyjwt==2.4.0 # via # adal # twilio -pylint==2.5.3 +pylint==2.4.4 # via # -r requirements/static/ci/lint.in # saltpylint @@ -782,6 +782,7 @@ setproctitle==1.3.2 six==1.16.0 # via # apscheduler + # astroid # bcrypt # cassandra-driver # cheroot @@ -822,7 +823,6 @@ toml==0.10.2 # via # -r requirements/static/ci/common.in # -r requirements/static/ci/lint.in - # pylint tornado==6.1 # via python-telegram-bot transitions==0.8.8 diff --git a/requirements/static/ci/py3.7/lint.txt b/requirements/static/ci/py3.7/lint.txt index 6fffbe6aca9..746ef57bfd5 100644 --- a/requirements/static/ci/py3.7/lint.txt +++ b/requirements/static/ci/py3.7/lint.txt @@ -24,7 +24,7 @@ asn1crypto==1.4.0 # via # certvalidator # oscrypto -astroid==2.5 +astroid==2.3.3 # via pylint async-timeout==4.0.2 # via aiohttp @@ -711,7 +711,7 @@ pyjwt==2.4.0 # via # adal # twilio -pylint==2.5.3 +pylint==2.4.4 # via # -r requirements/static/ci/lint.in # saltpylint @@ -831,6 +831,7 @@ setproctitle==1.3.2 six==1.16.0 # via # apscheduler + # astroid # bcrypt # cassandra-driver # cheroot @@ -879,7 +880,6 @@ toml==0.10.2 # via # -r requirements/static/ci/common.in # -r requirements/static/ci/lint.in - # pylint tornado==6.1 # via python-telegram-bot transitions==0.8.8 diff --git a/requirements/static/ci/py3.8/lint.txt b/requirements/static/ci/py3.8/lint.txt index 23e5157087b..485371d0803 100644 --- a/requirements/static/ci/py3.8/lint.txt +++ b/requirements/static/ci/py3.8/lint.txt @@ -24,7 +24,7 @@ asn1crypto==1.4.0 # via # certvalidator # oscrypto -astroid==2.5 +astroid==2.3.3 # via pylint async-timeout==4.0.2 # via aiohttp @@ -703,7 +703,7 @@ pyjwt==2.4.0 # via # adal # twilio -pylint==2.5.3 +pylint==2.4.4 # via # -r requirements/static/ci/lint.in # saltpylint @@ -823,6 +823,7 @@ setproctitle==1.3.2 six==1.16.0 # via # apscheduler + # astroid # bcrypt # cassandra-driver # cheroot @@ -871,7 +872,6 @@ toml==0.10.2 # via # -r requirements/static/ci/common.in # -r requirements/static/ci/lint.in - # pylint tornado==6.1 # via python-telegram-bot transitions==0.8.8 diff --git a/requirements/static/ci/py3.9/lint.txt b/requirements/static/ci/py3.9/lint.txt index f0dd1a6036a..06b369a679b 100644 --- a/requirements/static/ci/py3.9/lint.txt +++ b/requirements/static/ci/py3.9/lint.txt @@ -24,7 +24,7 @@ asn1crypto==1.4.0 # via # certvalidator # oscrypto -astroid==2.5 +astroid==2.3.3 # via pylint async-timeout==4.0.2 # via aiohttp @@ -704,7 +704,7 @@ pyjwt==2.4.0 # via # adal # twilio -pylint==2.5.3 +pylint==2.4.4 # via # -r requirements/static/ci/lint.in # saltpylint @@ -824,6 +824,7 @@ setproctitle==1.3.2 six==1.16.0 # via # apscheduler + # astroid # bcrypt # cassandra-driver # cheroot @@ -871,7 +872,6 @@ toml==0.10.2 # via # -r requirements/static/ci/common.in # -r requirements/static/ci/lint.in - # pylint tornado==6.1 # via python-telegram-bot transitions==0.8.8 From 101f30741049313cbd917f25acc4a678a438e95c Mon Sep 17 00:00:00 2001 From: David Murphy < dmurphy@saltstack.com> Date: Mon, 26 Jun 2023 10:10:01 -0600 Subject: [PATCH 216/393] Disabling lint message --- salt/log/__init__.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/salt/log/__init__.py b/salt/log/__init__.py index 3458474f2ca..45202cffb0f 100644 --- a/salt/log/__init__.py +++ b/salt/log/__init__.py @@ -9,6 +9,8 @@ are made to assure backwards compatibility. """ +# pylint: disable = no-name-in-module + # Import several classes/functions from salt.log.setup for backwards compatibility from salt._logging import LOG_LEVELS, SORTED_LEVEL_NAMES from salt.log.setup import ( From aee097ce8c4d370d47cda386c103c87deba14642 Mon Sep 17 00:00:00 2001 From: David Murphy Date: Wed, 28 Jun 2023 10:32:28 -0600 Subject: [PATCH 217/393] Update salt/__init__.py Co-authored-by: Pedro Algarvio --- salt/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/salt/__init__.py b/salt/__init__.py index 14c7235268f..f8b426a7f84 100644 --- a/salt/__init__.py +++ b/salt/__init__.py @@ -47,7 +47,7 @@ class NaclImporter: """ Import hook to force PyNaCl to perform dlopen on libsodium with the RTLD_DEEPBIND flag. This is to work around an issue where pyzmq does a dlopen - with RTLD_GLOBAL which the causes calls to libsodium to resolve to + with RTLD_GLOBAL which then causes calls to libsodium to resolve to tweetnacl when it's been bundled with pyzmq. See: https://github.com/zeromq/pyzmq/issues/1878 From 897c56034c33ef4ae453005223310bc34dc73a4d Mon Sep 17 00:00:00 2001 From: David Murphy < dmurphy@saltstack.com> Date: Wed, 28 Jun 2023 11:14:14 -0600 Subject: [PATCH 218/393] Updated for review comments --- tests/pytests/unit/utils/test_nacl.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/tests/pytests/unit/utils/test_nacl.py b/tests/pytests/unit/utils/test_nacl.py index 78b77e0f1f1..c23f6bc0846 100644 --- a/tests/pytests/unit/utils/test_nacl.py +++ b/tests/pytests/unit/utils/test_nacl.py @@ -4,7 +4,6 @@ import os import pytest -from saltfactories.utils.tempfiles import temp_file import salt.modules.config as config import salt.utils.files @@ -57,7 +56,7 @@ def test_keygen_sk_file(test_keygen): test nacl.keygen function with sk_file set """ - with temp_file("test_keygen_sk_file") as fpath: + with pytest.helpers.temp_file("test_keygen_sk_file") as fpath: with salt.utils.files.fopen(fpath, "wb") as wfh: wfh.write(test_keygen["sk"]) @@ -72,7 +71,7 @@ def test_keygen_keyfile(test_keygen): test nacl.keygen function with keyfile set """ - with temp_file("test_keygen_keyfile") as fpath: + with pytest.helpers.temp_file("test_keygen_keyfile") as fpath: with salt.utils.files.fopen(fpath, "wb") as wfh: wfh.write(test_keygen["sk"]) @@ -86,7 +85,7 @@ def test_enc_keyfile(test_keygen): test nacl.enc function with keyfile and pk_file set """ - with temp_file("test_enc_keyfile") as fpath: + with pytest.helpers.temp_file("test_enc_keyfile") as fpath: with salt.utils.files.fopen(fpath, "wb") as wfh: wfh.write(test_keygen["sk"]) with salt.utils.files.fopen(str(fpath) + ".pub", "wb") as wfhpub: @@ -107,7 +106,7 @@ def test_enc_sk_file(test_keygen): test nacl.enc function with sk_file and pk_file set """ - with temp_file("test_enc_sk_file") as fpath: + with pytest.helpers.temp_file("test_enc_sk_file") as fpath: with salt.utils.files.fopen(fpath, "wb") as wfh: wfh.write(test_keygen["sk"]) with salt.utils.files.fopen(str(fpath) + ".pub", "wb") as wfhpub: @@ -128,7 +127,7 @@ def test_dec_keyfile(test_keygen): test nacl.dec function with keyfile and pk_file set """ - with temp_file("test_dec_keyfile") as fpath: + with pytest.helpers.temp_file("test_dec_keyfile") as fpath: with salt.utils.files.fopen(fpath, "wb") as wfh: wfh.write(test_keygen["sk"]) with salt.utils.files.fopen(str(fpath) + ".pub", "wb") as wfhpub: @@ -152,7 +151,7 @@ def test_dec_sk_file(test_keygen): test nacl.dec function with sk_file and pk_file set """ - with temp_file("test_dec_sk_file") as fpath: + with pytest.helpers.temp_file("test_dec_sk_file") as fpath: with salt.utils.files.fopen(fpath, "wb") as wfh: wfh.write(test_keygen["sk"]) with salt.utils.files.fopen(str(fpath) + ".pub", "wb") as wfhpub: From d65aed8ced6b6a390f952b466ef13af0ef06a73b Mon Sep 17 00:00:00 2001 From: David Murphy < dmurphy@saltstack.com> Date: Wed, 28 Jun 2023 16:07:51 -0600 Subject: [PATCH 219/393] Updated immutables as per reviewer comments --- requirements/static/ci/common.in | 1 - requirements/static/ci/py3.10/cloud.txt | 4 +--- requirements/static/ci/py3.10/darwin.txt | 4 +--- requirements/static/ci/py3.10/freebsd.txt | 4 +--- requirements/static/ci/py3.10/lint.txt | 4 +--- requirements/static/ci/py3.10/linux.txt | 4 +--- requirements/static/ci/py3.10/windows.txt | 4 +--- requirements/static/ci/py3.7/cloud.txt | 4 +--- requirements/static/ci/py3.7/freebsd.txt | 4 +--- requirements/static/ci/py3.7/lint.txt | 4 +--- requirements/static/ci/py3.7/linux.txt | 4 +--- requirements/static/ci/py3.7/windows.txt | 4 +--- requirements/static/ci/py3.8/cloud.txt | 4 +--- requirements/static/ci/py3.8/freebsd.txt | 4 +--- requirements/static/ci/py3.8/lint.txt | 4 +--- requirements/static/ci/py3.8/linux.txt | 4 +--- requirements/static/ci/py3.8/windows.txt | 4 +--- requirements/static/ci/py3.9/cloud.txt | 4 +--- requirements/static/ci/py3.9/darwin.txt | 4 +--- requirements/static/ci/py3.9/freebsd.txt | 4 +--- requirements/static/ci/py3.9/lint.txt | 4 +--- requirements/static/ci/py3.9/linux.txt | 4 +--- requirements/static/ci/py3.9/windows.txt | 4 +--- 23 files changed, 22 insertions(+), 67 deletions(-) diff --git a/requirements/static/ci/common.in b/requirements/static/ci/common.in index eb4a6cfb615..ba08f698854 100644 --- a/requirements/static/ci/common.in +++ b/requirements/static/ci/common.in @@ -17,7 +17,6 @@ dnspython docker etcd3-py==0.1.6 ; python_version >= '3.6' gitpython>=3.1.30; python_version >= '3.7' -immutables>=0.19 jmespath jsonschema junos-eznc; sys_platform != 'win32' and python_version <= '3.10' diff --git a/requirements/static/ci/py3.10/cloud.txt b/requirements/static/ci/py3.10/cloud.txt index a64c17d4c04..1fee2a7de6a 100644 --- a/requirements/static/ci/py3.10/cloud.txt +++ b/requirements/static/ci/py3.10/cloud.txt @@ -442,9 +442,7 @@ idna==2.8 # requests # yarl immutables==0.19 - # via - # -r requirements/static/ci/common.in - # contextvars + # via contextvars importlib-metadata==6.0.0 # via -r requirements/static/pkg/linux.in iniconfig==1.1.1 diff --git a/requirements/static/ci/py3.10/darwin.txt b/requirements/static/ci/py3.10/darwin.txt index bfa407c3547..46a8830972c 100644 --- a/requirements/static/ci/py3.10/darwin.txt +++ b/requirements/static/ci/py3.10/darwin.txt @@ -445,9 +445,7 @@ idna==2.8 # requests # yarl immutables==0.19 - # via - # -r requirements/static/ci/common.in - # contextvars + # via contextvars importlib-metadata==6.0.0 # via -r requirements/darwin.txt iniconfig==1.0.1 diff --git a/requirements/static/ci/py3.10/freebsd.txt b/requirements/static/ci/py3.10/freebsd.txt index 6fc2305b345..3074d91a918 100644 --- a/requirements/static/ci/py3.10/freebsd.txt +++ b/requirements/static/ci/py3.10/freebsd.txt @@ -440,9 +440,7 @@ idna==2.8 # requests # yarl immutables==0.19 - # via - # -r requirements/static/ci/common.in - # contextvars + # via contextvars importlib-metadata==6.0.0 # via -r requirements/static/pkg/freebsd.in iniconfig==1.0.1 diff --git a/requirements/static/ci/py3.10/lint.txt b/requirements/static/ci/py3.10/lint.txt index fa3c194494b..2f0f5367e7e 100644 --- a/requirements/static/ci/py3.10/lint.txt +++ b/requirements/static/ci/py3.10/lint.txt @@ -439,9 +439,7 @@ idna==3.2 # requests # yarl immutables==0.19 - # via - # -r requirements/static/ci/common.in - # contextvars + # via contextvars importlib-metadata==6.0.0 # via -r requirements/static/pkg/linux.in ipaddress==1.0.23 diff --git a/requirements/static/ci/py3.10/linux.txt b/requirements/static/ci/py3.10/linux.txt index 0210afbab54..f180d84037f 100644 --- a/requirements/static/ci/py3.10/linux.txt +++ b/requirements/static/ci/py3.10/linux.txt @@ -455,9 +455,7 @@ idna==2.8 # requests # yarl immutables==0.19 - # via - # -r requirements/static/ci/common.in - # contextvars + # via contextvars importlib-metadata==6.0.0 # via -r requirements/static/pkg/linux.in iniconfig==1.0.1 diff --git a/requirements/static/ci/py3.10/windows.txt b/requirements/static/ci/py3.10/windows.txt index e08e1f5a113..f866bed87c5 100644 --- a/requirements/static/ci/py3.10/windows.txt +++ b/requirements/static/ci/py3.10/windows.txt @@ -125,9 +125,7 @@ idna==2.8 # requests # yarl immutables==0.19 - # via - # -r requirements/static/ci/common.in - # contextvars + # via contextvars importlib-metadata==6.0.0 # via -r requirements/windows.txt iniconfig==1.0.1 diff --git a/requirements/static/ci/py3.7/cloud.txt b/requirements/static/ci/py3.7/cloud.txt index 94d849e0427..33547d20175 100644 --- a/requirements/static/ci/py3.7/cloud.txt +++ b/requirements/static/ci/py3.7/cloud.txt @@ -453,9 +453,7 @@ idna==2.8 # requests # yarl immutables==0.19 - # via - # -r requirements/static/ci/common.in - # contextvars + # via contextvars importlib-metadata==4.8.1 # via # -r requirements/static/pkg/linux.in diff --git a/requirements/static/ci/py3.7/freebsd.txt b/requirements/static/ci/py3.7/freebsd.txt index 2e017a96077..8e711d00e86 100644 --- a/requirements/static/ci/py3.7/freebsd.txt +++ b/requirements/static/ci/py3.7/freebsd.txt @@ -451,9 +451,7 @@ idna==2.8 # requests # yarl immutables==0.19 - # via - # -r requirements/static/ci/common.in - # contextvars + # via contextvars importlib-metadata==4.6.4 # via # -r requirements/static/pkg/freebsd.in diff --git a/requirements/static/ci/py3.7/lint.txt b/requirements/static/ci/py3.7/lint.txt index 746ef57bfd5..838d6592ae5 100644 --- a/requirements/static/ci/py3.7/lint.txt +++ b/requirements/static/ci/py3.7/lint.txt @@ -452,9 +452,7 @@ idna==3.2 # requests # yarl immutables==0.19 - # via - # -r requirements/static/ci/common.in - # contextvars + # via contextvars importlib-metadata==4.6.4 # via # -r requirements/static/pkg/linux.in diff --git a/requirements/static/ci/py3.7/linux.txt b/requirements/static/ci/py3.7/linux.txt index f61f282aec7..a806aa4ef28 100644 --- a/requirements/static/ci/py3.7/linux.txt +++ b/requirements/static/ci/py3.7/linux.txt @@ -466,9 +466,7 @@ idna==2.8 # requests # yarl immutables==0.19 - # via - # -r requirements/static/ci/common.in - # contextvars + # via contextvars importlib-metadata==4.6.4 # via # -r requirements/static/pkg/linux.in diff --git a/requirements/static/ci/py3.7/windows.txt b/requirements/static/ci/py3.7/windows.txt index adc89147097..7930a486ae1 100644 --- a/requirements/static/ci/py3.7/windows.txt +++ b/requirements/static/ci/py3.7/windows.txt @@ -130,9 +130,7 @@ idna==2.8 # requests # yarl immutables==0.19 - # via - # -r requirements/static/ci/common.in - # contextvars + # via contextvars importlib-metadata==4.6.4 # via # -r requirements/windows.txt diff --git a/requirements/static/ci/py3.8/cloud.txt b/requirements/static/ci/py3.8/cloud.txt index 91fe5a6c732..83db00c3dc0 100644 --- a/requirements/static/ci/py3.8/cloud.txt +++ b/requirements/static/ci/py3.8/cloud.txt @@ -452,9 +452,7 @@ idna==2.8 # requests # yarl immutables==0.19 - # via - # -r requirements/static/ci/common.in - # contextvars + # via contextvars importlib-metadata==4.8.1 # via -r requirements/static/pkg/linux.in iniconfig==1.1.1 diff --git a/requirements/static/ci/py3.8/freebsd.txt b/requirements/static/ci/py3.8/freebsd.txt index f918c019285..063f78b12d7 100644 --- a/requirements/static/ci/py3.8/freebsd.txt +++ b/requirements/static/ci/py3.8/freebsd.txt @@ -450,9 +450,7 @@ idna==2.8 # requests # yarl immutables==0.19 - # via - # -r requirements/static/ci/common.in - # contextvars + # via contextvars importlib-metadata==4.6.4 # via -r requirements/static/pkg/freebsd.in iniconfig==1.0.1 diff --git a/requirements/static/ci/py3.8/lint.txt b/requirements/static/ci/py3.8/lint.txt index 485371d0803..cb505238dd9 100644 --- a/requirements/static/ci/py3.8/lint.txt +++ b/requirements/static/ci/py3.8/lint.txt @@ -451,9 +451,7 @@ idna==3.2 # requests # yarl immutables==0.19 - # via - # -r requirements/static/ci/common.in - # contextvars + # via contextvars importlib-metadata==4.6.4 # via -r requirements/static/pkg/linux.in ipaddress==1.0.23 diff --git a/requirements/static/ci/py3.8/linux.txt b/requirements/static/ci/py3.8/linux.txt index e20e8814c6b..2131fbb5a30 100644 --- a/requirements/static/ci/py3.8/linux.txt +++ b/requirements/static/ci/py3.8/linux.txt @@ -465,9 +465,7 @@ idna==2.8 # requests # yarl immutables==0.19 - # via - # -r requirements/static/ci/common.in - # contextvars + # via contextvars importlib-metadata==4.6.4 # via -r requirements/static/pkg/linux.in iniconfig==1.0.1 diff --git a/requirements/static/ci/py3.8/windows.txt b/requirements/static/ci/py3.8/windows.txt index 30cbe6e463b..407b4dbbf33 100644 --- a/requirements/static/ci/py3.8/windows.txt +++ b/requirements/static/ci/py3.8/windows.txt @@ -127,9 +127,7 @@ idna==2.8 # requests # yarl immutables==0.19 - # via - # -r requirements/static/ci/common.in - # contextvars + # via contextvars importlib-metadata==4.6.4 # via -r requirements/windows.txt iniconfig==1.0.1 diff --git a/requirements/static/ci/py3.9/cloud.txt b/requirements/static/ci/py3.9/cloud.txt index 33bb5204b5d..89c23c15d59 100644 --- a/requirements/static/ci/py3.9/cloud.txt +++ b/requirements/static/ci/py3.9/cloud.txt @@ -452,9 +452,7 @@ idna==2.8 # requests # yarl immutables==0.19 - # via - # -r requirements/static/ci/common.in - # contextvars + # via contextvars importlib-metadata==6.0.0 # via -r requirements/static/pkg/linux.in iniconfig==1.1.1 diff --git a/requirements/static/ci/py3.9/darwin.txt b/requirements/static/ci/py3.9/darwin.txt index d9f41bfa599..c52738dee7b 100644 --- a/requirements/static/ci/py3.9/darwin.txt +++ b/requirements/static/ci/py3.9/darwin.txt @@ -455,9 +455,7 @@ idna==2.8 # requests # yarl immutables==0.19 - # via - # -r requirements/static/ci/common.in - # contextvars + # via contextvars importlib-metadata==6.0.0 # via -r requirements/darwin.txt iniconfig==1.0.1 diff --git a/requirements/static/ci/py3.9/freebsd.txt b/requirements/static/ci/py3.9/freebsd.txt index d10713b1f08..7ab31e5bdb8 100644 --- a/requirements/static/ci/py3.9/freebsd.txt +++ b/requirements/static/ci/py3.9/freebsd.txt @@ -450,9 +450,7 @@ idna==2.8 # requests # yarl immutables==0.19 - # via - # -r requirements/static/ci/common.in - # contextvars + # via contextvars importlib-metadata==6.0.0 # via -r requirements/static/pkg/freebsd.in iniconfig==1.0.1 diff --git a/requirements/static/ci/py3.9/lint.txt b/requirements/static/ci/py3.9/lint.txt index 06b369a679b..6b0791b6efc 100644 --- a/requirements/static/ci/py3.9/lint.txt +++ b/requirements/static/ci/py3.9/lint.txt @@ -449,9 +449,7 @@ idna==3.2 # requests # yarl immutables==0.19 - # via - # -r requirements/static/ci/common.in - # contextvars + # via contextvars importlib-metadata==6.0.0 # via -r requirements/static/pkg/linux.in ipaddress==1.0.23 diff --git a/requirements/static/ci/py3.9/linux.txt b/requirements/static/ci/py3.9/linux.txt index e62627f4f80..ae9266dbac0 100644 --- a/requirements/static/ci/py3.9/linux.txt +++ b/requirements/static/ci/py3.9/linux.txt @@ -467,9 +467,7 @@ idna==2.8 # requests # yarl immutables==0.19 - # via - # -r requirements/static/ci/common.in - # contextvars + # via contextvars importlib-metadata==6.0.0 # via -r requirements/static/pkg/linux.in iniconfig==1.0.1 diff --git a/requirements/static/ci/py3.9/windows.txt b/requirements/static/ci/py3.9/windows.txt index b166cb729aa..0723baf2bec 100644 --- a/requirements/static/ci/py3.9/windows.txt +++ b/requirements/static/ci/py3.9/windows.txt @@ -127,9 +127,7 @@ idna==2.8 # requests # yarl immutables==0.19 - # via - # -r requirements/static/ci/common.in - # contextvars + # via contextvars importlib-metadata==6.0.0 # via -r requirements/windows.txt iniconfig==1.0.1 From 244f4a7dada5a317e341a1a005b1d4bf5e4d6b85 Mon Sep 17 00:00:00 2001 From: David Murphy < dmurphy@saltstack.com> Date: Wed, 28 Jun 2023 16:35:19 -0600 Subject: [PATCH 220/393] Updat4ed immutables==0.15 where applicable as per reviewer comments --- requirements/static/ci/py3.10/darwin.txt | 2 +- requirements/static/ci/py3.10/docs.txt | 2 +- requirements/static/ci/py3.10/freebsd.txt | 2 +- requirements/static/ci/py3.10/linux.txt | 2 +- requirements/static/ci/py3.10/windows.txt | 2 +- requirements/static/ci/py3.7/docs.txt | 2 +- requirements/static/ci/py3.7/freebsd.txt | 2 +- requirements/static/ci/py3.7/linux.txt | 2 +- requirements/static/ci/py3.7/windows.txt | 2 +- requirements/static/ci/py3.8/docs.txt | 2 +- requirements/static/ci/py3.8/freebsd.txt | 2 +- requirements/static/ci/py3.8/linux.txt | 2 +- requirements/static/ci/py3.8/windows.txt | 2 +- requirements/static/ci/py3.9/darwin.txt | 2 +- requirements/static/ci/py3.9/docs.txt | 2 +- requirements/static/ci/py3.9/freebsd.txt | 2 +- requirements/static/ci/py3.9/linux.txt | 2 +- requirements/static/ci/py3.9/windows.txt | 2 +- 18 files changed, 18 insertions(+), 18 deletions(-) diff --git a/requirements/static/ci/py3.10/darwin.txt b/requirements/static/ci/py3.10/darwin.txt index 46a8830972c..034d8bcdd4d 100644 --- a/requirements/static/ci/py3.10/darwin.txt +++ b/requirements/static/ci/py3.10/darwin.txt @@ -444,7 +444,7 @@ idna==2.8 # etcd3-py # requests # yarl -immutables==0.19 +immutables==0.15 # via contextvars importlib-metadata==6.0.0 # via -r requirements/darwin.txt diff --git a/requirements/static/ci/py3.10/docs.txt b/requirements/static/ci/py3.10/docs.txt index f7e45290bec..588b8682f56 100644 --- a/requirements/static/ci/py3.10/docs.txt +++ b/requirements/static/ci/py3.10/docs.txt @@ -40,7 +40,7 @@ idna==2.8 # requests imagesize==1.4.1 # via sphinx -immutables==0.19 +immutables==0.15 # via # -c requirements/static/ci/py3.10/linux.txt # contextvars diff --git a/requirements/static/ci/py3.10/freebsd.txt b/requirements/static/ci/py3.10/freebsd.txt index 3074d91a918..600c4657380 100644 --- a/requirements/static/ci/py3.10/freebsd.txt +++ b/requirements/static/ci/py3.10/freebsd.txt @@ -439,7 +439,7 @@ idna==2.8 # etcd3-py # requests # yarl -immutables==0.19 +immutables==0.15 # via contextvars importlib-metadata==6.0.0 # via -r requirements/static/pkg/freebsd.in diff --git a/requirements/static/ci/py3.10/linux.txt b/requirements/static/ci/py3.10/linux.txt index f180d84037f..42b2e9ed7bb 100644 --- a/requirements/static/ci/py3.10/linux.txt +++ b/requirements/static/ci/py3.10/linux.txt @@ -454,7 +454,7 @@ idna==2.8 # etcd3-py # requests # yarl -immutables==0.19 +immutables==0.15 # via contextvars importlib-metadata==6.0.0 # via -r requirements/static/pkg/linux.in diff --git a/requirements/static/ci/py3.10/windows.txt b/requirements/static/ci/py3.10/windows.txt index f866bed87c5..654f358af88 100644 --- a/requirements/static/ci/py3.10/windows.txt +++ b/requirements/static/ci/py3.10/windows.txt @@ -124,7 +124,7 @@ idna==2.8 # etcd3-py # requests # yarl -immutables==0.19 +immutables==0.15 # via contextvars importlib-metadata==6.0.0 # via -r requirements/windows.txt diff --git a/requirements/static/ci/py3.7/docs.txt b/requirements/static/ci/py3.7/docs.txt index c623580e104..99ef5e95227 100644 --- a/requirements/static/ci/py3.7/docs.txt +++ b/requirements/static/ci/py3.7/docs.txt @@ -40,7 +40,7 @@ idna==2.8 # requests imagesize==1.2.0 # via sphinx -immutables==0.19 +immutables==0.15 # via # -c requirements/static/ci/py3.7/linux.txt # contextvars diff --git a/requirements/static/ci/py3.7/freebsd.txt b/requirements/static/ci/py3.7/freebsd.txt index 8e711d00e86..65b1b2eebc1 100644 --- a/requirements/static/ci/py3.7/freebsd.txt +++ b/requirements/static/ci/py3.7/freebsd.txt @@ -450,7 +450,7 @@ idna==2.8 # etcd3-py # requests # yarl -immutables==0.19 +immutables==0.15 # via contextvars importlib-metadata==4.6.4 # via diff --git a/requirements/static/ci/py3.7/linux.txt b/requirements/static/ci/py3.7/linux.txt index a806aa4ef28..324aa1d0532 100644 --- a/requirements/static/ci/py3.7/linux.txt +++ b/requirements/static/ci/py3.7/linux.txt @@ -465,7 +465,7 @@ idna==2.8 # etcd3-py # requests # yarl -immutables==0.19 +immutables==0.15 # via contextvars importlib-metadata==4.6.4 # via diff --git a/requirements/static/ci/py3.7/windows.txt b/requirements/static/ci/py3.7/windows.txt index 7930a486ae1..9aca3cef7db 100644 --- a/requirements/static/ci/py3.7/windows.txt +++ b/requirements/static/ci/py3.7/windows.txt @@ -129,7 +129,7 @@ idna==2.8 # etcd3-py # requests # yarl -immutables==0.19 +immutables==0.15 # via contextvars importlib-metadata==4.6.4 # via diff --git a/requirements/static/ci/py3.8/docs.txt b/requirements/static/ci/py3.8/docs.txt index 5f7b7d17d02..da96a0c3bfb 100644 --- a/requirements/static/ci/py3.8/docs.txt +++ b/requirements/static/ci/py3.8/docs.txt @@ -40,7 +40,7 @@ idna==2.8 # requests imagesize==1.2.0 # via sphinx -immutables==0.19 +immutables==0.15 # via # -c requirements/static/ci/py3.8/linux.txt # contextvars diff --git a/requirements/static/ci/py3.8/freebsd.txt b/requirements/static/ci/py3.8/freebsd.txt index 063f78b12d7..e0c84876c57 100644 --- a/requirements/static/ci/py3.8/freebsd.txt +++ b/requirements/static/ci/py3.8/freebsd.txt @@ -449,7 +449,7 @@ idna==2.8 # etcd3-py # requests # yarl -immutables==0.19 +immutables==0.15 # via contextvars importlib-metadata==4.6.4 # via -r requirements/static/pkg/freebsd.in diff --git a/requirements/static/ci/py3.8/linux.txt b/requirements/static/ci/py3.8/linux.txt index 2131fbb5a30..8c068b8ee1e 100644 --- a/requirements/static/ci/py3.8/linux.txt +++ b/requirements/static/ci/py3.8/linux.txt @@ -464,7 +464,7 @@ idna==2.8 # etcd3-py # requests # yarl -immutables==0.19 +immutables==0.15 # via contextvars importlib-metadata==4.6.4 # via -r requirements/static/pkg/linux.in diff --git a/requirements/static/ci/py3.8/windows.txt b/requirements/static/ci/py3.8/windows.txt index 407b4dbbf33..8206b905138 100644 --- a/requirements/static/ci/py3.8/windows.txt +++ b/requirements/static/ci/py3.8/windows.txt @@ -126,7 +126,7 @@ idna==2.8 # etcd3-py # requests # yarl -immutables==0.19 +immutables==0.15 # via contextvars importlib-metadata==4.6.4 # via -r requirements/windows.txt diff --git a/requirements/static/ci/py3.9/darwin.txt b/requirements/static/ci/py3.9/darwin.txt index c52738dee7b..609e1623e07 100644 --- a/requirements/static/ci/py3.9/darwin.txt +++ b/requirements/static/ci/py3.9/darwin.txt @@ -454,7 +454,7 @@ idna==2.8 # etcd3-py # requests # yarl -immutables==0.19 +immutables==0.15 # via contextvars importlib-metadata==6.0.0 # via -r requirements/darwin.txt diff --git a/requirements/static/ci/py3.9/docs.txt b/requirements/static/ci/py3.9/docs.txt index ff85f0537d8..772a37c357a 100644 --- a/requirements/static/ci/py3.9/docs.txt +++ b/requirements/static/ci/py3.9/docs.txt @@ -40,7 +40,7 @@ idna==2.8 # requests imagesize==1.4.1 # via sphinx -immutables==0.19 +immutables==0.15 # via # -c requirements/static/ci/py3.9/linux.txt # contextvars diff --git a/requirements/static/ci/py3.9/freebsd.txt b/requirements/static/ci/py3.9/freebsd.txt index 7ab31e5bdb8..6c7c62d8a65 100644 --- a/requirements/static/ci/py3.9/freebsd.txt +++ b/requirements/static/ci/py3.9/freebsd.txt @@ -449,7 +449,7 @@ idna==2.8 # etcd3-py # requests # yarl -immutables==0.19 +immutables==0.15 # via contextvars importlib-metadata==6.0.0 # via -r requirements/static/pkg/freebsd.in diff --git a/requirements/static/ci/py3.9/linux.txt b/requirements/static/ci/py3.9/linux.txt index ae9266dbac0..f46c58999e3 100644 --- a/requirements/static/ci/py3.9/linux.txt +++ b/requirements/static/ci/py3.9/linux.txt @@ -466,7 +466,7 @@ idna==2.8 # etcd3-py # requests # yarl -immutables==0.19 +immutables==0.15 # via contextvars importlib-metadata==6.0.0 # via -r requirements/static/pkg/linux.in diff --git a/requirements/static/ci/py3.9/windows.txt b/requirements/static/ci/py3.9/windows.txt index 0723baf2bec..38cfc73db51 100644 --- a/requirements/static/ci/py3.9/windows.txt +++ b/requirements/static/ci/py3.9/windows.txt @@ -126,7 +126,7 @@ idna==2.8 # etcd3-py # requests # yarl -immutables==0.19 +immutables==0.15 # via contextvars importlib-metadata==6.0.0 # via -r requirements/windows.txt From 726e6d351a3c74fea8f8a2bda7320b200d24c129 Mon Sep 17 00:00:00 2001 From: David Murphy < dmurphy@saltstack.com> Date: Wed, 28 Jun 2023 18:17:32 -0600 Subject: [PATCH 221/393] Cleaned up py3.7 use of immutables in requirements --- requirements/static/ci/py3.7/docs.txt | 1 - requirements/static/ci/py3.7/freebsd.txt | 1 - requirements/static/ci/py3.7/linux.txt | 1 - requirements/static/ci/py3.7/windows.txt | 1 - 4 files changed, 4 deletions(-) diff --git a/requirements/static/ci/py3.7/docs.txt b/requirements/static/ci/py3.7/docs.txt index 99ef5e95227..31209a994b2 100644 --- a/requirements/static/ci/py3.7/docs.txt +++ b/requirements/static/ci/py3.7/docs.txt @@ -188,7 +188,6 @@ tempora==4.1.1 typing-extensions==3.10.0.0 # via # -c requirements/static/ci/py3.7/linux.txt - # immutables # importlib-metadata # markdown-it-py # myst-docutils diff --git a/requirements/static/ci/py3.7/freebsd.txt b/requirements/static/ci/py3.7/freebsd.txt index 65b1b2eebc1..8b0fa6828af 100644 --- a/requirements/static/ci/py3.7/freebsd.txt +++ b/requirements/static/ci/py3.7/freebsd.txt @@ -891,7 +891,6 @@ typing-extensions==3.10.0.0 # aiohttp # async-timeout # gitpython - # immutables # importlib-metadata # pytest-shell-utilities # pytest-system-statistics diff --git a/requirements/static/ci/py3.7/linux.txt b/requirements/static/ci/py3.7/linux.txt index 324aa1d0532..ec04e48a41a 100644 --- a/requirements/static/ci/py3.7/linux.txt +++ b/requirements/static/ci/py3.7/linux.txt @@ -939,7 +939,6 @@ typing-extensions==3.10.0.0 # aiohttp # async-timeout # gitpython - # immutables # importlib-metadata # pytest-shell-utilities # pytest-system-statistics diff --git a/requirements/static/ci/py3.7/windows.txt b/requirements/static/ci/py3.7/windows.txt index 9aca3cef7db..f0fae401318 100644 --- a/requirements/static/ci/py3.7/windows.txt +++ b/requirements/static/ci/py3.7/windows.txt @@ -404,7 +404,6 @@ typing-extensions==4.2.0 # aiohttp # async-timeout # gitpython - # immutables # importlib-metadata # pytest-shell-utilities # pytest-system-statistics From 09f4cea37b9b59897b3577b0cbd76a665ad78b1d Mon Sep 17 00:00:00 2001 From: David Murphy Date: Fri, 30 Jun 2023 16:37:11 -0600 Subject: [PATCH 222/393] Update tests/pytests/integration/runners/test_nacl.py Co-authored-by: Pedro Algarvio --- tests/pytests/integration/runners/test_nacl.py | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/tests/pytests/integration/runners/test_nacl.py b/tests/pytests/integration/runners/test_nacl.py index ff2880bc7e6..3dc9266f0bb 100644 --- a/tests/pytests/integration/runners/test_nacl.py +++ b/tests/pytests/integration/runners/test_nacl.py @@ -8,21 +8,13 @@ import salt.config import salt.utils.stringutils from tests.support.mock import patch -try: - import salt.runners.nacl as nacl - - HAS_PYNACL = True -except (ImportError, OSError, AttributeError): - HAS_PYNACL = False +pytest.importorskip("libnacl") pytestmark = [ pytest.mark.windows_whitelisted, ] -@pytest.mark.skipif( - not HAS_PYNACL, reason="skipping test_nacl, reason=PyNaCl is unavailable" -) @pytest.fixture(scope="module") def minion_opts(): return salt.config.minion_config(None) From 990c95c48e73ee8018dca9de095286e8a9fa34d1 Mon Sep 17 00:00:00 2001 From: David Murphy Date: Fri, 30 Jun 2023 16:37:43 -0600 Subject: [PATCH 223/393] Update tests/pytests/unit/utils/test_nacl.py Co-authored-by: Pedro Algarvio --- tests/pytests/unit/utils/test_nacl.py | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/tests/pytests/unit/utils/test_nacl.py b/tests/pytests/unit/utils/test_nacl.py index c23f6bc0846..8e48a8a1316 100644 --- a/tests/pytests/unit/utils/test_nacl.py +++ b/tests/pytests/unit/utils/test_nacl.py @@ -9,17 +9,7 @@ import salt.modules.config as config import salt.utils.files from tests.support.mock import patch -try: - import salt.utils.nacl as nacl - - HAS_PYNACL = nacl.check_requirements -except (ImportError, OSError, AttributeError): - HAS_PYNACL = False - - -@pytest.mark.skipif( - not HAS_PYNACL, reason="skipping test_nacl, reason=PyNaCl is unavailable" -) +pytest.importorskip("libnacl") @pytest.fixture def configure_loader_modules(): return { From 924885d4c2a2be4c64eb6102ce42934b34d63556 Mon Sep 17 00:00:00 2001 From: MKLeb Date: Thu, 15 Jun 2023 17:43:16 -0400 Subject: [PATCH 224/393] Add `get-latest-release` command so we can dynamically get the previous versions to test upgrades and downgrades for --- tools/ci.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/ci.py b/tools/ci.py index 08264bb4e50..1dfb586b238 100644 --- a/tools/ci.py +++ b/tools/ci.py @@ -13,6 +13,7 @@ import sys import time from typing import TYPE_CHECKING, Any +import requests from ptscripts import Context, command_group import tools.utils From d4f8bc1cbb867f1cb2a4c2d11ac0632328ece6a5 Mon Sep 17 00:00:00 2001 From: MKLeb Date: Fri, 16 Jun 2023 09:50:44 -0400 Subject: [PATCH 225/393] Use `ctx.web` for requests and require the `--salt-version` kwarg --- tools/ci.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tools/ci.py b/tools/ci.py index 1dfb586b238..08264bb4e50 100644 --- a/tools/ci.py +++ b/tools/ci.py @@ -13,7 +13,6 @@ import sys import time from typing import TYPE_CHECKING, Any -import requests from ptscripts import Context, command_group import tools.utils From b92c87130749dd0e6c484ccf894dc5ef9ccab1b4 Mon Sep 17 00:00:00 2001 From: cmcmarrow Date: Thu, 29 Jun 2023 18:38:01 -0500 Subject: [PATCH 226/393] unflip no-fast --- tests/conftest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/conftest.py b/tests/conftest.py index 361076e0e17..0dc0f119e31 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -605,7 +605,7 @@ def pytest_runtest_setup(item): "Slow tests are disabled, pass '--run-slow' to enable them.", _use_item_location=True, ) - if test_group_count == 0 and item.config.getoption("--no-fast-tests"): + if test_group_count == 0 and not item.config.getoption("--no-fast-tests"): raise pytest.skip.Exception( "Fast tests have been disabled by '--no-fast-tests'.", _use_item_location=True, From f47f8c8c4e7ba75ff022ec13a0ed70ccbafc3bcd Mon Sep 17 00:00:00 2001 From: cmcmarrow Date: Thu, 29 Jun 2023 18:56:31 -0500 Subject: [PATCH 227/393] flip default on --no-fast --- tests/conftest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/conftest.py b/tests/conftest.py index 0dc0f119e31..361076e0e17 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -605,7 +605,7 @@ def pytest_runtest_setup(item): "Slow tests are disabled, pass '--run-slow' to enable them.", _use_item_location=True, ) - if test_group_count == 0 and not item.config.getoption("--no-fast-tests"): + if test_group_count == 0 and item.config.getoption("--no-fast-tests"): raise pytest.skip.Exception( "Fast tests have been disabled by '--no-fast-tests'.", _use_item_location=True, From d4113e2031d957b576ad23a539c5df03ef334fea Mon Sep 17 00:00:00 2001 From: David Murphy < dmurphy@saltstack.com> Date: Fri, 30 Jun 2023 16:42:48 -0600 Subject: [PATCH 228/393] Updated per reviewer comments --- salt/__init__.py | 8 -------- 1 file changed, 8 deletions(-) diff --git a/salt/__init__.py b/salt/__init__.py index f8b426a7f84..7542ef8e263 100644 --- a/salt/__init__.py +++ b/salt/__init__.py @@ -38,10 +38,6 @@ class TornadoImporter: sys.modules[spec.name] = mod return mod - def exec_module(self, module): - log.error("exec_module %r", module) - return None - class NaclImporter: """ @@ -81,10 +77,6 @@ class NaclImporter: sys.modules[spec.name] = mod return mod - def exec_module(self, module): - log.error("exec_module %r", module) - return None - # Try our importer first sys.meta_path = [TornadoImporter(), NaclImporter()] + sys.meta_path From e092637f1aaeff76004924493382715e1a605684 Mon Sep 17 00:00:00 2001 From: David Murphy < dmurphy@saltstack.com> Date: Wed, 5 Jul 2023 09:51:24 -0600 Subject: [PATCH 229/393] Reverted reviewers suggestion, caused issues with missing variables in tests --- tests/pytests/unit/utils/test_nacl.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/tests/pytests/unit/utils/test_nacl.py b/tests/pytests/unit/utils/test_nacl.py index 8e48a8a1316..c23f6bc0846 100644 --- a/tests/pytests/unit/utils/test_nacl.py +++ b/tests/pytests/unit/utils/test_nacl.py @@ -9,7 +9,17 @@ import salt.modules.config as config import salt.utils.files from tests.support.mock import patch -pytest.importorskip("libnacl") +try: + import salt.utils.nacl as nacl + + HAS_PYNACL = nacl.check_requirements +except (ImportError, OSError, AttributeError): + HAS_PYNACL = False + + +@pytest.mark.skipif( + not HAS_PYNACL, reason="skipping test_nacl, reason=PyNaCl is unavailable" +) @pytest.fixture def configure_loader_modules(): return { From ca16a86e9573a36077927862115903a1548583be Mon Sep 17 00:00:00 2001 From: David Murphy < dmurphy@saltstack.com> Date: Fri, 14 Jul 2023 08:55:00 -0600 Subject: [PATCH 230/393] Reverting review suggestions --- tests/pytests/integration/runners/test_nacl.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/tests/pytests/integration/runners/test_nacl.py b/tests/pytests/integration/runners/test_nacl.py index 3dc9266f0bb..5e4688a79c8 100644 --- a/tests/pytests/integration/runners/test_nacl.py +++ b/tests/pytests/integration/runners/test_nacl.py @@ -8,13 +8,21 @@ import salt.config import salt.utils.stringutils from tests.support.mock import patch -pytest.importorskip("libnacl") - pytestmark = [ pytest.mark.windows_whitelisted, ] +try: + import salt.runners.nacl as nacl + HAS_PYNACL = True +except (ImportError, OSError, AttributeError): + HAS_PYNACL = False + + +@pytest.mark.skipif( + not HAS_PYNACL, reason="skipping test_nacl, reason=PyNaCl is unavailable" +) @pytest.fixture(scope="module") def minion_opts(): return salt.config.minion_config(None) From f97d354185c4afc6501e02831b94bf3889dec711 Mon Sep 17 00:00:00 2001 From: David Murphy < dmurphy@saltstack.com> Date: Fri, 14 Jul 2023 16:44:06 -0600 Subject: [PATCH 231/393] Restore exec_module to TornadoImporter and NaclImporter --- salt/__init__.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/salt/__init__.py b/salt/__init__.py index 7542ef8e263..edf7ff172f7 100644 --- a/salt/__init__.py +++ b/salt/__init__.py @@ -38,6 +38,9 @@ class TornadoImporter: sys.modules[spec.name] = mod return mod + def exec_module(self, module): + return None + class NaclImporter: """ @@ -77,6 +80,9 @@ class NaclImporter: sys.modules[spec.name] = mod return mod + def exec_module(self, module): + return None + # Try our importer first sys.meta_path = [TornadoImporter(), NaclImporter()] + sys.meta_path From 2d2b7208711c2dff53231eb3615d46e77bd037df Mon Sep 17 00:00:00 2001 From: David Murphy < dmurphy@saltstack.com> Date: Mon, 17 Jul 2023 11:03:59 -0600 Subject: [PATCH 232/393] Removed debug logging and updated requirements per reviewer suggestions --- requirements/static/ci/common.in | 7 ++----- requirements/static/ci/py3.10/cloud.txt | 4 ++-- requirements/static/ci/py3.10/darwin.txt | 4 ++-- requirements/static/ci/py3.10/freebsd.txt | 4 ++-- requirements/static/ci/py3.10/lint.txt | 4 ++-- requirements/static/ci/py3.10/linux.txt | 4 ++-- requirements/static/ci/py3.10/windows.txt | 4 ++-- requirements/static/ci/py3.7/cloud.txt | 6 +++--- requirements/static/ci/py3.7/freebsd.txt | 6 +++--- requirements/static/ci/py3.7/lint.txt | 6 +++--- requirements/static/ci/py3.7/linux.txt | 6 +++--- requirements/static/ci/py3.7/windows.txt | 6 +++--- requirements/static/ci/py3.8/cloud.txt | 5 ++--- requirements/static/ci/py3.8/freebsd.txt | 5 ++--- requirements/static/ci/py3.8/lint.txt | 5 ++--- requirements/static/ci/py3.8/linux.txt | 5 ++--- requirements/static/ci/py3.8/windows.txt | 5 ++--- requirements/static/ci/py3.9/cloud.txt | 4 ++-- requirements/static/ci/py3.9/darwin.txt | 4 ++-- requirements/static/ci/py3.9/freebsd.txt | 4 ++-- requirements/static/ci/py3.9/lint.txt | 4 ++-- requirements/static/ci/py3.9/linux.txt | 4 ++-- requirements/static/ci/py3.9/windows.txt | 4 ++-- salt/__init__.py | 3 --- 24 files changed, 51 insertions(+), 62 deletions(-) diff --git a/requirements/static/ci/common.in b/requirements/static/ci/common.in index ba08f698854..4e55fb95f10 100644 --- a/requirements/static/ci/common.in +++ b/requirements/static/ci/common.in @@ -8,8 +8,7 @@ boto3>=1.17.67; python_version >= '3.6' boto>=2.46.0 cassandra-driver>=2.0 certifi>=2022.12.07 -cffi>=1.12.2, <= 1.14.6; python_version < '3.7' -cffi>=1.15.1; python_version > '3.7' +cffi>=1.15.1 cherrypy>=17.4.1 clustershell croniter>=0.3.0,!=0.3.22"; sys_platform != 'win32' @@ -31,9 +30,7 @@ moto>=2.0.0 ; python_version >= '3.6' napalm; sys_platform != 'win32' and python_version > '3.6' and python_version < '3.10' paramiko>=2.10.1; sys_platform != 'win32' and sys_platform != 'darwin' passlib[bcrypt]>=1.7.4 -pynacl==1.3.0; python_version <= '3.7' -pynacl==1.4.0; python_version == '3.8' -pynacl>=1.5.0; python_version >= '3.9' +pynacl>=1.5.0 pycparser>=2.21; python_version >= '3.9' pyinotify>=0.9.6; sys_platform != 'win32' and sys_platform != 'darwin' and platform_system != "openbsd" python-etcd>0.4.2 diff --git a/requirements/static/ci/py3.10/cloud.txt b/requirements/static/ci/py3.10/cloud.txt index 1fee2a7de6a..797e0030942 100644 --- a/requirements/static/ci/py3.10/cloud.txt +++ b/requirements/static/ci/py3.10/cloud.txt @@ -358,7 +358,7 @@ certifi==2023.07.22 # requests certvalidator==0.11.1 # via vcert -cffi==1.15.1 ; python_version > "3.7" +cffi==1.15.1 # via # -r requirements/static/ci/common.in # azure-datalake-store @@ -667,7 +667,7 @@ pyinotify==0.9.6 ; sys_platform != "win32" and sys_platform != "darwin" and plat # via -r requirements/static/ci/common.in pyjwt==2.4.0 # via adal -pynacl==1.5.0 ; python_version >= "3.9" +pynacl==1.5.0 # via # -r requirements/static/ci/common.in # paramiko diff --git a/requirements/static/ci/py3.10/darwin.txt b/requirements/static/ci/py3.10/darwin.txt index 034d8bcdd4d..5bf23112ab6 100644 --- a/requirements/static/ci/py3.10/darwin.txt +++ b/requirements/static/ci/py3.10/darwin.txt @@ -358,7 +358,7 @@ certifi==2023.07.22 # requests certvalidator==0.11.1 # via vcert -cffi==1.15.1 ; python_version > "3.7" +cffi==1.15.1 # via # -r requirements/static/ci/common.in # azure-datalake-store @@ -668,7 +668,7 @@ pygit2==1.9.1 ; python_version >= "3.7" # via -r requirements/static/ci/darwin.in pyjwt==2.4.0 # via adal -pynacl==1.5.0 ; python_version >= "3.9" +pynacl==1.5.0 # via # -r requirements/static/ci/common.in # paramiko diff --git a/requirements/static/ci/py3.10/freebsd.txt b/requirements/static/ci/py3.10/freebsd.txt index 600c4657380..009befe86ff 100644 --- a/requirements/static/ci/py3.10/freebsd.txt +++ b/requirements/static/ci/py3.10/freebsd.txt @@ -356,7 +356,7 @@ certifi==2023.07.22 # requests certvalidator==0.11.1 # via vcert -cffi==1.15.1 ; python_version > "3.7" +cffi==1.15.1 # via # -r requirements/static/ci/common.in # azure-datalake-store @@ -667,7 +667,7 @@ pyinotify==0.9.6 ; sys_platform != "win32" and sys_platform != "darwin" and plat # via -r requirements/static/ci/common.in pyjwt==2.4.0 # via adal -pynacl==1.5.0 ; python_version >= "3.9" +pynacl==1.5.0 # via # -r requirements/static/ci/common.in # paramiko diff --git a/requirements/static/ci/py3.10/lint.txt b/requirements/static/ci/py3.10/lint.txt index 2f0f5367e7e..a724c32d3c9 100644 --- a/requirements/static/ci/py3.10/lint.txt +++ b/requirements/static/ci/py3.10/lint.txt @@ -362,7 +362,7 @@ certifi==2023.07.22 # requests certvalidator==0.11.1 # via vcert -cffi==1.15.1 ; python_version > "3.7" +cffi==1.15.1 # via # -r requirements/static/ci/common.in # azure-datalake-store @@ -673,7 +673,7 @@ pylint==2.4.4 # saltpylint pymysql==1.0.2 ; python_version > "3.5" # via -r requirements/static/ci/linux.in -pynacl==1.5.0 ; python_version >= "3.9" +pynacl==1.5.0 # via # -r requirements/static/ci/common.in # paramiko diff --git a/requirements/static/ci/py3.10/linux.txt b/requirements/static/ci/py3.10/linux.txt index 42b2e9ed7bb..15892aa82db 100644 --- a/requirements/static/ci/py3.10/linux.txt +++ b/requirements/static/ci/py3.10/linux.txt @@ -370,7 +370,7 @@ certifi==2023.07.22 # requests certvalidator==0.11.1 # via vcert -cffi==1.15.1 ; python_version > "3.7" +cffi==1.15.1 # via # -r requirements/static/ci/common.in # azure-datalake-store @@ -687,7 +687,7 @@ pyjwt==2.4.0 # twilio pymysql==1.0.2 ; python_version > "3.5" # via -r requirements/static/ci/linux.in -pynacl==1.5.0 ; python_version >= "3.9" +pynacl==1.5.0 # via # -r requirements/static/ci/common.in # paramiko diff --git a/requirements/static/ci/py3.10/windows.txt b/requirements/static/ci/py3.10/windows.txt index 654f358af88..15fd9ed41b1 100644 --- a/requirements/static/ci/py3.10/windows.txt +++ b/requirements/static/ci/py3.10/windows.txt @@ -42,7 +42,7 @@ certifi==2023.07.22 # -r requirements/windows.txt # kubernetes # requests -cffi==1.15.1 ; python_version > "3.7" +cffi==1.15.1 # via # -r requirements/static/ci/common.in # -r requirements/windows.txt @@ -238,7 +238,7 @@ pymssql==2.2.7 # via -r requirements/windows.txt pymysql==1.0.2 # via -r requirements/windows.txt -pynacl==1.5.0 ; python_version >= "3.9" +pynacl==1.5.0 # via -r requirements/static/ci/common.in pyopenssl==23.2.0 # via diff --git a/requirements/static/ci/py3.7/cloud.txt b/requirements/static/ci/py3.7/cloud.txt index 33547d20175..600b0bd5392 100644 --- a/requirements/static/ci/py3.7/cloud.txt +++ b/requirements/static/ci/py3.7/cloud.txt @@ -360,8 +360,9 @@ certifi==2023.07.22 # requests certvalidator==0.11.1 # via vcert -cffi==1.14.6 +cffi==1.15.1 # via + # -r requirements/static/ci/common.in # azure-datalake-store # bcrypt # cryptography @@ -708,7 +709,7 @@ pyinotify==0.9.6 ; sys_platform != "win32" and sys_platform != "darwin" and plat # via -r requirements/static/ci/common.in pyjwt==2.4.0 # via adal -pynacl==1.3.0 ; python_version <= "3.7" +pynacl==1.5.0 # via # -r requirements/static/ci/common.in # paramiko @@ -872,7 +873,6 @@ six==1.16.0 # ncclient # paramiko # profitbricks - # pynacl # pypsexec # python-dateutil # pyvmomi diff --git a/requirements/static/ci/py3.7/freebsd.txt b/requirements/static/ci/py3.7/freebsd.txt index 8b0fa6828af..5cbcb1ec49b 100644 --- a/requirements/static/ci/py3.7/freebsd.txt +++ b/requirements/static/ci/py3.7/freebsd.txt @@ -358,8 +358,9 @@ certifi==2023.07.22 # requests certvalidator==0.11.1 # via vcert -cffi==1.14.6 +cffi==1.15.1 # via + # -r requirements/static/ci/common.in # azure-datalake-store # bcrypt # cryptography @@ -702,7 +703,7 @@ pyinotify==0.9.6 ; sys_platform != "win32" and sys_platform != "darwin" and plat # via -r requirements/static/ci/common.in pyjwt==2.4.0 # via adal -pynacl==1.3.0 ; python_version <= "3.7" +pynacl==1.5.0 # via # -r requirements/static/ci/common.in # paramiko @@ -854,7 +855,6 @@ six==1.16.0 # msrestazure # ncclient # paramiko - # pynacl # python-dateutil # pyvmomi # responses diff --git a/requirements/static/ci/py3.7/lint.txt b/requirements/static/ci/py3.7/lint.txt index 838d6592ae5..2c1d983fa11 100644 --- a/requirements/static/ci/py3.7/lint.txt +++ b/requirements/static/ci/py3.7/lint.txt @@ -366,8 +366,9 @@ certifi==2023.07.22 # requests certvalidator==0.11.1 # via vcert -cffi==1.14.6 +cffi==1.15.1 # via + # -r requirements/static/ci/common.in # azure-datalake-store # bcrypt # cryptography @@ -715,7 +716,7 @@ pylint==2.4.4 # saltpylint pymysql==1.0.2 ; python_version > "3.5" # via -r requirements/static/ci/linux.in -pynacl==1.3.0 ; python_version <= "3.7" +pynacl==1.5.0 # via # -r requirements/static/ci/common.in # paramiko @@ -844,7 +845,6 @@ six==1.16.0 # msrestazure # ncclient # paramiko - # pynacl # python-consul # python-dateutil # pyvmomi diff --git a/requirements/static/ci/py3.7/linux.txt b/requirements/static/ci/py3.7/linux.txt index ec04e48a41a..1211423a9e8 100644 --- a/requirements/static/ci/py3.7/linux.txt +++ b/requirements/static/ci/py3.7/linux.txt @@ -372,8 +372,9 @@ certifi==2023.07.22 # requests certvalidator==0.11.1 # via vcert -cffi==1.14.6 +cffi==1.15.1 # via + # -r requirements/static/ci/common.in # azure-datalake-store # bcrypt # cryptography @@ -722,7 +723,7 @@ pyjwt==2.4.0 # twilio pymysql==1.0.2 ; python_version > "3.5" # via -r requirements/static/ci/linux.in -pynacl==1.3.0 ; python_version <= "3.7" +pynacl==1.5.0 # via # -r requirements/static/ci/common.in # paramiko @@ -893,7 +894,6 @@ six==1.16.0 # more-itertools # ncclient # paramiko - # pynacl # python-consul # python-dateutil # pyvmomi diff --git a/requirements/static/ci/py3.7/windows.txt b/requirements/static/ci/py3.7/windows.txt index f0fae401318..98dee3392b9 100644 --- a/requirements/static/ci/py3.7/windows.txt +++ b/requirements/static/ci/py3.7/windows.txt @@ -48,8 +48,9 @@ certifi==2023.07.22 # -r requirements/windows.txt # kubernetes # requests -cffi==1.14.6 +cffi==1.15.1 # via + # -r requirements/static/ci/common.in # -r requirements/windows.txt # clr-loader # cryptography @@ -250,7 +251,7 @@ pymssql==2.2.1 # via -r requirements/windows.txt pymysql==1.0.2 # via -r requirements/windows.txt -pynacl==1.3.0 ; python_version <= "3.7" +pynacl==1.5.0 # via -r requirements/static/ci/common.in pyopenssl==23.2.0 # via @@ -378,7 +379,6 @@ six==1.15.0 # jsonschema # kubernetes # mock - # pynacl # python-dateutil # pyvmomi # pywinrm diff --git a/requirements/static/ci/py3.8/cloud.txt b/requirements/static/ci/py3.8/cloud.txt index 83db00c3dc0..9a9be0b4f18 100644 --- a/requirements/static/ci/py3.8/cloud.txt +++ b/requirements/static/ci/py3.8/cloud.txt @@ -358,7 +358,7 @@ certifi==2023.07.22 # requests certvalidator==0.11.1 # via vcert -cffi==1.15.1 ; python_version > "3.7" +cffi==1.15.1 # via # -r requirements/static/ci/common.in # azure-datalake-store @@ -698,7 +698,7 @@ pyinotify==0.9.6 ; sys_platform != "win32" and sys_platform != "darwin" and plat # via -r requirements/static/ci/common.in pyjwt==2.4.0 # via adal -pynacl==1.4.0 ; python_version == "3.8" +pynacl==1.5.0 # via # -r requirements/static/ci/common.in # paramiko @@ -862,7 +862,6 @@ six==1.16.0 # ncclient # paramiko # profitbricks - # pynacl # pypsexec # python-dateutil # pyvmomi diff --git a/requirements/static/ci/py3.8/freebsd.txt b/requirements/static/ci/py3.8/freebsd.txt index e0c84876c57..4af8390b311 100644 --- a/requirements/static/ci/py3.8/freebsd.txt +++ b/requirements/static/ci/py3.8/freebsd.txt @@ -356,7 +356,7 @@ certifi==2023.07.22 # requests certvalidator==0.11.1 # via vcert -cffi==1.15.1 ; python_version > "3.7" +cffi==1.15.1 # via # -r requirements/static/ci/common.in # azure-datalake-store @@ -693,7 +693,7 @@ pyinotify==0.9.6 ; sys_platform != "win32" and sys_platform != "darwin" and plat # via -r requirements/static/ci/common.in pyjwt==2.4.0 # via adal -pynacl==1.4.0 ; python_version == "3.8" +pynacl==1.5.0 # via # -r requirements/static/ci/common.in # paramiko @@ -845,7 +845,6 @@ six==1.16.0 # msrestazure # ncclient # paramiko - # pynacl # python-dateutil # pyvmomi # responses diff --git a/requirements/static/ci/py3.8/lint.txt b/requirements/static/ci/py3.8/lint.txt index cb505238dd9..7f356487283 100644 --- a/requirements/static/ci/py3.8/lint.txt +++ b/requirements/static/ci/py3.8/lint.txt @@ -364,7 +364,7 @@ certifi==2023.07.22 # requests certvalidator==0.11.1 # via vcert -cffi==1.15.1 ; python_version > "3.7" +cffi==1.15.1 # via # -r requirements/static/ci/common.in # azure-datalake-store @@ -707,7 +707,7 @@ pylint==2.4.4 # saltpylint pymysql==1.0.2 ; python_version > "3.5" # via -r requirements/static/ci/linux.in -pynacl==1.4.0 ; python_version == "3.8" +pynacl==1.5.0 # via # -r requirements/static/ci/common.in # paramiko @@ -836,7 +836,6 @@ six==1.16.0 # msrestazure # ncclient # paramiko - # pynacl # python-consul # python-dateutil # pyvmomi diff --git a/requirements/static/ci/py3.8/linux.txt b/requirements/static/ci/py3.8/linux.txt index 8c068b8ee1e..981576f2e0e 100644 --- a/requirements/static/ci/py3.8/linux.txt +++ b/requirements/static/ci/py3.8/linux.txt @@ -370,7 +370,7 @@ certifi==2023.07.22 # requests certvalidator==0.11.1 # via vcert -cffi==1.15.1 ; python_version > "3.7" +cffi==1.15.1 # via # -r requirements/static/ci/common.in # azure-datalake-store @@ -713,7 +713,7 @@ pyjwt==2.4.0 # twilio pymysql==1.0.2 ; python_version > "3.5" # via -r requirements/static/ci/linux.in -pynacl==1.4.0 ; python_version == "3.8" +pynacl==1.5.0 # via # -r requirements/static/ci/common.in # paramiko @@ -882,7 +882,6 @@ six==1.16.0 # more-itertools # ncclient # paramiko - # pynacl # python-consul # python-dateutil # pyvmomi diff --git a/requirements/static/ci/py3.8/windows.txt b/requirements/static/ci/py3.8/windows.txt index 8206b905138..4bc662a75af 100644 --- a/requirements/static/ci/py3.8/windows.txt +++ b/requirements/static/ci/py3.8/windows.txt @@ -44,7 +44,7 @@ certifi==2023.07.22 # -r requirements/windows.txt # kubernetes # requests -cffi==1.15.1 ; python_version > "3.7" +cffi==1.15.1 # via # -r requirements/static/ci/common.in # -r requirements/windows.txt @@ -239,7 +239,7 @@ pymssql==2.2.1 # via -r requirements/windows.txt pymysql==1.0.2 # via -r requirements/windows.txt -pynacl==1.4.0 ; python_version == "3.8" +pynacl==1.5.0 # via -r requirements/static/ci/common.in pyopenssl==23.2.0 # via @@ -367,7 +367,6 @@ six==1.15.0 # jsonschema # kubernetes # mock - # pynacl # python-dateutil # pyvmomi # pywinrm diff --git a/requirements/static/ci/py3.9/cloud.txt b/requirements/static/ci/py3.9/cloud.txt index 89c23c15d59..c5ea66d3980 100644 --- a/requirements/static/ci/py3.9/cloud.txt +++ b/requirements/static/ci/py3.9/cloud.txt @@ -358,7 +358,7 @@ certifi==2023.07.22 # requests certvalidator==0.11.1 # via vcert -cffi==1.15.1 ; python_version > "3.7" +cffi==1.15.1 # via # -r requirements/static/ci/common.in # azure-datalake-store @@ -701,7 +701,7 @@ pyinotify==0.9.6 ; sys_platform != "win32" and sys_platform != "darwin" and plat # via -r requirements/static/ci/common.in pyjwt==2.4.0 # via adal -pynacl==1.5.0 ; python_version >= "3.9" +pynacl==1.5.0 # via # -r requirements/static/ci/common.in # paramiko diff --git a/requirements/static/ci/py3.9/darwin.txt b/requirements/static/ci/py3.9/darwin.txt index 609e1623e07..c088cf25eb0 100644 --- a/requirements/static/ci/py3.9/darwin.txt +++ b/requirements/static/ci/py3.9/darwin.txt @@ -358,7 +358,7 @@ certifi==2023.07.22 # requests certvalidator==0.11.1 # via vcert -cffi==1.15.1 ; python_version > "3.7" +cffi==1.15.1 # via # -r requirements/static/ci/common.in # azure-datalake-store @@ -697,7 +697,7 @@ pygit2==1.9.1 ; python_version >= "3.7" # via -r requirements/static/ci/darwin.in pyjwt==2.4.0 # via adal -pynacl==1.5.0 ; python_version >= "3.9" +pynacl==1.5.0 # via # -r requirements/static/ci/common.in # paramiko diff --git a/requirements/static/ci/py3.9/freebsd.txt b/requirements/static/ci/py3.9/freebsd.txt index 6c7c62d8a65..f10ea6a528d 100644 --- a/requirements/static/ci/py3.9/freebsd.txt +++ b/requirements/static/ci/py3.9/freebsd.txt @@ -356,7 +356,7 @@ certifi==2023.07.22 # requests certvalidator==0.11.1 # via vcert -cffi==1.15.1 ; python_version > "3.7" +cffi==1.15.1 # via # -r requirements/static/ci/common.in # azure-datalake-store @@ -696,7 +696,7 @@ pyinotify==0.9.6 ; sys_platform != "win32" and sys_platform != "darwin" and plat # via -r requirements/static/ci/common.in pyjwt==2.4.0 # via adal -pynacl==1.5.0 ; python_version >= "3.9" +pynacl==1.5.0 # via # -r requirements/static/ci/common.in # paramiko diff --git a/requirements/static/ci/py3.9/lint.txt b/requirements/static/ci/py3.9/lint.txt index 6b0791b6efc..26e10d45694 100644 --- a/requirements/static/ci/py3.9/lint.txt +++ b/requirements/static/ci/py3.9/lint.txt @@ -362,7 +362,7 @@ certifi==2023.07.22 # requests certvalidator==0.11.1 # via vcert -cffi==1.15.1 ; python_version > "3.7" +cffi==1.15.1 # via # -r requirements/static/ci/common.in # azure-datalake-store @@ -708,7 +708,7 @@ pylint==2.4.4 # saltpylint pymysql==1.0.2 ; python_version > "3.5" # via -r requirements/static/ci/linux.in -pynacl==1.5.0 ; python_version >= "3.9" +pynacl==1.5.0 # via # -r requirements/static/ci/common.in # paramiko diff --git a/requirements/static/ci/py3.9/linux.txt b/requirements/static/ci/py3.9/linux.txt index f46c58999e3..8373105cef7 100644 --- a/requirements/static/ci/py3.9/linux.txt +++ b/requirements/static/ci/py3.9/linux.txt @@ -372,7 +372,7 @@ certifi==2023.07.22 # requests certvalidator==0.11.1 # via vcert -cffi==1.15.1 ; python_version > "3.7" +cffi==1.15.1 # via # -r requirements/static/ci/common.in # azure-datalake-store @@ -718,7 +718,7 @@ pyjwt==2.4.0 # twilio pymysql==1.0.2 ; python_version > "3.5" # via -r requirements/static/ci/linux.in -pynacl==1.5.0 ; python_version >= "3.9" +pynacl==1.5.0 # via # -r requirements/static/ci/common.in # paramiko diff --git a/requirements/static/ci/py3.9/windows.txt b/requirements/static/ci/py3.9/windows.txt index 38cfc73db51..7874d241d12 100644 --- a/requirements/static/ci/py3.9/windows.txt +++ b/requirements/static/ci/py3.9/windows.txt @@ -44,7 +44,7 @@ certifi==2023.07.22 # -r requirements/windows.txt # kubernetes # requests -cffi==1.15.1 ; python_version > "3.7" +cffi==1.15.1 # via # -r requirements/static/ci/common.in # -r requirements/windows.txt @@ -240,7 +240,7 @@ pymssql==2.2.1 # via -r requirements/windows.txt pymysql==1.0.2 # via -r requirements/windows.txt -pynacl==1.5.0 ; python_version >= "3.9" +pynacl==1.5.0 # via -r requirements/static/ci/common.in pyopenssl==23.2.0 # via diff --git a/salt/__init__.py b/salt/__init__.py index edf7ff172f7..f75da5eb607 100644 --- a/salt/__init__.py +++ b/salt/__init__.py @@ -3,13 +3,10 @@ Salt package """ import importlib -import logging import os import sys import warnings -log = logging.getLogger() - if sys.version_info < (3,): sys.stderr.write( "\n\nAfter the Sodium release, 3001, Salt no longer supports Python 2. Exiting.\n\n" From af8d19061afb19da2f3e889e1278a7ee63035f0d Mon Sep 17 00:00:00 2001 From: David Murphy < dmurphy@saltstack.com> Date: Mon, 17 Jul 2023 17:50:55 -0600 Subject: [PATCH 233/393] Updated test to use importorskip, downgrade pyyaml to 5.3.1 to work around cython 3.0 issues --- changelog/{64372.fixed.md => 64372.changed.md} | 0 requirements/base.txt | 1 + requirements/static/ci/py3.10/cloud.txt | 2 ++ requirements/static/ci/py3.10/darwin.txt | 2 ++ requirements/static/ci/py3.10/docs.txt | 4 ++++ requirements/static/ci/py3.10/freebsd.txt | 2 ++ requirements/static/ci/py3.10/lint.txt | 2 ++ requirements/static/ci/py3.10/linux.txt | 2 ++ .../static/ci/py3.10/pkgtests-windows.txt | 2 ++ requirements/static/ci/py3.10/pkgtests.txt | 2 ++ requirements/static/ci/py3.10/windows.txt | 2 ++ requirements/static/ci/py3.7/cloud.txt | 2 ++ requirements/static/ci/py3.7/docs.txt | 4 ++++ requirements/static/ci/py3.7/freebsd.txt | 2 ++ requirements/static/ci/py3.7/lint.txt | 2 ++ requirements/static/ci/py3.7/linux.txt | 2 ++ requirements/static/ci/py3.7/windows.txt | 2 ++ requirements/static/ci/py3.8/cloud.txt | 2 ++ requirements/static/ci/py3.8/docs.txt | 4 ++++ requirements/static/ci/py3.8/freebsd.txt | 2 ++ requirements/static/ci/py3.8/lint.txt | 2 ++ requirements/static/ci/py3.8/linux.txt | 2 ++ requirements/static/ci/py3.8/windows.txt | 2 ++ requirements/static/ci/py3.9/cloud.txt | 2 ++ requirements/static/ci/py3.9/darwin.txt | 2 ++ requirements/static/ci/py3.9/docs.txt | 4 ++++ requirements/static/ci/py3.9/freebsd.txt | 2 ++ requirements/static/ci/py3.9/lint.txt | 2 ++ requirements/static/ci/py3.9/linux.txt | 2 ++ requirements/static/ci/py3.9/windows.txt | 2 ++ requirements/static/pkg/py3.10/darwin.txt | 2 ++ requirements/static/pkg/py3.10/freebsd.txt | 2 ++ requirements/static/pkg/py3.10/linux.txt | 2 ++ requirements/static/pkg/py3.10/windows.txt | 2 ++ requirements/static/pkg/py3.7/freebsd.txt | 2 ++ requirements/static/pkg/py3.7/linux.txt | 2 ++ requirements/static/pkg/py3.7/windows.txt | 2 ++ requirements/static/pkg/py3.8/freebsd.txt | 2 ++ requirements/static/pkg/py3.8/linux.txt | 2 ++ requirements/static/pkg/py3.8/windows.txt | 2 ++ requirements/static/pkg/py3.9/darwin.txt | 2 ++ requirements/static/pkg/py3.9/freebsd.txt | 2 ++ requirements/static/pkg/py3.9/linux.txt | 2 ++ requirements/static/pkg/py3.9/windows.txt | 2 ++ salt/utils/nacl.py | 5 ----- tests/pytests/integration/runners/test_nacl.py | 15 +++++---------- tests/pytests/unit/modules/test_nacl.py | 11 +++-------- tests/pytests/unit/utils/test_nacl.py | 11 +++-------- 48 files changed, 104 insertions(+), 31 deletions(-) rename changelog/{64372.fixed.md => 64372.changed.md} (100%) diff --git a/changelog/64372.fixed.md b/changelog/64372.changed.md similarity index 100% rename from changelog/64372.fixed.md rename to changelog/64372.changed.md diff --git a/requirements/base.txt b/requirements/base.txt index c19d8804a2b..b3a8e7947ca 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -1,3 +1,4 @@ +cython Jinja2 jmespath msgpack>=0.5,!=0.5.5 diff --git a/requirements/static/ci/py3.10/cloud.txt b/requirements/static/ci/py3.10/cloud.txt index 797e0030942..67741070f20 100644 --- a/requirements/static/ci/py3.10/cloud.txt +++ b/requirements/static/ci/py3.10/cloud.txt @@ -400,6 +400,8 @@ cryptography==41.0.2 # requests-ntlm # smbprotocol # vcert +cython==0.29.36 + # via -r requirements/base.txt distlib==0.3.2 # via virtualenv distro==1.6.0 diff --git a/requirements/static/ci/py3.10/darwin.txt b/requirements/static/ci/py3.10/darwin.txt index 5bf23112ab6..d902501a9b4 100644 --- a/requirements/static/ci/py3.10/darwin.txt +++ b/requirements/static/ci/py3.10/darwin.txt @@ -398,6 +398,8 @@ cryptography==41.0.2 # paramiko # pyopenssl # vcert +cython==0.29.36 + # via -r requirements/base.txt distlib==0.3.2 # via virtualenv distro==1.5.0 diff --git a/requirements/static/ci/py3.10/docs.txt b/requirements/static/ci/py3.10/docs.txt index 588b8682f56..c360b5bd2f9 100644 --- a/requirements/static/ci/py3.10/docs.txt +++ b/requirements/static/ci/py3.10/docs.txt @@ -28,6 +28,10 @@ contextvars==2.4 # via # -c requirements/static/ci/py3.10/linux.txt # -r requirements/base.txt +cython==0.29.36 + # via + # -c requirements/static/ci/py3.10/linux.txt + # -r requirements/base.txt distro==1.5.0 # via # -c requirements/static/ci/py3.10/linux.txt diff --git a/requirements/static/ci/py3.10/freebsd.txt b/requirements/static/ci/py3.10/freebsd.txt index 009befe86ff..7d2e2a17ecc 100644 --- a/requirements/static/ci/py3.10/freebsd.txt +++ b/requirements/static/ci/py3.10/freebsd.txt @@ -395,6 +395,8 @@ cryptography==41.0.2 # paramiko # pyopenssl # vcert +cython==0.29.36 + # via -r requirements/base.txt distlib==0.3.2 # via virtualenv distro==1.5.0 diff --git a/requirements/static/ci/py3.10/lint.txt b/requirements/static/ci/py3.10/lint.txt index a724c32d3c9..f51f38b26dc 100644 --- a/requirements/static/ci/py3.10/lint.txt +++ b/requirements/static/ci/py3.10/lint.txt @@ -403,6 +403,8 @@ cryptography==41.0.2 # paramiko # pyopenssl # vcert +cython==0.29.36 + # via -r requirements/base.txt distlib==0.3.2 # via virtualenv distro==1.6.0 diff --git a/requirements/static/ci/py3.10/linux.txt b/requirements/static/ci/py3.10/linux.txt index 15892aa82db..89f8d79aa9a 100644 --- a/requirements/static/ci/py3.10/linux.txt +++ b/requirements/static/ci/py3.10/linux.txt @@ -411,6 +411,8 @@ cryptography==41.0.2 # paramiko # pyopenssl # vcert +cython==0.29.36 + # via -r requirements/base.txt distlib==0.3.2 # via virtualenv distro==1.5.0 diff --git a/requirements/static/ci/py3.10/pkgtests-windows.txt b/requirements/static/ci/py3.10/pkgtests-windows.txt index de7ee93e182..541057a6988 100644 --- a/requirements/static/ci/py3.10/pkgtests-windows.txt +++ b/requirements/static/ci/py3.10/pkgtests-windows.txt @@ -29,6 +29,8 @@ colorama==0.4.6 # via pytest contextvars==2.4 # via -r requirements/base.txt +cython==0.29.36 + # via -r requirements/base.txt distlib==0.3.6 # via virtualenv distro==1.8.0 diff --git a/requirements/static/ci/py3.10/pkgtests.txt b/requirements/static/ci/py3.10/pkgtests.txt index 127e64a8857..13ea9ee51eb 100644 --- a/requirements/static/ci/py3.10/pkgtests.txt +++ b/requirements/static/ci/py3.10/pkgtests.txt @@ -23,6 +23,8 @@ cherrypy==18.8.0 # via -r requirements/static/ci/pkgtests.in contextvars==2.4 # via -r requirements/base.txt +cython==0.29.36 + # via -r requirements/base.txt distlib==0.3.6 # via virtualenv distro==1.8.0 diff --git a/requirements/static/ci/py3.10/windows.txt b/requirements/static/ci/py3.10/windows.txt index 15fd9ed41b1..ddaec5d1b98 100644 --- a/requirements/static/ci/py3.10/windows.txt +++ b/requirements/static/ci/py3.10/windows.txt @@ -79,6 +79,8 @@ cryptography==41.0.2 # moto # pyopenssl # requests-ntlm +cython==0.29.36 + # via -r requirements/base.txt distlib==0.3.6 # via virtualenv distro==1.5.0 diff --git a/requirements/static/ci/py3.7/cloud.txt b/requirements/static/ci/py3.7/cloud.txt index 600b0bd5392..d1eea4d5b77 100644 --- a/requirements/static/ci/py3.7/cloud.txt +++ b/requirements/static/ci/py3.7/cloud.txt @@ -407,6 +407,8 @@ cryptography==41.0.2 # requests-ntlm # smbprotocol # vcert +cython==0.29.36 + # via -r requirements/base.txt distlib==0.3.3 # via virtualenv distro==1.6.0 diff --git a/requirements/static/ci/py3.7/docs.txt b/requirements/static/ci/py3.7/docs.txt index 31209a994b2..32a688bfd1f 100644 --- a/requirements/static/ci/py3.7/docs.txt +++ b/requirements/static/ci/py3.7/docs.txt @@ -28,6 +28,10 @@ contextvars==2.4 # via # -c requirements/static/ci/py3.7/linux.txt # -r requirements/base.txt +cython==0.29.36 + # via + # -c requirements/static/ci/py3.7/linux.txt + # -r requirements/base.txt distro==1.5.0 # via # -c requirements/static/ci/py3.7/linux.txt diff --git a/requirements/static/ci/py3.7/freebsd.txt b/requirements/static/ci/py3.7/freebsd.txt index 5cbcb1ec49b..9f451efe86e 100644 --- a/requirements/static/ci/py3.7/freebsd.txt +++ b/requirements/static/ci/py3.7/freebsd.txt @@ -402,6 +402,8 @@ cryptography==41.0.2 # paramiko # pyopenssl # vcert +cython==0.29.36 + # via -r requirements/base.txt distlib==0.3.2 # via virtualenv distro==1.5.0 diff --git a/requirements/static/ci/py3.7/lint.txt b/requirements/static/ci/py3.7/lint.txt index 2c1d983fa11..63bbc5f0d39 100644 --- a/requirements/static/ci/py3.7/lint.txt +++ b/requirements/static/ci/py3.7/lint.txt @@ -412,6 +412,8 @@ cryptography==41.0.2 # paramiko # pyopenssl # vcert +cython==0.29.36 + # via -r requirements/base.txt distlib==0.3.2 # via virtualenv distro==1.6.0 diff --git a/requirements/static/ci/py3.7/linux.txt b/requirements/static/ci/py3.7/linux.txt index 1211423a9e8..8157c49929b 100644 --- a/requirements/static/ci/py3.7/linux.txt +++ b/requirements/static/ci/py3.7/linux.txt @@ -418,6 +418,8 @@ cryptography==41.0.2 # paramiko # pyopenssl # vcert +cython==0.29.36 + # via -r requirements/base.txt distlib==0.3.2 # via virtualenv distro==1.5.0 diff --git a/requirements/static/ci/py3.7/windows.txt b/requirements/static/ci/py3.7/windows.txt index 98dee3392b9..a9dde8fb4d9 100644 --- a/requirements/static/ci/py3.7/windows.txt +++ b/requirements/static/ci/py3.7/windows.txt @@ -85,6 +85,8 @@ cryptography==41.0.2 # moto # pyopenssl # requests-ntlm +cython==0.29.36 + # via -r requirements/base.txt distlib==0.3.2 # via virtualenv distro==1.5.0 diff --git a/requirements/static/ci/py3.8/cloud.txt b/requirements/static/ci/py3.8/cloud.txt index 9a9be0b4f18..8c2b8bee980 100644 --- a/requirements/static/ci/py3.8/cloud.txt +++ b/requirements/static/ci/py3.8/cloud.txt @@ -405,6 +405,8 @@ cryptography==41.0.2 # requests-ntlm # smbprotocol # vcert +cython==0.29.36 + # via -r requirements/base.txt distlib==0.3.3 # via virtualenv distro==1.6.0 diff --git a/requirements/static/ci/py3.8/docs.txt b/requirements/static/ci/py3.8/docs.txt index da96a0c3bfb..f0a237306e7 100644 --- a/requirements/static/ci/py3.8/docs.txt +++ b/requirements/static/ci/py3.8/docs.txt @@ -28,6 +28,10 @@ contextvars==2.4 # via # -c requirements/static/ci/py3.8/linux.txt # -r requirements/base.txt +cython==0.29.36 + # via + # -c requirements/static/ci/py3.8/linux.txt + # -r requirements/base.txt distro==1.5.0 # via # -c requirements/static/ci/py3.8/linux.txt diff --git a/requirements/static/ci/py3.8/freebsd.txt b/requirements/static/ci/py3.8/freebsd.txt index 4af8390b311..595091dc02f 100644 --- a/requirements/static/ci/py3.8/freebsd.txt +++ b/requirements/static/ci/py3.8/freebsd.txt @@ -400,6 +400,8 @@ cryptography==41.0.2 # paramiko # pyopenssl # vcert +cython==0.29.36 + # via -r requirements/base.txt distlib==0.3.2 # via virtualenv distro==1.5.0 diff --git a/requirements/static/ci/py3.8/lint.txt b/requirements/static/ci/py3.8/lint.txt index 7f356487283..9467bc6c7e3 100644 --- a/requirements/static/ci/py3.8/lint.txt +++ b/requirements/static/ci/py3.8/lint.txt @@ -410,6 +410,8 @@ cryptography==41.0.2 # paramiko # pyopenssl # vcert +cython==0.29.36 + # via -r requirements/base.txt distlib==0.3.2 # via virtualenv distro==1.6.0 diff --git a/requirements/static/ci/py3.8/linux.txt b/requirements/static/ci/py3.8/linux.txt index 981576f2e0e..e1b6fba1e7b 100644 --- a/requirements/static/ci/py3.8/linux.txt +++ b/requirements/static/ci/py3.8/linux.txt @@ -416,6 +416,8 @@ cryptography==41.0.2 # paramiko # pyopenssl # vcert +cython==0.29.36 + # via -r requirements/base.txt distlib==0.3.2 # via virtualenv distro==1.5.0 diff --git a/requirements/static/ci/py3.8/windows.txt b/requirements/static/ci/py3.8/windows.txt index 4bc662a75af..33c410621c0 100644 --- a/requirements/static/ci/py3.8/windows.txt +++ b/requirements/static/ci/py3.8/windows.txt @@ -81,6 +81,8 @@ cryptography==41.0.2 # moto # pyopenssl # requests-ntlm +cython==0.29.36 + # via -r requirements/base.txt distlib==0.3.2 # via virtualenv distro==1.5.0 diff --git a/requirements/static/ci/py3.9/cloud.txt b/requirements/static/ci/py3.9/cloud.txt index c5ea66d3980..6e40a4f59e0 100644 --- a/requirements/static/ci/py3.9/cloud.txt +++ b/requirements/static/ci/py3.9/cloud.txt @@ -405,6 +405,8 @@ cryptography==41.0.2 # requests-ntlm # smbprotocol # vcert +cython==0.29.36 + # via -r requirements/base.txt distlib==0.3.3 # via virtualenv distro==1.6.0 diff --git a/requirements/static/ci/py3.9/darwin.txt b/requirements/static/ci/py3.9/darwin.txt index c088cf25eb0..51ade7faa5a 100644 --- a/requirements/static/ci/py3.9/darwin.txt +++ b/requirements/static/ci/py3.9/darwin.txt @@ -403,6 +403,8 @@ cryptography==41.0.2 # paramiko # pyopenssl # vcert +cython==0.29.36 + # via -r requirements/base.txt distlib==0.3.2 # via virtualenv distro==1.5.0 diff --git a/requirements/static/ci/py3.9/docs.txt b/requirements/static/ci/py3.9/docs.txt index 772a37c357a..2fe7dc49d12 100644 --- a/requirements/static/ci/py3.9/docs.txt +++ b/requirements/static/ci/py3.9/docs.txt @@ -28,6 +28,10 @@ contextvars==2.4 # via # -c requirements/static/ci/py3.9/linux.txt # -r requirements/base.txt +cython==0.29.36 + # via + # -c requirements/static/ci/py3.9/linux.txt + # -r requirements/base.txt distro==1.5.0 # via # -c requirements/static/ci/py3.9/linux.txt diff --git a/requirements/static/ci/py3.9/freebsd.txt b/requirements/static/ci/py3.9/freebsd.txt index f10ea6a528d..f60d47923a9 100644 --- a/requirements/static/ci/py3.9/freebsd.txt +++ b/requirements/static/ci/py3.9/freebsd.txt @@ -400,6 +400,8 @@ cryptography==41.0.2 # paramiko # pyopenssl # vcert +cython==0.29.36 + # via -r requirements/base.txt distlib==0.3.2 # via virtualenv distro==1.5.0 diff --git a/requirements/static/ci/py3.9/lint.txt b/requirements/static/ci/py3.9/lint.txt index 26e10d45694..c2fb489ded4 100644 --- a/requirements/static/ci/py3.9/lint.txt +++ b/requirements/static/ci/py3.9/lint.txt @@ -408,6 +408,8 @@ cryptography==41.0.2 # paramiko # pyopenssl # vcert +cython==0.29.36 + # via -r requirements/base.txt distlib==0.3.2 # via virtualenv distro==1.6.0 diff --git a/requirements/static/ci/py3.9/linux.txt b/requirements/static/ci/py3.9/linux.txt index 8373105cef7..b3d7afda296 100644 --- a/requirements/static/ci/py3.9/linux.txt +++ b/requirements/static/ci/py3.9/linux.txt @@ -418,6 +418,8 @@ cryptography==41.0.2 # paramiko # pyopenssl # vcert +cython==0.29.36 + # via -r requirements/base.txt distlib==0.3.2 # via virtualenv distro==1.5.0 diff --git a/requirements/static/ci/py3.9/windows.txt b/requirements/static/ci/py3.9/windows.txt index 7874d241d12..989001c9b85 100644 --- a/requirements/static/ci/py3.9/windows.txt +++ b/requirements/static/ci/py3.9/windows.txt @@ -81,6 +81,8 @@ cryptography==41.0.2 # moto # pyopenssl # requests-ntlm +cython==0.29.36 + # via -r requirements/base.txt distlib==0.3.2 # via virtualenv distro==1.5.0 diff --git a/requirements/static/pkg/py3.10/darwin.txt b/requirements/static/pkg/py3.10/darwin.txt index e2667937927..6608855910e 100644 --- a/requirements/static/pkg/py3.10/darwin.txt +++ b/requirements/static/pkg/py3.10/darwin.txt @@ -22,6 +22,8 @@ cryptography==41.0.2 # via # -r requirements/darwin.txt # pyopenssl +cython==0.29.36 + # via -r requirements/base.txt distro==1.5.0 # via -r requirements/base.txt gitdb==4.0.5 diff --git a/requirements/static/pkg/py3.10/freebsd.txt b/requirements/static/pkg/py3.10/freebsd.txt index 8d2fe56ad5a..f1e1b2379f4 100644 --- a/requirements/static/pkg/py3.10/freebsd.txt +++ b/requirements/static/pkg/py3.10/freebsd.txt @@ -18,6 +18,8 @@ contextvars==2.4 # via -r requirements/base.txt cryptography==41.0.2 # via pyopenssl +cython==0.29.36 + # via -r requirements/base.txt distro==1.5.0 # via # -r requirements/base.txt diff --git a/requirements/static/pkg/py3.10/linux.txt b/requirements/static/pkg/py3.10/linux.txt index 2219e99e56a..8d5e005eadb 100644 --- a/requirements/static/pkg/py3.10/linux.txt +++ b/requirements/static/pkg/py3.10/linux.txt @@ -20,6 +20,8 @@ cryptography==41.0.2 # via # -r requirements/static/pkg/linux.in # pyopenssl +cython==0.29.36 + # via -r requirements/base.txt distro==1.5.0 # via -r requirements/base.txt idna==2.8 diff --git a/requirements/static/pkg/py3.10/windows.txt b/requirements/static/pkg/py3.10/windows.txt index 889f1288b18..f12de31741d 100644 --- a/requirements/static/pkg/py3.10/windows.txt +++ b/requirements/static/pkg/py3.10/windows.txt @@ -27,6 +27,8 @@ cryptography==41.0.2 # via # -r requirements/windows.txt # pyopenssl +cython==0.29.36 + # via -r requirements/base.txt distro==1.5.0 # via -r requirements/base.txt gitdb==4.0.7 diff --git a/requirements/static/pkg/py3.7/freebsd.txt b/requirements/static/pkg/py3.7/freebsd.txt index af258097ffd..5cee85df464 100644 --- a/requirements/static/pkg/py3.7/freebsd.txt +++ b/requirements/static/pkg/py3.7/freebsd.txt @@ -18,6 +18,8 @@ contextvars==2.4 # via -r requirements/base.txt cryptography==41.0.2 # via pyopenssl +cython==0.29.36 + # via -r requirements/base.txt distro==1.5.0 # via # -r requirements/base.txt diff --git a/requirements/static/pkg/py3.7/linux.txt b/requirements/static/pkg/py3.7/linux.txt index 376d4300a45..b4910c94b06 100644 --- a/requirements/static/pkg/py3.7/linux.txt +++ b/requirements/static/pkg/py3.7/linux.txt @@ -20,6 +20,8 @@ cryptography==41.0.2 # via # -r requirements/static/pkg/linux.in # pyopenssl +cython==0.29.36 + # via -r requirements/base.txt distro==1.5.0 # via -r requirements/base.txt idna==2.8 diff --git a/requirements/static/pkg/py3.7/windows.txt b/requirements/static/pkg/py3.7/windows.txt index 9b12b209653..db4ff2ceea7 100644 --- a/requirements/static/pkg/py3.7/windows.txt +++ b/requirements/static/pkg/py3.7/windows.txt @@ -27,6 +27,8 @@ cryptography==41.0.2 # via # -r requirements/windows.txt # pyopenssl +cython==0.29.36 + # via -r requirements/base.txt distro==1.5.0 # via -r requirements/base.txt gitdb==4.0.7 diff --git a/requirements/static/pkg/py3.8/freebsd.txt b/requirements/static/pkg/py3.8/freebsd.txt index d95e3798e96..ba35c0cc6ba 100644 --- a/requirements/static/pkg/py3.8/freebsd.txt +++ b/requirements/static/pkg/py3.8/freebsd.txt @@ -18,6 +18,8 @@ contextvars==2.4 # via -r requirements/base.txt cryptography==41.0.2 # via pyopenssl +cython==0.29.36 + # via -r requirements/base.txt distro==1.5.0 # via # -r requirements/base.txt diff --git a/requirements/static/pkg/py3.8/linux.txt b/requirements/static/pkg/py3.8/linux.txt index 59c1f49d169..8d23b1ec139 100644 --- a/requirements/static/pkg/py3.8/linux.txt +++ b/requirements/static/pkg/py3.8/linux.txt @@ -20,6 +20,8 @@ cryptography==41.0.2 # via # -r requirements/static/pkg/linux.in # pyopenssl +cython==0.29.36 + # via -r requirements/base.txt distro==1.5.0 # via -r requirements/base.txt idna==2.8 diff --git a/requirements/static/pkg/py3.8/windows.txt b/requirements/static/pkg/py3.8/windows.txt index 96d4e217b1a..f11a6c3bac2 100644 --- a/requirements/static/pkg/py3.8/windows.txt +++ b/requirements/static/pkg/py3.8/windows.txt @@ -27,6 +27,8 @@ cryptography==41.0.2 # via # -r requirements/windows.txt # pyopenssl +cython==0.29.36 + # via -r requirements/base.txt distro==1.5.0 # via -r requirements/base.txt gitdb==4.0.7 diff --git a/requirements/static/pkg/py3.9/darwin.txt b/requirements/static/pkg/py3.9/darwin.txt index 89449fc9055..4469fb91751 100644 --- a/requirements/static/pkg/py3.9/darwin.txt +++ b/requirements/static/pkg/py3.9/darwin.txt @@ -22,6 +22,8 @@ cryptography==41.0.2 # via # -r requirements/darwin.txt # pyopenssl +cython==0.29.36 + # via -r requirements/base.txt distro==1.5.0 # via -r requirements/base.txt gitdb==4.0.5 diff --git a/requirements/static/pkg/py3.9/freebsd.txt b/requirements/static/pkg/py3.9/freebsd.txt index 739271e590e..cb519a46993 100644 --- a/requirements/static/pkg/py3.9/freebsd.txt +++ b/requirements/static/pkg/py3.9/freebsd.txt @@ -18,6 +18,8 @@ contextvars==2.4 # via -r requirements/base.txt cryptography==41.0.2 # via pyopenssl +cython==0.29.36 + # via -r requirements/base.txt distro==1.5.0 # via # -r requirements/base.txt diff --git a/requirements/static/pkg/py3.9/linux.txt b/requirements/static/pkg/py3.9/linux.txt index 6c5fed38051..5be38437e59 100644 --- a/requirements/static/pkg/py3.9/linux.txt +++ b/requirements/static/pkg/py3.9/linux.txt @@ -20,6 +20,8 @@ cryptography==41.0.2 # via # -r requirements/static/pkg/linux.in # pyopenssl +cython==0.29.36 + # via -r requirements/base.txt distro==1.5.0 # via -r requirements/base.txt idna==2.8 diff --git a/requirements/static/pkg/py3.9/windows.txt b/requirements/static/pkg/py3.9/windows.txt index 42ca414ea99..f21f6fc1124 100644 --- a/requirements/static/pkg/py3.9/windows.txt +++ b/requirements/static/pkg/py3.9/windows.txt @@ -27,6 +27,8 @@ cryptography==41.0.2 # via # -r requirements/windows.txt # pyopenssl +cython==0.29.36 + # via -r requirements/base.txt distro==1.5.0 # via -r requirements/base.txt gitdb==4.0.7 diff --git a/salt/utils/nacl.py b/salt/utils/nacl.py index 20239ff35f7..b04904c2e14 100644 --- a/salt/utils/nacl.py +++ b/salt/utils/nacl.py @@ -2,9 +2,7 @@ Common code shared between the nacl module and runner. """ - import base64 -import logging import os import salt.syspaths @@ -15,9 +13,6 @@ import salt.utils.versions import salt.utils.win_dacl import salt.utils.win_functions -log = logging.getLogger(__name__) - - REQ_ERROR = None try: import nacl.public diff --git a/tests/pytests/integration/runners/test_nacl.py b/tests/pytests/integration/runners/test_nacl.py index 5e4688a79c8..dbdaf9db9ef 100644 --- a/tests/pytests/integration/runners/test_nacl.py +++ b/tests/pytests/integration/runners/test_nacl.py @@ -8,21 +8,16 @@ import salt.config import salt.utils.stringutils from tests.support.mock import patch +pytest.importorskip("nacl.public") +pytest.importorskip("nacl.secret") + +import salt.runners.nacl as nacl + pytestmark = [ pytest.mark.windows_whitelisted, ] -try: - import salt.runners.nacl as nacl - HAS_PYNACL = True -except (ImportError, OSError, AttributeError): - HAS_PYNACL = False - - -@pytest.mark.skipif( - not HAS_PYNACL, reason="skipping test_nacl, reason=PyNaCl is unavailable" -) @pytest.fixture(scope="module") def minion_opts(): return salt.config.minion_config(None) diff --git a/tests/pytests/unit/modules/test_nacl.py b/tests/pytests/unit/modules/test_nacl.py index 9e4e4796842..915e2c5e3dd 100644 --- a/tests/pytests/unit/modules/test_nacl.py +++ b/tests/pytests/unit/modules/test_nacl.py @@ -6,17 +6,12 @@ import pytest import salt.utils.stringutils from tests.support.mock import patch -try: - import salt.modules.nacl as nacl +pytest.importorskip("nacl.public") +pytest.importorskip("nacl.secret") - HAS_PYNACL = True -except (ImportError, OSError, AttributeError): - HAS_PYNACL = False +import salt.modules.nacl as nacl -@pytest.mark.skipif( - not HAS_PYNACL, reason="skipping test_nacl, reason=PyNaCl is unavailable" -) @pytest.fixture def configure_loader_modules(minion_opts): utils = salt.loader.utils(minion_opts) diff --git a/tests/pytests/unit/utils/test_nacl.py b/tests/pytests/unit/utils/test_nacl.py index c23f6bc0846..77f40d6fbf9 100644 --- a/tests/pytests/unit/utils/test_nacl.py +++ b/tests/pytests/unit/utils/test_nacl.py @@ -9,17 +9,12 @@ import salt.modules.config as config import salt.utils.files from tests.support.mock import patch -try: - import salt.utils.nacl as nacl +pytest.importorskip("nacl.public") +pytest.importorskip("nacl.secret") - HAS_PYNACL = nacl.check_requirements -except (ImportError, OSError, AttributeError): - HAS_PYNACL = False +import salt.utils.nacl as nacl -@pytest.mark.skipif( - not HAS_PYNACL, reason="skipping test_nacl, reason=PyNaCl is unavailable" -) @pytest.fixture def configure_loader_modules(): return { From 80785185ac00b9a7e416833d2253cc2b39d87f74 Mon Sep 17 00:00:00 2001 From: David Murphy < dmurphy@saltstack.com> Date: Tue, 18 Jul 2023 09:01:17 -0600 Subject: [PATCH 234/393] Remove cython and other pyyaml changes, now pyyaml 6.0.1 fixes cython 3.0 issue --- requirements/base.txt | 1 - requirements/static/ci/py3.10/cloud.txt | 2 -- requirements/static/ci/py3.10/darwin.txt | 2 -- requirements/static/ci/py3.10/docs.txt | 4 ---- requirements/static/ci/py3.10/freebsd.txt | 2 -- requirements/static/ci/py3.10/lint.txt | 2 -- requirements/static/ci/py3.10/linux.txt | 2 -- requirements/static/ci/py3.10/pkgtests-windows.txt | 2 -- requirements/static/ci/py3.10/pkgtests.txt | 2 -- requirements/static/ci/py3.10/windows.txt | 2 -- requirements/static/ci/py3.7/cloud.txt | 2 -- requirements/static/ci/py3.7/docs.txt | 4 ---- requirements/static/ci/py3.7/freebsd.txt | 2 -- requirements/static/ci/py3.7/lint.txt | 2 -- requirements/static/ci/py3.7/linux.txt | 2 -- requirements/static/ci/py3.7/windows.txt | 2 -- requirements/static/ci/py3.8/cloud.txt | 2 -- requirements/static/ci/py3.8/docs.txt | 4 ---- requirements/static/ci/py3.8/freebsd.txt | 2 -- requirements/static/ci/py3.8/lint.txt | 2 -- requirements/static/ci/py3.8/linux.txt | 2 -- requirements/static/ci/py3.8/windows.txt | 2 -- requirements/static/ci/py3.9/cloud.txt | 2 -- requirements/static/ci/py3.9/darwin.txt | 2 -- requirements/static/ci/py3.9/docs.txt | 4 ---- requirements/static/ci/py3.9/freebsd.txt | 2 -- requirements/static/ci/py3.9/lint.txt | 2 -- requirements/static/ci/py3.9/linux.txt | 2 -- requirements/static/ci/py3.9/windows.txt | 2 -- requirements/static/pkg/py3.10/darwin.txt | 2 -- requirements/static/pkg/py3.10/freebsd.txt | 2 -- requirements/static/pkg/py3.10/linux.txt | 2 -- requirements/static/pkg/py3.10/windows.txt | 2 -- requirements/static/pkg/py3.7/freebsd.txt | 2 -- requirements/static/pkg/py3.7/linux.txt | 2 -- requirements/static/pkg/py3.7/windows.txt | 2 -- requirements/static/pkg/py3.8/freebsd.txt | 2 -- requirements/static/pkg/py3.8/linux.txt | 2 -- requirements/static/pkg/py3.8/windows.txt | 2 -- requirements/static/pkg/py3.9/darwin.txt | 2 -- requirements/static/pkg/py3.9/freebsd.txt | 2 -- requirements/static/pkg/py3.9/linux.txt | 2 -- requirements/static/pkg/py3.9/windows.txt | 2 -- 43 files changed, 93 deletions(-) diff --git a/requirements/base.txt b/requirements/base.txt index b3a8e7947ca..c19d8804a2b 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -1,4 +1,3 @@ -cython Jinja2 jmespath msgpack>=0.5,!=0.5.5 diff --git a/requirements/static/ci/py3.10/cloud.txt b/requirements/static/ci/py3.10/cloud.txt index 67741070f20..797e0030942 100644 --- a/requirements/static/ci/py3.10/cloud.txt +++ b/requirements/static/ci/py3.10/cloud.txt @@ -400,8 +400,6 @@ cryptography==41.0.2 # requests-ntlm # smbprotocol # vcert -cython==0.29.36 - # via -r requirements/base.txt distlib==0.3.2 # via virtualenv distro==1.6.0 diff --git a/requirements/static/ci/py3.10/darwin.txt b/requirements/static/ci/py3.10/darwin.txt index d902501a9b4..5bf23112ab6 100644 --- a/requirements/static/ci/py3.10/darwin.txt +++ b/requirements/static/ci/py3.10/darwin.txt @@ -398,8 +398,6 @@ cryptography==41.0.2 # paramiko # pyopenssl # vcert -cython==0.29.36 - # via -r requirements/base.txt distlib==0.3.2 # via virtualenv distro==1.5.0 diff --git a/requirements/static/ci/py3.10/docs.txt b/requirements/static/ci/py3.10/docs.txt index c360b5bd2f9..588b8682f56 100644 --- a/requirements/static/ci/py3.10/docs.txt +++ b/requirements/static/ci/py3.10/docs.txt @@ -28,10 +28,6 @@ contextvars==2.4 # via # -c requirements/static/ci/py3.10/linux.txt # -r requirements/base.txt -cython==0.29.36 - # via - # -c requirements/static/ci/py3.10/linux.txt - # -r requirements/base.txt distro==1.5.0 # via # -c requirements/static/ci/py3.10/linux.txt diff --git a/requirements/static/ci/py3.10/freebsd.txt b/requirements/static/ci/py3.10/freebsd.txt index 7d2e2a17ecc..009befe86ff 100644 --- a/requirements/static/ci/py3.10/freebsd.txt +++ b/requirements/static/ci/py3.10/freebsd.txt @@ -395,8 +395,6 @@ cryptography==41.0.2 # paramiko # pyopenssl # vcert -cython==0.29.36 - # via -r requirements/base.txt distlib==0.3.2 # via virtualenv distro==1.5.0 diff --git a/requirements/static/ci/py3.10/lint.txt b/requirements/static/ci/py3.10/lint.txt index f51f38b26dc..a724c32d3c9 100644 --- a/requirements/static/ci/py3.10/lint.txt +++ b/requirements/static/ci/py3.10/lint.txt @@ -403,8 +403,6 @@ cryptography==41.0.2 # paramiko # pyopenssl # vcert -cython==0.29.36 - # via -r requirements/base.txt distlib==0.3.2 # via virtualenv distro==1.6.0 diff --git a/requirements/static/ci/py3.10/linux.txt b/requirements/static/ci/py3.10/linux.txt index 89f8d79aa9a..15892aa82db 100644 --- a/requirements/static/ci/py3.10/linux.txt +++ b/requirements/static/ci/py3.10/linux.txt @@ -411,8 +411,6 @@ cryptography==41.0.2 # paramiko # pyopenssl # vcert -cython==0.29.36 - # via -r requirements/base.txt distlib==0.3.2 # via virtualenv distro==1.5.0 diff --git a/requirements/static/ci/py3.10/pkgtests-windows.txt b/requirements/static/ci/py3.10/pkgtests-windows.txt index 541057a6988..de7ee93e182 100644 --- a/requirements/static/ci/py3.10/pkgtests-windows.txt +++ b/requirements/static/ci/py3.10/pkgtests-windows.txt @@ -29,8 +29,6 @@ colorama==0.4.6 # via pytest contextvars==2.4 # via -r requirements/base.txt -cython==0.29.36 - # via -r requirements/base.txt distlib==0.3.6 # via virtualenv distro==1.8.0 diff --git a/requirements/static/ci/py3.10/pkgtests.txt b/requirements/static/ci/py3.10/pkgtests.txt index 13ea9ee51eb..127e64a8857 100644 --- a/requirements/static/ci/py3.10/pkgtests.txt +++ b/requirements/static/ci/py3.10/pkgtests.txt @@ -23,8 +23,6 @@ cherrypy==18.8.0 # via -r requirements/static/ci/pkgtests.in contextvars==2.4 # via -r requirements/base.txt -cython==0.29.36 - # via -r requirements/base.txt distlib==0.3.6 # via virtualenv distro==1.8.0 diff --git a/requirements/static/ci/py3.10/windows.txt b/requirements/static/ci/py3.10/windows.txt index ddaec5d1b98..15fd9ed41b1 100644 --- a/requirements/static/ci/py3.10/windows.txt +++ b/requirements/static/ci/py3.10/windows.txt @@ -79,8 +79,6 @@ cryptography==41.0.2 # moto # pyopenssl # requests-ntlm -cython==0.29.36 - # via -r requirements/base.txt distlib==0.3.6 # via virtualenv distro==1.5.0 diff --git a/requirements/static/ci/py3.7/cloud.txt b/requirements/static/ci/py3.7/cloud.txt index d1eea4d5b77..600b0bd5392 100644 --- a/requirements/static/ci/py3.7/cloud.txt +++ b/requirements/static/ci/py3.7/cloud.txt @@ -407,8 +407,6 @@ cryptography==41.0.2 # requests-ntlm # smbprotocol # vcert -cython==0.29.36 - # via -r requirements/base.txt distlib==0.3.3 # via virtualenv distro==1.6.0 diff --git a/requirements/static/ci/py3.7/docs.txt b/requirements/static/ci/py3.7/docs.txt index 32a688bfd1f..31209a994b2 100644 --- a/requirements/static/ci/py3.7/docs.txt +++ b/requirements/static/ci/py3.7/docs.txt @@ -28,10 +28,6 @@ contextvars==2.4 # via # -c requirements/static/ci/py3.7/linux.txt # -r requirements/base.txt -cython==0.29.36 - # via - # -c requirements/static/ci/py3.7/linux.txt - # -r requirements/base.txt distro==1.5.0 # via # -c requirements/static/ci/py3.7/linux.txt diff --git a/requirements/static/ci/py3.7/freebsd.txt b/requirements/static/ci/py3.7/freebsd.txt index 9f451efe86e..5cbcb1ec49b 100644 --- a/requirements/static/ci/py3.7/freebsd.txt +++ b/requirements/static/ci/py3.7/freebsd.txt @@ -402,8 +402,6 @@ cryptography==41.0.2 # paramiko # pyopenssl # vcert -cython==0.29.36 - # via -r requirements/base.txt distlib==0.3.2 # via virtualenv distro==1.5.0 diff --git a/requirements/static/ci/py3.7/lint.txt b/requirements/static/ci/py3.7/lint.txt index 63bbc5f0d39..2c1d983fa11 100644 --- a/requirements/static/ci/py3.7/lint.txt +++ b/requirements/static/ci/py3.7/lint.txt @@ -412,8 +412,6 @@ cryptography==41.0.2 # paramiko # pyopenssl # vcert -cython==0.29.36 - # via -r requirements/base.txt distlib==0.3.2 # via virtualenv distro==1.6.0 diff --git a/requirements/static/ci/py3.7/linux.txt b/requirements/static/ci/py3.7/linux.txt index 8157c49929b..1211423a9e8 100644 --- a/requirements/static/ci/py3.7/linux.txt +++ b/requirements/static/ci/py3.7/linux.txt @@ -418,8 +418,6 @@ cryptography==41.0.2 # paramiko # pyopenssl # vcert -cython==0.29.36 - # via -r requirements/base.txt distlib==0.3.2 # via virtualenv distro==1.5.0 diff --git a/requirements/static/ci/py3.7/windows.txt b/requirements/static/ci/py3.7/windows.txt index a9dde8fb4d9..98dee3392b9 100644 --- a/requirements/static/ci/py3.7/windows.txt +++ b/requirements/static/ci/py3.7/windows.txt @@ -85,8 +85,6 @@ cryptography==41.0.2 # moto # pyopenssl # requests-ntlm -cython==0.29.36 - # via -r requirements/base.txt distlib==0.3.2 # via virtualenv distro==1.5.0 diff --git a/requirements/static/ci/py3.8/cloud.txt b/requirements/static/ci/py3.8/cloud.txt index 8c2b8bee980..9a9be0b4f18 100644 --- a/requirements/static/ci/py3.8/cloud.txt +++ b/requirements/static/ci/py3.8/cloud.txt @@ -405,8 +405,6 @@ cryptography==41.0.2 # requests-ntlm # smbprotocol # vcert -cython==0.29.36 - # via -r requirements/base.txt distlib==0.3.3 # via virtualenv distro==1.6.0 diff --git a/requirements/static/ci/py3.8/docs.txt b/requirements/static/ci/py3.8/docs.txt index f0a237306e7..da96a0c3bfb 100644 --- a/requirements/static/ci/py3.8/docs.txt +++ b/requirements/static/ci/py3.8/docs.txt @@ -28,10 +28,6 @@ contextvars==2.4 # via # -c requirements/static/ci/py3.8/linux.txt # -r requirements/base.txt -cython==0.29.36 - # via - # -c requirements/static/ci/py3.8/linux.txt - # -r requirements/base.txt distro==1.5.0 # via # -c requirements/static/ci/py3.8/linux.txt diff --git a/requirements/static/ci/py3.8/freebsd.txt b/requirements/static/ci/py3.8/freebsd.txt index 595091dc02f..4af8390b311 100644 --- a/requirements/static/ci/py3.8/freebsd.txt +++ b/requirements/static/ci/py3.8/freebsd.txt @@ -400,8 +400,6 @@ cryptography==41.0.2 # paramiko # pyopenssl # vcert -cython==0.29.36 - # via -r requirements/base.txt distlib==0.3.2 # via virtualenv distro==1.5.0 diff --git a/requirements/static/ci/py3.8/lint.txt b/requirements/static/ci/py3.8/lint.txt index 9467bc6c7e3..7f356487283 100644 --- a/requirements/static/ci/py3.8/lint.txt +++ b/requirements/static/ci/py3.8/lint.txt @@ -410,8 +410,6 @@ cryptography==41.0.2 # paramiko # pyopenssl # vcert -cython==0.29.36 - # via -r requirements/base.txt distlib==0.3.2 # via virtualenv distro==1.6.0 diff --git a/requirements/static/ci/py3.8/linux.txt b/requirements/static/ci/py3.8/linux.txt index e1b6fba1e7b..981576f2e0e 100644 --- a/requirements/static/ci/py3.8/linux.txt +++ b/requirements/static/ci/py3.8/linux.txt @@ -416,8 +416,6 @@ cryptography==41.0.2 # paramiko # pyopenssl # vcert -cython==0.29.36 - # via -r requirements/base.txt distlib==0.3.2 # via virtualenv distro==1.5.0 diff --git a/requirements/static/ci/py3.8/windows.txt b/requirements/static/ci/py3.8/windows.txt index 33c410621c0..4bc662a75af 100644 --- a/requirements/static/ci/py3.8/windows.txt +++ b/requirements/static/ci/py3.8/windows.txt @@ -81,8 +81,6 @@ cryptography==41.0.2 # moto # pyopenssl # requests-ntlm -cython==0.29.36 - # via -r requirements/base.txt distlib==0.3.2 # via virtualenv distro==1.5.0 diff --git a/requirements/static/ci/py3.9/cloud.txt b/requirements/static/ci/py3.9/cloud.txt index 6e40a4f59e0..c5ea66d3980 100644 --- a/requirements/static/ci/py3.9/cloud.txt +++ b/requirements/static/ci/py3.9/cloud.txt @@ -405,8 +405,6 @@ cryptography==41.0.2 # requests-ntlm # smbprotocol # vcert -cython==0.29.36 - # via -r requirements/base.txt distlib==0.3.3 # via virtualenv distro==1.6.0 diff --git a/requirements/static/ci/py3.9/darwin.txt b/requirements/static/ci/py3.9/darwin.txt index 51ade7faa5a..c088cf25eb0 100644 --- a/requirements/static/ci/py3.9/darwin.txt +++ b/requirements/static/ci/py3.9/darwin.txt @@ -403,8 +403,6 @@ cryptography==41.0.2 # paramiko # pyopenssl # vcert -cython==0.29.36 - # via -r requirements/base.txt distlib==0.3.2 # via virtualenv distro==1.5.0 diff --git a/requirements/static/ci/py3.9/docs.txt b/requirements/static/ci/py3.9/docs.txt index 2fe7dc49d12..772a37c357a 100644 --- a/requirements/static/ci/py3.9/docs.txt +++ b/requirements/static/ci/py3.9/docs.txt @@ -28,10 +28,6 @@ contextvars==2.4 # via # -c requirements/static/ci/py3.9/linux.txt # -r requirements/base.txt -cython==0.29.36 - # via - # -c requirements/static/ci/py3.9/linux.txt - # -r requirements/base.txt distro==1.5.0 # via # -c requirements/static/ci/py3.9/linux.txt diff --git a/requirements/static/ci/py3.9/freebsd.txt b/requirements/static/ci/py3.9/freebsd.txt index f60d47923a9..f10ea6a528d 100644 --- a/requirements/static/ci/py3.9/freebsd.txt +++ b/requirements/static/ci/py3.9/freebsd.txt @@ -400,8 +400,6 @@ cryptography==41.0.2 # paramiko # pyopenssl # vcert -cython==0.29.36 - # via -r requirements/base.txt distlib==0.3.2 # via virtualenv distro==1.5.0 diff --git a/requirements/static/ci/py3.9/lint.txt b/requirements/static/ci/py3.9/lint.txt index c2fb489ded4..26e10d45694 100644 --- a/requirements/static/ci/py3.9/lint.txt +++ b/requirements/static/ci/py3.9/lint.txt @@ -408,8 +408,6 @@ cryptography==41.0.2 # paramiko # pyopenssl # vcert -cython==0.29.36 - # via -r requirements/base.txt distlib==0.3.2 # via virtualenv distro==1.6.0 diff --git a/requirements/static/ci/py3.9/linux.txt b/requirements/static/ci/py3.9/linux.txt index b3d7afda296..8373105cef7 100644 --- a/requirements/static/ci/py3.9/linux.txt +++ b/requirements/static/ci/py3.9/linux.txt @@ -418,8 +418,6 @@ cryptography==41.0.2 # paramiko # pyopenssl # vcert -cython==0.29.36 - # via -r requirements/base.txt distlib==0.3.2 # via virtualenv distro==1.5.0 diff --git a/requirements/static/ci/py3.9/windows.txt b/requirements/static/ci/py3.9/windows.txt index 989001c9b85..7874d241d12 100644 --- a/requirements/static/ci/py3.9/windows.txt +++ b/requirements/static/ci/py3.9/windows.txt @@ -81,8 +81,6 @@ cryptography==41.0.2 # moto # pyopenssl # requests-ntlm -cython==0.29.36 - # via -r requirements/base.txt distlib==0.3.2 # via virtualenv distro==1.5.0 diff --git a/requirements/static/pkg/py3.10/darwin.txt b/requirements/static/pkg/py3.10/darwin.txt index 6608855910e..e2667937927 100644 --- a/requirements/static/pkg/py3.10/darwin.txt +++ b/requirements/static/pkg/py3.10/darwin.txt @@ -22,8 +22,6 @@ cryptography==41.0.2 # via # -r requirements/darwin.txt # pyopenssl -cython==0.29.36 - # via -r requirements/base.txt distro==1.5.0 # via -r requirements/base.txt gitdb==4.0.5 diff --git a/requirements/static/pkg/py3.10/freebsd.txt b/requirements/static/pkg/py3.10/freebsd.txt index f1e1b2379f4..8d2fe56ad5a 100644 --- a/requirements/static/pkg/py3.10/freebsd.txt +++ b/requirements/static/pkg/py3.10/freebsd.txt @@ -18,8 +18,6 @@ contextvars==2.4 # via -r requirements/base.txt cryptography==41.0.2 # via pyopenssl -cython==0.29.36 - # via -r requirements/base.txt distro==1.5.0 # via # -r requirements/base.txt diff --git a/requirements/static/pkg/py3.10/linux.txt b/requirements/static/pkg/py3.10/linux.txt index 8d5e005eadb..2219e99e56a 100644 --- a/requirements/static/pkg/py3.10/linux.txt +++ b/requirements/static/pkg/py3.10/linux.txt @@ -20,8 +20,6 @@ cryptography==41.0.2 # via # -r requirements/static/pkg/linux.in # pyopenssl -cython==0.29.36 - # via -r requirements/base.txt distro==1.5.0 # via -r requirements/base.txt idna==2.8 diff --git a/requirements/static/pkg/py3.10/windows.txt b/requirements/static/pkg/py3.10/windows.txt index f12de31741d..889f1288b18 100644 --- a/requirements/static/pkg/py3.10/windows.txt +++ b/requirements/static/pkg/py3.10/windows.txt @@ -27,8 +27,6 @@ cryptography==41.0.2 # via # -r requirements/windows.txt # pyopenssl -cython==0.29.36 - # via -r requirements/base.txt distro==1.5.0 # via -r requirements/base.txt gitdb==4.0.7 diff --git a/requirements/static/pkg/py3.7/freebsd.txt b/requirements/static/pkg/py3.7/freebsd.txt index 5cee85df464..af258097ffd 100644 --- a/requirements/static/pkg/py3.7/freebsd.txt +++ b/requirements/static/pkg/py3.7/freebsd.txt @@ -18,8 +18,6 @@ contextvars==2.4 # via -r requirements/base.txt cryptography==41.0.2 # via pyopenssl -cython==0.29.36 - # via -r requirements/base.txt distro==1.5.0 # via # -r requirements/base.txt diff --git a/requirements/static/pkg/py3.7/linux.txt b/requirements/static/pkg/py3.7/linux.txt index b4910c94b06..376d4300a45 100644 --- a/requirements/static/pkg/py3.7/linux.txt +++ b/requirements/static/pkg/py3.7/linux.txt @@ -20,8 +20,6 @@ cryptography==41.0.2 # via # -r requirements/static/pkg/linux.in # pyopenssl -cython==0.29.36 - # via -r requirements/base.txt distro==1.5.0 # via -r requirements/base.txt idna==2.8 diff --git a/requirements/static/pkg/py3.7/windows.txt b/requirements/static/pkg/py3.7/windows.txt index db4ff2ceea7..9b12b209653 100644 --- a/requirements/static/pkg/py3.7/windows.txt +++ b/requirements/static/pkg/py3.7/windows.txt @@ -27,8 +27,6 @@ cryptography==41.0.2 # via # -r requirements/windows.txt # pyopenssl -cython==0.29.36 - # via -r requirements/base.txt distro==1.5.0 # via -r requirements/base.txt gitdb==4.0.7 diff --git a/requirements/static/pkg/py3.8/freebsd.txt b/requirements/static/pkg/py3.8/freebsd.txt index ba35c0cc6ba..d95e3798e96 100644 --- a/requirements/static/pkg/py3.8/freebsd.txt +++ b/requirements/static/pkg/py3.8/freebsd.txt @@ -18,8 +18,6 @@ contextvars==2.4 # via -r requirements/base.txt cryptography==41.0.2 # via pyopenssl -cython==0.29.36 - # via -r requirements/base.txt distro==1.5.0 # via # -r requirements/base.txt diff --git a/requirements/static/pkg/py3.8/linux.txt b/requirements/static/pkg/py3.8/linux.txt index 8d23b1ec139..59c1f49d169 100644 --- a/requirements/static/pkg/py3.8/linux.txt +++ b/requirements/static/pkg/py3.8/linux.txt @@ -20,8 +20,6 @@ cryptography==41.0.2 # via # -r requirements/static/pkg/linux.in # pyopenssl -cython==0.29.36 - # via -r requirements/base.txt distro==1.5.0 # via -r requirements/base.txt idna==2.8 diff --git a/requirements/static/pkg/py3.8/windows.txt b/requirements/static/pkg/py3.8/windows.txt index f11a6c3bac2..96d4e217b1a 100644 --- a/requirements/static/pkg/py3.8/windows.txt +++ b/requirements/static/pkg/py3.8/windows.txt @@ -27,8 +27,6 @@ cryptography==41.0.2 # via # -r requirements/windows.txt # pyopenssl -cython==0.29.36 - # via -r requirements/base.txt distro==1.5.0 # via -r requirements/base.txt gitdb==4.0.7 diff --git a/requirements/static/pkg/py3.9/darwin.txt b/requirements/static/pkg/py3.9/darwin.txt index 4469fb91751..89449fc9055 100644 --- a/requirements/static/pkg/py3.9/darwin.txt +++ b/requirements/static/pkg/py3.9/darwin.txt @@ -22,8 +22,6 @@ cryptography==41.0.2 # via # -r requirements/darwin.txt # pyopenssl -cython==0.29.36 - # via -r requirements/base.txt distro==1.5.0 # via -r requirements/base.txt gitdb==4.0.5 diff --git a/requirements/static/pkg/py3.9/freebsd.txt b/requirements/static/pkg/py3.9/freebsd.txt index cb519a46993..739271e590e 100644 --- a/requirements/static/pkg/py3.9/freebsd.txt +++ b/requirements/static/pkg/py3.9/freebsd.txt @@ -18,8 +18,6 @@ contextvars==2.4 # via -r requirements/base.txt cryptography==41.0.2 # via pyopenssl -cython==0.29.36 - # via -r requirements/base.txt distro==1.5.0 # via # -r requirements/base.txt diff --git a/requirements/static/pkg/py3.9/linux.txt b/requirements/static/pkg/py3.9/linux.txt index 5be38437e59..6c5fed38051 100644 --- a/requirements/static/pkg/py3.9/linux.txt +++ b/requirements/static/pkg/py3.9/linux.txt @@ -20,8 +20,6 @@ cryptography==41.0.2 # via # -r requirements/static/pkg/linux.in # pyopenssl -cython==0.29.36 - # via -r requirements/base.txt distro==1.5.0 # via -r requirements/base.txt idna==2.8 diff --git a/requirements/static/pkg/py3.9/windows.txt b/requirements/static/pkg/py3.9/windows.txt index f21f6fc1124..42ca414ea99 100644 --- a/requirements/static/pkg/py3.9/windows.txt +++ b/requirements/static/pkg/py3.9/windows.txt @@ -27,8 +27,6 @@ cryptography==41.0.2 # via # -r requirements/windows.txt # pyopenssl -cython==0.29.36 - # via -r requirements/base.txt distro==1.5.0 # via -r requirements/base.txt gitdb==4.0.7 From 0caa05c54f73d689c507907ebfe28dd6c136c032 Mon Sep 17 00:00:00 2001 From: Alyssa Rock Date: Wed, 26 Jul 2023 10:04:14 -0600 Subject: [PATCH 235/393] Make changes requested by Chunga and Rob H --- .gitignore | 1 + doc/topics/cloud/windows.rst | 6 ------ doc/topics/tutorials/walkthrough.rst | 5 ++--- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/.gitignore b/.gitignore index 405f58704b1..e5d1058a170 100644 --- a/.gitignore +++ b/.gitignore @@ -16,6 +16,7 @@ MANIFEST .pytest_cache Pipfile.lock .mypy_cache/* +.tools-venvs/ # virtualenv # - ignores directories of a virtualenv when you create it right on diff --git a/doc/topics/cloud/windows.rst b/doc/topics/cloud/windows.rst index 9dfdde6db58..578c9481ef1 100644 --- a/doc/topics/cloud/windows.rst +++ b/doc/topics/cloud/windows.rst @@ -10,12 +10,6 @@ Windows images. Requirements ============ -.. note:: - Support ``winexe`` and ``impacket`` has been deprecated and will be removed in - 3001. These dependencies are replaced by ``pypsexec`` and ``smbprotocol`` - respectively. These are pure python alternatives that are compatible with all - supported python versions. - Salt Cloud makes use of `impacket` and `winexe` to set up the Windows Salt Minion installer. diff --git a/doc/topics/tutorials/walkthrough.rst b/doc/topics/tutorials/walkthrough.rst index f547837fdcc..10e5019d704 100644 --- a/doc/topics/tutorials/walkthrough.rst +++ b/doc/topics/tutorials/walkthrough.rst @@ -5,15 +5,14 @@ Salt in 10 Minutes ================== .. note:: - Welcome to SaltStack! I am excited that you are interested in Salt and + Welcome to Salt Project! I am excited that you are interested in Salt and starting down the path to better infrastructure management. I developed (and am continuing to develop) Salt with the goal of making the best software available to manage computers of almost any kind. I hope you enjoy working with Salt and that the software can solve your real world needs! - Thomas S Hatch - - Salt creator and Chief Developer - - CTO of SaltStack, Inc. + - Salt Project creator and Chief Developer of Salt Project Getting Started From 41b8b8423ab981b6f1d226844c3e27f34df97af5 Mon Sep 17 00:00:00 2001 From: Alyssa Rock Date: Wed, 26 Jul 2023 12:05:14 -0600 Subject: [PATCH 236/393] Add release notes file for 3007 to allow nox builds --- doc/topics/releases/3007.0.md | 147 ++++++++++++++++++++++++++++++++++ 1 file changed, 147 insertions(+) create mode 100644 doc/topics/releases/3007.0.md diff --git a/doc/topics/releases/3007.0.md b/doc/topics/releases/3007.0.md new file mode 100644 index 00000000000..a178e08c59f --- /dev/null +++ b/doc/topics/releases/3007.0.md @@ -0,0 +1,147 @@ +(release-3007.0)= +# Salt 3007.0 release notes - UNRELEASED + + + + + + +## 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. + +## Azure Salt Extension + +Starting from Salt version 3007.0, the Azure functionality previously available in the Salt code base is fully removed. To continue using Salt's features for interacting with Azure resources, users are required to utilize the Azure Salt extension. For more information, refer to the [Azure Salt Extension GitHub repository](https://github.com/salt-extensions/saltext-azurerm). + + +## Changelog + +### Removed + +- Removed RHEL 5 support since long since end-of-lifed [#62520](https://github.com/saltstack/salt/issues/62520) +- Fedora 36 support was removed because it reached EOL [#64315](https://github.com/saltstack/salt/issues/64315) +- Removing Azure-Cloud modules from the code base. [#64322](https://github.com/saltstack/salt/issues/64322) +- Dropped Python 3.7 support since it's EOL in 27 Jun 2023 [#64417](https://github.com/saltstack/salt/issues/64417) +- Remove netmiko_conn and pyeapi_conn from salt.modules.napalm_mod [#64460](https://github.com/saltstack/salt/issues/64460) +- Removed 'transport' arg from salt.utils.event.get_event [#64461](https://github.com/saltstack/salt/issues/64461) +- Handle deprecation warnings: + + * Switch to `FullArgSpec` since Py 3.11 no longer has `ArgSpec`, deprecated since Py 3.0 + * Stop using the deprecated `cgi` module + * Stop using the deprecated `pipes` module + * Stop using the deprecated `imp` module [#64553](https://github.com/saltstack/salt/issues/64553) + + +### Changed + +- 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 + * Stopped using the deprecated `imp` module [#64457](https://github.com/saltstack/salt/issues/64457) +- changed 'gpg_decrypt_must_succeed' default from False to True [#64462](https://github.com/saltstack/salt/issues/64462) +- Don't hardcode the python version on the Salt Package tests and on the `pkg/debian/salt-cloud.postinst` file [#64553](https://github.com/saltstack/salt/issues/64553) +- Some more deprecated code fixes: + + * Stop using the deprecated `locale.getdefaultlocale()` function + * Stop accessing deprecated attributes + * `pathlib.Path.__enter__()` usage is deprecated and not required, a no-op [#64565](https://github.com/saltstack/salt/issues/64565) +- Bump to `pyyaml==6.0.1` due to https://github.com/yaml/pyyaml/issues/601 and address lint issues [#64657](https://github.com/saltstack/salt/issues/64657) + + +### Fixed + +- fixes aptpkg module by checking for blank comps. [#58667](https://github.com/saltstack/salt/issues/58667) +- Make the LXD module work with pyLXD > 2.10 [#59514](https://github.com/saltstack/salt/issues/59514) +- `wheel.file_roots.find` is now able to find files in subdirectories of the roots. [#59800](https://github.com/saltstack/salt/issues/59800) +- Do not update the credentials dictionary in `utils/aws.py` while iterating over it, and use the correct delete functionality [#61049](https://github.com/saltstack/salt/issues/61049) +- fixed runner not having a proper exit code when runner modules throw an exception. [#61173](https://github.com/saltstack/salt/issues/61173) +- Fixes an issue with failing subsequent state runs with the lgpo state module. + The ``lgpo.get_polcy`` function now returns all boolean settings. [#63296](https://github.com/saltstack/salt/issues/63296) +- Fixes an issue with boolean settings not being reported after being set. The + ``lgpo.get_polcy`` function now returns all boolean settings. [#63473](https://github.com/saltstack/salt/issues/63473) +- pkg.installed no longer reports failure when installing packages that are installed via the task manager [#63767](https://github.com/saltstack/salt/issues/63767) +- mac_xattr.list and mac_xattr.read will replace undecode-able bytes to avoid raising CommandExecutionError. [#63779](https://github.com/saltstack/salt/issues/63779) [#63779](https://github.com/saltstack/salt/issues/63779) +- Fix aptpkg.latest_version performance, reducing number of times to 'shell out' [#63982](https://github.com/saltstack/salt/issues/63982) +- Added option to use a fresh connection for mysql cache [#63991](https://github.com/saltstack/salt/issues/63991) +- [lxd] Fixed a bug in `container_create` which prevented devices which are not of type `disk` to be correctly created and added to the container when passed via the `devices` parameter. [#63996](https://github.com/saltstack/salt/issues/63996) +- Fix state_queue type checking to allow int values [#64122](https://github.com/saltstack/salt/issues/64122) +- Call global logger when catching pip.list exceptions in states.pip.installed + Rename global logger `log` to `logger` inside pip_state [#64169](https://github.com/saltstack/salt/issues/64169) +- Fix user.present state when groups is unset to ensure the groups are unchanged, as documented. [#64211](https://github.com/saltstack/salt/issues/64211) +- Fixed issue in mac_user.enable_auto_login that caused the user's keychain to be reset at each boot [#64226](https://github.com/saltstack/salt/issues/64226) +- Fixed x509_v2 `create_private_key`/`create_crl` unknown kwargs: __pub_fun... [#64232](https://github.com/saltstack/salt/issues/64232) +- remove the hard coded python version in error. [#64237](https://github.com/saltstack/salt/issues/64237) +- Ensure we return an error when adding the key fails in the pkgrepo state for debian hosts. [#64253](https://github.com/saltstack/salt/issues/64253) +- Skipped the `isfile` check to greatly increase speed of reading minion keys for systems with a large number of minions on slow file storage [#64260](https://github.com/saltstack/salt/issues/64260) +- Fixed file client private attribute reference on `SaltMakoTemplateLookup` [#64280](https://github.com/saltstack/salt/issues/64280) +- Fix utf8 handling in 'pass' renderer [#64300](https://github.com/saltstack/salt/issues/64300) +- Upgade tornado to 6.3.2 [#64305](https://github.com/saltstack/salt/issues/64305) +- Fix detection of Salt codename by "salt_version" execution module [#64306](https://github.com/saltstack/salt/issues/64306) +- Ensure selinux values are handled lowercase [#64318](https://github.com/saltstack/salt/issues/64318) +- Remove the `clr.AddReference`, it is causing an `Illegal characters in path` exception [#64339](https://github.com/saltstack/salt/issues/64339) +- Allow for multiple user's keys presented when authenticating, for example: root, salt, etc. [#64398](https://github.com/saltstack/salt/issues/64398) +- Fixed an issue with ``lgpo_reg`` where existing entries for the same key in + ``Registry.pol`` were being overwritten in subsequent runs if the value name in + the subesequent run was contained in the existing value name. For example, a + key named ``SetUpdateNotificationLevel`` would be overwritten by a subsequent + run attempting to set ``UpdateNotificationLevel`` [#64401](https://github.com/saltstack/salt/issues/64401) +- Fix 'unable to unmount' failure to return False result instead of None [#64420](https://github.com/saltstack/salt/issues/64420) +- Add search for %ProgramData%\Chocolatey\choco.exe to determine if Chocolatey is installed or not [#64427](https://github.com/saltstack/salt/issues/64427) +- Fix regression for user.present on handling groups with dupe GIDs [#64430](https://github.com/saltstack/salt/issues/64430) +- Fixed issue uninstalling duplicate packages in ``win_appx`` execution module [#64450](https://github.com/saltstack/salt/issues/64450) +- Fix file.symlink will not replace/update existing symlink [#64477](https://github.com/saltstack/salt/issues/64477) +- Fixed salt-ssh state.* commands returning retcode 0 when state/pillar rendering fails [#64514](https://github.com/saltstack/salt/issues/64514) +- `win_pkg` Fixes an issue runing `pkg.install` with `version=latest` where the + new installer would not be cached if there was already an installer present + with the same name. [#64519](https://github.com/saltstack/salt/issues/64519) +- Added a `test:full` label in the salt repository, which, when selected, will force a full test run. [#64539](https://github.com/saltstack/salt/issues/64539) +- Added support for Chocolatey 2.0.0+ [#64622](https://github.com/saltstack/salt/issues/64622) + + +### Added + +- Added syncing of custom salt-ssh wrappers [#45450](https://github.com/saltstack/salt/issues/45450) +- Revised use of deprecated net-tools and added support for ip neighbour with IPv4 ip_neighs, IPv6 ip_neighs6 [#57541](https://github.com/saltstack/salt/issues/57541) +- Added signed_by_any/signed_by_all parameters to gpg.verify [#63166](https://github.com/saltstack/salt/issues/63166) +- Added match runner [#63278](https://github.com/saltstack/salt/issues/63278) +- add JUnit output for saltcheck [#63463](https://github.com/saltstack/salt/issues/63463) +- Add ability for file.keyvalue to create a file if it doesn't exist [#63545](https://github.com/saltstack/salt/issues/63545) +- added cleanup of temporary mountpoint dir for macpackage installed state [#63905](https://github.com/saltstack/salt/issues/63905) +- Add pkg.installed show installable version in test mode [#63985](https://github.com/saltstack/salt/issues/63985) +- Added flags to create local users and groups [#64256](https://github.com/saltstack/salt/issues/64256) +- Add ability to return False result in test mode of configurable_test_state [#64418](https://github.com/saltstack/salt/issues/64418) +- Added a script to automate setting up a 2nd minion in a user context on Windows [#64439](https://github.com/saltstack/salt/issues/64439) +- Switched Salt's onedir Python version to 3.11 [#64457](https://github.com/saltstack/salt/issues/64457) +- Added support for dnf5 and its new command syntax [#64532](https://github.com/saltstack/salt/issues/64532) +- Several fixes to the CI workflow: + + * Don't override the `on` Jinja block on the `ci.yaml` template. This enables reacting to labels getting added/removed + to/from pull requests. + * Switch to using `tools` and re-use the event payload available instead of querying the GH API again to get the pull + request labels + * Concentrate test selection by labels to a single place + * Enable code coverage on pull-requests by setting the `test:coverage` label [#64547](https://github.com/saltstack/salt/issues/64547) +- Adding a new decorator to indicate when a module is deprecated in favor of a Salt extension. [#64569](https://github.com/saltstack/salt/issues/64569) +- Added win_appx state and execution modules for managing Microsoft Store apps and deprovisioning them from systems [#64978](https://github.com/saltstack/salt/issues/64978) + + +### Security + +- Upgrade to `cryptography==41.0.1`(and therefor `pyopenssl==23.2.0` due to https://github.com/advisories/GHSA-5cpq-8wj7-hf2v + + This only really impacts pip installs of Salt and the windows onedir since the linux and macos onedir build every package dependency from source, not from pre-existing wheels. [#64595](https://github.com/saltstack/salt/issues/64595) +- Bump to `aiohttp==3.8.5` due to https://github.com/advisories/GHSA-45c4-8wx5-qw6w [#64687](https://github.com/saltstack/salt/issues/64687) From 01451adf6bbaf3500e796ad7e72f6ef5f5de5779 Mon Sep 17 00:00:00 2001 From: Alyssa Rock Date: Thu, 27 Jul 2023 14:06:11 -0600 Subject: [PATCH 237/393] Add fixes requested by reviewers --- doc/topics/cloud/windows.rst | 64 +++++---------- doc/topics/releases/3007.0.md | 147 ---------------------------------- 2 files changed, 19 insertions(+), 192 deletions(-) delete mode 100644 doc/topics/releases/3007.0.md diff --git a/doc/topics/cloud/windows.rst b/doc/topics/cloud/windows.rst index 578c9481ef1..b1106dc256d 100644 --- a/doc/topics/cloud/windows.rst +++ b/doc/topics/cloud/windows.rst @@ -7,56 +7,30 @@ Salt on them. This functionality is available on all cloud providers that are supported by Salt Cloud. However, it may not necessarily be available on all Windows images. +Dependencies +============ + +Salt Cloud's dependencies are automatically installed in Salt version 3006 and +later. + +For versions of Salt prior to 3006, Salt Cloud has a dependency on the +``impacket`` library to set up the Windows Salt Minion installer. + +``impacket`` is usually available as either the ``impacket`` or the +``python-impacket`` package, depending on the distribution. More information on +``impacket`` can be found at the +`impacket project home `_. + + Requirements ============ -Salt Cloud makes use of `impacket` and `winexe` to set up the Windows Salt -Minion installer. - -`impacket` is usually available as either the `impacket` or the -`python-impacket` package, depending on the distribution. More information on -`impacket` can be found at the project home: - -* `impacket project home`__ - -.. __: https://github.com/SecureAuthCorp/impacket - -`winexe` is less commonly available in distribution-specific repositories. -However, it is currently being built for various distributions in 3rd party -channels: - -* `RPMs at pbone.net`__ - -.. __: http://rpm.pbone.net/index.php3?stat=3&search=winexe - -* `openSUSE Build Service`__ - -.. __: https://software.opensuse.org/package/winexe - -* `pypsexec project home`__ - -.. __: https://github.com/jborean93/pypsexec - -* `smbprotocol project home`__ - -.. __: https://github.com/jborean93/smbprotocol +A copy of the Salt Minion Windows installer must be present on the system on +which Salt Cloud is running. See +`Windows - Salt install guide `_ for information about downloading +and using the Salt Minion Windows installer. -Optionally WinRM can be used instead of `winexe` if the python module `pywinrm` -is available and WinRM is supported on the target Windows version. Information -on pywinrm can be found at the project home: - -* `pywinrm project home`__ - -.. __: https://github.com/diyan/pywinrm - -Additionally, a copy of the Salt Minion Windows installer must be present on -the system on which Salt Cloud is running. This installer may be downloaded -from saltstack.com: - -* `SaltStack Download Area`__ - -.. __: https://repo.saltproject.io/windows/ .. _new-pywinrm: diff --git a/doc/topics/releases/3007.0.md b/doc/topics/releases/3007.0.md deleted file mode 100644 index a178e08c59f..00000000000 --- a/doc/topics/releases/3007.0.md +++ /dev/null @@ -1,147 +0,0 @@ -(release-3007.0)= -# Salt 3007.0 release notes - UNRELEASED - - - - - - -## 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. - -## Azure Salt Extension - -Starting from Salt version 3007.0, the Azure functionality previously available in the Salt code base is fully removed. To continue using Salt's features for interacting with Azure resources, users are required to utilize the Azure Salt extension. For more information, refer to the [Azure Salt Extension GitHub repository](https://github.com/salt-extensions/saltext-azurerm). - - -## Changelog - -### Removed - -- Removed RHEL 5 support since long since end-of-lifed [#62520](https://github.com/saltstack/salt/issues/62520) -- Fedora 36 support was removed because it reached EOL [#64315](https://github.com/saltstack/salt/issues/64315) -- Removing Azure-Cloud modules from the code base. [#64322](https://github.com/saltstack/salt/issues/64322) -- Dropped Python 3.7 support since it's EOL in 27 Jun 2023 [#64417](https://github.com/saltstack/salt/issues/64417) -- Remove netmiko_conn and pyeapi_conn from salt.modules.napalm_mod [#64460](https://github.com/saltstack/salt/issues/64460) -- Removed 'transport' arg from salt.utils.event.get_event [#64461](https://github.com/saltstack/salt/issues/64461) -- Handle deprecation warnings: - - * Switch to `FullArgSpec` since Py 3.11 no longer has `ArgSpec`, deprecated since Py 3.0 - * Stop using the deprecated `cgi` module - * Stop using the deprecated `pipes` module - * Stop using the deprecated `imp` module [#64553](https://github.com/saltstack/salt/issues/64553) - - -### Changed - -- 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 - * Stopped using the deprecated `imp` module [#64457](https://github.com/saltstack/salt/issues/64457) -- changed 'gpg_decrypt_must_succeed' default from False to True [#64462](https://github.com/saltstack/salt/issues/64462) -- Don't hardcode the python version on the Salt Package tests and on the `pkg/debian/salt-cloud.postinst` file [#64553](https://github.com/saltstack/salt/issues/64553) -- Some more deprecated code fixes: - - * Stop using the deprecated `locale.getdefaultlocale()` function - * Stop accessing deprecated attributes - * `pathlib.Path.__enter__()` usage is deprecated and not required, a no-op [#64565](https://github.com/saltstack/salt/issues/64565) -- Bump to `pyyaml==6.0.1` due to https://github.com/yaml/pyyaml/issues/601 and address lint issues [#64657](https://github.com/saltstack/salt/issues/64657) - - -### Fixed - -- fixes aptpkg module by checking for blank comps. [#58667](https://github.com/saltstack/salt/issues/58667) -- Make the LXD module work with pyLXD > 2.10 [#59514](https://github.com/saltstack/salt/issues/59514) -- `wheel.file_roots.find` is now able to find files in subdirectories of the roots. [#59800](https://github.com/saltstack/salt/issues/59800) -- Do not update the credentials dictionary in `utils/aws.py` while iterating over it, and use the correct delete functionality [#61049](https://github.com/saltstack/salt/issues/61049) -- fixed runner not having a proper exit code when runner modules throw an exception. [#61173](https://github.com/saltstack/salt/issues/61173) -- Fixes an issue with failing subsequent state runs with the lgpo state module. - The ``lgpo.get_polcy`` function now returns all boolean settings. [#63296](https://github.com/saltstack/salt/issues/63296) -- Fixes an issue with boolean settings not being reported after being set. The - ``lgpo.get_polcy`` function now returns all boolean settings. [#63473](https://github.com/saltstack/salt/issues/63473) -- pkg.installed no longer reports failure when installing packages that are installed via the task manager [#63767](https://github.com/saltstack/salt/issues/63767) -- mac_xattr.list and mac_xattr.read will replace undecode-able bytes to avoid raising CommandExecutionError. [#63779](https://github.com/saltstack/salt/issues/63779) [#63779](https://github.com/saltstack/salt/issues/63779) -- Fix aptpkg.latest_version performance, reducing number of times to 'shell out' [#63982](https://github.com/saltstack/salt/issues/63982) -- Added option to use a fresh connection for mysql cache [#63991](https://github.com/saltstack/salt/issues/63991) -- [lxd] Fixed a bug in `container_create` which prevented devices which are not of type `disk` to be correctly created and added to the container when passed via the `devices` parameter. [#63996](https://github.com/saltstack/salt/issues/63996) -- Fix state_queue type checking to allow int values [#64122](https://github.com/saltstack/salt/issues/64122) -- Call global logger when catching pip.list exceptions in states.pip.installed - Rename global logger `log` to `logger` inside pip_state [#64169](https://github.com/saltstack/salt/issues/64169) -- Fix user.present state when groups is unset to ensure the groups are unchanged, as documented. [#64211](https://github.com/saltstack/salt/issues/64211) -- Fixed issue in mac_user.enable_auto_login that caused the user's keychain to be reset at each boot [#64226](https://github.com/saltstack/salt/issues/64226) -- Fixed x509_v2 `create_private_key`/`create_crl` unknown kwargs: __pub_fun... [#64232](https://github.com/saltstack/salt/issues/64232) -- remove the hard coded python version in error. [#64237](https://github.com/saltstack/salt/issues/64237) -- Ensure we return an error when adding the key fails in the pkgrepo state for debian hosts. [#64253](https://github.com/saltstack/salt/issues/64253) -- Skipped the `isfile` check to greatly increase speed of reading minion keys for systems with a large number of minions on slow file storage [#64260](https://github.com/saltstack/salt/issues/64260) -- Fixed file client private attribute reference on `SaltMakoTemplateLookup` [#64280](https://github.com/saltstack/salt/issues/64280) -- Fix utf8 handling in 'pass' renderer [#64300](https://github.com/saltstack/salt/issues/64300) -- Upgade tornado to 6.3.2 [#64305](https://github.com/saltstack/salt/issues/64305) -- Fix detection of Salt codename by "salt_version" execution module [#64306](https://github.com/saltstack/salt/issues/64306) -- Ensure selinux values are handled lowercase [#64318](https://github.com/saltstack/salt/issues/64318) -- Remove the `clr.AddReference`, it is causing an `Illegal characters in path` exception [#64339](https://github.com/saltstack/salt/issues/64339) -- Allow for multiple user's keys presented when authenticating, for example: root, salt, etc. [#64398](https://github.com/saltstack/salt/issues/64398) -- Fixed an issue with ``lgpo_reg`` where existing entries for the same key in - ``Registry.pol`` were being overwritten in subsequent runs if the value name in - the subesequent run was contained in the existing value name. For example, a - key named ``SetUpdateNotificationLevel`` would be overwritten by a subsequent - run attempting to set ``UpdateNotificationLevel`` [#64401](https://github.com/saltstack/salt/issues/64401) -- Fix 'unable to unmount' failure to return False result instead of None [#64420](https://github.com/saltstack/salt/issues/64420) -- Add search for %ProgramData%\Chocolatey\choco.exe to determine if Chocolatey is installed or not [#64427](https://github.com/saltstack/salt/issues/64427) -- Fix regression for user.present on handling groups with dupe GIDs [#64430](https://github.com/saltstack/salt/issues/64430) -- Fixed issue uninstalling duplicate packages in ``win_appx`` execution module [#64450](https://github.com/saltstack/salt/issues/64450) -- Fix file.symlink will not replace/update existing symlink [#64477](https://github.com/saltstack/salt/issues/64477) -- Fixed salt-ssh state.* commands returning retcode 0 when state/pillar rendering fails [#64514](https://github.com/saltstack/salt/issues/64514) -- `win_pkg` Fixes an issue runing `pkg.install` with `version=latest` where the - new installer would not be cached if there was already an installer present - with the same name. [#64519](https://github.com/saltstack/salt/issues/64519) -- Added a `test:full` label in the salt repository, which, when selected, will force a full test run. [#64539](https://github.com/saltstack/salt/issues/64539) -- Added support for Chocolatey 2.0.0+ [#64622](https://github.com/saltstack/salt/issues/64622) - - -### Added - -- Added syncing of custom salt-ssh wrappers [#45450](https://github.com/saltstack/salt/issues/45450) -- Revised use of deprecated net-tools and added support for ip neighbour with IPv4 ip_neighs, IPv6 ip_neighs6 [#57541](https://github.com/saltstack/salt/issues/57541) -- Added signed_by_any/signed_by_all parameters to gpg.verify [#63166](https://github.com/saltstack/salt/issues/63166) -- Added match runner [#63278](https://github.com/saltstack/salt/issues/63278) -- add JUnit output for saltcheck [#63463](https://github.com/saltstack/salt/issues/63463) -- Add ability for file.keyvalue to create a file if it doesn't exist [#63545](https://github.com/saltstack/salt/issues/63545) -- added cleanup of temporary mountpoint dir for macpackage installed state [#63905](https://github.com/saltstack/salt/issues/63905) -- Add pkg.installed show installable version in test mode [#63985](https://github.com/saltstack/salt/issues/63985) -- Added flags to create local users and groups [#64256](https://github.com/saltstack/salt/issues/64256) -- Add ability to return False result in test mode of configurable_test_state [#64418](https://github.com/saltstack/salt/issues/64418) -- Added a script to automate setting up a 2nd minion in a user context on Windows [#64439](https://github.com/saltstack/salt/issues/64439) -- Switched Salt's onedir Python version to 3.11 [#64457](https://github.com/saltstack/salt/issues/64457) -- Added support for dnf5 and its new command syntax [#64532](https://github.com/saltstack/salt/issues/64532) -- Several fixes to the CI workflow: - - * Don't override the `on` Jinja block on the `ci.yaml` template. This enables reacting to labels getting added/removed - to/from pull requests. - * Switch to using `tools` and re-use the event payload available instead of querying the GH API again to get the pull - request labels - * Concentrate test selection by labels to a single place - * Enable code coverage on pull-requests by setting the `test:coverage` label [#64547](https://github.com/saltstack/salt/issues/64547) -- Adding a new decorator to indicate when a module is deprecated in favor of a Salt extension. [#64569](https://github.com/saltstack/salt/issues/64569) -- Added win_appx state and execution modules for managing Microsoft Store apps and deprovisioning them from systems [#64978](https://github.com/saltstack/salt/issues/64978) - - -### Security - -- Upgrade to `cryptography==41.0.1`(and therefor `pyopenssl==23.2.0` due to https://github.com/advisories/GHSA-5cpq-8wj7-hf2v - - This only really impacts pip installs of Salt and the windows onedir since the linux and macos onedir build every package dependency from source, not from pre-existing wheels. [#64595](https://github.com/saltstack/salt/issues/64595) -- Bump to `aiohttp==3.8.5` due to https://github.com/advisories/GHSA-45c4-8wx5-qw6w [#64687](https://github.com/saltstack/salt/issues/64687) From ae11e7c061b0baa51c58fda7339985a815dfbc76 Mon Sep 17 00:00:00 2001 From: Alyssa Rock Date: Thu, 27 Jul 2023 14:22:28 -0600 Subject: [PATCH 238/393] Further changes requested by reviewers --- doc/topics/cloud/windows.rst | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/doc/topics/cloud/windows.rst b/doc/topics/cloud/windows.rst index b1106dc256d..a80014faf7f 100644 --- a/doc/topics/cloud/windows.rst +++ b/doc/topics/cloud/windows.rst @@ -10,16 +10,16 @@ Windows images. Dependencies ============ -Salt Cloud's dependencies are automatically installed in Salt version 3006 and -later. +Salt Cloud needs the following packages: + +* `pypsexec `_. +* `smbprotocol `_. + For versions of Salt prior to 3006, Salt Cloud has a dependency on the -``impacket`` library to set up the Windows Salt Minion installer. +``impacket`` library to set up the Windows Salt Minion installer: -``impacket`` is usually available as either the ``impacket`` or the -``python-impacket`` package, depending on the distribution. More information on -``impacket`` can be found at the -`impacket project home `_. +* `impacket `_. Requirements From 2244d93fb4e8ffe7f76184c3de16f2c3101e7895 Mon Sep 17 00:00:00 2001 From: Salt Project Packaging Date: Tue, 25 Jul 2023 20:08:29 +0000 Subject: [PATCH 239/393] Update the bootstrap script to v2023.07.25 --- salt/cloud/deploy/bootstrap-salt.sh | 50 ++++++++++++++++++++++++++--- 1 file changed, 46 insertions(+), 4 deletions(-) diff --git a/salt/cloud/deploy/bootstrap-salt.sh b/salt/cloud/deploy/bootstrap-salt.sh index 1cf46c774df..b937fbb7ef7 100644 --- a/salt/cloud/deploy/bootstrap-salt.sh +++ b/salt/cloud/deploy/bootstrap-salt.sh @@ -23,7 +23,7 @@ #====================================================================================================================== set -o nounset # Treat unset variables as an error -__ScriptVersion="2023.06.28" +__ScriptVersion="2023.07.25" __ScriptName="bootstrap-salt.sh" __ScriptFullName="$0" @@ -277,6 +277,8 @@ _MINIMUM_PIP_VERSION="9.0.1" _MINIMUM_SETUPTOOLS_VERSION="9.1" _POST_NEON_PIP_INSTALL_ARGS="--prefix=/usr" _PIP_DOWNLOAD_ARGS="" +_QUICK_START="$BS_FALSE" +_AUTO_ACCEPT_MINION_KEYS="$BS_FALSE" # Defaults for install arguments ITYPE="stable" @@ -395,6 +397,8 @@ __usage() { resort method. NOTE: This only works for functions which actually implement pip based installations. -q Quiet salt installation from git (setup.py install -q) + -Q Quickstart, install the Salt master and the Salt minion. + And automatically accept the minion key. -R Specify a custom repository URL. Assumes the custom repository URL points to a repository that mirrors Salt packages located at repo.saltproject.io. The option passed with -R replaces the @@ -426,7 +430,7 @@ EOT } # ---------- end of function __usage ---------- -while getopts ':hvnDc:g:Gyx:k:s:MSNXCPFUKIA:i:Lp:dH:bflV:J:j:rR:aq' opt +while getopts ':hvnDc:g:Gyx:k:s:MSNXCPFUKIA:i:Lp:dH:bflV:J:j:rR:aqQ' opt do case "${opt}" in @@ -470,6 +474,7 @@ do J ) _CUSTOM_MASTER_CONFIG=$OPTARG ;; j ) _CUSTOM_MINION_CONFIG=$OPTARG ;; q ) _QUIET_GIT_INSTALLATION=$BS_TRUE ;; + Q ) _QUICK_START=$BS_TRUE ;; x ) _PY_EXE="$OPTARG" ;; y ) _INSTALL_PY="$BS_TRUE" ;; @@ -714,6 +719,31 @@ elif [ "$ITYPE" = "onedir_rc" ]; then fi fi +# Doing a quick start, so install master +# set master address to 127.0.0.1 +if [ "$_QUICK_START" -eq "$BS_TRUE" ]; then + # make install type is stable + ITYPE="stable" + + # make sure the revision is latest + STABLE_REV="latest" + ONEDIR_REV="latest" + + # make sure we're installing the master + _INSTALL_MASTER=$BS_TRUE + + # override incase install minion + # is set to false + _INSTALL_MINION=$BS_TRUE + + # Set master address to loopback IP + _SALT_MASTER_ADDRESS="127.0.0.1" + + # Auto accept the minion key + # when the install is done. + _AUTO_ACCEPT_MINION_KEYS=$BS_TRUE +fi + # Check for any unparsed arguments. Should be an error. if [ "$#" -gt 0 ]; then __usage @@ -4670,7 +4700,7 @@ __install_saltstack_rhel_onedir_repository() { if [ "${ONEDIR_REV}" = "nightly" ] ; then base_url="${HTTP_VAL}://${_REPO_URL}/${_ONEDIR_NIGHTLY_DIR}/${__PY_VERSION_REPO}/redhat/${DISTRO_MAJOR_VERSION}/\$basearch/" fi - if [ "$(echo "${ONEDIR_REV}" | grep -E '(3004|3005)')" != "" ]; then + if [ "$(echo "${ONEDIR_REV}" | grep -E '(3004|3005)')" != "" ] || [ "${ONEDIR_REV}" = "nightly" ]; then if [ "${DISTRO_MAJOR_VERSION}" -eq 9 ]; then gpg_key="SALTSTACK-GPG-KEY2.pub" else @@ -6464,7 +6494,7 @@ install_amazon_linux_ami_2_onedir_deps() { base_url="$HTTP_VAL://${_REPO_URL}/${_ONEDIR_NIGHTLY_DIR}/${__PY_VERSION_REPO}/amazon/2/\$basearch/" fi - if [ "$(echo "${ONEDIR_REV}" | grep -E '(3004|3005)')" != "" ]; then + if [ "$(echo "${ONEDIR_REV}" | grep -E '(3004|3005)')" != "" ] || [ "${ONEDIR_REV}" = "nightly" ]; then gpg_key="${base_url}SALTSTACK-GPG-KEY.pub,${base_url}base/RPM-GPG-KEY-CentOS-7" if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -eq 3 ]; then gpg_key="${base_url}SALTSTACK-GPG-KEY.pub" @@ -9698,6 +9728,11 @@ if [ "$DAEMONS_RUNNING_FUNC" != "null" ] && [ ${_START_DAEMONS} -eq $BS_TRUE ]; fi fi +if [ "$_AUTO_ACCEPT_MINION_KEYS" -eq "$BS_TRUE" ]; then + echoinfo "Accepting the Salt Minion Keys" + salt-key -yA +fi + # Done! if [ "$_CONFIG_ONLY" -eq $BS_FALSE ]; then echoinfo "Salt installed!" @@ -9705,6 +9740,13 @@ else echoinfo "Salt configured!" fi +if [ "$_QUICK_START" -eq "$BS_TRUE" ]; then + echoinfo "Congratulations!" + echoinfo "A couple of commands to try:" + echoinfo " salt \* test.ping" + echoinfo " salt \* test.version" +fi + exit 0 # vim: set sts=4 ts=4 et From d92ba4c8e2deb5d1569031ffd7052d9271d6cda1 Mon Sep 17 00:00:00 2001 From: Michael Calmer Date: Mon, 8 Mar 2021 16:40:59 +0100 Subject: [PATCH 240/393] Enhance openscap module: add xccdf_eval call --- changelog/59756.added | 1 + salt/modules/openscap.py | 98 ++++++++++++ tests/unit/modules/test_openscap.py | 234 ++++++++++++++++++++++++++++ 3 files changed, 333 insertions(+) create mode 100644 changelog/59756.added diff --git a/changelog/59756.added b/changelog/59756.added new file mode 100644 index 00000000000..a59fb21eef4 --- /dev/null +++ b/changelog/59756.added @@ -0,0 +1 @@ +adding new call for openscap xccdf eval supporting new parameters diff --git a/salt/modules/openscap.py b/salt/modules/openscap.py index 770c8e7c043..b8a383b13c8 100644 --- a/salt/modules/openscap.py +++ b/salt/modules/openscap.py @@ -4,6 +4,7 @@ Module for OpenSCAP Management """ +import os.path import shlex import shutil import tempfile @@ -55,6 +56,103 @@ _OSCAP_EXIT_CODES_MAP = { } +def xccdf_eval(xccdffile, ovalfiles=None, **kwargs): + """ + Run ``oscap xccdf eval`` commands on minions. + It uses cp.push_dir to upload the generated files to the salt master + in the master's minion files cachedir + (defaults to ``/var/cache/salt/master/minions/minion-id/files``) + + It needs ``file_recv`` set to ``True`` in the master configuration file. + + xccdffile + the path to the xccdf file to evaluate + + ovalfiles + additional oval definition files + + profile + the name of Profile to be evaluated + + rule + the name of a single rule to be evaluated + + oval_results + save OVAL results as well (True or False) + + results + write XCCDF Results into given file + + report + write HTML report into given file + + fetch_remote_resources + download remote content referenced by XCCDF (True or False) + + remediate + automatically execute XCCDF fix elements for failed rules. + Use of this option is always at your own risk. (True or False) + + CLI Example: + + .. code-block:: bash + + salt '*' openscap.xccdf_eval /usr/share/openscap/scap-yast2sec-xccdf.xml profile=Default + + """ + success = True + error = None + upload_dir = None + returncode = None + if not ovalfiles: + ovalfiles = [] + + cmd_opts = ["oscap", "xccdf", "eval"] + if kwargs.get("oval_results"): + cmd_opts.append("--oval-results") + if "results" in kwargs: + cmd_opts.append("--results") + cmd_opts.append(kwargs["results"]) + if "report" in kwargs: + cmd_opts.append("--report") + cmd_opts.append(kwargs["report"]) + if "profile" in kwargs: + cmd_opts.append("--profile") + cmd_opts.append(kwargs["profile"]) + if "rule" in kwargs: + cmd_opts.append("--rule") + cmd_opts.append(kwargs["rule"]) + if kwargs.get("fetch_remote_resources"): + cmd_opts.append("--fetch-remote-resources") + if kwargs.get("remediate"): + cmd_opts.append("--remediate") + cmd_opts.append(xccdffile) + cmd_opts.extend(ovalfiles) + + if not os.path.exists(xccdffile): + success = False + error = "XCCDF File '{}' does not exist".format(xccdffile) + for ofile in ovalfiles: + if success and not os.path.exists(ofile): + success = False + error = "Oval File '{}' does not exist".format(ofile) + + if success: + tempdir = tempfile.mkdtemp() + proc = Popen(cmd_opts, stdout=PIPE, stderr=PIPE, cwd=tempdir) + (stdoutdata, error) = proc.communicate() + success = _OSCAP_EXIT_CODES_MAP[proc.returncode] + returncode = proc.returncode + if success: + __salt__["cp.push_dir"](tempdir) + upload_dir = tempdir + shutil.rmtree(tempdir, ignore_errors=True) + + return dict( + success=success, upload_dir=upload_dir, error=error, returncode=returncode + ) + + def xccdf(params): """ Run ``oscap xccdf`` commands on minions. diff --git a/tests/unit/modules/test_openscap.py b/tests/unit/modules/test_openscap.py index 045c37f7c9b..301c1869ecf 100644 --- a/tests/unit/modules/test_openscap.py +++ b/tests/unit/modules/test_openscap.py @@ -21,6 +21,7 @@ class OpenscapTestCase(TestCase): "salt.modules.openscap.tempfile.mkdtemp", Mock(return_value=self.random_temp_dir), ), + patch("salt.modules.openscap.os.path.exists", Mock(return_value=True)), ] for patcher in patchers: self.apply_patch(patcher) @@ -211,3 +212,236 @@ class OpenscapTestCase(TestCase): "returncode": None, }, ) + + def test_new_openscap_xccdf_eval_success(self): + with patch( + "salt.modules.openscap.Popen", + MagicMock( + return_value=Mock( + **{"returncode": 0, "communicate.return_value": ("", "")} + ) + ), + ): + response = openscap.xccdf_eval( + self.policy_file, + profile="Default", + oval_results=True, + results="results.xml", + report="report.html", + ) + + self.assertEqual(openscap.tempfile.mkdtemp.call_count, 1) + expected_cmd = [ + "oscap", + "xccdf", + "eval", + "--oval-results", + "--results", + "results.xml", + "--report", + "report.html", + "--profile", + "Default", + self.policy_file, + ] + openscap.Popen.assert_called_once_with( + expected_cmd, + cwd=openscap.tempfile.mkdtemp.return_value, + stderr=subprocess.PIPE, + stdout=subprocess.PIPE, + ) + openscap.__salt__["cp.push_dir"].assert_called_once_with( + self.random_temp_dir + ) + self.assertEqual(openscap.shutil.rmtree.call_count, 1) + self.assertEqual( + response, + { + "upload_dir": self.random_temp_dir, + "error": "", + "success": True, + "returncode": 0, + }, + ) + + def test_new_openscap_xccdf_eval_success_with_extra_ovalfiles(self): + with patch( + "salt.modules.openscap.Popen", + MagicMock( + return_value=Mock( + **{"returncode": 0, "communicate.return_value": ("", "")} + ) + ), + ): + response = openscap.xccdf_eval( + self.policy_file, + ["/usr/share/xml/another-oval.xml", "/usr/share/xml/oval.xml"], + profile="Default", + oval_results=True, + results="results.xml", + report="report.html", + ) + + self.assertEqual(openscap.tempfile.mkdtemp.call_count, 1) + expected_cmd = [ + "oscap", + "xccdf", + "eval", + "--oval-results", + "--results", + "results.xml", + "--report", + "report.html", + "--profile", + "Default", + self.policy_file, + "/usr/share/xml/another-oval.xml", + "/usr/share/xml/oval.xml", + ] + openscap.Popen.assert_called_once_with( + expected_cmd, + cwd=openscap.tempfile.mkdtemp.return_value, + stderr=subprocess.PIPE, + stdout=subprocess.PIPE, + ) + openscap.__salt__["cp.push_dir"].assert_called_once_with( + self.random_temp_dir + ) + self.assertEqual(openscap.shutil.rmtree.call_count, 1) + self.assertEqual( + response, + { + "upload_dir": self.random_temp_dir, + "error": "", + "success": True, + "returncode": 0, + }, + ) + + def test_new_openscap_xccdf_eval_success_with_failing_rules(self): + with patch( + "salt.modules.openscap.Popen", + MagicMock( + return_value=Mock( + **{"returncode": 2, "communicate.return_value": ("", "some error")} + ) + ), + ): + response = openscap.xccdf_eval( + self.policy_file, + profile="Default", + oval_results=True, + results="results.xml", + report="report.html", + ) + + self.assertEqual(openscap.tempfile.mkdtemp.call_count, 1) + expected_cmd = [ + "oscap", + "xccdf", + "eval", + "--oval-results", + "--results", + "results.xml", + "--report", + "report.html", + "--profile", + "Default", + self.policy_file, + ] + openscap.Popen.assert_called_once_with( + expected_cmd, + cwd=openscap.tempfile.mkdtemp.return_value, + stderr=subprocess.PIPE, + stdout=subprocess.PIPE, + ) + openscap.__salt__["cp.push_dir"].assert_called_once_with( + self.random_temp_dir + ) + self.assertEqual(openscap.shutil.rmtree.call_count, 1) + self.assertEqual( + response, + { + "upload_dir": self.random_temp_dir, + "error": "some error", + "success": True, + "returncode": 2, + }, + ) + + def test_new_openscap_xccdf_eval_success_ignore_unknown_params(self): + with patch( + "salt.modules.openscap.Popen", + MagicMock( + return_value=Mock( + **{"returncode": 2, "communicate.return_value": ("", "some error")} + ) + ), + ): + response = openscap.xccdf_eval( + "/policy/file", + param="Default", + profile="Default", + oval_results=True, + results="results.xml", + report="report.html", + ) + + self.assertEqual( + response, + { + "upload_dir": self.random_temp_dir, + "error": "some error", + "success": True, + "returncode": 2, + }, + ) + expected_cmd = [ + "oscap", + "xccdf", + "eval", + "--oval-results", + "--results", + "results.xml", + "--report", + "report.html", + "--profile", + "Default", + "/policy/file", + ] + openscap.Popen.assert_called_once_with( + expected_cmd, + cwd=openscap.tempfile.mkdtemp.return_value, + stderr=subprocess.PIPE, + stdout=subprocess.PIPE, + ) + + def test_new_openscap_xccdf_eval_evaluation_error(self): + with patch( + "salt.modules.openscap.Popen", + MagicMock( + return_value=Mock( + **{ + "returncode": 1, + "communicate.return_value": ("", "evaluation error"), + } + ) + ), + ): + response = openscap.xccdf_eval( + self.policy_file, + profile="Default", + oval_results=True, + results="results.xml", + report="report.html", + ) + + self.assertEqual( + response, + { + "upload_dir": None, + "error": "evaluation error", + "success": False, + "returncode": 1, + }, + ) From 271cf16d85d35947e672c8e1c50fb37cbf871d2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20Su=C3=A1rez=20Hern=C3=A1ndez?= Date: Thu, 24 Jun 2021 16:32:43 +0100 Subject: [PATCH 241/393] Allow 'tailoring_file' and 'tailoring_id' parameters --- salt/modules/openscap.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/salt/modules/openscap.py b/salt/modules/openscap.py index b8a383b13c8..f75e1c5e6b3 100644 --- a/salt/modules/openscap.py +++ b/salt/modules/openscap.py @@ -89,6 +89,12 @@ def xccdf_eval(xccdffile, ovalfiles=None, **kwargs): fetch_remote_resources download remote content referenced by XCCDF (True or False) + tailoring_file + use given XCCDF Tailoring file + + tailoring_id + use given DS component as XCCDF Tailoring file + remediate automatically execute XCCDF fix elements for failed rules. Use of this option is always at your own risk. (True or False) @@ -122,6 +128,12 @@ def xccdf_eval(xccdffile, ovalfiles=None, **kwargs): if "rule" in kwargs: cmd_opts.append("--rule") cmd_opts.append(kwargs["rule"]) + if "tailoring_file" in kwargs: + cmd_opts.append("--tailoring-file") + cmd_opts.append(kwargs["tailoring_file"]) + if "tailoring_id" in kwargs: + cmd_opts.append("--tailoring-id") + cmd_opts.append(kwargs["tailoring_id"]) if kwargs.get("fetch_remote_resources"): cmd_opts.append("--fetch-remote-resources") if kwargs.get("remediate"): From 516ef95ca8f6ff33b771cfdc4b5469fe2d0a734e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20Su=C3=A1rez=20Hern=C3=A1ndez?= Date: Thu, 5 Jan 2023 11:16:25 +0000 Subject: [PATCH 242/393] Rename changelog file --- changelog/{59756.added => 63416.added} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename changelog/{59756.added => 63416.added} (100%) diff --git a/changelog/59756.added b/changelog/63416.added similarity index 100% rename from changelog/59756.added rename to changelog/63416.added From f7b5792b7103827dbb9308821b33dbb4ce15ede4 Mon Sep 17 00:00:00 2001 From: Vladimir Nadvornik Date: Mon, 9 Aug 2021 12:34:15 +0200 Subject: [PATCH 243/393] Fix error handling in openscap module --- salt/modules/openscap.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/salt/modules/openscap.py b/salt/modules/openscap.py index f75e1c5e6b3..216fd89eef6 100644 --- a/salt/modules/openscap.py +++ b/salt/modules/openscap.py @@ -153,7 +153,9 @@ def xccdf_eval(xccdffile, ovalfiles=None, **kwargs): tempdir = tempfile.mkdtemp() proc = Popen(cmd_opts, stdout=PIPE, stderr=PIPE, cwd=tempdir) (stdoutdata, error) = proc.communicate() - success = _OSCAP_EXIT_CODES_MAP[proc.returncode] + success = _OSCAP_EXIT_CODES_MAP.get(proc.returncode, False) + if proc.returncode < 0: + error += "\nKilled by signal {}\n".format(proc.returncode).encode('ascii') returncode = proc.returncode if success: __salt__["cp.push_dir"](tempdir) @@ -202,7 +204,9 @@ def xccdf(params): tempdir = tempfile.mkdtemp() proc = Popen(shlex.split(cmd), stdout=PIPE, stderr=PIPE, cwd=tempdir) (stdoutdata, error) = proc.communicate() - success = _OSCAP_EXIT_CODES_MAP[proc.returncode] + success = _OSCAP_EXIT_CODES_MAP.get(proc.returncode, False) + if proc.returncode < 0: + error += "\nKilled by signal {}\n".format(proc.returncode).encode('ascii') returncode = proc.returncode if success: __salt__["cp.push_dir"](tempdir) From aba6f6beae193707ddc79aae33b35ba6a822ada2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20Su=C3=A1rez=20Hern=C3=A1ndez?= Date: Wed, 11 Jan 2023 12:45:11 +0000 Subject: [PATCH 244/393] Add versionadded tag --- salt/modules/openscap.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/salt/modules/openscap.py b/salt/modules/openscap.py index 216fd89eef6..c61fa82f2c8 100644 --- a/salt/modules/openscap.py +++ b/salt/modules/openscap.py @@ -59,6 +59,9 @@ _OSCAP_EXIT_CODES_MAP = { def xccdf_eval(xccdffile, ovalfiles=None, **kwargs): """ Run ``oscap xccdf eval`` commands on minions. + + .. versionadded:: 3007 + It uses cp.push_dir to upload the generated files to the salt master in the master's minion files cachedir (defaults to ``/var/cache/salt/master/minions/minion-id/files``) From 1c923149aedaffef61e868e2dcfaa6a08634a0dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20Su=C3=A1rez=20Hern=C3=A1ndez?= Date: Wed, 11 Jan 2023 15:41:26 +0000 Subject: [PATCH 245/393] Add deprecation warning for 'openscap.xccdf' function --- salt/modules/openscap.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/salt/modules/openscap.py b/salt/modules/openscap.py index c61fa82f2c8..5570b08caed 100644 --- a/salt/modules/openscap.py +++ b/salt/modules/openscap.py @@ -10,6 +10,8 @@ import shutil import tempfile from subprocess import PIPE, Popen +import salt.utils.versions + ArgumentParser = object try: @@ -185,6 +187,10 @@ def xccdf(params): salt '*' openscap.xccdf "eval --profile Default /usr/share/openscap/scap-yast2sec-xccdf.xml" """ + salt.utils.versions.warn_until( + 3009, + "The 'xccdf' function has been deprecated, please use 'xccdf_eval' instead", + ) params = shlex.split(params) policy = params[-1] From 9770229106233c5d0a4e9ab618918f3bc397b62c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20Su=C3=A1rez=20Hern=C3=A1ndez?= Date: Wed, 11 Jan 2023 15:41:55 +0000 Subject: [PATCH 246/393] Fix code according to black suggestions --- salt/modules/openscap.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/salt/modules/openscap.py b/salt/modules/openscap.py index 5570b08caed..41547fe1977 100644 --- a/salt/modules/openscap.py +++ b/salt/modules/openscap.py @@ -160,7 +160,7 @@ def xccdf_eval(xccdffile, ovalfiles=None, **kwargs): (stdoutdata, error) = proc.communicate() success = _OSCAP_EXIT_CODES_MAP.get(proc.returncode, False) if proc.returncode < 0: - error += "\nKilled by signal {}\n".format(proc.returncode).encode('ascii') + error += "\nKilled by signal {}\n".format(proc.returncode).encode("ascii") returncode = proc.returncode if success: __salt__["cp.push_dir"](tempdir) @@ -215,7 +215,7 @@ def xccdf(params): (stdoutdata, error) = proc.communicate() success = _OSCAP_EXIT_CODES_MAP.get(proc.returncode, False) if proc.returncode < 0: - error += "\nKilled by signal {}\n".format(proc.returncode).encode('ascii') + error += "\nKilled by signal {}\n".format(proc.returncode).encode("ascii") returncode = proc.returncode if success: __salt__["cp.push_dir"](tempdir) From 00b9b20c4c3fb794eaad303b96e6b6dc277f75e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20Su=C3=A1rez=20Hern=C3=A1ndez?= Date: Wed, 11 Jan 2023 16:41:53 +0000 Subject: [PATCH 247/393] Migrate openscap unit tests to pytest --- tests/pytests/unit/modules/test_openscap.py | 421 ++++++++++++++++++ tests/unit/modules/test_openscap.py | 447 -------------------- 2 files changed, 421 insertions(+), 447 deletions(-) create mode 100644 tests/pytests/unit/modules/test_openscap.py delete mode 100644 tests/unit/modules/test_openscap.py diff --git a/tests/pytests/unit/modules/test_openscap.py b/tests/pytests/unit/modules/test_openscap.py new file mode 100644 index 00000000000..35e200bb9bc --- /dev/null +++ b/tests/pytests/unit/modules/test_openscap.py @@ -0,0 +1,421 @@ +import subprocess + +import pytest + +import salt.modules.openscap as openscap +from tests.support.mock import MagicMock, Mock, patch + +random_temp_dir = "/tmp/unique-name" +policy_file = "/usr/share/openscap/policy-file-xccdf.xml" + + +class OpenscapTestMock: + def __init__(self): + import salt.modules.openscap + + salt.modules.openscap.__salt__ = MagicMock() + self.patchers = [ + patch("salt.modules.openscap.__salt__", MagicMock()), + patch("salt.modules.openscap.shutil.rmtree", Mock()), + patch( + "salt.modules.openscap.tempfile.mkdtemp", + Mock(return_value=random_temp_dir), + ), + patch("salt.modules.openscap.os.path.exists", Mock(return_value=True)), + ] + for patcher in self.patchers: + self.apply_patch(patcher) + + def apply_patch(self, patcher): + patcher.start() + + def close(self): + for patcher in self.patchers: + patcher.stop() + + +@pytest.fixture +def openscap_mocks(): + mocks = OpenscapTestMock() + yield mocks + mocks.close() + + +@pytest.fixture +def configure_loader_modules(openscap_mocks): + return {openscap: {"__salt__": {"cp.push_dir": MagicMock()}}} + + +def test_openscap_xccdf_eval_success(): + with patch( + "salt.modules.openscap.Popen", + MagicMock( + return_value=Mock(**{"returncode": 0, "communicate.return_value": ("", "")}) + ), + ): + response = openscap.xccdf("eval --profile Default {}".format(policy_file)) + + assert openscap.tempfile.mkdtemp.call_count == 1 + expected_cmd = [ + "oscap", + "xccdf", + "eval", + "--oval-results", + "--results", + "results.xml", + "--report", + "report.html", + "--profile", + "Default", + policy_file, + ] + openscap.Popen.assert_called_once_with( + expected_cmd, + cwd=openscap.tempfile.mkdtemp.return_value, + stderr=subprocess.PIPE, + stdout=subprocess.PIPE, + ) + openscap.__salt__["cp.push_dir"].assert_called_once_with(random_temp_dir) + assert openscap.shutil.rmtree.call_count == 1 + assert response == { + "upload_dir": random_temp_dir, + "error": "", + "success": True, + "returncode": 0, + } + + +def test_openscap_xccdf_eval_success_with_failing_rules(): + with patch( + "salt.modules.openscap.Popen", + MagicMock( + return_value=Mock( + **{"returncode": 2, "communicate.return_value": ("", "some error")} + ) + ), + ): + response = openscap.xccdf("eval --profile Default {}".format(policy_file)) + + assert openscap.tempfile.mkdtemp.call_count == 1 + expected_cmd = [ + "oscap", + "xccdf", + "eval", + "--oval-results", + "--results", + "results.xml", + "--report", + "report.html", + "--profile", + "Default", + policy_file, + ] + openscap.Popen.assert_called_once_with( + expected_cmd, + cwd=openscap.tempfile.mkdtemp.return_value, + stderr=subprocess.PIPE, + stdout=subprocess.PIPE, + ) + openscap.__salt__["cp.push_dir"].assert_called_once_with(random_temp_dir) + assert openscap.shutil.rmtree.call_count == 1 + assert response == { + "upload_dir": random_temp_dir, + "error": "some error", + "success": True, + "returncode": 2, + } + + +def test_openscap_xccdf_eval_fail_no_profile(): + response = openscap.xccdf("eval --param Default /unknown/param") + error = "the following arguments are required: --profile" + assert response == { + "error": error, + "upload_dir": None, + "success": False, + "returncode": None, + } + + +def test_openscap_xccdf_eval_success_ignore_unknown_params(): + with patch( + "salt.modules.openscap.Popen", + MagicMock( + return_value=Mock( + **{"returncode": 2, "communicate.return_value": ("", "some error")} + ) + ), + ): + response = openscap.xccdf("eval --profile Default --param Default /policy/file") + assert response == { + "upload_dir": random_temp_dir, + "error": "some error", + "success": True, + "returncode": 2, + } + expected_cmd = [ + "oscap", + "xccdf", + "eval", + "--oval-results", + "--results", + "results.xml", + "--report", + "report.html", + "--profile", + "Default", + "/policy/file", + ] + openscap.Popen.assert_called_once_with( + expected_cmd, + cwd=openscap.tempfile.mkdtemp.return_value, + stderr=subprocess.PIPE, + stdout=subprocess.PIPE, + ) + + +def test_openscap_xccdf_eval_evaluation_error(): + with patch( + "salt.modules.openscap.Popen", + MagicMock( + return_value=Mock( + **{ + "returncode": 1, + "communicate.return_value": ("", "evaluation error"), + } + ) + ), + ): + response = openscap.xccdf("eval --profile Default {}".format(policy_file)) + + assert response == { + "upload_dir": None, + "error": "evaluation error", + "success": False, + "returncode": 1, + } + + +def test_openscap_xccdf_eval_fail_not_implemented_action(): + response = openscap.xccdf("info {}".format(policy_file)) + mock_err = "argument action: invalid choice: 'info' (choose from 'eval')" + + assert response == { + "upload_dir": None, + "error": mock_err, + "success": False, + "returncode": None, + } + + +def test_new_openscap_xccdf_eval_success(): + with patch( + "salt.modules.openscap.Popen", + MagicMock( + return_value=Mock(**{"returncode": 0, "communicate.return_value": ("", "")}) + ), + ): + response = openscap.xccdf_eval( + policy_file, + profile="Default", + oval_results=True, + results="results.xml", + report="report.html", + ) + + assert openscap.tempfile.mkdtemp.call_count == 1 + expected_cmd = [ + "oscap", + "xccdf", + "eval", + "--oval-results", + "--results", + "results.xml", + "--report", + "report.html", + "--profile", + "Default", + policy_file, + ] + openscap.Popen.assert_called_once_with( + expected_cmd, + cwd=openscap.tempfile.mkdtemp.return_value, + stderr=subprocess.PIPE, + stdout=subprocess.PIPE, + ) + openscap.__salt__["cp.push_dir"].assert_called_once_with(random_temp_dir) + assert openscap.shutil.rmtree.call_count == 1 + assert response == { + "upload_dir": random_temp_dir, + "error": "", + "success": True, + "returncode": 0, + } + + +def test_new_openscap_xccdf_eval_success_with_extra_ovalfiles(): + with patch( + "salt.modules.openscap.Popen", + MagicMock( + return_value=Mock(**{"returncode": 0, "communicate.return_value": ("", "")}) + ), + ): + response = openscap.xccdf_eval( + policy_file, + ["/usr/share/xml/another-oval.xml", "/usr/share/xml/oval.xml"], + profile="Default", + oval_results=True, + results="results.xml", + report="report.html", + ) + + assert openscap.tempfile.mkdtemp.call_count == 1 + expected_cmd = [ + "oscap", + "xccdf", + "eval", + "--oval-results", + "--results", + "results.xml", + "--report", + "report.html", + "--profile", + "Default", + policy_file, + "/usr/share/xml/another-oval.xml", + "/usr/share/xml/oval.xml", + ] + openscap.Popen.assert_called_once_with( + expected_cmd, + cwd=openscap.tempfile.mkdtemp.return_value, + stderr=subprocess.PIPE, + stdout=subprocess.PIPE, + ) + openscap.__salt__["cp.push_dir"].assert_called_once_with(random_temp_dir) + assert openscap.shutil.rmtree.call_count == 1 + assert response == { + "upload_dir": random_temp_dir, + "error": "", + "success": True, + "returncode": 0, + } + + +def test_new_openscap_xccdf_eval_success_with_failing_rules(): + with patch( + "salt.modules.openscap.Popen", + MagicMock( + return_value=Mock( + **{"returncode": 2, "communicate.return_value": ("", "some error")} + ) + ), + ): + response = openscap.xccdf_eval( + policy_file, + profile="Default", + oval_results=True, + results="results.xml", + report="report.html", + ) + + assert openscap.tempfile.mkdtemp.call_count == 1 + expected_cmd = [ + "oscap", + "xccdf", + "eval", + "--oval-results", + "--results", + "results.xml", + "--report", + "report.html", + "--profile", + "Default", + policy_file, + ] + openscap.Popen.assert_called_once_with( + expected_cmd, + cwd=openscap.tempfile.mkdtemp.return_value, + stderr=subprocess.PIPE, + stdout=subprocess.PIPE, + ) + openscap.__salt__["cp.push_dir"].assert_called_once_with(random_temp_dir) + assert openscap.shutil.rmtree.call_count == 1 + assert response == { + "upload_dir": random_temp_dir, + "error": "some error", + "success": True, + "returncode": 2, + } + + +def test_new_openscap_xccdf_eval_success_ignore_unknown_params(): + with patch( + "salt.modules.openscap.Popen", + MagicMock( + return_value=Mock( + **{"returncode": 2, "communicate.return_value": ("", "some error")} + ) + ), + ): + response = openscap.xccdf_eval( + "/policy/file", + param="Default", + profile="Default", + oval_results=True, + results="results.xml", + report="report.html", + ) + + assert response == { + "upload_dir": random_temp_dir, + "error": "some error", + "success": True, + "returncode": 2, + } + expected_cmd = [ + "oscap", + "xccdf", + "eval", + "--oval-results", + "--results", + "results.xml", + "--report", + "report.html", + "--profile", + "Default", + "/policy/file", + ] + openscap.Popen.assert_called_once_with( + expected_cmd, + cwd=openscap.tempfile.mkdtemp.return_value, + stderr=subprocess.PIPE, + stdout=subprocess.PIPE, + ) + + +def test_new_openscap_xccdf_eval_evaluation_error(): + with patch( + "salt.modules.openscap.Popen", + MagicMock( + return_value=Mock( + **{ + "returncode": 1, + "communicate.return_value": ("", "evaluation error"), + } + ) + ), + ): + response = openscap.xccdf_eval( + policy_file, + profile="Default", + oval_results=True, + results="results.xml", + report="report.html", + ) + + assert response == { + "upload_dir": None, + "error": "evaluation error", + "success": False, + "returncode": 1, + } diff --git a/tests/unit/modules/test_openscap.py b/tests/unit/modules/test_openscap.py deleted file mode 100644 index 301c1869ecf..00000000000 --- a/tests/unit/modules/test_openscap.py +++ /dev/null @@ -1,447 +0,0 @@ -import subprocess - -import salt.modules.openscap as openscap -from tests.support.mock import MagicMock, Mock, patch -from tests.support.unit import TestCase - - -class OpenscapTestCase(TestCase): - - random_temp_dir = "/tmp/unique-name" - policy_file = "/usr/share/openscap/policy-file-xccdf.xml" - - def setUp(self): - import salt.modules.openscap - - salt.modules.openscap.__salt__ = MagicMock() - patchers = [ - patch("salt.modules.openscap.__salt__", MagicMock()), - patch("salt.modules.openscap.shutil.rmtree", Mock()), - patch( - "salt.modules.openscap.tempfile.mkdtemp", - Mock(return_value=self.random_temp_dir), - ), - patch("salt.modules.openscap.os.path.exists", Mock(return_value=True)), - ] - for patcher in patchers: - self.apply_patch(patcher) - - def apply_patch(self, patcher): - patcher.start() - self.addCleanup(patcher.stop) - - def test_openscap_xccdf_eval_success(self): - with patch( - "salt.modules.openscap.Popen", - MagicMock( - return_value=Mock( - **{"returncode": 0, "communicate.return_value": ("", "")} - ) - ), - ): - response = openscap.xccdf( - "eval --profile Default {}".format(self.policy_file) - ) - - self.assertEqual(openscap.tempfile.mkdtemp.call_count, 1) - expected_cmd = [ - "oscap", - "xccdf", - "eval", - "--oval-results", - "--results", - "results.xml", - "--report", - "report.html", - "--profile", - "Default", - self.policy_file, - ] - openscap.Popen.assert_called_once_with( - expected_cmd, - cwd=openscap.tempfile.mkdtemp.return_value, - stderr=subprocess.PIPE, - stdout=subprocess.PIPE, - ) - openscap.__salt__["cp.push_dir"].assert_called_once_with( - self.random_temp_dir - ) - self.assertEqual(openscap.shutil.rmtree.call_count, 1) - self.assertEqual( - response, - { - "upload_dir": self.random_temp_dir, - "error": "", - "success": True, - "returncode": 0, - }, - ) - - def test_openscap_xccdf_eval_success_with_failing_rules(self): - with patch( - "salt.modules.openscap.Popen", - MagicMock( - return_value=Mock( - **{"returncode": 2, "communicate.return_value": ("", "some error")} - ) - ), - ): - response = openscap.xccdf( - "eval --profile Default {}".format(self.policy_file) - ) - - self.assertEqual(openscap.tempfile.mkdtemp.call_count, 1) - expected_cmd = [ - "oscap", - "xccdf", - "eval", - "--oval-results", - "--results", - "results.xml", - "--report", - "report.html", - "--profile", - "Default", - self.policy_file, - ] - openscap.Popen.assert_called_once_with( - expected_cmd, - cwd=openscap.tempfile.mkdtemp.return_value, - stderr=subprocess.PIPE, - stdout=subprocess.PIPE, - ) - openscap.__salt__["cp.push_dir"].assert_called_once_with( - self.random_temp_dir - ) - self.assertEqual(openscap.shutil.rmtree.call_count, 1) - self.assertEqual( - response, - { - "upload_dir": self.random_temp_dir, - "error": "some error", - "success": True, - "returncode": 2, - }, - ) - - def test_openscap_xccdf_eval_fail_no_profile(self): - response = openscap.xccdf("eval --param Default /unknown/param") - error = "the following arguments are required: --profile" - self.assertEqual( - response, - {"error": error, "upload_dir": None, "success": False, "returncode": None}, - ) - - def test_openscap_xccdf_eval_success_ignore_unknown_params(self): - with patch( - "salt.modules.openscap.Popen", - MagicMock( - return_value=Mock( - **{"returncode": 2, "communicate.return_value": ("", "some error")} - ) - ), - ): - response = openscap.xccdf( - "eval --profile Default --param Default /policy/file" - ) - self.assertEqual( - response, - { - "upload_dir": self.random_temp_dir, - "error": "some error", - "success": True, - "returncode": 2, - }, - ) - expected_cmd = [ - "oscap", - "xccdf", - "eval", - "--oval-results", - "--results", - "results.xml", - "--report", - "report.html", - "--profile", - "Default", - "/policy/file", - ] - openscap.Popen.assert_called_once_with( - expected_cmd, - cwd=openscap.tempfile.mkdtemp.return_value, - stderr=subprocess.PIPE, - stdout=subprocess.PIPE, - ) - - def test_openscap_xccdf_eval_evaluation_error(self): - with patch( - "salt.modules.openscap.Popen", - MagicMock( - return_value=Mock( - **{ - "returncode": 1, - "communicate.return_value": ("", "evaluation error"), - } - ) - ), - ): - response = openscap.xccdf( - "eval --profile Default {}".format(self.policy_file) - ) - - self.assertEqual( - response, - { - "upload_dir": None, - "error": "evaluation error", - "success": False, - "returncode": 1, - }, - ) - - def test_openscap_xccdf_eval_fail_not_implemented_action(self): - response = openscap.xccdf("info {}".format(self.policy_file)) - mock_err = "argument action: invalid choice: 'info' (choose from 'eval')" - - self.assertEqual( - response, - { - "upload_dir": None, - "error": mock_err, - "success": False, - "returncode": None, - }, - ) - - def test_new_openscap_xccdf_eval_success(self): - with patch( - "salt.modules.openscap.Popen", - MagicMock( - return_value=Mock( - **{"returncode": 0, "communicate.return_value": ("", "")} - ) - ), - ): - response = openscap.xccdf_eval( - self.policy_file, - profile="Default", - oval_results=True, - results="results.xml", - report="report.html", - ) - - self.assertEqual(openscap.tempfile.mkdtemp.call_count, 1) - expected_cmd = [ - "oscap", - "xccdf", - "eval", - "--oval-results", - "--results", - "results.xml", - "--report", - "report.html", - "--profile", - "Default", - self.policy_file, - ] - openscap.Popen.assert_called_once_with( - expected_cmd, - cwd=openscap.tempfile.mkdtemp.return_value, - stderr=subprocess.PIPE, - stdout=subprocess.PIPE, - ) - openscap.__salt__["cp.push_dir"].assert_called_once_with( - self.random_temp_dir - ) - self.assertEqual(openscap.shutil.rmtree.call_count, 1) - self.assertEqual( - response, - { - "upload_dir": self.random_temp_dir, - "error": "", - "success": True, - "returncode": 0, - }, - ) - - def test_new_openscap_xccdf_eval_success_with_extra_ovalfiles(self): - with patch( - "salt.modules.openscap.Popen", - MagicMock( - return_value=Mock( - **{"returncode": 0, "communicate.return_value": ("", "")} - ) - ), - ): - response = openscap.xccdf_eval( - self.policy_file, - ["/usr/share/xml/another-oval.xml", "/usr/share/xml/oval.xml"], - profile="Default", - oval_results=True, - results="results.xml", - report="report.html", - ) - - self.assertEqual(openscap.tempfile.mkdtemp.call_count, 1) - expected_cmd = [ - "oscap", - "xccdf", - "eval", - "--oval-results", - "--results", - "results.xml", - "--report", - "report.html", - "--profile", - "Default", - self.policy_file, - "/usr/share/xml/another-oval.xml", - "/usr/share/xml/oval.xml", - ] - openscap.Popen.assert_called_once_with( - expected_cmd, - cwd=openscap.tempfile.mkdtemp.return_value, - stderr=subprocess.PIPE, - stdout=subprocess.PIPE, - ) - openscap.__salt__["cp.push_dir"].assert_called_once_with( - self.random_temp_dir - ) - self.assertEqual(openscap.shutil.rmtree.call_count, 1) - self.assertEqual( - response, - { - "upload_dir": self.random_temp_dir, - "error": "", - "success": True, - "returncode": 0, - }, - ) - - def test_new_openscap_xccdf_eval_success_with_failing_rules(self): - with patch( - "salt.modules.openscap.Popen", - MagicMock( - return_value=Mock( - **{"returncode": 2, "communicate.return_value": ("", "some error")} - ) - ), - ): - response = openscap.xccdf_eval( - self.policy_file, - profile="Default", - oval_results=True, - results="results.xml", - report="report.html", - ) - - self.assertEqual(openscap.tempfile.mkdtemp.call_count, 1) - expected_cmd = [ - "oscap", - "xccdf", - "eval", - "--oval-results", - "--results", - "results.xml", - "--report", - "report.html", - "--profile", - "Default", - self.policy_file, - ] - openscap.Popen.assert_called_once_with( - expected_cmd, - cwd=openscap.tempfile.mkdtemp.return_value, - stderr=subprocess.PIPE, - stdout=subprocess.PIPE, - ) - openscap.__salt__["cp.push_dir"].assert_called_once_with( - self.random_temp_dir - ) - self.assertEqual(openscap.shutil.rmtree.call_count, 1) - self.assertEqual( - response, - { - "upload_dir": self.random_temp_dir, - "error": "some error", - "success": True, - "returncode": 2, - }, - ) - - def test_new_openscap_xccdf_eval_success_ignore_unknown_params(self): - with patch( - "salt.modules.openscap.Popen", - MagicMock( - return_value=Mock( - **{"returncode": 2, "communicate.return_value": ("", "some error")} - ) - ), - ): - response = openscap.xccdf_eval( - "/policy/file", - param="Default", - profile="Default", - oval_results=True, - results="results.xml", - report="report.html", - ) - - self.assertEqual( - response, - { - "upload_dir": self.random_temp_dir, - "error": "some error", - "success": True, - "returncode": 2, - }, - ) - expected_cmd = [ - "oscap", - "xccdf", - "eval", - "--oval-results", - "--results", - "results.xml", - "--report", - "report.html", - "--profile", - "Default", - "/policy/file", - ] - openscap.Popen.assert_called_once_with( - expected_cmd, - cwd=openscap.tempfile.mkdtemp.return_value, - stderr=subprocess.PIPE, - stdout=subprocess.PIPE, - ) - - def test_new_openscap_xccdf_eval_evaluation_error(self): - with patch( - "salt.modules.openscap.Popen", - MagicMock( - return_value=Mock( - **{ - "returncode": 1, - "communicate.return_value": ("", "evaluation error"), - } - ) - ), - ): - response = openscap.xccdf_eval( - self.policy_file, - profile="Default", - oval_results=True, - results="results.xml", - report="report.html", - ) - - self.assertEqual( - response, - { - "upload_dir": None, - "error": "evaluation error", - "success": False, - "returncode": 1, - }, - ) From 0464a16c2a49aeed79db876a2e7707630f16dffb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20Su=C3=A1rez=20Hern=C3=A1ndez?= Date: Wed, 11 Jan 2023 16:50:30 +0000 Subject: [PATCH 248/393] Move parameters for 'xccdf_eval' out of kwargs --- salt/modules/openscap.py | 45 ++++++++++++++++++++++++++-------------- 1 file changed, 29 insertions(+), 16 deletions(-) diff --git a/salt/modules/openscap.py b/salt/modules/openscap.py index 41547fe1977..9df9fa5a834 100644 --- a/salt/modules/openscap.py +++ b/salt/modules/openscap.py @@ -58,7 +58,20 @@ _OSCAP_EXIT_CODES_MAP = { } -def xccdf_eval(xccdffile, ovalfiles=None, **kwargs): +def xccdf_eval( + xccdffile, + ovalfiles=None, + profile=None, + rule=None, + oval_results=None, + results=None, + report=None, + fetch_remote_resources=None, + tailoring_file=None, + tailoring_id=None, + remediate=None, + **kwargs +): """ Run ``oscap xccdf eval`` commands on minions. @@ -119,29 +132,29 @@ def xccdf_eval(xccdffile, ovalfiles=None, **kwargs): ovalfiles = [] cmd_opts = ["oscap", "xccdf", "eval"] - if kwargs.get("oval_results"): + if oval_results: cmd_opts.append("--oval-results") - if "results" in kwargs: + if results: cmd_opts.append("--results") - cmd_opts.append(kwargs["results"]) - if "report" in kwargs: + cmd_opts.append(results) + if report: cmd_opts.append("--report") - cmd_opts.append(kwargs["report"]) - if "profile" in kwargs: + cmd_opts.append(report) + if profile: cmd_opts.append("--profile") - cmd_opts.append(kwargs["profile"]) - if "rule" in kwargs: + cmd_opts.append(profile) + if rule: cmd_opts.append("--rule") - cmd_opts.append(kwargs["rule"]) - if "tailoring_file" in kwargs: + cmd_opts.append(rule) + if tailoring_file: cmd_opts.append("--tailoring-file") - cmd_opts.append(kwargs["tailoring_file"]) - if "tailoring_id" in kwargs: + cmd_opts.append(tailoring_file) + if tailoring_id: cmd_opts.append("--tailoring-id") - cmd_opts.append(kwargs["tailoring_id"]) - if kwargs.get("fetch_remote_resources"): + cmd_opts.append(tailoring_id) + if fetch_remote_resources: cmd_opts.append("--fetch-remote-resources") - if kwargs.get("remediate"): + if remediate: cmd_opts.append("--remediate") cmd_opts.append(xccdffile) cmd_opts.extend(ovalfiles) From 87715c4dc6536153a4d9691d555416cba69ac97a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20Su=C3=A1rez=20Hern=C3=A1ndez?= Date: Fri, 13 Jan 2023 08:43:57 +0000 Subject: [PATCH 249/393] Remove kwargs from xccdf_eval function --- salt/modules/openscap.py | 1 - 1 file changed, 1 deletion(-) diff --git a/salt/modules/openscap.py b/salt/modules/openscap.py index 9df9fa5a834..721d61d13a6 100644 --- a/salt/modules/openscap.py +++ b/salt/modules/openscap.py @@ -70,7 +70,6 @@ def xccdf_eval( tailoring_file=None, tailoring_id=None, remediate=None, - **kwargs ): """ Run ``oscap xccdf eval`` commands on minions. From a8b88be486006419cd2f186cfa38c659668fc58a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20Su=C3=A1rez=20Hern=C3=A1ndez?= Date: Fri, 13 Jan 2023 09:25:51 +0000 Subject: [PATCH 250/393] Remove test that does not make sense for xccdf_eval --- tests/pytests/unit/modules/test_openscap.py | 45 --------------------- 1 file changed, 45 deletions(-) diff --git a/tests/pytests/unit/modules/test_openscap.py b/tests/pytests/unit/modules/test_openscap.py index 35e200bb9bc..c12cc564579 100644 --- a/tests/pytests/unit/modules/test_openscap.py +++ b/tests/pytests/unit/modules/test_openscap.py @@ -348,51 +348,6 @@ def test_new_openscap_xccdf_eval_success_with_failing_rules(): } -def test_new_openscap_xccdf_eval_success_ignore_unknown_params(): - with patch( - "salt.modules.openscap.Popen", - MagicMock( - return_value=Mock( - **{"returncode": 2, "communicate.return_value": ("", "some error")} - ) - ), - ): - response = openscap.xccdf_eval( - "/policy/file", - param="Default", - profile="Default", - oval_results=True, - results="results.xml", - report="report.html", - ) - - assert response == { - "upload_dir": random_temp_dir, - "error": "some error", - "success": True, - "returncode": 2, - } - expected_cmd = [ - "oscap", - "xccdf", - "eval", - "--oval-results", - "--results", - "results.xml", - "--report", - "report.html", - "--profile", - "Default", - "/policy/file", - ] - openscap.Popen.assert_called_once_with( - expected_cmd, - cwd=openscap.tempfile.mkdtemp.return_value, - stderr=subprocess.PIPE, - stdout=subprocess.PIPE, - ) - - def test_new_openscap_xccdf_eval_evaluation_error(): with patch( "salt.modules.openscap.Popen", From b87c24ebeb11a6d1c1adb88f0095b59cc1144e35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20Su=C3=A1rez=20Hern=C3=A1ndez?= Date: Mon, 23 Jan 2023 11:08:57 +0000 Subject: [PATCH 251/393] Refactor OpenscapTestMock into pytest fixture Co-authored-by: Pedro Algarvio --- tests/pytests/unit/modules/test_openscap.py | 56 +++++++-------------- 1 file changed, 17 insertions(+), 39 deletions(-) diff --git a/tests/pytests/unit/modules/test_openscap.py b/tests/pytests/unit/modules/test_openscap.py index c12cc564579..1f893ee0cb6 100644 --- a/tests/pytests/unit/modules/test_openscap.py +++ b/tests/pytests/unit/modules/test_openscap.py @@ -5,48 +5,26 @@ import pytest import salt.modules.openscap as openscap from tests.support.mock import MagicMock, Mock, patch -random_temp_dir = "/tmp/unique-name" policy_file = "/usr/share/openscap/policy-file-xccdf.xml" -class OpenscapTestMock: - def __init__(self): - import salt.modules.openscap - - salt.modules.openscap.__salt__ = MagicMock() - self.patchers = [ - patch("salt.modules.openscap.__salt__", MagicMock()), - patch("salt.modules.openscap.shutil.rmtree", Mock()), - patch( - "salt.modules.openscap.tempfile.mkdtemp", - Mock(return_value=random_temp_dir), - ), - patch("salt.modules.openscap.os.path.exists", Mock(return_value=True)), - ] - for patcher in self.patchers: - self.apply_patch(patcher) - - def apply_patch(self, patcher): - patcher.start() - - def close(self): - for patcher in self.patchers: - patcher.stop() +@pytest.fixture +def random_temp_dir(tmp_path): + tmp_dir = tmp_path / "unique" + tmp_dir.mkdir() + return str(tmp_dir) @pytest.fixture -def openscap_mocks(): - mocks = OpenscapTestMock() - yield mocks - mocks.close() +def configure_loader_modules(random_temp_dir): + with patch("salt.modules.openscap.shutil.rmtree", Mock()), patch( + "salt.modules.openscap.tempfile.mkdtemp", + Mock(return_value=random_temp_dir), + ), patch("salt.modules.openscap.os.path.exists", Mock(return_value=True)): + yield {openscap: {"__salt__": {"cp.push_dir": MagicMock()}}} -@pytest.fixture -def configure_loader_modules(openscap_mocks): - return {openscap: {"__salt__": {"cp.push_dir": MagicMock()}}} - - -def test_openscap_xccdf_eval_success(): +def test_openscap_xccdf_eval_success(random_temp_dir): with patch( "salt.modules.openscap.Popen", MagicMock( @@ -85,7 +63,7 @@ def test_openscap_xccdf_eval_success(): } -def test_openscap_xccdf_eval_success_with_failing_rules(): +def test_openscap_xccdf_eval_success_with_failing_rules(random_temp_dir): with patch( "salt.modules.openscap.Popen", MagicMock( @@ -137,7 +115,7 @@ def test_openscap_xccdf_eval_fail_no_profile(): } -def test_openscap_xccdf_eval_success_ignore_unknown_params(): +def test_openscap_xccdf_eval_success_ignore_unknown_params(random_temp_dir): with patch( "salt.modules.openscap.Popen", MagicMock( @@ -208,7 +186,7 @@ def test_openscap_xccdf_eval_fail_not_implemented_action(): } -def test_new_openscap_xccdf_eval_success(): +def test_new_openscap_xccdf_eval_success(random_temp_dir): with patch( "salt.modules.openscap.Popen", MagicMock( @@ -253,7 +231,7 @@ def test_new_openscap_xccdf_eval_success(): } -def test_new_openscap_xccdf_eval_success_with_extra_ovalfiles(): +def test_new_openscap_xccdf_eval_success_with_extra_ovalfiles(random_temp_dir): with patch( "salt.modules.openscap.Popen", MagicMock( @@ -301,7 +279,7 @@ def test_new_openscap_xccdf_eval_success_with_extra_ovalfiles(): } -def test_new_openscap_xccdf_eval_success_with_failing_rules(): +def test_new_openscap_xccdf_eval_success_with_failing_rules(random_temp_dir): with patch( "salt.modules.openscap.Popen", MagicMock( From 70486ca1d4a328402fc5ca8ccc36d96727320300 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20Su=C3=A1rez=20Hern=C3=A1ndez?= Date: Mon, 23 Jan 2023 13:27:37 +0000 Subject: [PATCH 252/393] Return error if there is a problem uploading openscap results to master --- salt/modules/openscap.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/salt/modules/openscap.py b/salt/modules/openscap.py index 721d61d13a6..a6ff75d530e 100644 --- a/salt/modules/openscap.py +++ b/salt/modules/openscap.py @@ -175,7 +175,9 @@ def xccdf_eval( error += "\nKilled by signal {}\n".format(proc.returncode).encode("ascii") returncode = proc.returncode if success: - __salt__["cp.push_dir"](tempdir) + if not __salt__["cp.push_dir"](tempdir): + success = False + error = "There was an error uploading openscap results files to salt master. Please check logs." upload_dir = tempdir shutil.rmtree(tempdir, ignore_errors=True) @@ -230,7 +232,9 @@ def xccdf(params): error += "\nKilled by signal {}\n".format(proc.returncode).encode("ascii") returncode = proc.returncode if success: - __salt__["cp.push_dir"](tempdir) + if not __salt__["cp.push_dir"](tempdir): + success = False + error = "There was an error uploading openscap results files to salt master. Please check logs." shutil.rmtree(tempdir, ignore_errors=True) upload_dir = tempdir From 1f1420aa0b2db22d3c33dd15791a359bbe665ed3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20Su=C3=A1rez=20Hern=C3=A1ndez?= Date: Thu, 29 Jun 2023 09:09:32 +0100 Subject: [PATCH 253/393] Add changes suggested by pre-commit --- changelog/{63416.added => 63416.added.md} | 0 salt/modules/openscap.py | 10 +++++----- tests/pytests/unit/modules/test_openscap.py | 8 ++++---- 3 files changed, 9 insertions(+), 9 deletions(-) rename changelog/{63416.added => 63416.added.md} (100%) diff --git a/changelog/63416.added b/changelog/63416.added.md similarity index 100% rename from changelog/63416.added rename to changelog/63416.added.md diff --git a/salt/modules/openscap.py b/salt/modules/openscap.py index a6ff75d530e..28df1521906 100644 --- a/salt/modules/openscap.py +++ b/salt/modules/openscap.py @@ -74,7 +74,7 @@ def xccdf_eval( """ Run ``oscap xccdf eval`` commands on minions. - .. versionadded:: 3007 + .. versionadded:: 3007.0 It uses cp.push_dir to upload the generated files to the salt master in the master's minion files cachedir @@ -160,11 +160,11 @@ def xccdf_eval( if not os.path.exists(xccdffile): success = False - error = "XCCDF File '{}' does not exist".format(xccdffile) + error = f"XCCDF File '{xccdffile}' does not exist" for ofile in ovalfiles: if success and not os.path.exists(ofile): success = False - error = "Oval File '{}' does not exist".format(ofile) + error = f"Oval File '{ofile}' does not exist" if success: tempdir = tempfile.mkdtemp() @@ -172,7 +172,7 @@ def xccdf_eval( (stdoutdata, error) = proc.communicate() success = _OSCAP_EXIT_CODES_MAP.get(proc.returncode, False) if proc.returncode < 0: - error += "\nKilled by signal {}\n".format(proc.returncode).encode("ascii") + error += f"\nKilled by signal {proc.returncode}\n".encode("ascii") returncode = proc.returncode if success: if not __salt__["cp.push_dir"](tempdir): @@ -229,7 +229,7 @@ def xccdf(params): (stdoutdata, error) = proc.communicate() success = _OSCAP_EXIT_CODES_MAP.get(proc.returncode, False) if proc.returncode < 0: - error += "\nKilled by signal {}\n".format(proc.returncode).encode("ascii") + error += f"\nKilled by signal {proc.returncode}\n".encode("ascii") returncode = proc.returncode if success: if not __salt__["cp.push_dir"](tempdir): diff --git a/tests/pytests/unit/modules/test_openscap.py b/tests/pytests/unit/modules/test_openscap.py index 1f893ee0cb6..a40dc612433 100644 --- a/tests/pytests/unit/modules/test_openscap.py +++ b/tests/pytests/unit/modules/test_openscap.py @@ -31,7 +31,7 @@ def test_openscap_xccdf_eval_success(random_temp_dir): return_value=Mock(**{"returncode": 0, "communicate.return_value": ("", "")}) ), ): - response = openscap.xccdf("eval --profile Default {}".format(policy_file)) + response = openscap.xccdf(f"eval --profile Default {policy_file}") assert openscap.tempfile.mkdtemp.call_count == 1 expected_cmd = [ @@ -72,7 +72,7 @@ def test_openscap_xccdf_eval_success_with_failing_rules(random_temp_dir): ) ), ): - response = openscap.xccdf("eval --profile Default {}".format(policy_file)) + response = openscap.xccdf(f"eval --profile Default {policy_file}") assert openscap.tempfile.mkdtemp.call_count == 1 expected_cmd = [ @@ -164,7 +164,7 @@ def test_openscap_xccdf_eval_evaluation_error(): ) ), ): - response = openscap.xccdf("eval --profile Default {}".format(policy_file)) + response = openscap.xccdf(f"eval --profile Default {policy_file}") assert response == { "upload_dir": None, @@ -175,7 +175,7 @@ def test_openscap_xccdf_eval_evaluation_error(): def test_openscap_xccdf_eval_fail_not_implemented_action(): - response = openscap.xccdf("info {}".format(policy_file)) + response = openscap.xccdf(f"info {policy_file}") mock_err = "argument action: invalid choice: 'info' (choose from 'eval')" assert response == { From 1826c9cf6709296b36367df4c6d292ed28c633be Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Wed, 21 Dec 2022 09:09:10 +0000 Subject: [PATCH 254/393] Test requires root permissions Signed-off-by: Pedro Algarvio --- tests/integration/modules/test_status.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/integration/modules/test_status.py b/tests/integration/modules/test_status.py index 73ce4817e82..3574e23a3a2 100644 --- a/tests/integration/modules/test_status.py +++ b/tests/integration/modules/test_status.py @@ -44,6 +44,7 @@ class StatusModuleTest(ModuleCase): self.assertTrue(isinstance(ret, int)) @pytest.mark.slow_test + @pytest.mark.skip_if_not_root def test_status_diskusage(self): """ status.diskusage From 61fc2933c420e5f7464731553f79b69626c66ad9 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Tue, 25 Jul 2023 11:38:24 +0100 Subject: [PATCH 255/393] Bump to `pytest-salt-factories==1.0.0rc24` Signed-off-by: Pedro Algarvio --- requirements/pytest.txt | 2 +- requirements/static/ci/py3.10/darwin.txt | 3 ++- requirements/static/ci/py3.10/freebsd.txt | 3 ++- requirements/static/ci/py3.10/linux.txt | 3 ++- requirements/static/ci/py3.10/windows.txt | 3 ++- requirements/static/ci/py3.11/darwin.txt | 3 ++- requirements/static/ci/py3.11/freebsd.txt | 3 ++- requirements/static/ci/py3.11/linux.txt | 3 ++- requirements/static/ci/py3.11/windows.txt | 3 ++- requirements/static/ci/py3.8/freebsd.txt | 3 ++- requirements/static/ci/py3.8/linux.txt | 3 ++- requirements/static/ci/py3.8/windows.txt | 3 ++- requirements/static/ci/py3.9/darwin.txt | 3 ++- requirements/static/ci/py3.9/freebsd.txt | 3 ++- requirements/static/ci/py3.9/linux.txt | 3 ++- requirements/static/ci/py3.9/windows.txt | 3 ++- 16 files changed, 31 insertions(+), 16 deletions(-) diff --git a/requirements/pytest.txt b/requirements/pytest.txt index d4227c33e17..010052e43ea 100644 --- a/requirements/pytest.txt +++ b/requirements/pytest.txt @@ -2,7 +2,7 @@ mock >= 3.0.0 # PyTest docker pytest >= 7.2.0 -pytest-salt-factories >= 1.0.0rc21 +pytest-salt-factories >= 1.0.0rc24 pytest-tempdir >= 2019.10.12 pytest-helpers-namespace >= 2019.1.8 pytest-subtests diff --git a/requirements/static/ci/py3.10/darwin.txt b/requirements/static/ci/py3.10/darwin.txt index 087fd46d838..ce389ec5867 100644 --- a/requirements/static/ci/py3.10/darwin.txt +++ b/requirements/static/ci/py3.10/darwin.txt @@ -358,7 +358,7 @@ pytest-helpers-namespace==2021.12.29 # pytest-shell-utilities pytest-httpserver==1.0.8 # via -r requirements/pytest.txt -pytest-salt-factories==1.0.0rc21 +pytest-salt-factories==1.0.0rc24 # via -r requirements/pytest.txt pytest-shell-utilities==1.8.0 # via pytest-salt-factories @@ -419,6 +419,7 @@ pyyaml==6.0.1 # kubernetes # napalm # netmiko + # pytest-salt-factories # responses # yamllint # yamlordereddictloader diff --git a/requirements/static/ci/py3.10/freebsd.txt b/requirements/static/ci/py3.10/freebsd.txt index bc76ccd73b4..46873867854 100644 --- a/requirements/static/ci/py3.10/freebsd.txt +++ b/requirements/static/ci/py3.10/freebsd.txt @@ -352,7 +352,7 @@ pytest-helpers-namespace==2021.12.29 # pytest-shell-utilities pytest-httpserver==1.0.8 # via -r requirements/pytest.txt -pytest-salt-factories==1.0.0rc21 +pytest-salt-factories==1.0.0rc24 # via -r requirements/pytest.txt pytest-shell-utilities==1.8.0 # via pytest-salt-factories @@ -413,6 +413,7 @@ pyyaml==6.0.1 # kubernetes # napalm # netmiko + # pytest-salt-factories # responses # yamllint # yamlordereddictloader diff --git a/requirements/static/ci/py3.10/linux.txt b/requirements/static/ci/py3.10/linux.txt index 5690b5585f8..4f6dc5c6b0a 100644 --- a/requirements/static/ci/py3.10/linux.txt +++ b/requirements/static/ci/py3.10/linux.txt @@ -386,7 +386,7 @@ pytest-helpers-namespace==2021.12.29 # pytest-shell-utilities pytest-httpserver==1.0.8 # via -r requirements/pytest.txt -pytest-salt-factories==1.0.0rc21 +pytest-salt-factories==1.0.0rc24 # via -r requirements/pytest.txt pytest-shell-utilities==1.8.0 # via pytest-salt-factories @@ -453,6 +453,7 @@ pyyaml==6.0.1 # kubernetes # napalm # netmiko + # pytest-salt-factories # responses # yamllint # yamlordereddictloader diff --git a/requirements/static/ci/py3.10/windows.txt b/requirements/static/ci/py3.10/windows.txt index 590280715c1..0f6199d870d 100644 --- a/requirements/static/ci/py3.10/windows.txt +++ b/requirements/static/ci/py3.10/windows.txt @@ -312,7 +312,7 @@ pytest-helpers-namespace==2021.12.29 # pytest-shell-utilities pytest-httpserver==1.0.8 # via -r requirements/pytest.txt -pytest-salt-factories==1.0.0rc21 +pytest-salt-factories==1.0.0rc24 # via -r requirements/pytest.txt pytest-shell-utilities==1.8.0 # via pytest-salt-factories @@ -381,6 +381,7 @@ pyyaml==6.0.1 # -r requirements/base.txt # clustershell # kubernetes + # pytest-salt-factories # responses # yamllint pyzmq==25.1.0 diff --git a/requirements/static/ci/py3.11/darwin.txt b/requirements/static/ci/py3.11/darwin.txt index d756eb68aba..b01652073f8 100644 --- a/requirements/static/ci/py3.11/darwin.txt +++ b/requirements/static/ci/py3.11/darwin.txt @@ -356,7 +356,7 @@ pytest-helpers-namespace==2021.12.29 # pytest-shell-utilities pytest-httpserver==1.0.8 # via -r requirements/pytest.txt -pytest-salt-factories==1.0.0rc21 +pytest-salt-factories==1.0.0rc24 # via -r requirements/pytest.txt pytest-shell-utilities==1.8.0 # via pytest-salt-factories @@ -417,6 +417,7 @@ pyyaml==6.0.1 # kubernetes # napalm # netmiko + # pytest-salt-factories # responses # yamllint # yamlordereddictloader diff --git a/requirements/static/ci/py3.11/freebsd.txt b/requirements/static/ci/py3.11/freebsd.txt index a13eaeecda8..2cd3328fe9c 100644 --- a/requirements/static/ci/py3.11/freebsd.txt +++ b/requirements/static/ci/py3.11/freebsd.txt @@ -350,7 +350,7 @@ pytest-helpers-namespace==2021.12.29 # pytest-shell-utilities pytest-httpserver==1.0.8 # via -r requirements/pytest.txt -pytest-salt-factories==1.0.0rc21 +pytest-salt-factories==1.0.0rc24 # via -r requirements/pytest.txt pytest-shell-utilities==1.8.0 # via pytest-salt-factories @@ -411,6 +411,7 @@ pyyaml==6.0.1 # kubernetes # napalm # netmiko + # pytest-salt-factories # responses # yamllint # yamlordereddictloader diff --git a/requirements/static/ci/py3.11/linux.txt b/requirements/static/ci/py3.11/linux.txt index 810055c9fbc..978468cbc04 100644 --- a/requirements/static/ci/py3.11/linux.txt +++ b/requirements/static/ci/py3.11/linux.txt @@ -382,7 +382,7 @@ pytest-helpers-namespace==2021.12.29 # pytest-shell-utilities pytest-httpserver==1.0.8 # via -r requirements/pytest.txt -pytest-salt-factories==1.0.0rc21 +pytest-salt-factories==1.0.0rc24 # via -r requirements/pytest.txt pytest-shell-utilities==1.8.0 # via pytest-salt-factories @@ -449,6 +449,7 @@ pyyaml==6.0.1 # kubernetes # napalm # netmiko + # pytest-salt-factories # responses # yamllint # yamlordereddictloader diff --git a/requirements/static/ci/py3.11/windows.txt b/requirements/static/ci/py3.11/windows.txt index e48d0e253df..bd5b10849be 100644 --- a/requirements/static/ci/py3.11/windows.txt +++ b/requirements/static/ci/py3.11/windows.txt @@ -310,7 +310,7 @@ pytest-helpers-namespace==2021.12.29 # pytest-shell-utilities pytest-httpserver==1.0.8 # via -r requirements/pytest.txt -pytest-salt-factories==1.0.0rc21 +pytest-salt-factories==1.0.0rc24 # via -r requirements/pytest.txt pytest-shell-utilities==1.8.0 # via pytest-salt-factories @@ -379,6 +379,7 @@ pyyaml==6.0.1 # -r requirements/base.txt # clustershell # kubernetes + # pytest-salt-factories # responses # yamllint pyzmq==25.1.0 diff --git a/requirements/static/ci/py3.8/freebsd.txt b/requirements/static/ci/py3.8/freebsd.txt index f79f6bb4733..babc7513793 100644 --- a/requirements/static/ci/py3.8/freebsd.txt +++ b/requirements/static/ci/py3.8/freebsd.txt @@ -355,7 +355,7 @@ pytest-helpers-namespace==2021.12.29 # pytest-shell-utilities pytest-httpserver==1.0.8 # via -r requirements/pytest.txt -pytest-salt-factories==1.0.0rc21 +pytest-salt-factories==1.0.0rc24 # via -r requirements/pytest.txt pytest-shell-utilities==1.8.0 # via pytest-salt-factories @@ -416,6 +416,7 @@ pyyaml==6.0.1 # kubernetes # napalm # netmiko + # pytest-salt-factories # responses # yamllint # yamlordereddictloader diff --git a/requirements/static/ci/py3.8/linux.txt b/requirements/static/ci/py3.8/linux.txt index 1ba2c692c36..3e27e2c01d6 100644 --- a/requirements/static/ci/py3.8/linux.txt +++ b/requirements/static/ci/py3.8/linux.txt @@ -390,7 +390,7 @@ pytest-helpers-namespace==2021.12.29 # pytest-shell-utilities pytest-httpserver==1.0.8 # via -r requirements/pytest.txt -pytest-salt-factories==1.0.0rc21 +pytest-salt-factories==1.0.0rc24 # via -r requirements/pytest.txt pytest-shell-utilities==1.8.0 # via pytest-salt-factories @@ -457,6 +457,7 @@ pyyaml==6.0.1 # kubernetes # napalm # netmiko + # pytest-salt-factories # responses # yamllint # yamlordereddictloader diff --git a/requirements/static/ci/py3.8/windows.txt b/requirements/static/ci/py3.8/windows.txt index 64143918b8b..b9c0539c8c6 100644 --- a/requirements/static/ci/py3.8/windows.txt +++ b/requirements/static/ci/py3.8/windows.txt @@ -316,7 +316,7 @@ pytest-helpers-namespace==2021.12.29 # pytest-shell-utilities pytest-httpserver==1.0.8 # via -r requirements/pytest.txt -pytest-salt-factories==1.0.0rc21 +pytest-salt-factories==1.0.0rc24 # via -r requirements/pytest.txt pytest-shell-utilities==1.8.0 # via pytest-salt-factories @@ -386,6 +386,7 @@ pyyaml==6.0.1 # -r requirements/base.txt # clustershell # kubernetes + # pytest-salt-factories # responses # yamllint pyzmq==25.1.0 diff --git a/requirements/static/ci/py3.9/darwin.txt b/requirements/static/ci/py3.9/darwin.txt index 5a7a01cc8df..5d121c5ab2d 100644 --- a/requirements/static/ci/py3.9/darwin.txt +++ b/requirements/static/ci/py3.9/darwin.txt @@ -358,7 +358,7 @@ pytest-helpers-namespace==2021.12.29 # pytest-shell-utilities pytest-httpserver==1.0.8 # via -r requirements/pytest.txt -pytest-salt-factories==1.0.0rc21 +pytest-salt-factories==1.0.0rc24 # via -r requirements/pytest.txt pytest-shell-utilities==1.8.0 # via pytest-salt-factories @@ -419,6 +419,7 @@ pyyaml==6.0.1 # kubernetes # napalm # netmiko + # pytest-salt-factories # responses # yamllint # yamlordereddictloader diff --git a/requirements/static/ci/py3.9/freebsd.txt b/requirements/static/ci/py3.9/freebsd.txt index d1e2e7551f6..e9f5620e8b9 100644 --- a/requirements/static/ci/py3.9/freebsd.txt +++ b/requirements/static/ci/py3.9/freebsd.txt @@ -352,7 +352,7 @@ pytest-helpers-namespace==2021.12.29 # pytest-shell-utilities pytest-httpserver==1.0.8 # via -r requirements/pytest.txt -pytest-salt-factories==1.0.0rc21 +pytest-salt-factories==1.0.0rc24 # via -r requirements/pytest.txt pytest-shell-utilities==1.8.0 # via pytest-salt-factories @@ -413,6 +413,7 @@ pyyaml==6.0.1 # kubernetes # napalm # netmiko + # pytest-salt-factories # responses # yamllint # yamlordereddictloader diff --git a/requirements/static/ci/py3.9/linux.txt b/requirements/static/ci/py3.9/linux.txt index 58334b40dfe..b38c0d5440c 100644 --- a/requirements/static/ci/py3.9/linux.txt +++ b/requirements/static/ci/py3.9/linux.txt @@ -388,7 +388,7 @@ pytest-helpers-namespace==2021.12.29 # pytest-shell-utilities pytest-httpserver==1.0.8 # via -r requirements/pytest.txt -pytest-salt-factories==1.0.0rc21 +pytest-salt-factories==1.0.0rc24 # via -r requirements/pytest.txt pytest-shell-utilities==1.8.0 # via pytest-salt-factories @@ -455,6 +455,7 @@ pyyaml==6.0.1 # kubernetes # napalm # netmiko + # pytest-salt-factories # responses # yamllint # yamlordereddictloader diff --git a/requirements/static/ci/py3.9/windows.txt b/requirements/static/ci/py3.9/windows.txt index ad690f4bb9c..654b19fd3ab 100644 --- a/requirements/static/ci/py3.9/windows.txt +++ b/requirements/static/ci/py3.9/windows.txt @@ -312,7 +312,7 @@ pytest-helpers-namespace==2021.12.29 # pytest-shell-utilities pytest-httpserver==1.0.8 # via -r requirements/pytest.txt -pytest-salt-factories==1.0.0rc21 +pytest-salt-factories==1.0.0rc24 # via -r requirements/pytest.txt pytest-shell-utilities==1.8.0 # via pytest-salt-factories @@ -382,6 +382,7 @@ pyyaml==6.0.1 # -r requirements/base.txt # clustershell # kubernetes + # pytest-salt-factories # responses # yamllint pyzmq==25.1.0 From 7e709b11ddc8aaba5d9fad5e91aafa9f1c15d601 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Mon, 8 May 2023 11:34:33 +0100 Subject: [PATCH 256/393] Revert "Allow running unit/functional tests against the salt checkout for now" This reverts commit 7382aa187e7cb19ba0e63d53af54872e05836a6a. --- tests/conftest.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index c076ca2b471..1d7c8ba796a 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -258,18 +258,18 @@ def pytest_configure(config): called after command line options have been parsed and all plugins and initial conftest files been loaded. """ - # try: - # assert config._onedir_check_complete - # return - # except AttributeError: - # if os.environ.get("ONEDIR_TESTRUN", "0") == "1": - # if pathlib.Path(salt.__file__).parent == CODE_DIR / "salt": - # raise pytest.UsageError( - # "Apparently running the test suite against the onedir build " - # "of salt, however, the imported salt package is pointing to " - # "the respository checkout instead of the onedir package." - # ) - # config._onedir_check_complete = True + try: + assert config._onedir_check_complete + return + except AttributeError: + if os.environ.get("ONEDIR_TESTRUN", "0") == "1": + if pathlib.Path(salt.__file__).parent == CODE_DIR / "salt": + raise pytest.UsageError( + "Apparently running the test suite against the onedir build " + "of salt, however, the imported salt package is pointing to " + "the respository checkout instead of the onedir package." + ) + config._onedir_check_complete = True for dirname in CODE_DIR.iterdir(): if not dirname.is_dir(): From 8b6497da729f8867c4e869b2169eb003a678ada4 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Thu, 27 Jul 2023 21:07:55 +0100 Subject: [PATCH 257/393] Show `sys.path` on error Signed-off-by: Pedro Algarvio --- tests/conftest.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/conftest.py b/tests/conftest.py index 1d7c8ba796a..898df041412 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -267,7 +267,8 @@ def pytest_configure(config): raise pytest.UsageError( "Apparently running the test suite against the onedir build " "of salt, however, the imported salt package is pointing to " - "the respository checkout instead of the onedir package." + "the respository checkout instead of the onedir package.\n\n" + f" * sys.path: {sys.path}" ) config._onedir_check_complete = True From ba106493c5b99b3c7ae3f1ba40c89cbf5f26831a Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Fri, 28 Jul 2023 11:32:38 +0100 Subject: [PATCH 258/393] Make `sys.path` cleanup work on windows Signed-off-by: Pedro Algarvio --- tests/__init__.py | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/tests/__init__.py b/tests/__init__.py index 909f68753c3..219b3c78a75 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -2,19 +2,14 @@ import os import pathlib import sys -_repo_root = pathlib.Path(__file__).parent.parent -_paths_to_check = {""} -if sys.platform.startswith("win"): - _paths_to_check.add(str(_repo_root).replace("\\", "\\\\")) - _paths_to_check.add(str(_repo_root.resolve()).replace("\\", "\\\\")) -else: - _paths_to_check.add(str(_repo_root)) - +_repo_root = pathlib.Path(__file__).resolve().parent.parent if os.environ.get("ONEDIR_TESTRUN", "0") == "1": # In this particular case, we want to make sure that the repo root # is not part if sys.path so that when we import salt, we import salt from # the onedir and not the code checkout - for path in _paths_to_check: - if path in sys.path: + for path in list(sys.path): + if path == "": + sys.path.remove(path) + elif pathlib.Path(path).resolve() == _repo_root: sys.path.remove(path) From 26001ed8ebc3eed78d8bdaa96a28a89d7b62052a Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Fri, 28 Jul 2023 18:27:25 +0100 Subject: [PATCH 259/393] Remove salt execution and state modules only when building the windows package Signed-off-by: Pedro Algarvio --- pkg/common/env-cleanup-rules.yml | 76 +++++----- pkg/windows/msi/build_pkg.ps1 | 232 +++++++++++++++++++++++++++++-- pkg/windows/nsis/build_pkg.ps1 | 232 +++++++++++++++++++++++++++++-- pkg/windows/prep_salt.ps1 | 208 --------------------------- 4 files changed, 480 insertions(+), 268 deletions(-) diff --git a/pkg/common/env-cleanup-rules.yml b/pkg/common/env-cleanup-rules.yml index 6a0ff594a97..09708110473 100644 --- a/pkg/common/env-cleanup-rules.yml +++ b/pkg/common/env-cleanup-rules.yml @@ -49,6 +49,44 @@ ci: # Help files - "**/*.chm" - "**/Scripts/wmitest*" + +pkg: + darwin: + dir_patterns: + - *ci_darwin_dir_patterns + - "**/pkgconfig" + - "**/share" + - "**/artifacts/salt/opt" + - "**/artifacts/salt/etc" + - "**/artifacts/salt/Lib" + file_patterns: + - *ci_darwin_file_patterns + linux: + dir_patterns: + - *ci_linux_dir_patterns + file_patterns: + - *ci_linux_file_patterns + windows: + dir_patterns: + - *ci_windows_dir_patterns + - "**/salt/share" + - "**/site-packages/pywin32_system32" + file_patterns: + - *ci_windows_file_patterns + - "**/Scripts/py.exe" + - "**/Scripts/pyw.exe" + - "**/Scripts/venvlauncher.exe" + - "**/Scripts/venvwlauncher.exe" + - "**/Scripts/wheel*" + - "**/doc" + - "**/readme" + - "**/salt/salt-api*" + - "**/salt/salt-key*" + - "**/salt/salt-run*" + - "**/salt/salt-syndic*" + - "**/salt/salt-unity*" + - "**/salt/spm*" + - "**/salt/wheel*" # Non Windows execution modules - "**/site-packages/salt/modules/aacme.py*" - "**/site-packages/salt/modules/aix.py*" @@ -231,41 +269,3 @@ ci: - "**/site-packages/salt/states/virt.py.py*" - "**/site-packages/salt/states/zfs.py*" - "**/site-packages/salt/states/zpool.py*" - -pkg: - darwin: - dir_patterns: - - *ci_darwin_dir_patterns - - "**/pkgconfig" - - "**/share" - - "**/artifacts/salt/opt" - - "**/artifacts/salt/etc" - - "**/artifacts/salt/Lib" - file_patterns: - - *ci_darwin_file_patterns - linux: - dir_patterns: - - *ci_linux_dir_patterns - file_patterns: - - *ci_linux_file_patterns - windows: - dir_patterns: - - *ci_windows_dir_patterns - - "**/salt/share" - - "**/site-packages/pywin32_system32" - file_patterns: - - *ci_windows_file_patterns - - "**/Scripts/py.exe" - - "**/Scripts/pyw.exe" - - "**/Scripts/venvlauncher.exe" - - "**/Scripts/venvwlauncher.exe" - - "**/Scripts/wheel*" - - "**/doc" - - "**/readme" - - "**/salt/salt-api*" - - "**/salt/salt-key*" - - "**/salt/salt-run*" - - "**/salt/salt-syndic*" - - "**/salt/salt-unity*" - - "**/salt/spm*" - - "**/salt/wheel*" diff --git a/pkg/windows/msi/build_pkg.ps1 b/pkg/windows/msi/build_pkg.ps1 index 897d60782e6..f5fa7ce234e 100644 --- a/pkg/windows/msi/build_pkg.ps1 +++ b/pkg/windows/msi/build_pkg.ps1 @@ -73,17 +73,19 @@ function VerifyOrDownload ($local_file, $URL, $SHA256) { # Script Variables #------------------------------------------------------------------------------- -$WEBCACHE_DIR = "$env:TEMP\msi_build_cache_dir" -$DEPS_URL = "https://repo.saltproject.io/windows/dependencies" -$PROJECT_DIR = $(git rev-parse --show-toplevel) -$BUILD_DIR = "$PROJECT_DIR\pkg\windows\build" -$BUILDENV_DIR = "$PROJECT_DIR\pkg\windows\buildenv" -$SCRIPTS_DIR = "$BUILDENV_DIR\Scripts" -$PYTHON_BIN = "$SCRIPTS_DIR\python.exe" -$BUILD_ARCH = $(. $PYTHON_BIN -c "import platform; print(platform.architecture()[0])") -$SCRIPT_DIR = (Get-ChildItem "$($myInvocation.MyCommand.Definition)").DirectoryName -$RUNTIME_DIR = [System.Runtime.InteropServices.RuntimeEnvironment]::GetRuntimeDirectory() -$CSC_BIN = "$RUNTIME_DIR\csc.exe" +$WEBCACHE_DIR = "$env:TEMP\msi_build_cache_dir" +$DEPS_URL = "https://repo.saltproject.io/windows/dependencies" +$PROJECT_DIR = $(git rev-parse --show-toplevel) +$BUILD_DIR = "$PROJECT_DIR\pkg\windows\build" +$BUILDENV_DIR = "$PROJECT_DIR\pkg\windows\buildenv" +$SCRIPTS_DIR = "$BUILDENV_DIR\Scripts" +$SITE_PKGS_DIR = "$BUILDENV_DIR\Lib\site-packages" +$BUILD_SALT_DIR = "$SITE_PKGS_DIR\salt" +$PYTHON_BIN = "$SCRIPTS_DIR\python.exe" +$BUILD_ARCH = $(. $PYTHON_BIN -c "import platform; print(platform.architecture()[0])") +$SCRIPT_DIR = (Get-ChildItem "$($myInvocation.MyCommand.Definition)").DirectoryName +$RUNTIME_DIR = [System.Runtime.InteropServices.RuntimeEnvironment]::GetRuntimeDirectory() +$CSC_BIN = "$RUNTIME_DIR\csc.exe" if ( $BUILD_ARCH -eq "64bit" ) { $BUILD_ARCH = "AMD64" @@ -263,6 +265,214 @@ Write-Host "Packaging *.dll's to *.CA.dll: " -NoNewline "$SCRIPT_DIR\CustomAction01\CustomAction.config" > build.tmp CheckExitCode +#------------------------------------------------------------------------------- +# Remove Non-Windows Execution Modules +#------------------------------------------------------------------------------- +Write-Host "Removing Non-Windows Execution Modules: " -NoNewline +$modules = "acme", + "aix", + "alternatives", + "apcups", + "apf", + "apt", + "arista", + "at", + "bcache", + "blockdev", + "bluez", + "bridge", + "bsd", + "btrfs", + "ceph", + "container_resource", + "cron", + "csf", + "daemontools", + "deb*", + "devmap", + "dpkg", + "ebuild", + "eix", + "eselect", + "ethtool", + "extfs", + "firewalld", + "freebsd", + "genesis", + "gentoo", + "glusterfs", + "gnomedesktop", + "groupadd", + "grub_legacy", + "guestfs", + "htpasswd", + "ilo", + "img", + "incron", + "inspector", + "ipset", + "iptables", + "iwtools", + "k8s", + "kapacitor", + "keyboard", + "keystone", + "kmod", + "layman", + "linux", + "localemod", + "locate", + "logadm", + "logrotate", + "lvs", + "lxc", + "mac", + "makeconf", + "mdadm", + "mdata", + "monit", + "moosefs", + "mount", + "napalm", + "netbsd", + "netscaler", + "neutron", + "nfs3", + "nftables", + "nova", + "nspawn", + "openbsd", + "openstack", + "openvswitch", + "opkg", + "pacman", + "parallels", + "parted", + "pcs", + "pkgin", + "pkgng", + "pkgutil", + "portage_config", + "postfix", + "poudriere", + "powerpath", + "pw_", + "qemu_", + "quota", + "redismod", + "restartcheck", + "rh_", + "riak", + "rpm", + "runit", + "s6", + "scsi", + "sensors", + "service", + "shadow", + "smartos", + "smf", + "snapper", + "solaris", + "solr", + "ssh_", + "supervisord", + "sysbench", + "sysfs", + "sysrc", + "system", + "test_virtual", + "timezone", + "trafficserver", + "tuned", + "udev", + "upstart", + "useradd", + "uswgi", + "varnish", + "vbox", + "virt", + "xapi", + "xbpspkg", + "xfs", + "yum*", + "zfs", + "znc", + "zpool", + "zypper" +$modules | ForEach-Object { + Remove-Item -Path "$BUILD_SALT_DIR\modules\$_*" -Recurse + if ( Test-Path -Path "$BUILD_SALT_DIR\modules\$_*" ) { + Write-Result "Failed" -ForegroundColor Red + Write-Host "Failed to remove: $BUILD_SALT_DIR\modules\$_" + exit 1 + } +} +Write-Result "Success" -ForegroundColor Green + +#------------------------------------------------------------------------------- +# Remove Non-Windows State Modules +#------------------------------------------------------------------------------- +Write-Host "Removing Non-Windows State Modules: " -NoNewline +$states = "acme", + "alternatives", + "apt", + "at", + "blockdev", + "ceph", + "cron", + "csf", + "deb", + "eselect", + "ethtool", + "firewalld", + "glusterfs", + "gnome", + "htpasswd", + "incron", + "ipset", + "iptables", + "k8s", + "kapacitor", + "keyboard", + "keystone", + "kmod", + "layman", + "linux", + "lxc", + "mac", + "makeconf", + "mdadm", + "monit", + "mount", + "nftables", + "pcs", + "pkgng", + "portage", + "powerpath", + "quota", + "redismod", + "smartos", + "snapper", + "ssh", + "supervisord", + "sysrc", + "trafficserver", + "tuned", + "vbox", + "virt.py", + "zfs", + "zpool" +$states | ForEach-Object { + Remove-Item -Path "$BUILD_SALT_DIR\states\$_*" -Recurse + if ( Test-Path -Path "$BUILD_SALT_DIR\states\$_*" ) { + Write-Result "Failed" -ForegroundColor Red + Write-Host "Failed to remove: $BUILD_SALT_DIR\states\$_" + exit 1 + } +} +Write-Result "Success" -ForegroundColor Green + #------------------------------------------------------------------------------- # Remove compiled files #------------------------------------------------------------------------------- diff --git a/pkg/windows/nsis/build_pkg.ps1 b/pkg/windows/nsis/build_pkg.ps1 index 8c964014e7f..2573e20998b 100644 --- a/pkg/windows/nsis/build_pkg.ps1 +++ b/pkg/windows/nsis/build_pkg.ps1 @@ -51,17 +51,19 @@ function Write-Result($result, $ForegroundColor="Green") { # Script Variables #------------------------------------------------------------------------------- -$PROJECT_DIR = $(git rev-parse --show-toplevel) -$SCRIPT_DIR = (Get-ChildItem "$($myInvocation.MyCommand.Definition)").DirectoryName -$BUILD_DIR = "$PROJECT_DIR\pkg\windows\build" -$BUILDENV_DIR = "$PROJECT_DIR\pkg\windows\buildenv" -$INSTALLER_DIR = "$SCRIPT_DIR\installer" -$SCRIPTS_DIR = "$BUILDENV_DIR\Scripts" -$PYTHON_BIN = "$SCRIPTS_DIR\python.exe" -$PY_VERSION = [Version]((Get-Command $PYTHON_BIN).FileVersionInfo.ProductVersion) -$PY_VERSION = "$($PY_VERSION.Major).$($PY_VERSION.Minor)" -$NSIS_BIN = "$( ${env:ProgramFiles(x86)} )\NSIS\makensis.exe" -$ARCH = $(. $PYTHON_BIN -c "import platform; print(platform.architecture()[0])") +$PROJECT_DIR = $(git rev-parse --show-toplevel) +$SCRIPT_DIR = (Get-ChildItem "$($myInvocation.MyCommand.Definition)").DirectoryName +$BUILD_DIR = "$PROJECT_DIR\pkg\windows\build" +$BUILDENV_DIR = "$PROJECT_DIR\pkg\windows\buildenv" +$INSTALLER_DIR = "$SCRIPT_DIR\installer" +$SCRIPTS_DIR = "$BUILDENV_DIR\Scripts" +$SITE_PKGS_DIR = "$BUILDENV_DIR\Lib\site-packages" +$BUILD_SALT_DIR = "$SITE_PKGS_DIR\salt" +$PYTHON_BIN = "$SCRIPTS_DIR\python.exe" +$PY_VERSION = [Version]((Get-Command $PYTHON_BIN).FileVersionInfo.ProductVersion) +$PY_VERSION = "$($PY_VERSION.Major).$($PY_VERSION.Minor)" +$NSIS_BIN = "$( ${env:ProgramFiles(x86)} )\NSIS\makensis.exe" +$ARCH = $(. $PYTHON_BIN -c "import platform; print(platform.architecture()[0])") if ( $ARCH -eq "64bit" ) { $ARCH = "AMD64" @@ -133,6 +135,214 @@ if ( Test-Path -Path "$INSTALLER_DIR\salt.ico" ) { exit 1 } +#------------------------------------------------------------------------------- +# Remove Non-Windows Execution Modules +#------------------------------------------------------------------------------- +Write-Host "Removing Non-Windows Execution Modules: " -NoNewline +$modules = "acme", + "aix", + "alternatives", + "apcups", + "apf", + "apt", + "arista", + "at", + "bcache", + "blockdev", + "bluez", + "bridge", + "bsd", + "btrfs", + "ceph", + "container_resource", + "cron", + "csf", + "daemontools", + "deb*", + "devmap", + "dpkg", + "ebuild", + "eix", + "eselect", + "ethtool", + "extfs", + "firewalld", + "freebsd", + "genesis", + "gentoo", + "glusterfs", + "gnomedesktop", + "groupadd", + "grub_legacy", + "guestfs", + "htpasswd", + "ilo", + "img", + "incron", + "inspector", + "ipset", + "iptables", + "iwtools", + "k8s", + "kapacitor", + "keyboard", + "keystone", + "kmod", + "layman", + "linux", + "localemod", + "locate", + "logadm", + "logrotate", + "lvs", + "lxc", + "mac", + "makeconf", + "mdadm", + "mdata", + "monit", + "moosefs", + "mount", + "napalm", + "netbsd", + "netscaler", + "neutron", + "nfs3", + "nftables", + "nova", + "nspawn", + "openbsd", + "openstack", + "openvswitch", + "opkg", + "pacman", + "parallels", + "parted", + "pcs", + "pkgin", + "pkgng", + "pkgutil", + "portage_config", + "postfix", + "poudriere", + "powerpath", + "pw_", + "qemu_", + "quota", + "redismod", + "restartcheck", + "rh_", + "riak", + "rpm", + "runit", + "s6", + "scsi", + "sensors", + "service", + "shadow", + "smartos", + "smf", + "snapper", + "solaris", + "solr", + "ssh_", + "supervisord", + "sysbench", + "sysfs", + "sysrc", + "system", + "test_virtual", + "timezone", + "trafficserver", + "tuned", + "udev", + "upstart", + "useradd", + "uswgi", + "varnish", + "vbox", + "virt", + "xapi", + "xbpspkg", + "xfs", + "yum*", + "zfs", + "znc", + "zpool", + "zypper" +$modules | ForEach-Object { + Remove-Item -Path "$BUILD_SALT_DIR\modules\$_*" -Recurse + if ( Test-Path -Path "$BUILD_SALT_DIR\modules\$_*" ) { + Write-Result "Failed" -ForegroundColor Red + Write-Host "Failed to remove: $BUILD_SALT_DIR\modules\$_" + exit 1 + } +} +Write-Result "Success" -ForegroundColor Green + +#------------------------------------------------------------------------------- +# Remove Non-Windows State Modules +#------------------------------------------------------------------------------- +Write-Host "Removing Non-Windows State Modules: " -NoNewline +$states = "acme", + "alternatives", + "apt", + "at", + "blockdev", + "ceph", + "cron", + "csf", + "deb", + "eselect", + "ethtool", + "firewalld", + "glusterfs", + "gnome", + "htpasswd", + "incron", + "ipset", + "iptables", + "k8s", + "kapacitor", + "keyboard", + "keystone", + "kmod", + "layman", + "linux", + "lxc", + "mac", + "makeconf", + "mdadm", + "monit", + "mount", + "nftables", + "pcs", + "pkgng", + "portage", + "powerpath", + "quota", + "redismod", + "smartos", + "snapper", + "ssh", + "supervisord", + "sysrc", + "trafficserver", + "tuned", + "vbox", + "virt.py", + "zfs", + "zpool" +$states | ForEach-Object { + Remove-Item -Path "$BUILD_SALT_DIR\states\$_*" -Recurse + if ( Test-Path -Path "$BUILD_SALT_DIR\states\$_*" ) { + Write-Result "Failed" -ForegroundColor Red + Write-Host "Failed to remove: $BUILD_SALT_DIR\states\$_" + exit 1 + } +} +Write-Result "Success" -ForegroundColor Green + #------------------------------------------------------------------------------- # Remove compiled files #------------------------------------------------------------------------------- diff --git a/pkg/windows/prep_salt.ps1 b/pkg/windows/prep_salt.ps1 index 45ee93eaabe..544d513ab60 100644 --- a/pkg/windows/prep_salt.ps1 +++ b/pkg/windows/prep_salt.ps1 @@ -278,214 +278,6 @@ $directories | ForEach-Object { } } -#------------------------------------------------------------------------------- -# Remove Non-Windows Execution Modules -#------------------------------------------------------------------------------- -Write-Host "Removing Non-Windows Execution Modules: " -NoNewline -$modules = "acme", - "aix", - "alternatives", - "apcups", - "apf", - "apt", - "arista", - "at", - "bcache", - "blockdev", - "bluez", - "bridge", - "bsd", - "btrfs", - "ceph", - "container_resource", - "cron", - "csf", - "daemontools", - "deb*", - "devmap", - "dpkg", - "ebuild", - "eix", - "eselect", - "ethtool", - "extfs", - "firewalld", - "freebsd", - "genesis", - "gentoo", - "glusterfs", - "gnomedesktop", - "groupadd", - "grub_legacy", - "guestfs", - "htpasswd", - "ilo", - "img", - "incron", - "inspector", - "ipset", - "iptables", - "iwtools", - "k8s", - "kapacitor", - "keyboard", - "keystone", - "kmod", - "layman", - "linux", - "localemod", - "locate", - "logadm", - "logrotate", - "lvs", - "lxc", - "mac", - "makeconf", - "mdadm", - "mdata", - "monit", - "moosefs", - "mount", - "napalm", - "netbsd", - "netscaler", - "neutron", - "nfs3", - "nftables", - "nova", - "nspawn", - "openbsd", - "openstack", - "openvswitch", - "opkg", - "pacman", - "parallels", - "parted", - "pcs", - "pkgin", - "pkgng", - "pkgutil", - "portage_config", - "postfix", - "poudriere", - "powerpath", - "pw_", - "qemu_", - "quota", - "redismod", - "restartcheck", - "rh_", - "riak", - "rpm", - "runit", - "s6", - "scsi", - "sensors", - "service", - "shadow", - "smartos", - "smf", - "snapper", - "solaris", - "solr", - "ssh_", - "supervisord", - "sysbench", - "sysfs", - "sysrc", - "system", - "test_virtual", - "timezone", - "trafficserver", - "tuned", - "udev", - "upstart", - "useradd", - "uswgi", - "varnish", - "vbox", - "virt", - "xapi", - "xbpspkg", - "xfs", - "yum*", - "zfs", - "znc", - "zpool", - "zypper" -$modules | ForEach-Object { - Remove-Item -Path "$BUILD_SALT_DIR\modules\$_*" -Recurse - if ( Test-Path -Path "$BUILD_SALT_DIR\modules\$_*" ) { - Write-Result "Failed" -ForegroundColor Red - Write-Host "Failed to remove: $BUILD_SALT_DIR\modules\$_" - exit 1 - } -} -Write-Result "Success" -ForegroundColor Green - -#------------------------------------------------------------------------------- -# Remove Non-Windows State Modules -#------------------------------------------------------------------------------- -Write-Host "Removing Non-Windows State Modules: " -NoNewline -$states = "acme", - "alternatives", - "apt", - "at", - "blockdev", - "ceph", - "cron", - "csf", - "deb", - "eselect", - "ethtool", - "firewalld", - "glusterfs", - "gnome", - "htpasswd", - "incron", - "ipset", - "iptables", - "k8s", - "kapacitor", - "keyboard", - "keystone", - "kmod", - "layman", - "linux", - "lxc", - "mac", - "makeconf", - "mdadm", - "monit", - "mount", - "nftables", - "pcs", - "pkgng", - "portage", - "powerpath", - "quota", - "redismod", - "smartos", - "snapper", - "ssh", - "supervisord", - "sysrc", - "trafficserver", - "tuned", - "vbox", - "virt.py", - "zfs", - "zpool" -$states | ForEach-Object { - Remove-Item -Path "$BUILD_SALT_DIR\states\$_*" -Recurse - if ( Test-Path -Path "$BUILD_SALT_DIR\states\$_*" ) { - Write-Result "Failed" -ForegroundColor Red - Write-Host "Failed to remove: $BUILD_SALT_DIR\states\$_" - exit 1 - } -} -Write-Result "Success" -ForegroundColor Green - Write-Host "Removing __pycache__ directories: " -NoNewline $found = Get-ChildItem -Path "$BUILD_DIR" -Filter "__pycache__" -Recurse $found | ForEach-Object { From 43c7376f69fd4bd362dcfa90893013ddbc64283f Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Mon, 31 Jul 2023 15:15:24 +0100 Subject: [PATCH 260/393] Bump to `pytest-skip-markers==1.4.1` Signed-off-by: Pedro Algarvio --- requirements/static/ci/py3.10/darwin.txt | 2 +- requirements/static/ci/py3.10/freebsd.txt | 2 +- requirements/static/ci/py3.10/linux.txt | 2 +- requirements/static/ci/py3.10/pkgtests-windows.txt | 2 +- requirements/static/ci/py3.10/pkgtests.txt | 2 +- requirements/static/ci/py3.10/windows.txt | 2 +- requirements/static/ci/py3.11/darwin.txt | 2 +- requirements/static/ci/py3.11/freebsd.txt | 2 +- requirements/static/ci/py3.11/linux.txt | 2 +- requirements/static/ci/py3.11/pkgtests-windows.txt | 2 +- requirements/static/ci/py3.11/pkgtests.txt | 2 +- requirements/static/ci/py3.11/windows.txt | 2 +- requirements/static/ci/py3.8/freebsd.txt | 2 +- requirements/static/ci/py3.8/linux.txt | 2 +- requirements/static/ci/py3.8/windows.txt | 2 +- requirements/static/ci/py3.9/darwin.txt | 2 +- requirements/static/ci/py3.9/freebsd.txt | 2 +- requirements/static/ci/py3.9/linux.txt | 2 +- requirements/static/ci/py3.9/windows.txt | 2 +- 19 files changed, 19 insertions(+), 19 deletions(-) diff --git a/requirements/static/ci/py3.10/darwin.txt b/requirements/static/ci/py3.10/darwin.txt index ce389ec5867..8de81ffe88d 100644 --- a/requirements/static/ci/py3.10/darwin.txt +++ b/requirements/static/ci/py3.10/darwin.txt @@ -362,7 +362,7 @@ pytest-salt-factories==1.0.0rc24 # via -r requirements/pytest.txt pytest-shell-utilities==1.8.0 # via pytest-salt-factories -pytest-skip-markers==1.4.0 +pytest-skip-markers==1.4.1 # via # pytest-salt-factories # pytest-shell-utilities diff --git a/requirements/static/ci/py3.10/freebsd.txt b/requirements/static/ci/py3.10/freebsd.txt index 46873867854..6beaeb46c45 100644 --- a/requirements/static/ci/py3.10/freebsd.txt +++ b/requirements/static/ci/py3.10/freebsd.txt @@ -356,7 +356,7 @@ pytest-salt-factories==1.0.0rc24 # via -r requirements/pytest.txt pytest-shell-utilities==1.8.0 # via pytest-salt-factories -pytest-skip-markers==1.4.0 +pytest-skip-markers==1.4.1 # via # pytest-salt-factories # pytest-shell-utilities diff --git a/requirements/static/ci/py3.10/linux.txt b/requirements/static/ci/py3.10/linux.txt index 4f6dc5c6b0a..86f0a94601a 100644 --- a/requirements/static/ci/py3.10/linux.txt +++ b/requirements/static/ci/py3.10/linux.txt @@ -390,7 +390,7 @@ pytest-salt-factories==1.0.0rc24 # via -r requirements/pytest.txt pytest-shell-utilities==1.8.0 # via pytest-salt-factories -pytest-skip-markers==1.4.0 +pytest-skip-markers==1.4.1 # via # pytest-salt-factories # pytest-shell-utilities diff --git a/requirements/static/ci/py3.10/pkgtests-windows.txt b/requirements/static/ci/py3.10/pkgtests-windows.txt index 22c13fd5889..8edaf07825f 100644 --- a/requirements/static/ci/py3.10/pkgtests-windows.txt +++ b/requirements/static/ci/py3.10/pkgtests-windows.txt @@ -111,7 +111,7 @@ 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 +pytest-skip-markers==1.4.1 # via # pytest-salt-factories # pytest-shell-utilities diff --git a/requirements/static/ci/py3.10/pkgtests.txt b/requirements/static/ci/py3.10/pkgtests.txt index 57b6b8a05f6..35268b30014 100644 --- a/requirements/static/ci/py3.10/pkgtests.txt +++ b/requirements/static/ci/py3.10/pkgtests.txt @@ -108,7 +108,7 @@ 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 +pytest-skip-markers==1.4.1 # via # pytest-salt-factories # pytest-shell-utilities diff --git a/requirements/static/ci/py3.10/windows.txt b/requirements/static/ci/py3.10/windows.txt index 0f6199d870d..5d7b93c0096 100644 --- a/requirements/static/ci/py3.10/windows.txt +++ b/requirements/static/ci/py3.10/windows.txt @@ -316,7 +316,7 @@ pytest-salt-factories==1.0.0rc24 # via -r requirements/pytest.txt pytest-shell-utilities==1.8.0 # via pytest-salt-factories -pytest-skip-markers==1.4.0 +pytest-skip-markers==1.4.1 # via # pytest-salt-factories # pytest-shell-utilities diff --git a/requirements/static/ci/py3.11/darwin.txt b/requirements/static/ci/py3.11/darwin.txt index b01652073f8..7d36dbe7d15 100644 --- a/requirements/static/ci/py3.11/darwin.txt +++ b/requirements/static/ci/py3.11/darwin.txt @@ -360,7 +360,7 @@ pytest-salt-factories==1.0.0rc24 # via -r requirements/pytest.txt pytest-shell-utilities==1.8.0 # via pytest-salt-factories -pytest-skip-markers==1.4.0 +pytest-skip-markers==1.4.1 # via # pytest-salt-factories # pytest-shell-utilities diff --git a/requirements/static/ci/py3.11/freebsd.txt b/requirements/static/ci/py3.11/freebsd.txt index 2cd3328fe9c..aa074a3b6ba 100644 --- a/requirements/static/ci/py3.11/freebsd.txt +++ b/requirements/static/ci/py3.11/freebsd.txt @@ -354,7 +354,7 @@ pytest-salt-factories==1.0.0rc24 # via -r requirements/pytest.txt pytest-shell-utilities==1.8.0 # via pytest-salt-factories -pytest-skip-markers==1.4.0 +pytest-skip-markers==1.4.1 # via # pytest-salt-factories # pytest-shell-utilities diff --git a/requirements/static/ci/py3.11/linux.txt b/requirements/static/ci/py3.11/linux.txt index 978468cbc04..290ab9830d4 100644 --- a/requirements/static/ci/py3.11/linux.txt +++ b/requirements/static/ci/py3.11/linux.txt @@ -386,7 +386,7 @@ pytest-salt-factories==1.0.0rc24 # via -r requirements/pytest.txt pytest-shell-utilities==1.8.0 # via pytest-salt-factories -pytest-skip-markers==1.4.0 +pytest-skip-markers==1.4.1 # via # pytest-salt-factories # pytest-shell-utilities diff --git a/requirements/static/ci/py3.11/pkgtests-windows.txt b/requirements/static/ci/py3.11/pkgtests-windows.txt index 8560822cabf..a321a215796 100644 --- a/requirements/static/ci/py3.11/pkgtests-windows.txt +++ b/requirements/static/ci/py3.11/pkgtests-windows.txt @@ -109,7 +109,7 @@ 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 +pytest-skip-markers==1.4.1 # via # pytest-salt-factories # pytest-shell-utilities diff --git a/requirements/static/ci/py3.11/pkgtests.txt b/requirements/static/ci/py3.11/pkgtests.txt index bc1a77a9408..1faa06d47dd 100644 --- a/requirements/static/ci/py3.11/pkgtests.txt +++ b/requirements/static/ci/py3.11/pkgtests.txt @@ -106,7 +106,7 @@ 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 +pytest-skip-markers==1.4.1 # via # pytest-salt-factories # pytest-shell-utilities diff --git a/requirements/static/ci/py3.11/windows.txt b/requirements/static/ci/py3.11/windows.txt index bd5b10849be..b23d68eae7d 100644 --- a/requirements/static/ci/py3.11/windows.txt +++ b/requirements/static/ci/py3.11/windows.txt @@ -314,7 +314,7 @@ pytest-salt-factories==1.0.0rc24 # via -r requirements/pytest.txt pytest-shell-utilities==1.8.0 # via pytest-salt-factories -pytest-skip-markers==1.4.0 +pytest-skip-markers==1.4.1 # via # pytest-salt-factories # pytest-shell-utilities diff --git a/requirements/static/ci/py3.8/freebsd.txt b/requirements/static/ci/py3.8/freebsd.txt index babc7513793..4864a8765d4 100644 --- a/requirements/static/ci/py3.8/freebsd.txt +++ b/requirements/static/ci/py3.8/freebsd.txt @@ -359,7 +359,7 @@ pytest-salt-factories==1.0.0rc24 # via -r requirements/pytest.txt pytest-shell-utilities==1.8.0 # via pytest-salt-factories -pytest-skip-markers==1.4.0 +pytest-skip-markers==1.4.1 # via # pytest-salt-factories # pytest-shell-utilities diff --git a/requirements/static/ci/py3.8/linux.txt b/requirements/static/ci/py3.8/linux.txt index 3e27e2c01d6..5a469fb4251 100644 --- a/requirements/static/ci/py3.8/linux.txt +++ b/requirements/static/ci/py3.8/linux.txt @@ -394,7 +394,7 @@ pytest-salt-factories==1.0.0rc24 # via -r requirements/pytest.txt pytest-shell-utilities==1.8.0 # via pytest-salt-factories -pytest-skip-markers==1.4.0 +pytest-skip-markers==1.4.1 # via # pytest-salt-factories # pytest-shell-utilities diff --git a/requirements/static/ci/py3.8/windows.txt b/requirements/static/ci/py3.8/windows.txt index b9c0539c8c6..23b2fb53238 100644 --- a/requirements/static/ci/py3.8/windows.txt +++ b/requirements/static/ci/py3.8/windows.txt @@ -320,7 +320,7 @@ pytest-salt-factories==1.0.0rc24 # via -r requirements/pytest.txt pytest-shell-utilities==1.8.0 # via pytest-salt-factories -pytest-skip-markers==1.4.0 +pytest-skip-markers==1.4.1 # via # pytest-salt-factories # pytest-shell-utilities diff --git a/requirements/static/ci/py3.9/darwin.txt b/requirements/static/ci/py3.9/darwin.txt index 5d121c5ab2d..3592b10a268 100644 --- a/requirements/static/ci/py3.9/darwin.txt +++ b/requirements/static/ci/py3.9/darwin.txt @@ -362,7 +362,7 @@ pytest-salt-factories==1.0.0rc24 # via -r requirements/pytest.txt pytest-shell-utilities==1.8.0 # via pytest-salt-factories -pytest-skip-markers==1.4.0 +pytest-skip-markers==1.4.1 # via # pytest-salt-factories # pytest-shell-utilities diff --git a/requirements/static/ci/py3.9/freebsd.txt b/requirements/static/ci/py3.9/freebsd.txt index e9f5620e8b9..212a1e771f9 100644 --- a/requirements/static/ci/py3.9/freebsd.txt +++ b/requirements/static/ci/py3.9/freebsd.txt @@ -356,7 +356,7 @@ pytest-salt-factories==1.0.0rc24 # via -r requirements/pytest.txt pytest-shell-utilities==1.8.0 # via pytest-salt-factories -pytest-skip-markers==1.4.0 +pytest-skip-markers==1.4.1 # via # pytest-salt-factories # pytest-shell-utilities diff --git a/requirements/static/ci/py3.9/linux.txt b/requirements/static/ci/py3.9/linux.txt index b38c0d5440c..20ee095bdf3 100644 --- a/requirements/static/ci/py3.9/linux.txt +++ b/requirements/static/ci/py3.9/linux.txt @@ -392,7 +392,7 @@ pytest-salt-factories==1.0.0rc24 # via -r requirements/pytest.txt pytest-shell-utilities==1.8.0 # via pytest-salt-factories -pytest-skip-markers==1.4.0 +pytest-skip-markers==1.4.1 # via # pytest-salt-factories # pytest-shell-utilities diff --git a/requirements/static/ci/py3.9/windows.txt b/requirements/static/ci/py3.9/windows.txt index 654b19fd3ab..02a54b73a39 100644 --- a/requirements/static/ci/py3.9/windows.txt +++ b/requirements/static/ci/py3.9/windows.txt @@ -316,7 +316,7 @@ pytest-salt-factories==1.0.0rc24 # via -r requirements/pytest.txt pytest-shell-utilities==1.8.0 # via pytest-salt-factories -pytest-skip-markers==1.4.0 +pytest-skip-markers==1.4.1 # via # pytest-salt-factories # pytest-shell-utilities From 5f64fbd8863208a15050b78313b4d5db61a41c16 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Mon, 31 Jul 2023 15:21:25 +0100 Subject: [PATCH 261/393] Bump to `pytest-salt-factories==1.0.0rc25` Signed-off-by: Pedro Algarvio --- requirements/pytest.txt | 3 +-- requirements/static/ci/py3.10/darwin.txt | 7 +------ requirements/static/ci/py3.10/freebsd.txt | 7 +------ requirements/static/ci/py3.10/linux.txt | 7 +------ requirements/static/ci/py3.10/windows.txt | 7 +------ requirements/static/ci/py3.11/darwin.txt | 7 +------ requirements/static/ci/py3.11/freebsd.txt | 7 +------ requirements/static/ci/py3.11/linux.txt | 7 +------ requirements/static/ci/py3.11/windows.txt | 7 +------ requirements/static/ci/py3.8/freebsd.txt | 7 +------ requirements/static/ci/py3.8/linux.txt | 7 +------ requirements/static/ci/py3.8/windows.txt | 7 +------ requirements/static/ci/py3.9/darwin.txt | 7 +------ requirements/static/ci/py3.9/freebsd.txt | 7 +------ requirements/static/ci/py3.9/linux.txt | 7 +------ requirements/static/ci/py3.9/windows.txt | 7 +------ tests/conftest.py | 13 +------------ 17 files changed, 17 insertions(+), 104 deletions(-) diff --git a/requirements/pytest.txt b/requirements/pytest.txt index 010052e43ea..291498a7009 100644 --- a/requirements/pytest.txt +++ b/requirements/pytest.txt @@ -2,8 +2,7 @@ mock >= 3.0.0 # PyTest docker pytest >= 7.2.0 -pytest-salt-factories >= 1.0.0rc24 -pytest-tempdir >= 2019.10.12 +pytest-salt-factories >= 1.0.0rc25 pytest-helpers-namespace >= 2019.1.8 pytest-subtests pytest-timeout diff --git a/requirements/static/ci/py3.10/darwin.txt b/requirements/static/ci/py3.10/darwin.txt index 8de81ffe88d..89f606aebe7 100644 --- a/requirements/static/ci/py3.10/darwin.txt +++ b/requirements/static/ci/py3.10/darwin.txt @@ -358,7 +358,7 @@ pytest-helpers-namespace==2021.12.29 # pytest-shell-utilities pytest-httpserver==1.0.8 # via -r requirements/pytest.txt -pytest-salt-factories==1.0.0rc24 +pytest-salt-factories==1.0.0rc25 # via -r requirements/pytest.txt pytest-shell-utilities==1.8.0 # via pytest-salt-factories @@ -371,10 +371,6 @@ pytest-subtests==0.11.0 # via -r requirements/pytest.txt pytest-system-statistics==1.0.2 # via pytest-salt-factories -pytest-tempdir==2019.10.12 - # via - # -r requirements/pytest.txt - # pytest-salt-factories pytest-timeout==2.1.0 # via -r requirements/pytest.txt pytest==7.3.2 @@ -387,7 +383,6 @@ pytest==7.3.2 # pytest-skip-markers # pytest-subtests # pytest-system-statistics - # pytest-tempdir # pytest-timeout python-dateutil==2.8.2 # via diff --git a/requirements/static/ci/py3.10/freebsd.txt b/requirements/static/ci/py3.10/freebsd.txt index 6beaeb46c45..2c6ba361fb4 100644 --- a/requirements/static/ci/py3.10/freebsd.txt +++ b/requirements/static/ci/py3.10/freebsd.txt @@ -352,7 +352,7 @@ pytest-helpers-namespace==2021.12.29 # pytest-shell-utilities pytest-httpserver==1.0.8 # via -r requirements/pytest.txt -pytest-salt-factories==1.0.0rc24 +pytest-salt-factories==1.0.0rc25 # via -r requirements/pytest.txt pytest-shell-utilities==1.8.0 # via pytest-salt-factories @@ -365,10 +365,6 @@ pytest-subtests==0.11.0 # via -r requirements/pytest.txt pytest-system-statistics==1.0.2 # via pytest-salt-factories -pytest-tempdir==2019.10.12 - # via - # -r requirements/pytest.txt - # pytest-salt-factories pytest-timeout==2.1.0 # via -r requirements/pytest.txt pytest==7.3.2 @@ -381,7 +377,6 @@ pytest==7.3.2 # pytest-skip-markers # pytest-subtests # pytest-system-statistics - # pytest-tempdir # pytest-timeout python-dateutil==2.8.2 # via diff --git a/requirements/static/ci/py3.10/linux.txt b/requirements/static/ci/py3.10/linux.txt index 86f0a94601a..bf6ba4d7db1 100644 --- a/requirements/static/ci/py3.10/linux.txt +++ b/requirements/static/ci/py3.10/linux.txt @@ -386,7 +386,7 @@ pytest-helpers-namespace==2021.12.29 # pytest-shell-utilities pytest-httpserver==1.0.8 # via -r requirements/pytest.txt -pytest-salt-factories==1.0.0rc24 +pytest-salt-factories==1.0.0rc25 # via -r requirements/pytest.txt pytest-shell-utilities==1.8.0 # via pytest-salt-factories @@ -399,10 +399,6 @@ pytest-subtests==0.11.0 # via -r requirements/pytest.txt pytest-system-statistics==1.0.2 # via pytest-salt-factories -pytest-tempdir==2019.10.12 - # via - # -r requirements/pytest.txt - # pytest-salt-factories pytest-timeout==2.1.0 # via -r requirements/pytest.txt pytest==7.3.2 @@ -415,7 +411,6 @@ pytest==7.3.2 # pytest-skip-markers # pytest-subtests # pytest-system-statistics - # pytest-tempdir # pytest-timeout python-consul==1.1.0 # via -r requirements/static/ci/linux.in diff --git a/requirements/static/ci/py3.10/windows.txt b/requirements/static/ci/py3.10/windows.txt index 5d7b93c0096..33470c5c9b6 100644 --- a/requirements/static/ci/py3.10/windows.txt +++ b/requirements/static/ci/py3.10/windows.txt @@ -312,7 +312,7 @@ pytest-helpers-namespace==2021.12.29 # pytest-shell-utilities pytest-httpserver==1.0.8 # via -r requirements/pytest.txt -pytest-salt-factories==1.0.0rc24 +pytest-salt-factories==1.0.0rc25 # via -r requirements/pytest.txt pytest-shell-utilities==1.8.0 # via pytest-salt-factories @@ -325,10 +325,6 @@ pytest-subtests==0.11.0 # via -r requirements/pytest.txt pytest-system-statistics==1.0.2 # via pytest-salt-factories -pytest-tempdir==2019.10.12 - # via - # -r requirements/pytest.txt - # pytest-salt-factories pytest-timeout==2.1.0 # via -r requirements/pytest.txt pytest==7.3.2 @@ -341,7 +337,6 @@ pytest==7.3.2 # pytest-skip-markers # pytest-subtests # pytest-system-statistics - # pytest-tempdir # pytest-timeout python-dateutil==2.8.2 # via diff --git a/requirements/static/ci/py3.11/darwin.txt b/requirements/static/ci/py3.11/darwin.txt index 7d36dbe7d15..3e082565e84 100644 --- a/requirements/static/ci/py3.11/darwin.txt +++ b/requirements/static/ci/py3.11/darwin.txt @@ -356,7 +356,7 @@ pytest-helpers-namespace==2021.12.29 # pytest-shell-utilities pytest-httpserver==1.0.8 # via -r requirements/pytest.txt -pytest-salt-factories==1.0.0rc24 +pytest-salt-factories==1.0.0rc25 # via -r requirements/pytest.txt pytest-shell-utilities==1.8.0 # via pytest-salt-factories @@ -369,10 +369,6 @@ pytest-subtests==0.11.0 # via -r requirements/pytest.txt pytest-system-statistics==1.0.2 # via pytest-salt-factories -pytest-tempdir==2019.10.12 - # via - # -r requirements/pytest.txt - # pytest-salt-factories pytest-timeout==2.1.0 # via -r requirements/pytest.txt pytest==7.3.2 @@ -385,7 +381,6 @@ pytest==7.3.2 # pytest-skip-markers # pytest-subtests # pytest-system-statistics - # pytest-tempdir # pytest-timeout python-dateutil==2.8.2 # via diff --git a/requirements/static/ci/py3.11/freebsd.txt b/requirements/static/ci/py3.11/freebsd.txt index aa074a3b6ba..926427b28ca 100644 --- a/requirements/static/ci/py3.11/freebsd.txt +++ b/requirements/static/ci/py3.11/freebsd.txt @@ -350,7 +350,7 @@ pytest-helpers-namespace==2021.12.29 # pytest-shell-utilities pytest-httpserver==1.0.8 # via -r requirements/pytest.txt -pytest-salt-factories==1.0.0rc24 +pytest-salt-factories==1.0.0rc25 # via -r requirements/pytest.txt pytest-shell-utilities==1.8.0 # via pytest-salt-factories @@ -363,10 +363,6 @@ pytest-subtests==0.11.0 # via -r requirements/pytest.txt pytest-system-statistics==1.0.2 # via pytest-salt-factories -pytest-tempdir==2019.10.12 - # via - # -r requirements/pytest.txt - # pytest-salt-factories pytest-timeout==2.1.0 # via -r requirements/pytest.txt pytest==7.3.2 @@ -379,7 +375,6 @@ pytest==7.3.2 # pytest-skip-markers # pytest-subtests # pytest-system-statistics - # pytest-tempdir # pytest-timeout python-dateutil==2.8.2 # via diff --git a/requirements/static/ci/py3.11/linux.txt b/requirements/static/ci/py3.11/linux.txt index 290ab9830d4..07ec5be7525 100644 --- a/requirements/static/ci/py3.11/linux.txt +++ b/requirements/static/ci/py3.11/linux.txt @@ -382,7 +382,7 @@ pytest-helpers-namespace==2021.12.29 # pytest-shell-utilities pytest-httpserver==1.0.8 # via -r requirements/pytest.txt -pytest-salt-factories==1.0.0rc24 +pytest-salt-factories==1.0.0rc25 # via -r requirements/pytest.txt pytest-shell-utilities==1.8.0 # via pytest-salt-factories @@ -395,10 +395,6 @@ pytest-subtests==0.11.0 # via -r requirements/pytest.txt pytest-system-statistics==1.0.2 # via pytest-salt-factories -pytest-tempdir==2019.10.12 - # via - # -r requirements/pytest.txt - # pytest-salt-factories pytest-timeout==2.1.0 # via -r requirements/pytest.txt pytest==7.3.2 @@ -411,7 +407,6 @@ pytest==7.3.2 # pytest-skip-markers # pytest-subtests # pytest-system-statistics - # pytest-tempdir # pytest-timeout python-consul==1.1.0 # via -r requirements/static/ci/linux.in diff --git a/requirements/static/ci/py3.11/windows.txt b/requirements/static/ci/py3.11/windows.txt index b23d68eae7d..762be17626d 100644 --- a/requirements/static/ci/py3.11/windows.txt +++ b/requirements/static/ci/py3.11/windows.txt @@ -310,7 +310,7 @@ pytest-helpers-namespace==2021.12.29 # pytest-shell-utilities pytest-httpserver==1.0.8 # via -r requirements/pytest.txt -pytest-salt-factories==1.0.0rc24 +pytest-salt-factories==1.0.0rc25 # via -r requirements/pytest.txt pytest-shell-utilities==1.8.0 # via pytest-salt-factories @@ -323,10 +323,6 @@ pytest-subtests==0.11.0 # via -r requirements/pytest.txt pytest-system-statistics==1.0.2 # via pytest-salt-factories -pytest-tempdir==2019.10.12 - # via - # -r requirements/pytest.txt - # pytest-salt-factories pytest-timeout==2.1.0 # via -r requirements/pytest.txt pytest==7.3.2 @@ -339,7 +335,6 @@ pytest==7.3.2 # pytest-skip-markers # pytest-subtests # pytest-system-statistics - # pytest-tempdir # pytest-timeout python-dateutil==2.8.2 # via diff --git a/requirements/static/ci/py3.8/freebsd.txt b/requirements/static/ci/py3.8/freebsd.txt index 4864a8765d4..cb198d7902f 100644 --- a/requirements/static/ci/py3.8/freebsd.txt +++ b/requirements/static/ci/py3.8/freebsd.txt @@ -355,7 +355,7 @@ pytest-helpers-namespace==2021.12.29 # pytest-shell-utilities pytest-httpserver==1.0.8 # via -r requirements/pytest.txt -pytest-salt-factories==1.0.0rc24 +pytest-salt-factories==1.0.0rc25 # via -r requirements/pytest.txt pytest-shell-utilities==1.8.0 # via pytest-salt-factories @@ -368,10 +368,6 @@ pytest-subtests==0.11.0 # via -r requirements/pytest.txt pytest-system-statistics==1.0.2 # via pytest-salt-factories -pytest-tempdir==2019.10.12 - # via - # -r requirements/pytest.txt - # pytest-salt-factories pytest-timeout==2.1.0 # via -r requirements/pytest.txt pytest==7.3.2 @@ -384,7 +380,6 @@ pytest==7.3.2 # pytest-skip-markers # pytest-subtests # pytest-system-statistics - # pytest-tempdir # pytest-timeout python-dateutil==2.8.2 # via diff --git a/requirements/static/ci/py3.8/linux.txt b/requirements/static/ci/py3.8/linux.txt index 5a469fb4251..1357e34628a 100644 --- a/requirements/static/ci/py3.8/linux.txt +++ b/requirements/static/ci/py3.8/linux.txt @@ -390,7 +390,7 @@ pytest-helpers-namespace==2021.12.29 # pytest-shell-utilities pytest-httpserver==1.0.8 # via -r requirements/pytest.txt -pytest-salt-factories==1.0.0rc24 +pytest-salt-factories==1.0.0rc25 # via -r requirements/pytest.txt pytest-shell-utilities==1.8.0 # via pytest-salt-factories @@ -403,10 +403,6 @@ pytest-subtests==0.11.0 # via -r requirements/pytest.txt pytest-system-statistics==1.0.2 # via pytest-salt-factories -pytest-tempdir==2019.10.12 - # via - # -r requirements/pytest.txt - # pytest-salt-factories pytest-timeout==2.1.0 # via -r requirements/pytest.txt pytest==7.3.2 @@ -419,7 +415,6 @@ pytest==7.3.2 # pytest-skip-markers # pytest-subtests # pytest-system-statistics - # pytest-tempdir # pytest-timeout python-consul==1.1.0 # via -r requirements/static/ci/linux.in diff --git a/requirements/static/ci/py3.8/windows.txt b/requirements/static/ci/py3.8/windows.txt index 23b2fb53238..a7fe603d804 100644 --- a/requirements/static/ci/py3.8/windows.txt +++ b/requirements/static/ci/py3.8/windows.txt @@ -316,7 +316,7 @@ pytest-helpers-namespace==2021.12.29 # pytest-shell-utilities pytest-httpserver==1.0.8 # via -r requirements/pytest.txt -pytest-salt-factories==1.0.0rc24 +pytest-salt-factories==1.0.0rc25 # via -r requirements/pytest.txt pytest-shell-utilities==1.8.0 # via pytest-salt-factories @@ -329,10 +329,6 @@ pytest-subtests==0.11.0 # via -r requirements/pytest.txt pytest-system-statistics==1.0.2 # via pytest-salt-factories -pytest-tempdir==2019.10.12 - # via - # -r requirements/pytest.txt - # pytest-salt-factories pytest-timeout==2.1.0 # via -r requirements/pytest.txt pytest==7.3.2 @@ -345,7 +341,6 @@ pytest==7.3.2 # pytest-skip-markers # pytest-subtests # pytest-system-statistics - # pytest-tempdir # pytest-timeout python-dateutil==2.8.2 # via diff --git a/requirements/static/ci/py3.9/darwin.txt b/requirements/static/ci/py3.9/darwin.txt index 3592b10a268..eff0d5f5d4b 100644 --- a/requirements/static/ci/py3.9/darwin.txt +++ b/requirements/static/ci/py3.9/darwin.txt @@ -358,7 +358,7 @@ pytest-helpers-namespace==2021.12.29 # pytest-shell-utilities pytest-httpserver==1.0.8 # via -r requirements/pytest.txt -pytest-salt-factories==1.0.0rc24 +pytest-salt-factories==1.0.0rc25 # via -r requirements/pytest.txt pytest-shell-utilities==1.8.0 # via pytest-salt-factories @@ -371,10 +371,6 @@ pytest-subtests==0.11.0 # via -r requirements/pytest.txt pytest-system-statistics==1.0.2 # via pytest-salt-factories -pytest-tempdir==2019.10.12 - # via - # -r requirements/pytest.txt - # pytest-salt-factories pytest-timeout==2.1.0 # via -r requirements/pytest.txt pytest==7.3.2 @@ -387,7 +383,6 @@ pytest==7.3.2 # pytest-skip-markers # pytest-subtests # pytest-system-statistics - # pytest-tempdir # pytest-timeout python-dateutil==2.8.2 # via diff --git a/requirements/static/ci/py3.9/freebsd.txt b/requirements/static/ci/py3.9/freebsd.txt index 212a1e771f9..252dc2880c1 100644 --- a/requirements/static/ci/py3.9/freebsd.txt +++ b/requirements/static/ci/py3.9/freebsd.txt @@ -352,7 +352,7 @@ pytest-helpers-namespace==2021.12.29 # pytest-shell-utilities pytest-httpserver==1.0.8 # via -r requirements/pytest.txt -pytest-salt-factories==1.0.0rc24 +pytest-salt-factories==1.0.0rc25 # via -r requirements/pytest.txt pytest-shell-utilities==1.8.0 # via pytest-salt-factories @@ -365,10 +365,6 @@ pytest-subtests==0.11.0 # via -r requirements/pytest.txt pytest-system-statistics==1.0.2 # via pytest-salt-factories -pytest-tempdir==2019.10.12 - # via - # -r requirements/pytest.txt - # pytest-salt-factories pytest-timeout==2.1.0 # via -r requirements/pytest.txt pytest==7.3.2 @@ -381,7 +377,6 @@ pytest==7.3.2 # pytest-skip-markers # pytest-subtests # pytest-system-statistics - # pytest-tempdir # pytest-timeout python-dateutil==2.8.2 # via diff --git a/requirements/static/ci/py3.9/linux.txt b/requirements/static/ci/py3.9/linux.txt index 20ee095bdf3..b16ead8e6b0 100644 --- a/requirements/static/ci/py3.9/linux.txt +++ b/requirements/static/ci/py3.9/linux.txt @@ -388,7 +388,7 @@ pytest-helpers-namespace==2021.12.29 # pytest-shell-utilities pytest-httpserver==1.0.8 # via -r requirements/pytest.txt -pytest-salt-factories==1.0.0rc24 +pytest-salt-factories==1.0.0rc25 # via -r requirements/pytest.txt pytest-shell-utilities==1.8.0 # via pytest-salt-factories @@ -401,10 +401,6 @@ pytest-subtests==0.11.0 # via -r requirements/pytest.txt pytest-system-statistics==1.0.2 # via pytest-salt-factories -pytest-tempdir==2019.10.12 - # via - # -r requirements/pytest.txt - # pytest-salt-factories pytest-timeout==2.1.0 # via -r requirements/pytest.txt pytest==7.3.2 @@ -417,7 +413,6 @@ pytest==7.3.2 # pytest-skip-markers # pytest-subtests # pytest-system-statistics - # pytest-tempdir # pytest-timeout python-consul==1.1.0 # via -r requirements/static/ci/linux.in diff --git a/requirements/static/ci/py3.9/windows.txt b/requirements/static/ci/py3.9/windows.txt index 02a54b73a39..1eb2c8be733 100644 --- a/requirements/static/ci/py3.9/windows.txt +++ b/requirements/static/ci/py3.9/windows.txt @@ -312,7 +312,7 @@ pytest-helpers-namespace==2021.12.29 # pytest-shell-utilities pytest-httpserver==1.0.8 # via -r requirements/pytest.txt -pytest-salt-factories==1.0.0rc24 +pytest-salt-factories==1.0.0rc25 # via -r requirements/pytest.txt pytest-shell-utilities==1.8.0 # via pytest-salt-factories @@ -325,10 +325,6 @@ pytest-subtests==0.11.0 # via -r requirements/pytest.txt pytest-system-statistics==1.0.2 # via pytest-salt-factories -pytest-tempdir==2019.10.12 - # via - # -r requirements/pytest.txt - # pytest-salt-factories pytest-timeout==2.1.0 # via -r requirements/pytest.txt pytest==7.3.2 @@ -341,7 +337,6 @@ pytest==7.3.2 # pytest-skip-markers # pytest-subtests # pytest-system-statistics - # pytest-tempdir # pytest-timeout python-dateutil==2.8.2 # via diff --git a/tests/conftest.py b/tests/conftest.py index 898df041412..4dfeb95c6aa 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -67,7 +67,7 @@ else: os.environ["COVERAGE_PROCESS_START"] = str(COVERAGERC_FILE) # Define the pytest plugins we rely on -pytest_plugins = ["tempdir", "helpers_namespace"] +pytest_plugins = ["helpers_namespace"] # Define where not to collect tests from collect_ignore = ["setup.py"] @@ -112,17 +112,6 @@ logging.root.setLevel(logging.WARNING) log = logging.getLogger("salt.testsuite") -# ----- PyTest Tempdir Plugin Hooks ---------------------------------------------------------------------------------> -def pytest_tempdir_basename(): - """ - Return the temporary directory basename for the salt test suite. - """ - return "stsuite" - - -# <---- PyTest Tempdir Plugin Hooks ---------------------------------------------------------------------------------- - - # ----- CLI Options Setup -------------------------------------------------------------------------------------------> def pytest_addoption(parser): """ From 29743902636fcc2b57d67e9e8dde180c550d49f2 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Tue, 1 Aug 2023 08:26:02 +0100 Subject: [PATCH 262/393] Define `salt_factories_default_root_dir` to try and avoid SELinux error on Fedora 38 ``` Internal Server Error ("error setting label on mount source '/tmp': SELinux relabeling of /tmp is not allowed") ``` Signed-off-by: Pedro Algarvio --- tests/conftest.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/conftest.py b/tests/conftest.py index 4dfeb95c6aa..0f03df29f47 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -853,6 +853,22 @@ def groups_collection_modifyitems(config, items): # ----- Fixtures Overrides ------------------------------------------------------------------------------------------> +@pytest.fixture(scope="session") +def salt_factories_default_root_dir(salt_factories_default_root_dir): + """ + The root directory from where to base all salt-factories paths. + + For example, in a salt system installation, this would be ``/``. + + .. admonition:: Attention + + If `root_dir` is returned on the `salt_factories_config()` fixture + dictionary, then that's the value used, and not the one returned by + this fixture. + """ + return salt_factories_default_root_dir / "stsuite" + + @pytest.fixture(scope="session") def salt_factories_config(): """ From 0519a4cc6b6aac58e5358037ae61436e30b07c17 Mon Sep 17 00:00:00 2001 From: "Daniel A. Wozniak" Date: Mon, 31 Jul 2023 17:28:07 -0700 Subject: [PATCH 263/393] Reasonable failures when pillars timeout --- salt/channel/client.py | 66 ++++++++++++++--- salt/config/__init__.py | 4 ++ salt/minion.py | 26 +++++-- salt/pillar/__init__.py | 33 +++++++-- .../integration/minion/test_return_retries.py | 70 +++++++++++++++++++ tests/pytests/unit/pillar/test_pillar.py | 18 +++++ 6 files changed, 195 insertions(+), 22 deletions(-) diff --git a/salt/channel/client.py b/salt/channel/client.py index e5b073ccdba..5d07a04ad63 100644 --- a/salt/channel/client.py +++ b/salt/channel/client.py @@ -40,6 +40,9 @@ except ImportError: log = logging.getLogger(__name__) +REQUEST_CHANNEL_TIMEOUT = 60 +REQUEST_CHANNEL_TRIES = 3 + class ReqChannel: """ @@ -121,6 +124,9 @@ class AsyncReqChannel: if io_loop is None: io_loop = salt.ext.tornado.ioloop.IOLoop.current() + timeout = opts.get("request_channel_timeout", REQUEST_CHANNEL_TIMEOUT) + tries = opts.get("request_channel_tries", REQUEST_CHANNEL_TRIES) + crypt = kwargs.get("crypt", "aes") if crypt != "clear": # we don't need to worry about auth as a kwarg, since its a singleton @@ -129,9 +135,17 @@ class AsyncReqChannel: auth = None transport = salt.transport.request_client(opts, io_loop=io_loop) - return cls(opts, transport, auth) + return cls(opts, transport, auth, tries=tries, timeout=timeout) - def __init__(self, opts, transport, auth, **kwargs): + def __init__( + self, + opts, + transport, + auth, + timeout=REQUEST_CHANNEL_TIMEOUT, + tries=REQUEST_CHANNEL_TRIES, + **kwargs + ): self.opts = dict(opts) self.transport = transport self.auth = auth @@ -139,6 +153,8 @@ class AsyncReqChannel: if self.auth: self.master_pubkey_path = os.path.join(self.opts["pki_dir"], self.auth.mpub) self._closing = False + self.timeout = timeout + self.tries = tries @property def crypt(self): @@ -157,28 +173,54 @@ class AsyncReqChannel: "version": 2, } + @salt.ext.tornado.gen.coroutine + def _send_with_retry(self, load, tries, timeout): + _try = 1 + while True: + try: + ret = yield self.transport.send( + load, + timeout=timeout, + ) + break + except Exception as exc: # pylint: disable=broad-except + log.trace("Failed to send msg %r", exc) + if _try >= tries: + raise + else: + _try += 1 + continue + raise salt.ext.tornado.gen.Return(ret) + @salt.ext.tornado.gen.coroutine def crypted_transfer_decode_dictentry( self, load, dictkey=None, - timeout=60, + timeout=None, + tries=None, ): + if timeout is None: + timeout = self.timeout + if tries is None: + tries = self.tries nonce = uuid.uuid4().hex load["nonce"] = nonce if not self.auth.authenticated: yield self.auth.authenticate() - ret = yield self.transport.send( + ret = yield self._send_with_retry( self._package_load(self.auth.crypticle.dumps(load)), - timeout=timeout, + tries, + timeout, ) key = self.auth.get_keys() if "key" not in ret: # Reauth in the case our key is deleted on the master side. yield self.auth.authenticate() - ret = yield self.transport.send( + ret = yield self._send_with_retry( self._package_load(self.auth.crypticle.dumps(load)), - timeout=timeout, + tries, + timeout, ) if HAS_M2: aes = key.private_decrypt(ret["key"], RSA.pkcs1_oaep_padding) @@ -210,7 +252,7 @@ class AsyncReqChannel: return salt.crypt.verify_signature(self.master_pubkey_path, data, sig) @salt.ext.tornado.gen.coroutine - def _crypted_transfer(self, load, timeout=60, raw=False): + def _crypted_transfer(self, load, timeout, raw=False): """ Send a load across the wire, with encryption @@ -257,7 +299,7 @@ class AsyncReqChannel: raise salt.ext.tornado.gen.Return(ret) @salt.ext.tornado.gen.coroutine - def _uncrypted_transfer(self, load, timeout=60): + def _uncrypted_transfer(self, load, timeout): """ Send a load across the wire in cleartext @@ -276,7 +318,7 @@ class AsyncReqChannel: yield self.transport.connect() @salt.ext.tornado.gen.coroutine - def send(self, load, tries=3, timeout=60, raw=False): + def send(self, load, tries=None, timeout=None, raw=False): """ Send a request, return a future which will complete when we send the message @@ -284,6 +326,10 @@ class AsyncReqChannel: :param int tries: The number of times to make before failure :param int timeout: The number of seconds on a response before failing """ + if timeout is None: + timeout = self.timeout + if tries is None: + tries = self.tries _try = 1 while True: try: diff --git a/salt/config/__init__.py b/salt/config/__init__.py index 781c5637409..27b1edcea87 100644 --- a/salt/config/__init__.py +++ b/salt/config/__init__.py @@ -991,6 +991,8 @@ VALID_OPTS = immutabletypes.freeze( "maintenance_interval": int, # Fileserver process restart interval "fileserver_interval": int, + "request_channel_timeout": int, + "request_channel_tries": int, } ) @@ -1052,6 +1054,8 @@ DEFAULT_MINION_OPTS = immutabletypes.freeze( "pillar_cache": False, "pillar_cache_ttl": 3600, "pillar_cache_backend": "disk", + "request_channel_timeout": 30, + "request_channel_tries": 3, "gpg_cache": False, "gpg_cache_ttl": 86400, "gpg_cache_backend": "disk", diff --git a/salt/minion.py b/salt/minion.py index 3a7c26366fc..2ee1387c6ec 100644 --- a/salt/minion.py +++ b/salt/minion.py @@ -1998,7 +1998,20 @@ class Minion(MinionBase): ret["return"] = "ERROR executing '{}': {}".format(function_name, exc) ret["out"] = "nested" ret["retcode"] = salt.defaults.exitcodes.EX_GENERIC + except SaltClientError as exc: + log.error( + "Problem executing '%s': %s", + function_name, + exc, + ) + ret["return"] = "ERROR executing '{}': {}".format(function_name, exc) + ret["out"] = "nested" + ret["retcode"] = salt.defaults.exitcodes.EX_GENERIC except TypeError as exc: + # XXX: This can ba extreemly missleading when something outside of a + # execution module call raises a TypeError. Make this it's own + # type of exception when we start validating state and + # execution argument module inputs. msg = "Passed invalid arguments to {}: {}\n{}".format( function_name, exc, @@ -2696,11 +2709,14 @@ class Minion(MinionBase): notify=data.get("notify", False), ) elif tag.startswith("__master_req_channel_payload"): - yield _minion.req_channel.send( - data, - timeout=_minion._return_retry_timer(), - tries=_minion.opts["return_retry_tries"], - ) + try: + yield _minion.req_channel.send( + data, + timeout=_minion._return_retry_timer(), + tries=_minion.opts["return_retry_tries"], + ) + except salt.exceptions.SaltReqTimeoutError: + log.error("Timeout encountered while sending %r request", data) elif tag.startswith("pillar_refresh"): yield _minion.pillar_refresh( force_refresh=data.get("force_refresh", False), diff --git a/salt/pillar/__init__.py b/salt/pillar/__init__.py index d324fcee192..d047f367fb5 100644 --- a/salt/pillar/__init__.py +++ b/salt/pillar/__init__.py @@ -8,6 +8,7 @@ import fnmatch import logging import os import sys +import time import traceback import salt.channel.client @@ -259,6 +260,7 @@ class AsyncRemotePillar(RemotePillarMixin): if self.ext: load["ext"] = self.ext try: + start = time.monotonic() ret_pillar = yield self.channel.crypted_transfer_decode_dictentry( load, dictkey="pillar", @@ -266,6 +268,10 @@ class AsyncRemotePillar(RemotePillarMixin): except salt.crypt.AuthenticationError as exc: log.error(exc.message) raise SaltClientError("Exception getting pillar.") + except salt.exceptions.SaltReqTimeoutError: + raise SaltClientError( + f"Pillar timed out after {int(time.monotonic() - start)} seconds" + ) except Exception: # pylint: disable=broad-except log.exception("Exception getting pillar:") raise SaltClientError("Exception getting pillar.") @@ -350,10 +356,23 @@ class RemotePillar(RemotePillarMixin): } if self.ext: load["ext"] = self.ext - ret_pillar = self.channel.crypted_transfer_decode_dictentry( - load, - dictkey="pillar", - ) + + try: + start = time.monotonic() + ret_pillar = self.channel.crypted_transfer_decode_dictentry( + load, + dictkey="pillar", + ) + except salt.crypt.AuthenticationError as exc: + log.error(exc.message) + raise SaltClientError("Exception getting pillar.") + except salt.exceptions.SaltReqTimeoutError: + raise SaltClientError( + f"Pillar timed out after {int(time.monotonic() - start)} seconds" + ) + except Exception: # pylint: disable=broad-except + log.exception("Exception getting pillar:") + raise SaltClientError("Exception getting pillar.") if not isinstance(ret_pillar, dict): log.error( @@ -925,7 +944,7 @@ class Pillar: saltenv, sls, _pillar_rend=True, - **defaults + **defaults, ) except Exception as exc: # pylint: disable=broad-except msg = "Rendering SLS '{}' failed, render error:\n{}".format(sls, exc) @@ -1104,7 +1123,7 @@ class Pillar: self.minion_id, pillar, extra_minion_data=self.extra_minion_data, - **val + **val, ) else: ext = self.ext_pillars[key](self.minion_id, pillar, **val) @@ -1114,7 +1133,7 @@ class Pillar: self.minion_id, pillar, *val, - extra_minion_data=self.extra_minion_data + extra_minion_data=self.extra_minion_data, ) else: ext = self.ext_pillars[key](self.minion_id, pillar, *val) diff --git a/tests/pytests/integration/minion/test_return_retries.py b/tests/pytests/integration/minion/test_return_retries.py index a7f5eaeff16..ae421c4b4da 100644 --- a/tests/pytests/integration/minion/test_return_retries.py +++ b/tests/pytests/integration/minion/test_return_retries.py @@ -3,6 +3,8 @@ import time import pytest from saltfactories.utils import random_string +from tests.support.helpers import dedent + @pytest.fixture(scope="function") def salt_minion_retry(salt_master_factory, salt_minion_id): @@ -50,3 +52,71 @@ def test_publish_retry(salt_master, salt_minion_retry, salt_cli, salt_run_cli): assert salt_minion_retry.id in data assert data[salt_minion_retry.id] is True + + +@pytest.mark.slow_test +def test_pillar_timeout(salt_master_factory): + cmd = """ + python -c "import time; time.sleep(4.8); print('{\\"foo\\": \\"bar\\"}');\" + """.strip() + master_overrides = { + "ext_pillar": [ + {"cmd_json": cmd}, + ], + "auto_accept": True, + "worker_threads": 3, + "peer": True, + } + minion_overrides = { + "auth_timeout": 20, + "request_channel_timeout": 5, + "request_channel_tries": 1, + } + sls_name = "issue-50221" + sls_contents = dedent( + """ + custom_test_state: + test.configurable_test_state: + - name: example + - changes: True + - result: True + - comment: "Nothing has acutally been changed" + """ + ) + master = salt_master_factory.salt_master_daemon( + "pillar-timeout-master", + overrides=master_overrides, + ) + minion1 = master.salt_minion_daemon( + random_string("pillar-timeout-1-"), + overrides=minion_overrides, + ) + minion2 = master.salt_minion_daemon( + random_string("pillar-timeout-2-"), + overrides=minion_overrides, + ) + minion3 = master.salt_minion_daemon( + random_string("pillar-timeout-3-"), + overrides=minion_overrides, + ) + minion4 = master.salt_minion_daemon( + random_string("pillar-timeout-4-"), + overrides=minion_overrides, + ) + cli = master.salt_cli() + sls_tempfile = master.state_tree.base.temp_file( + "{}.sls".format(sls_name), sls_contents + ) + with master.started(), minion1.started(), minion2.started(), minion3.started(), minion4.started(), sls_tempfile: + proc = cli.run("state.sls", sls_name, minion_tgt="*") + # At least one minion should have a Pillar timeout + print(proc) + assert proc.returncode == 1 + minion_timed_out = False + # Find the minion that has a Pillar timeout + for key in proc.data: + if isinstance(proc.data[key], str): + if proc.data[key].find("Pillar timed out") != -1: + minion_timed_out = True + break + assert minion_timed_out is True diff --git a/tests/pytests/unit/pillar/test_pillar.py b/tests/pytests/unit/pillar/test_pillar.py index 75603aa0fe4..11eda34318b 100644 --- a/tests/pytests/unit/pillar/test_pillar.py +++ b/tests/pytests/unit/pillar/test_pillar.py @@ -7,6 +7,7 @@ import salt.loader import salt.pillar import salt.utils.cache from salt.utils.odict import OrderedDict +from tests.support.mock import MagicMock @pytest.mark.parametrize( @@ -157,3 +158,20 @@ def test_pillar_get_cache_disk(temp_salt_minion, caplog): in caplog.messages ) assert fresh_pillar == {} + + +def test_remote_pillar_timeout(temp_salt_minion, tmp_path): + opts = temp_salt_minion.config.copy() + opts["master_uri"] = "tcp://127.0.0.1:12323" + grains = salt.loader.grains(opts) + pillar = salt.pillar.RemotePillar( + opts, + grains, + temp_salt_minion.id, + "base", + ) + mock = MagicMock() + mock.side_effect = salt.exceptions.SaltReqTimeoutError() + pillar.channel.crypted_transfer_decode_dictentry = mock + with pytest.raises(salt.exceptions.SaltClientError): + pillar.compile_pillar() From 179583e93fad1fe6c2d83bf3ec60613ac6ebe02f Mon Sep 17 00:00:00 2001 From: "Daniel A. Wozniak" Date: Mon, 31 Jul 2023 17:38:45 -0700 Subject: [PATCH 264/393] Reasonable file client failures --- salt/fileclient.py | 66 +++++++++++++++++++++------ tests/pytests/unit/test_fileclient.py | 48 ++++++++++++++++++- 2 files changed, 98 insertions(+), 16 deletions(-) diff --git a/salt/fileclient.py b/salt/fileclient.py index f01a86dd0d4..4335558f754 100644 --- a/salt/fileclient.py +++ b/salt/fileclient.py @@ -9,6 +9,7 @@ import logging import os import shutil import string +import time import urllib.error import urllib.parse @@ -31,7 +32,7 @@ import salt.utils.templates import salt.utils.url import salt.utils.verify import salt.utils.versions -from salt.exceptions import CommandExecutionError, MinionError +from salt.exceptions import CommandExecutionError, MinionError, SaltClientError from salt.ext.tornado.httputil import ( HTTPHeaders, HTTPInputError, @@ -793,7 +794,7 @@ class Client: opts=self.opts, verify_ssl=verify_ssl, header_dict=header_dict, - **get_kwargs + **get_kwargs, ) # 304 Not Modified is returned when If-None-Match header @@ -822,7 +823,7 @@ class Client: "HTTP error {0} reading {1}: {3}".format( exc.code, url, - *http.server.BaseHTTPRequestHandler.responses[exc.code] + *http.server.BaseHTTPRequestHandler.responses[exc.code], ) ) except urllib.error.URLError as exc: @@ -839,7 +840,7 @@ class Client: makedirs=False, saltenv="base", cachedir=None, - **kwargs + **kwargs, ): """ Cache a file then process it as a template @@ -1136,6 +1137,18 @@ class RemoteClient(Client): self.channel = salt.channel.client.ReqChannel.factory(self.opts) return self.channel + def _channel_send(self, load, raw=False): + start = time.monotonic() + try: + return self.channel.send( + load, + raw=raw, + ) + except salt.exceptions.SaltReqTimeoutError: + raise SaltClientError( + f"File client timed out after {int(time.time() - start)}" + ) + def destroy(self): if self._closing: return @@ -1250,7 +1263,10 @@ class RemoteClient(Client): load["loc"] = 0 else: load["loc"] = fn_.tell() - data = self.channel.send(load, raw=True) + data = self._channel_send( + load, + raw=True, + ) # Sometimes the source is local (eg when using # 'salt.fileserver.FSChan'), in which case the keys are # already strings. Sometimes the source is remote, in which @@ -1343,28 +1359,36 @@ class RemoteClient(Client): List the files on the master """ load = {"saltenv": saltenv, "prefix": prefix, "cmd": "_file_list"} - return self.channel.send(load) + return self._channel_send( + load, + ) def file_list_emptydirs(self, saltenv="base", prefix=""): """ List the empty dirs on the master """ load = {"saltenv": saltenv, "prefix": prefix, "cmd": "_file_list_emptydirs"} - return self.channel.send(load) + return self._channel_send( + load, + ) def dir_list(self, saltenv="base", prefix=""): """ List the dirs on the master """ load = {"saltenv": saltenv, "prefix": prefix, "cmd": "_dir_list"} - return self.channel.send(load) + return self._channel_send( + load, + ) def symlink_list(self, saltenv="base", prefix=""): """ List symlinked files and dirs on the master """ load = {"saltenv": saltenv, "prefix": prefix, "cmd": "_symlink_list"} - return self.channel.send(load) + return self._channel_send( + load, + ) def __hash_and_stat_file(self, path, saltenv="base"): """ @@ -1385,7 +1409,9 @@ class RemoteClient(Client): ret["hash_type"] = hash_type return ret load = {"path": path, "saltenv": saltenv, "cmd": "_file_hash"} - return self.channel.send(load) + return self._channel_send( + load, + ) def hash_file(self, path, saltenv="base"): """ @@ -1412,7 +1438,9 @@ class RemoteClient(Client): except Exception: # pylint: disable=broad-except return hash_result, None load = {"path": path, "saltenv": saltenv, "cmd": "_file_find"} - fnd = self.channel.send(load) + fnd = self._channel_send( + load, + ) try: stat_result = fnd.get("stat") except AttributeError: @@ -1424,21 +1452,27 @@ class RemoteClient(Client): Return a list of the files in the file server's specified environment """ load = {"saltenv": saltenv, "cmd": "_file_list"} - return self.channel.send(load) + return self._channel_send( + load, + ) def envs(self): """ Return a list of available environments """ load = {"cmd": "_file_envs"} - return self.channel.send(load) + return self._channel_send( + load, + ) def master_opts(self): """ Return the master opts data """ load = {"cmd": "_master_opts"} - return self.channel.send(load) + return self._channel_send( + load, + ) def master_tops(self): """ @@ -1447,7 +1481,9 @@ class RemoteClient(Client): load = {"cmd": "_master_tops", "id": self.opts["id"], "opts": self.opts} if self.auth: load["tok"] = self.auth.gen_token(b"salt") - return self.channel.send(load) + return self._channel_send( + load, + ) def __enter__(self): return self diff --git a/tests/pytests/unit/test_fileclient.py b/tests/pytests/unit/test_fileclient.py index 20d16baa734..541f4be2675 100644 --- a/tests/pytests/unit/test_fileclient.py +++ b/tests/pytests/unit/test_fileclient.py @@ -1,5 +1,7 @@ +import pytest + import salt.fileclient -from tests.support.mock import patch +from tests.support.mock import Mock, patch class MockReqChannel: @@ -30,6 +32,8 @@ def test_fileclient_context_manager_closes(temp_salt_minion, temp_salt_master): "master_uri": "tcp://127.0.0.1:{}".format( temp_salt_master.config["ret_port"] ), + "request_channel_timeout": 1, + "request_channel_tries": 1, } ) master_uri = "tcp://{master_ip}:{master_port}".format( @@ -46,3 +50,45 @@ def test_fileclient_context_manager_closes(temp_salt_minion, temp_salt_master): assert client._closing assert client.channel.close.called + + +@pytest.mark.slow_test +def test_fileclient_timeout(temp_salt_minion, temp_salt_master): + """ + ensure fileclient channel closes + when used with a context manager + """ + opts = temp_salt_minion.config.copy() + opts.update( + { + "id": "root", + "transport": "zeromq", + "auth_tries": 1, + "auth_timeout": 5, + "master_ip": "127.0.0.1", + "master_port": temp_salt_master.config["ret_port"], + "master_uri": "tcp://127.0.0.1:{}".format( + temp_salt_master.config["ret_port"] + ), + "request_channel_timeout": 1, + "request_channel_tries": 1, + } + ) + master_uri = "tcp://{master_ip}:{master_port}".format( + master_ip="localhost", master_port=opts["master_port"] + ) + + async def mock_auth(): + return True + + def mock_dumps(*args): + return b"meh" + + with salt.fileclient.get_file_client(opts) as client: + # Authenticate must return true + client.auth.authenticate = mock_auth + # Crypticla must return bytes to pass to transport.RequestClient.send + client.auth._crypticle = Mock() + client.auth._crypticle.dumps = mock_dumps + with pytest.raises(salt.exceptions.SaltClientError): + client.file_list() From f7ca58e0afacc6b0d70e84edfc417848568abbe1 Mon Sep 17 00:00:00 2001 From: "Daniel A. Wozniak" Date: Mon, 31 Jul 2023 18:34:16 -0700 Subject: [PATCH 265/393] Docs and changelogs for timeout handling --- changelog/63824.fixed.md | 1 + changelog/64651.fixed.md | 1 + changelog/64653.fixed.md | 1 + changelog/64729.fixed.md | 1 + doc/ref/configuration/minion.rst | 30 +++++++++++++++++++ .../integration/minion/test_return_retries.py | 5 ++-- 6 files changed, 36 insertions(+), 3 deletions(-) create mode 100644 changelog/63824.fixed.md create mode 100644 changelog/64651.fixed.md create mode 100644 changelog/64653.fixed.md create mode 100644 changelog/64729.fixed.md diff --git a/changelog/63824.fixed.md b/changelog/63824.fixed.md new file mode 100644 index 00000000000..4a9ede961c5 --- /dev/null +++ b/changelog/63824.fixed.md @@ -0,0 +1 @@ +Allow long running pillar and file client requests to finish using request_channel_timeout and request_channel_tries minion config. diff --git a/changelog/64651.fixed.md b/changelog/64651.fixed.md new file mode 100644 index 00000000000..1ecab80c4af --- /dev/null +++ b/changelog/64651.fixed.md @@ -0,0 +1 @@ +Show user friendly message when pillars timeout diff --git a/changelog/64653.fixed.md b/changelog/64653.fixed.md new file mode 100644 index 00000000000..e7cc9d12185 --- /dev/null +++ b/changelog/64653.fixed.md @@ -0,0 +1 @@ +File client timeouts durring jobs show user friendly errors instead of tracbacks diff --git a/changelog/64729.fixed.md b/changelog/64729.fixed.md new file mode 100644 index 00000000000..4dfbc3819dd --- /dev/null +++ b/changelog/64729.fixed.md @@ -0,0 +1 @@ +SaltClientError does not log a traceback on minions, we expect these to happen so a user friendly log is shown. diff --git a/doc/ref/configuration/minion.rst b/doc/ref/configuration/minion.rst index b614376d136..780f36144cc 100644 --- a/doc/ref/configuration/minion.rst +++ b/doc/ref/configuration/minion.rst @@ -1305,6 +1305,36 @@ restart. auth_safemode: False +.. conf_minion:: request_channel_timeout + +``request_channel_timeout`` +--------------------------- + +.. versionadded:: 3006.2 + +Default: ``30`` + +The default timeout timeout for request channel requests. This setting can be used to tune minions to better handle long running pillar and file client requests. + +.. code-block:: yaml + + request_channel_timeout: 30 + +``request_channel_tries`` +------------------------- + +.. versionadded:: 3006.2 + +Default: ``3`` + +The default number of times the minion will try request channel requests. This +setting can be used to tune minions to better handle long running pillar and +file client requests by retrying them after a timeout happens. + +.. code-block:: yaml + + request_channel_tries: 3 + .. conf_minion:: ping_interval ``ping_interval`` diff --git a/tests/pytests/integration/minion/test_return_retries.py b/tests/pytests/integration/minion/test_return_retries.py index ae421c4b4da..25f3aaf97a9 100644 --- a/tests/pytests/integration/minion/test_return_retries.py +++ b/tests/pytests/integration/minion/test_return_retries.py @@ -30,7 +30,7 @@ def salt_minion_retry(salt_master_factory, salt_minion_id): @pytest.mark.slow_test def test_publish_retry(salt_master, salt_minion_retry, salt_cli, salt_run_cli): # run job that takes some time for warmup - rtn = salt_cli.run("test.sleep", "5", "--async", minion_tgt=salt_minion_retry.id) + rtn = salt_cli.run("test.sleep", "4.9", "--async", minion_tgt=salt_minion_retry.id) # obtain JID jid = rtn.stdout.strip().split(" ")[-1] @@ -110,13 +110,12 @@ def test_pillar_timeout(salt_master_factory): with master.started(), minion1.started(), minion2.started(), minion3.started(), minion4.started(), sls_tempfile: proc = cli.run("state.sls", sls_name, minion_tgt="*") # At least one minion should have a Pillar timeout - print(proc) assert proc.returncode == 1 minion_timed_out = False # Find the minion that has a Pillar timeout for key in proc.data: if isinstance(proc.data[key], str): - if proc.data[key].find("Pillar timed out") != -1: + if "Pillar timed out" in proc.data[key]: minion_timed_out = True break assert minion_timed_out is True From 7e373ee40b5d53ed74605e21da07bd113b9cf0f0 Mon Sep 17 00:00:00 2001 From: "Daniel A. Wozniak" Date: Tue, 1 Aug 2023 14:18:29 -0700 Subject: [PATCH 266/393] Test fix up --- .../integration/minion/test_return_retries.py | 10 ++----- tests/pytests/unit/test_fileclient.py | 30 ++++++++----------- 2 files changed, 15 insertions(+), 25 deletions(-) diff --git a/tests/pytests/integration/minion/test_return_retries.py b/tests/pytests/integration/minion/test_return_retries.py index 25f3aaf97a9..49517e52d22 100644 --- a/tests/pytests/integration/minion/test_return_retries.py +++ b/tests/pytests/integration/minion/test_return_retries.py @@ -3,8 +3,6 @@ import time import pytest from saltfactories.utils import random_string -from tests.support.helpers import dedent - @pytest.fixture(scope="function") def salt_minion_retry(salt_master_factory, salt_minion_id): @@ -30,7 +28,7 @@ def salt_minion_retry(salt_master_factory, salt_minion_id): @pytest.mark.slow_test def test_publish_retry(salt_master, salt_minion_retry, salt_cli, salt_run_cli): # run job that takes some time for warmup - rtn = salt_cli.run("test.sleep", "4.9", "--async", minion_tgt=salt_minion_retry.id) + rtn = salt_cli.run("test.sleep", "5", "--async", minion_tgt=salt_minion_retry.id) # obtain JID jid = rtn.stdout.strip().split(" ")[-1] @@ -57,7 +55,7 @@ def test_publish_retry(salt_master, salt_minion_retry, salt_cli, salt_run_cli): @pytest.mark.slow_test def test_pillar_timeout(salt_master_factory): cmd = """ - python -c "import time; time.sleep(4.8); print('{\\"foo\\": \\"bar\\"}');\" + python -c "import time; time.sleep(2.5); print('{\\"foo\\": \\"bar\\"}');\" """.strip() master_overrides = { "ext_pillar": [ @@ -73,8 +71,7 @@ def test_pillar_timeout(salt_master_factory): "request_channel_tries": 1, } sls_name = "issue-50221" - sls_contents = dedent( - """ + sls_contents = """ custom_test_state: test.configurable_test_state: - name: example @@ -82,7 +79,6 @@ def test_pillar_timeout(salt_master_factory): - result: True - comment: "Nothing has acutally been changed" """ - ) master = salt_master_factory.salt_master_daemon( "pillar-timeout-master", overrides=master_overrides, diff --git a/tests/pytests/unit/test_fileclient.py b/tests/pytests/unit/test_fileclient.py index 541f4be2675..b34d4391641 100644 --- a/tests/pytests/unit/test_fileclient.py +++ b/tests/pytests/unit/test_fileclient.py @@ -15,36 +15,33 @@ class MockReqChannel: return self -def test_fileclient_context_manager_closes(temp_salt_minion, temp_salt_master): +def test_fileclient_context_manager_closes(minion_opts, master_opts): """ ensure fileclient channel closes when used with a context manager """ - opts = temp_salt_minion.config.copy() - opts.update( + minion_opts.update( { "id": "root", "transport": "zeromq", "auth_tries": 1, "auth_timeout": 5, "master_ip": "127.0.0.1", - "master_port": temp_salt_master.config["ret_port"], - "master_uri": "tcp://127.0.0.1:{}".format( - temp_salt_master.config["ret_port"] - ), + "master_port": master_opts["ret_port"], + "master_uri": "tcp://127.0.0.1:{}".format(master_opts["ret_port"]), "request_channel_timeout": 1, "request_channel_tries": 1, } ) master_uri = "tcp://{master_ip}:{master_port}".format( - master_ip="localhost", master_port=opts["master_port"] + master_ip="localhost", master_port=minion_opts["master_port"] ) mock_reqchannel = MockReqChannel() patch_reqchannel = patch.object( salt.channel.client, "ReqChannel", return_value=mock_reqchannel ) with patch_reqchannel: - with salt.fileclient.get_file_client(opts) as client: + with salt.fileclient.get_file_client(minion_opts) as client: client.master_opts() assert not client._closing @@ -53,29 +50,26 @@ def test_fileclient_context_manager_closes(temp_salt_minion, temp_salt_master): @pytest.mark.slow_test -def test_fileclient_timeout(temp_salt_minion, temp_salt_master): +def test_fileclient_timeout(minion_opts, master_opts): """ ensure fileclient channel closes when used with a context manager """ - opts = temp_salt_minion.config.copy() - opts.update( + minion_opts.update( { "id": "root", "transport": "zeromq", "auth_tries": 1, "auth_timeout": 5, "master_ip": "127.0.0.1", - "master_port": temp_salt_master.config["ret_port"], - "master_uri": "tcp://127.0.0.1:{}".format( - temp_salt_master.config["ret_port"] - ), + "master_port": master_opts["ret_port"], + "master_uri": "tcp://127.0.0.1:{}".format(master_opts["ret_port"]), "request_channel_timeout": 1, "request_channel_tries": 1, } ) master_uri = "tcp://{master_ip}:{master_port}".format( - master_ip="localhost", master_port=opts["master_port"] + master_ip="localhost", master_port=minion_opts["master_port"] ) async def mock_auth(): @@ -84,7 +78,7 @@ def test_fileclient_timeout(temp_salt_minion, temp_salt_master): def mock_dumps(*args): return b"meh" - with salt.fileclient.get_file_client(opts) as client: + with salt.fileclient.get_file_client(minion_opts) as client: # Authenticate must return true client.auth.authenticate = mock_auth # Crypticla must return bytes to pass to transport.RequestClient.send From a58a741150e0036e330cc810698e472267cc62ac Mon Sep 17 00:00:00 2001 From: "Jamie (Bear) Murphy" <1613241+ITJamie@users.noreply.github.com> Date: Wed, 2 Aug 2023 10:49:29 +0100 Subject: [PATCH 267/393] fix nightly repofile path --- tools/pkg/repo/create.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/pkg/repo/create.py b/tools/pkg/repo/create.py index 60ed8ad0570..5edf2be0409 100644 --- a/tools/pkg/repo/create.py +++ b/tools/pkg/repo/create.py @@ -12,6 +12,7 @@ import pathlib import shutil import sys import textwrap +from datetime import datetime from typing import TYPE_CHECKING from ptscripts import Context, command_group @@ -487,7 +488,7 @@ def rpm( def _create_repo_file(create_repo_path, url_suffix): ctx.info(f"Creating '{repo_file_path.relative_to(repo_path)}' file ...") if nightly_build_from: - base_url = f"salt-dev/{nightly_build_from}/" + base_url = f"salt-dev/{nightly_build_from}/latest/{datetime.utcnow().strftime("%Y-%m-%d") }" repo_file_contents = "[salt-nightly-repo]" elif "rc" in salt_version: base_url = "salt_rc/" From 2073e52bc4de9f74bb6e15811f0354e484229600 Mon Sep 17 00:00:00 2001 From: "Jamie (Bear) Murphy" <1613241+ITJamie@users.noreply.github.com> Date: Wed, 2 Aug 2023 10:51:54 +0100 Subject: [PATCH 268/393] drop latest --- tools/pkg/repo/create.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/pkg/repo/create.py b/tools/pkg/repo/create.py index 5edf2be0409..0442bfbbb55 100644 --- a/tools/pkg/repo/create.py +++ b/tools/pkg/repo/create.py @@ -488,7 +488,7 @@ def rpm( def _create_repo_file(create_repo_path, url_suffix): ctx.info(f"Creating '{repo_file_path.relative_to(repo_path)}' file ...") if nightly_build_from: - base_url = f"salt-dev/{nightly_build_from}/latest/{datetime.utcnow().strftime("%Y-%m-%d") }" + base_url = f"salt-dev/{nightly_build_from}/{datetime.utcnow().strftime("%Y-%m-%d") }" repo_file_contents = "[salt-nightly-repo]" elif "rc" in salt_version: base_url = "salt_rc/" From 318c198a6f19242631f68233fcd4aeaa223756d1 Mon Sep 17 00:00:00 2001 From: "Jamie (Bear) Murphy" <1613241+ITJamie@users.noreply.github.com> Date: Wed, 2 Aug 2023 10:54:51 +0100 Subject: [PATCH 269/393] linting --- tools/pkg/repo/create.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/pkg/repo/create.py b/tools/pkg/repo/create.py index 0442bfbbb55..2fab46147c2 100644 --- a/tools/pkg/repo/create.py +++ b/tools/pkg/repo/create.py @@ -488,7 +488,7 @@ def rpm( def _create_repo_file(create_repo_path, url_suffix): ctx.info(f"Creating '{repo_file_path.relative_to(repo_path)}' file ...") if nightly_build_from: - base_url = f"salt-dev/{nightly_build_from}/{datetime.utcnow().strftime("%Y-%m-%d") }" + base_url = f"salt-dev/{nightly_build_from}/{datetime.utcnow().strftime("%Y-%m-%d")}" repo_file_contents = "[salt-nightly-repo]" elif "rc" in salt_version: base_url = "salt_rc/" From b2dc649f90fba98513f4c592dc49aa0ac3f043fb Mon Sep 17 00:00:00 2001 From: "Jamie (Bear) Murphy" <1613241+ITJamie@users.noreply.github.com> Date: Wed, 2 Aug 2023 10:56:12 +0100 Subject: [PATCH 270/393] add missing slash --- tools/pkg/repo/create.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/pkg/repo/create.py b/tools/pkg/repo/create.py index 2fab46147c2..161c4bc7d23 100644 --- a/tools/pkg/repo/create.py +++ b/tools/pkg/repo/create.py @@ -488,7 +488,7 @@ def rpm( def _create_repo_file(create_repo_path, url_suffix): ctx.info(f"Creating '{repo_file_path.relative_to(repo_path)}' file ...") if nightly_build_from: - base_url = f"salt-dev/{nightly_build_from}/{datetime.utcnow().strftime("%Y-%m-%d")}" + base_url = f"salt-dev/{nightly_build_from}/{datetime.utcnow().strftime("%Y-%m-%d")}/" repo_file_contents = "[salt-nightly-repo]" elif "rc" in salt_version: base_url = "salt_rc/" From 611944fa7bd5d811f62e14ce2d3c7fb2108c23c8 Mon Sep 17 00:00:00 2001 From: "Jamie (Bear) Murphy" <1613241+ITJamie@users.noreply.github.com> Date: Wed, 2 Aug 2023 15:11:42 +0100 Subject: [PATCH 271/393] fix quotes in fstring --- tools/pkg/repo/create.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/pkg/repo/create.py b/tools/pkg/repo/create.py index 161c4bc7d23..904208d53da 100644 --- a/tools/pkg/repo/create.py +++ b/tools/pkg/repo/create.py @@ -488,7 +488,7 @@ def rpm( def _create_repo_file(create_repo_path, url_suffix): ctx.info(f"Creating '{repo_file_path.relative_to(repo_path)}' file ...") if nightly_build_from: - base_url = f"salt-dev/{nightly_build_from}/{datetime.utcnow().strftime("%Y-%m-%d")}/" + base_url = f"salt-dev/{nightly_build_from}/{datetime.utcnow().strftime('%Y-%m-%d')}/" repo_file_contents = "[salt-nightly-repo]" elif "rc" in salt_version: base_url = "salt_rc/" From 78f3b27f1bcb053797bc45bfde6918d0f414e9d2 Mon Sep 17 00:00:00 2001 From: Salt Project Packaging Date: Tue, 25 Jul 2023 20:08:29 +0000 Subject: [PATCH 272/393] Update the bootstrap script to v2023.07.25 (cherry picked from commit 2244d93fb4e8ffe7f76184c3de16f2c3101e7895) --- salt/cloud/deploy/bootstrap-salt.sh | 50 ++++++++++++++++++++++++++--- 1 file changed, 46 insertions(+), 4 deletions(-) diff --git a/salt/cloud/deploy/bootstrap-salt.sh b/salt/cloud/deploy/bootstrap-salt.sh index 1cf46c774df..b937fbb7ef7 100644 --- a/salt/cloud/deploy/bootstrap-salt.sh +++ b/salt/cloud/deploy/bootstrap-salt.sh @@ -23,7 +23,7 @@ #====================================================================================================================== set -o nounset # Treat unset variables as an error -__ScriptVersion="2023.06.28" +__ScriptVersion="2023.07.25" __ScriptName="bootstrap-salt.sh" __ScriptFullName="$0" @@ -277,6 +277,8 @@ _MINIMUM_PIP_VERSION="9.0.1" _MINIMUM_SETUPTOOLS_VERSION="9.1" _POST_NEON_PIP_INSTALL_ARGS="--prefix=/usr" _PIP_DOWNLOAD_ARGS="" +_QUICK_START="$BS_FALSE" +_AUTO_ACCEPT_MINION_KEYS="$BS_FALSE" # Defaults for install arguments ITYPE="stable" @@ -395,6 +397,8 @@ __usage() { resort method. NOTE: This only works for functions which actually implement pip based installations. -q Quiet salt installation from git (setup.py install -q) + -Q Quickstart, install the Salt master and the Salt minion. + And automatically accept the minion key. -R Specify a custom repository URL. Assumes the custom repository URL points to a repository that mirrors Salt packages located at repo.saltproject.io. The option passed with -R replaces the @@ -426,7 +430,7 @@ EOT } # ---------- end of function __usage ---------- -while getopts ':hvnDc:g:Gyx:k:s:MSNXCPFUKIA:i:Lp:dH:bflV:J:j:rR:aq' opt +while getopts ':hvnDc:g:Gyx:k:s:MSNXCPFUKIA:i:Lp:dH:bflV:J:j:rR:aqQ' opt do case "${opt}" in @@ -470,6 +474,7 @@ do J ) _CUSTOM_MASTER_CONFIG=$OPTARG ;; j ) _CUSTOM_MINION_CONFIG=$OPTARG ;; q ) _QUIET_GIT_INSTALLATION=$BS_TRUE ;; + Q ) _QUICK_START=$BS_TRUE ;; x ) _PY_EXE="$OPTARG" ;; y ) _INSTALL_PY="$BS_TRUE" ;; @@ -714,6 +719,31 @@ elif [ "$ITYPE" = "onedir_rc" ]; then fi fi +# Doing a quick start, so install master +# set master address to 127.0.0.1 +if [ "$_QUICK_START" -eq "$BS_TRUE" ]; then + # make install type is stable + ITYPE="stable" + + # make sure the revision is latest + STABLE_REV="latest" + ONEDIR_REV="latest" + + # make sure we're installing the master + _INSTALL_MASTER=$BS_TRUE + + # override incase install minion + # is set to false + _INSTALL_MINION=$BS_TRUE + + # Set master address to loopback IP + _SALT_MASTER_ADDRESS="127.0.0.1" + + # Auto accept the minion key + # when the install is done. + _AUTO_ACCEPT_MINION_KEYS=$BS_TRUE +fi + # Check for any unparsed arguments. Should be an error. if [ "$#" -gt 0 ]; then __usage @@ -4670,7 +4700,7 @@ __install_saltstack_rhel_onedir_repository() { if [ "${ONEDIR_REV}" = "nightly" ] ; then base_url="${HTTP_VAL}://${_REPO_URL}/${_ONEDIR_NIGHTLY_DIR}/${__PY_VERSION_REPO}/redhat/${DISTRO_MAJOR_VERSION}/\$basearch/" fi - if [ "$(echo "${ONEDIR_REV}" | grep -E '(3004|3005)')" != "" ]; then + if [ "$(echo "${ONEDIR_REV}" | grep -E '(3004|3005)')" != "" ] || [ "${ONEDIR_REV}" = "nightly" ]; then if [ "${DISTRO_MAJOR_VERSION}" -eq 9 ]; then gpg_key="SALTSTACK-GPG-KEY2.pub" else @@ -6464,7 +6494,7 @@ install_amazon_linux_ami_2_onedir_deps() { base_url="$HTTP_VAL://${_REPO_URL}/${_ONEDIR_NIGHTLY_DIR}/${__PY_VERSION_REPO}/amazon/2/\$basearch/" fi - if [ "$(echo "${ONEDIR_REV}" | grep -E '(3004|3005)')" != "" ]; then + if [ "$(echo "${ONEDIR_REV}" | grep -E '(3004|3005)')" != "" ] || [ "${ONEDIR_REV}" = "nightly" ]; then gpg_key="${base_url}SALTSTACK-GPG-KEY.pub,${base_url}base/RPM-GPG-KEY-CentOS-7" if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -eq 3 ]; then gpg_key="${base_url}SALTSTACK-GPG-KEY.pub" @@ -9698,6 +9728,11 @@ if [ "$DAEMONS_RUNNING_FUNC" != "null" ] && [ ${_START_DAEMONS} -eq $BS_TRUE ]; fi fi +if [ "$_AUTO_ACCEPT_MINION_KEYS" -eq "$BS_TRUE" ]; then + echoinfo "Accepting the Salt Minion Keys" + salt-key -yA +fi + # Done! if [ "$_CONFIG_ONLY" -eq $BS_FALSE ]; then echoinfo "Salt installed!" @@ -9705,6 +9740,13 @@ else echoinfo "Salt configured!" fi +if [ "$_QUICK_START" -eq "$BS_TRUE" ]; then + echoinfo "Congratulations!" + echoinfo "A couple of commands to try:" + echoinfo " salt \* test.ping" + echoinfo " salt \* test.version" +fi + exit 0 # vim: set sts=4 ts=4 et From 9f34aa38dc03d482a34c5064f745ef7278b0ddff Mon Sep 17 00:00:00 2001 From: Felippe Burk Date: Mon, 31 Jul 2023 14:32:05 -0600 Subject: [PATCH 273/393] adding obsoletes to rpm.spec for photon3 packages Signed-off-by: Felippe Burk --- pkg/rpm/salt.spec | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/pkg/rpm/salt.spec b/pkg/rpm/salt.spec index 9a6f71cba38..50b8e9c9783 100644 --- a/pkg/rpm/salt.spec +++ b/pkg/rpm/salt.spec @@ -32,6 +32,8 @@ Group: System Environment/Daemons License: ASL 2.0 URL: https://saltproject.io/ +Provides: salt = %{version} +Obsoletes: salt3 < 3006 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -68,6 +70,8 @@ servers, handle them quickly and through a simple and manageable interface. Summary: Management component for salt, a parallel remote execution system Group: System Environment/Daemons Requires: %{name} = %{version}-%{release} +Provides: salt-master = %{version} +Obsoletes: salt3-master < 3006 %description master The Salt master is the central server to which all minions connect. @@ -77,6 +81,8 @@ The Salt master is the central server to which all minions connect. Summary: Client component for Salt, a parallel remote execution system Group: System Environment/Daemons Requires: %{name} = %{version}-%{release} +Provides: salt-minion = %{version} +Obsoletes: salt3-minion < 3006 %description minion The Salt minion is the agent component of Salt. It listens for instructions @@ -87,6 +93,8 @@ from the master, runs jobs, and returns results back to the master. Summary: Master-of-master component for Salt, a parallel remote execution system Group: System Environment/Daemons Requires: %{name}-master = %{version}-%{release} +Provides: salt-syndic = %{version} +Obsoletes: salt3-syndic < 3006 %description syndic The Salt syndic is a master daemon which can receive instruction from a @@ -98,6 +106,8 @@ infrastructure. Summary: REST API for Salt, a parallel remote execution system Group: Applications/System Requires: %{name}-master = %{version}-%{release} +Provides: salt-api = %{version} +Obsoletes: salt3-api < 3006 %description api salt-api provides a REST interface to the Salt master. @@ -107,6 +117,8 @@ salt-api provides a REST interface to the Salt master. Summary: Cloud provisioner for Salt, a parallel remote execution system Group: Applications/System Requires: %{name}-master = %{version}-%{release} +Provides: salt-cloud = %{version} +Obsoletes: salt3-cloud < 3006 %description cloud The salt-cloud tool provisions new cloud VMs, installs salt-minion on them, and @@ -117,6 +129,8 @@ adds them to the master's collection of controllable minions. Summary: Agentless SSH-based version of Salt, a parallel remote execution system Group: Applications/System Requires: %{name} = %{version}-%{release} +Provides: salt-ssh = %{version} +Obsoletes: salt3-ssh < 3006 %description ssh The salt-ssh tool can run remote execution functions and states without the use From bdb04c3f73fe9645650064f0689e0e6aacf8e085 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Thu, 3 Aug 2023 15:48:03 +0100 Subject: [PATCH 274/393] Bump to `saltpylint==2023.8.3` Signed-off-by: Pedro Algarvio --- requirements/static/ci/lint.in | 2 +- requirements/static/ci/py3.10/lint.txt | 2 +- requirements/static/ci/py3.7/lint.txt | 2 +- requirements/static/ci/py3.8/lint.txt | 2 +- requirements/static/ci/py3.9/lint.txt | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/requirements/static/ci/lint.in b/requirements/static/ci/lint.in index 7b568d61d38..6511b70c51b 100644 --- a/requirements/static/ci/lint.in +++ b/requirements/static/ci/lint.in @@ -1,4 +1,4 @@ # Lint requirements pylint==2.4.4 -SaltPyLint>=v2020.9.28 +SaltPyLint>=2023.3.8 toml diff --git a/requirements/static/ci/py3.10/lint.txt b/requirements/static/ci/py3.10/lint.txt index a724c32d3c9..09c8e61d80a 100644 --- a/requirements/static/ci/py3.10/lint.txt +++ b/requirements/static/ci/py3.10/lint.txt @@ -769,7 +769,7 @@ rsa==4.7.2 # via google-auth s3transfer==0.5.0 # via boto3 -saltpylint==2020.9.28 +saltpylint==2023.8.3 # via -r requirements/static/ci/lint.in scp==0.13.6 # via junos-eznc diff --git a/requirements/static/ci/py3.7/lint.txt b/requirements/static/ci/py3.7/lint.txt index 2c1d983fa11..550e3235fe6 100644 --- a/requirements/static/ci/py3.7/lint.txt +++ b/requirements/static/ci/py3.7/lint.txt @@ -816,7 +816,7 @@ rsa==4.7.2 # via google-auth s3transfer==0.5.0 # via boto3 -saltpylint==2020.9.28 +saltpylint==2023.8.3 # via -r requirements/static/ci/lint.in scp==0.13.6 # via diff --git a/requirements/static/ci/py3.8/lint.txt b/requirements/static/ci/py3.8/lint.txt index 7f356487283..ce7c7ebcc2d 100644 --- a/requirements/static/ci/py3.8/lint.txt +++ b/requirements/static/ci/py3.8/lint.txt @@ -807,7 +807,7 @@ rsa==4.7.2 # via google-auth s3transfer==0.5.0 # via boto3 -saltpylint==2020.9.28 +saltpylint==2023.8.3 # via -r requirements/static/ci/lint.in scp==0.13.6 # via diff --git a/requirements/static/ci/py3.9/lint.txt b/requirements/static/ci/py3.9/lint.txt index 26e10d45694..2d3ef95cd92 100644 --- a/requirements/static/ci/py3.9/lint.txt +++ b/requirements/static/ci/py3.9/lint.txt @@ -808,7 +808,7 @@ rsa==4.7.2 # via google-auth s3transfer==0.5.0 # via boto3 -saltpylint==2020.9.28 +saltpylint==2023.8.3 # via -r requirements/static/ci/lint.in scp==0.13.6 # via From 2bad38a08ca6c8ced8a6c9c08c0444469504e363 Mon Sep 17 00:00:00 2001 From: "Jamie (Bear) Murphy" <1613241+ITJamie@users.noreply.github.com> Date: Wed, 2 Aug 2023 10:49:29 +0100 Subject: [PATCH 275/393] fix nightly repofile path (cherry picked from commit a58a741150e0036e330cc810698e472267cc62ac) --- tools/pkg/repo/create.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/pkg/repo/create.py b/tools/pkg/repo/create.py index 60ed8ad0570..5edf2be0409 100644 --- a/tools/pkg/repo/create.py +++ b/tools/pkg/repo/create.py @@ -12,6 +12,7 @@ import pathlib import shutil import sys import textwrap +from datetime import datetime from typing import TYPE_CHECKING from ptscripts import Context, command_group @@ -487,7 +488,7 @@ def rpm( def _create_repo_file(create_repo_path, url_suffix): ctx.info(f"Creating '{repo_file_path.relative_to(repo_path)}' file ...") if nightly_build_from: - base_url = f"salt-dev/{nightly_build_from}/" + base_url = f"salt-dev/{nightly_build_from}/latest/{datetime.utcnow().strftime("%Y-%m-%d") }" repo_file_contents = "[salt-nightly-repo]" elif "rc" in salt_version: base_url = "salt_rc/" From b9841886935647427962d697ecd1da8f216ab9ba Mon Sep 17 00:00:00 2001 From: "Jamie (Bear) Murphy" <1613241+ITJamie@users.noreply.github.com> Date: Wed, 2 Aug 2023 10:51:54 +0100 Subject: [PATCH 276/393] drop latest (cherry picked from commit 2073e52bc4de9f74bb6e15811f0354e484229600) --- tools/pkg/repo/create.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/pkg/repo/create.py b/tools/pkg/repo/create.py index 5edf2be0409..0442bfbbb55 100644 --- a/tools/pkg/repo/create.py +++ b/tools/pkg/repo/create.py @@ -488,7 +488,7 @@ def rpm( def _create_repo_file(create_repo_path, url_suffix): ctx.info(f"Creating '{repo_file_path.relative_to(repo_path)}' file ...") if nightly_build_from: - base_url = f"salt-dev/{nightly_build_from}/latest/{datetime.utcnow().strftime("%Y-%m-%d") }" + base_url = f"salt-dev/{nightly_build_from}/{datetime.utcnow().strftime("%Y-%m-%d") }" repo_file_contents = "[salt-nightly-repo]" elif "rc" in salt_version: base_url = "salt_rc/" From 7e7e83b00faf08c42af257b3f82b15b4168f4a95 Mon Sep 17 00:00:00 2001 From: "Jamie (Bear) Murphy" <1613241+ITJamie@users.noreply.github.com> Date: Wed, 2 Aug 2023 10:54:51 +0100 Subject: [PATCH 277/393] linting (cherry picked from commit 318c198a6f19242631f68233fcd4aeaa223756d1) --- tools/pkg/repo/create.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/pkg/repo/create.py b/tools/pkg/repo/create.py index 0442bfbbb55..2fab46147c2 100644 --- a/tools/pkg/repo/create.py +++ b/tools/pkg/repo/create.py @@ -488,7 +488,7 @@ def rpm( def _create_repo_file(create_repo_path, url_suffix): ctx.info(f"Creating '{repo_file_path.relative_to(repo_path)}' file ...") if nightly_build_from: - base_url = f"salt-dev/{nightly_build_from}/{datetime.utcnow().strftime("%Y-%m-%d") }" + base_url = f"salt-dev/{nightly_build_from}/{datetime.utcnow().strftime("%Y-%m-%d")}" repo_file_contents = "[salt-nightly-repo]" elif "rc" in salt_version: base_url = "salt_rc/" From 92254e8a0335e7911fe0ef99bf2339b072be7ea3 Mon Sep 17 00:00:00 2001 From: "Jamie (Bear) Murphy" <1613241+ITJamie@users.noreply.github.com> Date: Wed, 2 Aug 2023 10:56:12 +0100 Subject: [PATCH 278/393] add missing slash (cherry picked from commit b2dc649f90fba98513f4c592dc49aa0ac3f043fb) --- tools/pkg/repo/create.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/pkg/repo/create.py b/tools/pkg/repo/create.py index 2fab46147c2..161c4bc7d23 100644 --- a/tools/pkg/repo/create.py +++ b/tools/pkg/repo/create.py @@ -488,7 +488,7 @@ def rpm( def _create_repo_file(create_repo_path, url_suffix): ctx.info(f"Creating '{repo_file_path.relative_to(repo_path)}' file ...") if nightly_build_from: - base_url = f"salt-dev/{nightly_build_from}/{datetime.utcnow().strftime("%Y-%m-%d")}" + base_url = f"salt-dev/{nightly_build_from}/{datetime.utcnow().strftime("%Y-%m-%d")}/" repo_file_contents = "[salt-nightly-repo]" elif "rc" in salt_version: base_url = "salt_rc/" From 08482ed6f3f2ca3014910fa4c9b5ff09780db01b Mon Sep 17 00:00:00 2001 From: "Jamie (Bear) Murphy" <1613241+ITJamie@users.noreply.github.com> Date: Wed, 2 Aug 2023 15:11:42 +0100 Subject: [PATCH 279/393] fix quotes in fstring (cherry picked from commit 611944fa7bd5d811f62e14ce2d3c7fb2108c23c8) --- tools/pkg/repo/create.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/pkg/repo/create.py b/tools/pkg/repo/create.py index 161c4bc7d23..904208d53da 100644 --- a/tools/pkg/repo/create.py +++ b/tools/pkg/repo/create.py @@ -488,7 +488,7 @@ def rpm( def _create_repo_file(create_repo_path, url_suffix): ctx.info(f"Creating '{repo_file_path.relative_to(repo_path)}' file ...") if nightly_build_from: - base_url = f"salt-dev/{nightly_build_from}/{datetime.utcnow().strftime("%Y-%m-%d")}/" + base_url = f"salt-dev/{nightly_build_from}/{datetime.utcnow().strftime('%Y-%m-%d')}/" repo_file_contents = "[salt-nightly-repo]" elif "rc" in salt_version: base_url = "salt_rc/" From 7674112d146ea86e28ad76bae05bc048166183d6 Mon Sep 17 00:00:00 2001 From: Felippe Burk Date: Mon, 31 Jul 2023 14:32:05 -0600 Subject: [PATCH 280/393] adding obsoletes to rpm.spec for photon3 packages Signed-off-by: Felippe Burk --- pkg/rpm/salt.spec | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/pkg/rpm/salt.spec b/pkg/rpm/salt.spec index 9a6f71cba38..50b8e9c9783 100644 --- a/pkg/rpm/salt.spec +++ b/pkg/rpm/salt.spec @@ -32,6 +32,8 @@ Group: System Environment/Daemons License: ASL 2.0 URL: https://saltproject.io/ +Provides: salt = %{version} +Obsoletes: salt3 < 3006 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -68,6 +70,8 @@ servers, handle them quickly and through a simple and manageable interface. Summary: Management component for salt, a parallel remote execution system Group: System Environment/Daemons Requires: %{name} = %{version}-%{release} +Provides: salt-master = %{version} +Obsoletes: salt3-master < 3006 %description master The Salt master is the central server to which all minions connect. @@ -77,6 +81,8 @@ The Salt master is the central server to which all minions connect. Summary: Client component for Salt, a parallel remote execution system Group: System Environment/Daemons Requires: %{name} = %{version}-%{release} +Provides: salt-minion = %{version} +Obsoletes: salt3-minion < 3006 %description minion The Salt minion is the agent component of Salt. It listens for instructions @@ -87,6 +93,8 @@ from the master, runs jobs, and returns results back to the master. Summary: Master-of-master component for Salt, a parallel remote execution system Group: System Environment/Daemons Requires: %{name}-master = %{version}-%{release} +Provides: salt-syndic = %{version} +Obsoletes: salt3-syndic < 3006 %description syndic The Salt syndic is a master daemon which can receive instruction from a @@ -98,6 +106,8 @@ infrastructure. Summary: REST API for Salt, a parallel remote execution system Group: Applications/System Requires: %{name}-master = %{version}-%{release} +Provides: salt-api = %{version} +Obsoletes: salt3-api < 3006 %description api salt-api provides a REST interface to the Salt master. @@ -107,6 +117,8 @@ salt-api provides a REST interface to the Salt master. Summary: Cloud provisioner for Salt, a parallel remote execution system Group: Applications/System Requires: %{name}-master = %{version}-%{release} +Provides: salt-cloud = %{version} +Obsoletes: salt3-cloud < 3006 %description cloud The salt-cloud tool provisions new cloud VMs, installs salt-minion on them, and @@ -117,6 +129,8 @@ adds them to the master's collection of controllable minions. Summary: Agentless SSH-based version of Salt, a parallel remote execution system Group: Applications/System Requires: %{name} = %{version}-%{release} +Provides: salt-ssh = %{version} +Obsoletes: salt3-ssh < 3006 %description ssh The salt-ssh tool can run remote execution functions and states without the use From 9de739f9dd87b6c765f0d280e4864a7e6308c54a Mon Sep 17 00:00:00 2001 From: "Gareth J. Greenaway" Date: Fri, 28 Jul 2023 14:39:10 -0700 Subject: [PATCH 281/393] Look in location salt is running from, this accounts for running from an unpacked onedir file that has not been installed. --- salt/utils/rsax931.py | 6 ++++++ tests/unit/utils/test_rsax931.py | 27 +++++++++++++++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/salt/utils/rsax931.py b/salt/utils/rsax931.py index 0eebf999446..535e7f6d3e6 100644 --- a/salt/utils/rsax931.py +++ b/salt/utils/rsax931.py @@ -37,6 +37,12 @@ def _find_libcrypto(): # system. # look in salts pkg install location. lib = glob.glob("/opt/salt/lib/libcrypto.dylib") + + # look in location salt is running from + # this accounts for running from an unpacked + # onedir file + lib = lib or glob.glob(os.path.join("lib/libcrypto.dylib")) + # Find library symlinks in Homebrew locations. brew_prefix = os.getenv("HOMEBREW_PREFIX", "/usr/local") lib = lib or glob.glob( diff --git a/tests/unit/utils/test_rsax931.py b/tests/unit/utils/test_rsax931.py index 67946d4bf5b..7fed394dcee 100644 --- a/tests/unit/utils/test_rsax931.py +++ b/tests/unit/utils/test_rsax931.py @@ -276,3 +276,30 @@ class RSAX931Test(TestCase): or hasattr(lib, "OPENSSL_init_crypto") or hasattr(lib, "OPENSSL_no_config") ) + + @patch.object(salt.utils.platform, "is_darwin", lambda: True) + @patch.object(platform, "mac_ver", lambda: ("10.15.2", (), "")) + @patch.object(sys, "platform", "macosx") + def test_find_libcrypto_darwin_onedir(self): + """ + Test _find_libcrypto on a macOS + libcryptos and defaulting to the versioned system libraries. + """ + available = [ + "/usr/lib/libcrypto.0.9.7.dylib", + "/usr/lib/libcrypto.0.9.8.dylib", + "/usr/lib/libcrypto.35.dylib", + "/usr/lib/libcrypto.41.dylib", + "/usr/lib/libcrypto.42.dylib", + "/usr/lib/libcrypto.44.dylib", + "/test/homebrew/prefix/opt/openssl/lib/libcrypto.dylib", + "/opt/local/lib/libcrypto.dylib", + "lib/libcrypto.dylib", + ] + + def test_glob(pattern): + return [lib for lib in available if fnmatch.fnmatch(lib, pattern)] + + with patch.object(glob, "glob", test_glob): + lib_path = _find_libcrypto() + self.assertEqual("lib/libcrypto.dylib", lib_path) From 1d85a3ed89fba6d0628c03facc614e242bf9d2e4 Mon Sep 17 00:00:00 2001 From: "Gareth J. Greenaway" Date: Fri, 28 Jul 2023 14:41:10 -0700 Subject: [PATCH 282/393] Adding changelog. --- changelog/64877.fixed.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog/64877.fixed.md diff --git a/changelog/64877.fixed.md b/changelog/64877.fixed.md new file mode 100644 index 00000000000..ccf4e556880 --- /dev/null +++ b/changelog/64877.fixed.md @@ -0,0 +1 @@ +Look in location salt is running from, this accounts for running from an unpacked onedir file that has not been installed. From b39278d39f133a8bb64f4c8908031d2ed143e4a2 Mon Sep 17 00:00:00 2001 From: "Gareth J. Greenaway" Date: Sun, 30 Jul 2023 13:30:28 -0700 Subject: [PATCH 283/393] removing unused os.path.join. moving all patch decorators into the test functions. --- salt/utils/rsax931.py | 2 +- tests/unit/utils/test_rsax931.py | 77 +++++++++++++++++--------------- 2 files changed, 42 insertions(+), 37 deletions(-) diff --git a/salt/utils/rsax931.py b/salt/utils/rsax931.py index 535e7f6d3e6..fb8a1cbbd74 100644 --- a/salt/utils/rsax931.py +++ b/salt/utils/rsax931.py @@ -41,7 +41,7 @@ def _find_libcrypto(): # look in location salt is running from # this accounts for running from an unpacked # onedir file - lib = lib or glob.glob(os.path.join("lib/libcrypto.dylib")) + lib = lib or glob.glob("lib/libcrypto.dylib") # Find library symlinks in Homebrew locations. brew_prefix = os.getenv("HOMEBREW_PREFIX", "/usr/local") diff --git a/tests/unit/utils/test_rsax931.py b/tests/unit/utils/test_rsax931.py index 7fed394dcee..cbd1ffbc8ed 100644 --- a/tests/unit/utils/test_rsax931.py +++ b/tests/unit/utils/test_rsax931.py @@ -169,21 +169,19 @@ class RSAX931Test(TestCase): fnmatch.fnmatch(lib_path, "/opt/freeware/lib/libcrypto.so*") ) - @patch.object(salt.utils.platform, "is_darwin", lambda: True) - @patch.object(platform, "mac_ver", lambda: ("10.14.2", (), "")) - @patch.object(glob, "glob", lambda _: []) - @patch.object(sys, "platform", "macosx") def test_find_libcrypto_with_system_before_catalina(self): """ Test _find_libcrypto on a pre-Catalina macOS host by simulating not finding any other libcryptos and verifying that it defaults to system. """ - lib_path = _find_libcrypto() - self.assertEqual(lib_path, "/usr/lib/libcrypto.dylib") + with patch.object(salt.utils.platform, "is_darwin", lambda: True), patch.object( + platform, "mac_ver", lambda: ("10.14.2", (), "") + ), patch.object(glob, "glob", lambda _: []), patch.object( + sys, "platform", "macosx" + ): + lib_path = _find_libcrypto() + self.assertEqual(lib_path, "/usr/lib/libcrypto.dylib") - @patch.object(salt.utils.platform, "is_darwin", lambda: True) - @patch.object(platform, "mac_ver", lambda: ("10.15.2", (), "")) - @patch.object(sys, "platform", "macosx") def test_find_libcrypto_darwin_catalina(self): """ Test _find_libcrypto on a macOS Catalina host where there are no custom @@ -202,13 +200,14 @@ class RSAX931Test(TestCase): def test_glob(pattern): return [lib for lib in available if fnmatch.fnmatch(lib, pattern)] - with patch.object(glob, "glob", test_glob): + with patch.object(salt.utils.platform, "is_darwin", lambda: True), patch.object( + platform, "mac_ver", lambda: ("10.15.2", (), "") + ), patch.object(sys, "platform", "macosx"), patch.object( + glob, "glob", test_glob + ): lib_path = _find_libcrypto() self.assertEqual("/usr/lib/libcrypto.44.dylib", lib_path) - @patch.object(salt.utils.platform, "is_darwin", lambda: True) - @patch.object(platform, "mac_ver", lambda: ("11.2.2", (), "")) - @patch.object(sys, "platform", "macosx") def test_find_libcrypto_darwin_bigsur_packaged(self): """ Test _find_libcrypto on a Darwin-like macOS host where there isn't a @@ -237,31 +236,36 @@ class RSAX931Test(TestCase): return test_glob - for package_manager, expected_lib in managed_paths.items(): - if package_manager == "brew": - env = {"HOMEBREW_PREFIX": "/test/homebrew/prefix"} - else: - env = {"HOMEBREW_PREFIX": ""} - with patch.object(os, "getenv", mock_getenv(env)): - with patch.object(glob, "glob", mock_glob(expected_lib)): + with patch.object(salt.utils.platform, "is_darwin", lambda: True), patch.object( + platform, "mac_ver", lambda: ("11.2.2", (), "") + ), patch.object(sys, "platform", "macosx"): + for package_manager, expected_lib in managed_paths.items(): + if package_manager == "brew": + env = {"HOMEBREW_PREFIX": "/test/homebrew/prefix"} + else: + env = {"HOMEBREW_PREFIX": ""} + with patch.object(os, "getenv", mock_getenv(env)): + with patch.object(glob, "glob", mock_glob(expected_lib)): + lib_path = _find_libcrypto() + + self.assertEqual(expected_lib, lib_path) + + # On Big Sur, there's nothing else to fall back on. + with patch.object(glob, "glob", lambda _: []): + with self.assertRaises(OSError): lib_path = _find_libcrypto() - self.assertEqual(expected_lib, lib_path) - - # On Big Sur, there's nothing else to fall back on. - with patch.object(glob, "glob", lambda _: []): - with self.assertRaises(OSError): - lib_path = _find_libcrypto() - - @patch.object(ctypes.util, "find_library", lambda a: None) - @patch.object(glob, "glob", lambda a: []) - @patch.object(sys, "platform", "unknown") - @patch.object(salt.utils.platform, "is_darwin", lambda: False) def test_find_libcrypto_unsupported(self): """ Ensure that _find_libcrypto works correctly on an unsupported host OS. """ - with self.assertRaises(OSError): + with patch.object(ctypes.util, "find_library", lambda a: None), patch.object( + glob, "glob", lambda a: [] + ), patch.object(sys, "platform", "unknown"), patch.object( + salt.utils.platform, "is_darwin", lambda: False + ), self.assertRaises( + OSError + ): _find_libcrypto() def test_load_libcrypto(self): @@ -277,9 +281,6 @@ class RSAX931Test(TestCase): or hasattr(lib, "OPENSSL_no_config") ) - @patch.object(salt.utils.platform, "is_darwin", lambda: True) - @patch.object(platform, "mac_ver", lambda: ("10.15.2", (), "")) - @patch.object(sys, "platform", "macosx") def test_find_libcrypto_darwin_onedir(self): """ Test _find_libcrypto on a macOS @@ -300,6 +301,10 @@ class RSAX931Test(TestCase): def test_glob(pattern): return [lib for lib in available if fnmatch.fnmatch(lib, pattern)] - with patch.object(glob, "glob", test_glob): + with patch.object(glob, "glob", test_glob), patch.object( + salt.utils.platform, "is_darwin", lambda: True + ), patch.object(platform, "mac_ver", lambda: ("10.15.2", (), "")), patch.object( + sys, "platform", "macosx" + ): lib_path = _find_libcrypto() self.assertEqual("lib/libcrypto.dylib", lib_path) From fd6be3b6e410abc9d11b77a7eba91abfb51570fd Mon Sep 17 00:00:00 2001 From: "Gareth J. Greenaway" Date: Mon, 31 Jul 2023 10:47:00 -0700 Subject: [PATCH 284/393] moving test to pytest. --- tests/pytests/unit/utils/test_rsax931.py | 322 +++++++++++++++++++++++ tests/unit/utils/test_rsax931.py | 310 ---------------------- 2 files changed, 322 insertions(+), 310 deletions(-) create mode 100644 tests/pytests/unit/utils/test_rsax931.py delete mode 100644 tests/unit/utils/test_rsax931.py diff --git a/tests/pytests/unit/utils/test_rsax931.py b/tests/pytests/unit/utils/test_rsax931.py new file mode 100644 index 00000000000..75d176d7020 --- /dev/null +++ b/tests/pytests/unit/utils/test_rsax931.py @@ -0,0 +1,322 @@ +""" +Test the RSA ANSI X9.31 signer and verifier +""" + +import ctypes +import ctypes.util +import fnmatch +import glob +import os +import platform +import sys + +import pytest + +import salt.utils.platform + +# salt libs +from salt.utils.rsax931 import ( + RSAX931Signer, + RSAX931Verifier, + _find_libcrypto, + _load_libcrypto, +) +from tests.support.mock import patch + + +@pytest.fixture +def privkey_data(): + return ( + "-----BEGIN RSA PRIVATE KEY-----\n" + "MIIEpAIBAAKCAQEA75GR6ZTv5JOv90Vq8tKhKC7YQnhDIo2hM0HVziTEk5R4UQBW\n" + "a0CKytFMbTONY2msEDwX9iA0x7F5Lgj0X8eD4ZMsYqLzqjWMekLC8bjhxc+EuPo9\n" + "Dygu3mJ2VgRC7XhlFpmdo5NN8J2E7B/CNB3R4hOcMMZNZdi0xLtFoTfwU61UPfFX\n" + "14mV2laqLbvDEfQLJhUTDeFFV8EN5Z4H1ttLP3sMXJvc3EvM0JiDVj4l1TWFUHHz\n" + "eFgCA1Im0lv8i7PFrgW7nyMfK9uDSsUmIp7k6ai4tVzwkTmV5PsriP1ju88Lo3MB\n" + "4/sUmDv/JmlZ9YyzTO3Po8Uz3Aeq9HJWyBWHAQIDAQABAoIBAGOzBzBYZUWRGOgl\n" + "IY8QjTT12dY/ymC05GM6gMobjxuD7FZ5d32HDLu/QrknfS3kKlFPUQGDAbQhbbb0\n" + "zw6VL5NO9mfOPO2W/3FaG1sRgBQcerWonoSSSn8OJwVBHMFLG3a+U1Zh1UvPoiPK\n" + "S734swIM+zFpNYivGPvOm/muF/waFf8tF/47t1cwt/JGXYQnkG/P7z0vp47Irpsb\n" + "Yjw7vPe4BnbY6SppSxscW3KoV7GtJLFKIxAXbxsuJMF/rYe3O3w2VKJ1Sug1VDJl\n" + "/GytwAkSUer84WwP2b07Wn4c5pCnmLslMgXCLkENgi1NnJMhYVOnckxGDZk54hqP\n" + "9RbLnkkCgYEA/yKuWEvgdzYRYkqpzB0l9ka7Y00CV4Dha9Of6GjQi9i4VCJ/UFVr\n" + "UlhTo5y0ZzpcDAPcoZf5CFZsD90a/BpQ3YTtdln2MMCL/Kr3QFmetkmDrt+3wYnX\n" + "sKESfsa2nZdOATRpl1antpwyD4RzsAeOPwBiACj4fkq5iZJBSI0bxrMCgYEA8GFi\n" + "qAjgKh81/Uai6KWTOW2kX02LEMVRrnZLQ9VPPLGid4KZDDk1/dEfxjjkcyOxX1Ux\n" + "Klu4W8ZEdZyzPcJrfk7PdopfGOfrhWzkREK9C40H7ou/1jUecq/STPfSOmxh3Y+D\n" + "ifMNO6z4sQAHx8VaHaxVsJ7SGR/spr0pkZL+NXsCgYEA84rIgBKWB1W+TGRXJzdf\n" + "yHIGaCjXpm2pQMN3LmP3RrcuZWm0vBt94dHcrR5l+u/zc6iwEDTAjJvqdU4rdyEr\n" + "tfkwr7v6TNlQB3WvpWanIPyVzfVSNFX/ZWSsAgZvxYjr9ixw6vzWBXOeOb/Gqu7b\n" + "cvpLkjmJ0wxDhbXtyXKhZA8CgYBZyvcQb+hUs732M4mtQBSD0kohc5TsGdlOQ1AQ\n" + "McFcmbpnzDghkclyW8jzwdLMk9uxEeDAwuxWE/UEvhlSi6qdzxC+Zifp5NBc0fVe\n" + "7lMx2mfJGxj5CnSqQLVdHQHB4zSXkAGB6XHbBd0MOUeuvzDPfs2voVQ4IG3FR0oc\n" + "3/znuwKBgQChZGH3McQcxmLA28aUwOVbWssfXKdDCsiJO+PEXXlL0maO3SbnFn+Q\n" + "Tyf8oHI5cdP7AbwDSx9bUfRPjg9dKKmATBFr2bn216pjGxK0OjYOCntFTVr0psRB\n" + "CrKg52Qrq71/2l4V2NLQZU40Dr1bN9V+Ftd9L0pvpCAEAWpIbLXGDw==\n" + "-----END RSA PRIVATE KEY-----" + ) + + +@pytest.fixture +def pubkey_data(): + return ( + "-----BEGIN PUBLIC KEY-----\n" + "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA75GR6ZTv5JOv90Vq8tKh\n" + "KC7YQnhDIo2hM0HVziTEk5R4UQBWa0CKytFMbTONY2msEDwX9iA0x7F5Lgj0X8eD\n" + "4ZMsYqLzqjWMekLC8bjhxc+EuPo9Dygu3mJ2VgRC7XhlFpmdo5NN8J2E7B/CNB3R\n" + "4hOcMMZNZdi0xLtFoTfwU61UPfFX14mV2laqLbvDEfQLJhUTDeFFV8EN5Z4H1ttL\n" + "P3sMXJvc3EvM0JiDVj4l1TWFUHHzeFgCA1Im0lv8i7PFrgW7nyMfK9uDSsUmIp7k\n" + "6ai4tVzwkTmV5PsriP1ju88Lo3MB4/sUmDv/JmlZ9YyzTO3Po8Uz3Aeq9HJWyBWH\n" + "AQIDAQAB\n" + "-----END PUBLIC KEY-----" + ) + + +@pytest.fixture +def hello_world(): + return b"hello, world" + + +@pytest.fixture +def hello_world_sig(): + return ( + b"\x63\xa0\x70\xd2\xe4\xd4\x6b\x8a\xa2\x59\x27\x5f\x00\x69" + b"\x1e\x3c\x50\xed\x50\x13\x09\x80\xe3\x47\x4e\x14\xb5\x7c" + b"\x07\x26\x4e\x20\x74\xea\x0e\xf8\xda\xff\x1e\x57\x8c\x67" + b"\x76\x73\xaa\xea\x0f\x0a\xe7\xa2\xe3\x88\xfc\x09\x87\x36" + b"\x01\x3a\xb7\x4c\x40\xe0\xf4\x54\xc5\xf1\xaa\xb2\x1d\x7f" + b"\xb6\xd3\xa8\xdd\x28\x69\x8b\x88\xe4\x42\x1e\x48\x3e\x1f" + b"\xe2\x2b\x3c\x7c\x85\x11\xe9\x59\xd7\xf3\xc2\x21\xd3\x55" + b"\xcb\x9c\x3c\x93\xcc\x20\xdf\x64\x81\xd0\x0d\xbf\x8e\x8d" + b"\x47\xec\x1d\x9e\x27\xec\x12\xed\x8b\x5f\xd6\x1d\xec\x8d" + b"\x77\x5a\x58\x8a\x24\xb6\x0f\x12\xb7\x51\xef\x7d\x85\x0f" + b"\x49\x39\x02\x81\x15\x08\x70\xd6\xe0\x0b\x31\xff\x5f\xf9" + b"\xd1\x92\x38\x59\x8c\x22\x9c\xbb\xbf\xcf\x85\x34\xe2\x47" + b"\xf5\xe2\xaa\xb4\x62\x33\x3c\x13\x78\x33\x87\x08\x9e\xb5" + b"\xbc\x5d\xc1\xbf\x79\x7c\xfa\x5f\x06\x6a\x3b\x17\x40\x09" + b"\xb9\x09\xbf\x32\xc3\x00\xe2\xbc\x91\x77\x14\xa5\x23\xf5" + b"\xf5\xf1\x09\x12\x38\xda\x3b\x6a\x82\x81\x7b\x5e\x1c\xcb" + b"\xaa\x36\x9b\x08\x36\x03\x14\x96\xa3\x31\x39\x59\x16\x75" + b"\xc9\xb6\x66\x94\x1b\x97\xff\xc8\xa1\xe3\x21\x35\x23\x06" + b"\x4c\x9b\xf4\xee" + ) + + +def test_signer(privkey_data, pubkey_data, hello_world, hello_world_sig): + with pytest.raises(ValueError): + signer = RSAX931Signer("bogus key data") + with pytest.raises(ValueError): + signer = RSAX931Signer(pubkey_data) + + signer = RSAX931Signer(privkey_data) + with pytest.raises(ValueError): + signer.sign("x" * 255) # message too long + + sig = signer.sign(hello_world) + assert hello_world_sig == sig + + +def test_verifier(privkey_data, pubkey_data, hello_world, hello_world_sig): + with pytest.raises(ValueError): + verifier = RSAX931Verifier("bogus key data") + with pytest.raises(ValueError): + verifier = RSAX931Verifier(privkey_data) + + verifier = RSAX931Verifier(pubkey_data) + with pytest.raises(ValueError): + verifier.verify("") + with pytest.raises(ValueError): + verifier.verify(hello_world_sig + b"junk") + + msg = verifier.verify(hello_world_sig) + assert hello_world == msg + + +@pytest.mark.skip_unless_on_windows +def test_find_libcrypto_win32(): + """ + Test _find_libcrypto on Windows hosts. + """ + lib_path = _find_libcrypto() + assert "libcrypto" in lib_path + + +@pytest.mark.skip_unless_on_smartos +def test_find_libcrypto_smartos(): + """ + Test _find_libcrypto on a SmartOS host. + """ + lib_path = _find_libcrypto() + assert fnmatch.fnmatch( + lib_path, os.path.join(os.path.dirname(sys.executable), "libcrypto*") + ) + + +@pytest.mark.skip_unless_on_sunos +def test_find_libcrypto_sunos(): + """ + Test _find_libcrypto on a Solaris-like host. + """ + lib_path = _find_libcrypto() + passed = False + for i in ("/opt/local/lib/libcrypto.so*", "/opt/tools/lib/libcrypto.so*"): + if fnmatch.fnmatch(lib_path, i): + passed = True + break + assert passed + + +@pytest.mark.skip_unless_on_aix +def test_find_libcrypto_aix(): + """ + Test _find_libcrypto on an IBM AIX host. + """ + lib_path = _find_libcrypto() + if os.path.isdir("/opt/salt/lib"): + assert fnmatch.fnmatch(lib_path, "/opt/salt/lib/libcrypto.so*") + else: + assert fnmatch.fnmatch(lib_path, "/opt/freeware/lib/libcrypto.so*") + + +def test_find_libcrypto_with_system_before_catalina(): + """ + Test _find_libcrypto on a pre-Catalina macOS host by simulating not + finding any other libcryptos and verifying that it defaults to system. + """ + with patch.object(salt.utils.platform, "is_darwin", lambda: True), patch.object( + platform, "mac_ver", lambda: ("10.14.2", (), "") + ), patch.object(glob, "glob", lambda _: []), patch.object( + sys, "platform", "macosx" + ): + lib_path = _find_libcrypto() + assert lib_path == "/usr/lib/libcrypto.dylib" + + +def test_find_libcrypto_darwin_catalina(): + """ + Test _find_libcrypto on a macOS Catalina host where there are no custom + libcryptos and defaulting to the versioned system libraries. + """ + available = [ + "/usr/lib/libcrypto.0.9.7.dylib", + "/usr/lib/libcrypto.0.9.8.dylib", + "/usr/lib/libcrypto.35.dylib", + "/usr/lib/libcrypto.41.dylib", + "/usr/lib/libcrypto.42.dylib", + "/usr/lib/libcrypto.44.dylib", + "/usr/lib/libcrypto.dylib", + ] + + def test_glob(pattern): + return [lib for lib in available if fnmatch.fnmatch(lib, pattern)] + + with patch.object(salt.utils.platform, "is_darwin", lambda: True), patch.object( + platform, "mac_ver", lambda: ("10.15.2", (), "") + ), patch.object(sys, "platform", "macosx"), patch.object(glob, "glob", test_glob): + lib_path = _find_libcrypto() + assert "/usr/lib/libcrypto.44.dylib" == lib_path + + +def test_find_libcrypto_darwin_bigsur_packaged(): + """ + Test _find_libcrypto on a Darwin-like macOS host where there isn't a + lacation returned by ctypes.util.find_library() and the libcrypto + installation comes from a package manager (ports, brew, salt). + """ + managed_paths = { + "salt": "/opt/salt/lib/libcrypto.dylib", + "brew": "/test/homebrew/prefix/opt/openssl/lib/libcrypto.dylib", + "port": "/opt/local/lib/libcrypto.dylib", + } + + saved_getenv = os.getenv + + def mock_getenv(env): + def test_getenv(var, default=None): + return env.get(var, saved_getenv(var, default)) + + return test_getenv + + def mock_glob(expected_lib): + def test_glob(pattern): + if fnmatch.fnmatch(expected_lib, pattern): + return [expected_lib] + return [] + + return test_glob + + with patch.object(salt.utils.platform, "is_darwin", lambda: True), patch.object( + platform, "mac_ver", lambda: ("11.2.2", (), "") + ), patch.object(sys, "platform", "macosx"): + for package_manager, expected_lib in managed_paths.items(): + if package_manager == "brew": + env = {"HOMEBREW_PREFIX": "/test/homebrew/prefix"} + else: + env = {"HOMEBREW_PREFIX": ""} + with patch.object(os, "getenv", mock_getenv(env)): + with patch.object(glob, "glob", mock_glob(expected_lib)): + lib_path = _find_libcrypto() + + assert expected_lib == lib_path + + # On Big Sur, there's nothing else to fall back on. + with patch.object(glob, "glob", lambda _: []): + with pytest.raises(OSError): + lib_path = _find_libcrypto() + + +def test_find_libcrypto_unsupported(): + """ + Ensure that _find_libcrypto works correctly on an unsupported host OS. + """ + with patch.object(ctypes.util, "find_library", lambda a: None), patch.object( + glob, "glob", lambda a: [] + ), patch.object(sys, "platform", "unknown"), patch.object( + salt.utils.platform, "is_darwin", lambda: False + ), pytest.raises( + OSError + ): + _find_libcrypto() + + +def test_load_libcrypto(): + """ + Test _load_libcrypto generically. + """ + lib = _load_libcrypto() + assert isinstance(lib, ctypes.CDLL) + # Try to cover both pre and post OpenSSL 1.1. + assert ( + hasattr(lib, "OpenSSL_version_num") + or hasattr(lib, "OPENSSL_init_crypto") + or hasattr(lib, "OPENSSL_no_config") + ) + + +def test_find_libcrypto_darwin_onedir(): + """ + Test _find_libcrypto on a macOS + libcryptos and defaulting to the versioned system libraries. + """ + available = [ + "/usr/lib/libcrypto.0.9.7.dylib", + "/usr/lib/libcrypto.0.9.8.dylib", + "/usr/lib/libcrypto.35.dylib", + "/usr/lib/libcrypto.41.dylib", + "/usr/lib/libcrypto.42.dylib", + "/usr/lib/libcrypto.44.dylib", + "/test/homebrew/prefix/opt/openssl/lib/libcrypto.dylib", + "/opt/local/lib/libcrypto.dylib", + "lib/libcrypto.dylib", + ] + + def test_glob(pattern): + return [lib for lib in available if fnmatch.fnmatch(lib, pattern)] + + with patch.object(glob, "glob", test_glob), patch.object( + salt.utils.platform, "is_darwin", lambda: True + ), patch.object(platform, "mac_ver", lambda: ("10.15.2", (), "")), patch.object( + sys, "platform", "macosx" + ): + lib_path = _find_libcrypto() + assert "lib/libcrypto.dylib" == lib_path diff --git a/tests/unit/utils/test_rsax931.py b/tests/unit/utils/test_rsax931.py deleted file mode 100644 index cbd1ffbc8ed..00000000000 --- a/tests/unit/utils/test_rsax931.py +++ /dev/null @@ -1,310 +0,0 @@ -""" -Test the RSA ANSI X9.31 signer and verifier -""" - -import ctypes -import ctypes.util -import fnmatch -import glob -import os -import platform -import sys - -import pytest - -import salt.utils.platform - -# salt libs -from salt.utils.rsax931 import ( - RSAX931Signer, - RSAX931Verifier, - _find_libcrypto, - _load_libcrypto, -) -from tests.support.mock import patch - -# salt testing libs -from tests.support.unit import TestCase - - -class RSAX931Test(TestCase): - - privkey_data = ( - "-----BEGIN RSA PRIVATE KEY-----\n" - "MIIEpAIBAAKCAQEA75GR6ZTv5JOv90Vq8tKhKC7YQnhDIo2hM0HVziTEk5R4UQBW\n" - "a0CKytFMbTONY2msEDwX9iA0x7F5Lgj0X8eD4ZMsYqLzqjWMekLC8bjhxc+EuPo9\n" - "Dygu3mJ2VgRC7XhlFpmdo5NN8J2E7B/CNB3R4hOcMMZNZdi0xLtFoTfwU61UPfFX\n" - "14mV2laqLbvDEfQLJhUTDeFFV8EN5Z4H1ttLP3sMXJvc3EvM0JiDVj4l1TWFUHHz\n" - "eFgCA1Im0lv8i7PFrgW7nyMfK9uDSsUmIp7k6ai4tVzwkTmV5PsriP1ju88Lo3MB\n" - "4/sUmDv/JmlZ9YyzTO3Po8Uz3Aeq9HJWyBWHAQIDAQABAoIBAGOzBzBYZUWRGOgl\n" - "IY8QjTT12dY/ymC05GM6gMobjxuD7FZ5d32HDLu/QrknfS3kKlFPUQGDAbQhbbb0\n" - "zw6VL5NO9mfOPO2W/3FaG1sRgBQcerWonoSSSn8OJwVBHMFLG3a+U1Zh1UvPoiPK\n" - "S734swIM+zFpNYivGPvOm/muF/waFf8tF/47t1cwt/JGXYQnkG/P7z0vp47Irpsb\n" - "Yjw7vPe4BnbY6SppSxscW3KoV7GtJLFKIxAXbxsuJMF/rYe3O3w2VKJ1Sug1VDJl\n" - "/GytwAkSUer84WwP2b07Wn4c5pCnmLslMgXCLkENgi1NnJMhYVOnckxGDZk54hqP\n" - "9RbLnkkCgYEA/yKuWEvgdzYRYkqpzB0l9ka7Y00CV4Dha9Of6GjQi9i4VCJ/UFVr\n" - "UlhTo5y0ZzpcDAPcoZf5CFZsD90a/BpQ3YTtdln2MMCL/Kr3QFmetkmDrt+3wYnX\n" - "sKESfsa2nZdOATRpl1antpwyD4RzsAeOPwBiACj4fkq5iZJBSI0bxrMCgYEA8GFi\n" - "qAjgKh81/Uai6KWTOW2kX02LEMVRrnZLQ9VPPLGid4KZDDk1/dEfxjjkcyOxX1Ux\n" - "Klu4W8ZEdZyzPcJrfk7PdopfGOfrhWzkREK9C40H7ou/1jUecq/STPfSOmxh3Y+D\n" - "ifMNO6z4sQAHx8VaHaxVsJ7SGR/spr0pkZL+NXsCgYEA84rIgBKWB1W+TGRXJzdf\n" - "yHIGaCjXpm2pQMN3LmP3RrcuZWm0vBt94dHcrR5l+u/zc6iwEDTAjJvqdU4rdyEr\n" - "tfkwr7v6TNlQB3WvpWanIPyVzfVSNFX/ZWSsAgZvxYjr9ixw6vzWBXOeOb/Gqu7b\n" - "cvpLkjmJ0wxDhbXtyXKhZA8CgYBZyvcQb+hUs732M4mtQBSD0kohc5TsGdlOQ1AQ\n" - "McFcmbpnzDghkclyW8jzwdLMk9uxEeDAwuxWE/UEvhlSi6qdzxC+Zifp5NBc0fVe\n" - "7lMx2mfJGxj5CnSqQLVdHQHB4zSXkAGB6XHbBd0MOUeuvzDPfs2voVQ4IG3FR0oc\n" - "3/znuwKBgQChZGH3McQcxmLA28aUwOVbWssfXKdDCsiJO+PEXXlL0maO3SbnFn+Q\n" - "Tyf8oHI5cdP7AbwDSx9bUfRPjg9dKKmATBFr2bn216pjGxK0OjYOCntFTVr0psRB\n" - "CrKg52Qrq71/2l4V2NLQZU40Dr1bN9V+Ftd9L0pvpCAEAWpIbLXGDw==\n" - "-----END RSA PRIVATE KEY-----" - ) - - pubkey_data = ( - "-----BEGIN PUBLIC KEY-----\n" - "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA75GR6ZTv5JOv90Vq8tKh\n" - "KC7YQnhDIo2hM0HVziTEk5R4UQBWa0CKytFMbTONY2msEDwX9iA0x7F5Lgj0X8eD\n" - "4ZMsYqLzqjWMekLC8bjhxc+EuPo9Dygu3mJ2VgRC7XhlFpmdo5NN8J2E7B/CNB3R\n" - "4hOcMMZNZdi0xLtFoTfwU61UPfFX14mV2laqLbvDEfQLJhUTDeFFV8EN5Z4H1ttL\n" - "P3sMXJvc3EvM0JiDVj4l1TWFUHHzeFgCA1Im0lv8i7PFrgW7nyMfK9uDSsUmIp7k\n" - "6ai4tVzwkTmV5PsriP1ju88Lo3MB4/sUmDv/JmlZ9YyzTO3Po8Uz3Aeq9HJWyBWH\n" - "AQIDAQAB\n" - "-----END PUBLIC KEY-----" - ) - - hello_world = b"hello, world" - - hello_world_sig = ( - b"\x63\xa0\x70\xd2\xe4\xd4\x6b\x8a\xa2\x59\x27\x5f\x00\x69" - b"\x1e\x3c\x50\xed\x50\x13\x09\x80\xe3\x47\x4e\x14\xb5\x7c" - b"\x07\x26\x4e\x20\x74\xea\x0e\xf8\xda\xff\x1e\x57\x8c\x67" - b"\x76\x73\xaa\xea\x0f\x0a\xe7\xa2\xe3\x88\xfc\x09\x87\x36" - b"\x01\x3a\xb7\x4c\x40\xe0\xf4\x54\xc5\xf1\xaa\xb2\x1d\x7f" - b"\xb6\xd3\xa8\xdd\x28\x69\x8b\x88\xe4\x42\x1e\x48\x3e\x1f" - b"\xe2\x2b\x3c\x7c\x85\x11\xe9\x59\xd7\xf3\xc2\x21\xd3\x55" - b"\xcb\x9c\x3c\x93\xcc\x20\xdf\x64\x81\xd0\x0d\xbf\x8e\x8d" - b"\x47\xec\x1d\x9e\x27\xec\x12\xed\x8b\x5f\xd6\x1d\xec\x8d" - b"\x77\x5a\x58\x8a\x24\xb6\x0f\x12\xb7\x51\xef\x7d\x85\x0f" - b"\x49\x39\x02\x81\x15\x08\x70\xd6\xe0\x0b\x31\xff\x5f\xf9" - b"\xd1\x92\x38\x59\x8c\x22\x9c\xbb\xbf\xcf\x85\x34\xe2\x47" - b"\xf5\xe2\xaa\xb4\x62\x33\x3c\x13\x78\x33\x87\x08\x9e\xb5" - b"\xbc\x5d\xc1\xbf\x79\x7c\xfa\x5f\x06\x6a\x3b\x17\x40\x09" - b"\xb9\x09\xbf\x32\xc3\x00\xe2\xbc\x91\x77\x14\xa5\x23\xf5" - b"\xf5\xf1\x09\x12\x38\xda\x3b\x6a\x82\x81\x7b\x5e\x1c\xcb" - b"\xaa\x36\x9b\x08\x36\x03\x14\x96\xa3\x31\x39\x59\x16\x75" - b"\xc9\xb6\x66\x94\x1b\x97\xff\xc8\xa1\xe3\x21\x35\x23\x06" - b"\x4c\x9b\xf4\xee" - ) - - def test_signer(self): - with self.assertRaises(ValueError): - signer = RSAX931Signer("bogus key data") - with self.assertRaises(ValueError): - signer = RSAX931Signer(RSAX931Test.pubkey_data) - - signer = RSAX931Signer(RSAX931Test.privkey_data) - with self.assertRaises(ValueError): - signer.sign("x" * 255) # message too long - - sig = signer.sign(RSAX931Test.hello_world) - self.assertEqual(RSAX931Test.hello_world_sig, sig) - - def test_verifier(self): - with self.assertRaises(ValueError): - verifier = RSAX931Verifier("bogus key data") - with self.assertRaises(ValueError): - verifier = RSAX931Verifier(RSAX931Test.privkey_data) - - verifier = RSAX931Verifier(RSAX931Test.pubkey_data) - with self.assertRaises(ValueError): - verifier.verify("") - with self.assertRaises(ValueError): - verifier.verify(RSAX931Test.hello_world_sig + b"junk") - - msg = verifier.verify(RSAX931Test.hello_world_sig) - self.assertEqual(RSAX931Test.hello_world, msg) - - @pytest.mark.skip_unless_on_windows - def test_find_libcrypto_win32(self): - """ - Test _find_libcrypto on Windows hosts. - """ - lib_path = _find_libcrypto() - self.assertIn("libcrypto", lib_path) - - @pytest.mark.skip_unless_on_smartos - def test_find_libcrypto_smartos(self): - """ - Test _find_libcrypto on a SmartOS host. - """ - lib_path = _find_libcrypto() - self.assertTrue( - fnmatch.fnmatch( - lib_path, os.path.join(os.path.dirname(sys.executable), "libcrypto*") - ) - ) - - @pytest.mark.skip_unless_on_sunos - def test_find_libcrypto_sunos(self): - """ - Test _find_libcrypto on a Solaris-like host. - """ - lib_path = _find_libcrypto() - passed = False - for i in ("/opt/local/lib/libcrypto.so*", "/opt/tools/lib/libcrypto.so*"): - if fnmatch.fnmatch(lib_path, i): - passed = True - break - self.assertTrue(passed) - - @pytest.mark.skip_unless_on_aix - def test_find_libcrypto_aix(self): - """ - Test _find_libcrypto on an IBM AIX host. - """ - lib_path = _find_libcrypto() - if os.path.isdir("/opt/salt/lib"): - self.assertTrue(fnmatch.fnmatch(lib_path, "/opt/salt/lib/libcrypto.so*")) - else: - self.assertTrue( - fnmatch.fnmatch(lib_path, "/opt/freeware/lib/libcrypto.so*") - ) - - def test_find_libcrypto_with_system_before_catalina(self): - """ - Test _find_libcrypto on a pre-Catalina macOS host by simulating not - finding any other libcryptos and verifying that it defaults to system. - """ - with patch.object(salt.utils.platform, "is_darwin", lambda: True), patch.object( - platform, "mac_ver", lambda: ("10.14.2", (), "") - ), patch.object(glob, "glob", lambda _: []), patch.object( - sys, "platform", "macosx" - ): - lib_path = _find_libcrypto() - self.assertEqual(lib_path, "/usr/lib/libcrypto.dylib") - - def test_find_libcrypto_darwin_catalina(self): - """ - Test _find_libcrypto on a macOS Catalina host where there are no custom - libcryptos and defaulting to the versioned system libraries. - """ - available = [ - "/usr/lib/libcrypto.0.9.7.dylib", - "/usr/lib/libcrypto.0.9.8.dylib", - "/usr/lib/libcrypto.35.dylib", - "/usr/lib/libcrypto.41.dylib", - "/usr/lib/libcrypto.42.dylib", - "/usr/lib/libcrypto.44.dylib", - "/usr/lib/libcrypto.dylib", - ] - - def test_glob(pattern): - return [lib for lib in available if fnmatch.fnmatch(lib, pattern)] - - with patch.object(salt.utils.platform, "is_darwin", lambda: True), patch.object( - platform, "mac_ver", lambda: ("10.15.2", (), "") - ), patch.object(sys, "platform", "macosx"), patch.object( - glob, "glob", test_glob - ): - lib_path = _find_libcrypto() - self.assertEqual("/usr/lib/libcrypto.44.dylib", lib_path) - - def test_find_libcrypto_darwin_bigsur_packaged(self): - """ - Test _find_libcrypto on a Darwin-like macOS host where there isn't a - lacation returned by ctypes.util.find_library() and the libcrypto - installation comes from a package manager (ports, brew, salt). - """ - managed_paths = { - "salt": "/opt/salt/lib/libcrypto.dylib", - "brew": "/test/homebrew/prefix/opt/openssl/lib/libcrypto.dylib", - "port": "/opt/local/lib/libcrypto.dylib", - } - - saved_getenv = os.getenv - - def mock_getenv(env): - def test_getenv(var, default=None): - return env.get(var, saved_getenv(var, default)) - - return test_getenv - - def mock_glob(expected_lib): - def test_glob(pattern): - if fnmatch.fnmatch(expected_lib, pattern): - return [expected_lib] - return [] - - return test_glob - - with patch.object(salt.utils.platform, "is_darwin", lambda: True), patch.object( - platform, "mac_ver", lambda: ("11.2.2", (), "") - ), patch.object(sys, "platform", "macosx"): - for package_manager, expected_lib in managed_paths.items(): - if package_manager == "brew": - env = {"HOMEBREW_PREFIX": "/test/homebrew/prefix"} - else: - env = {"HOMEBREW_PREFIX": ""} - with patch.object(os, "getenv", mock_getenv(env)): - with patch.object(glob, "glob", mock_glob(expected_lib)): - lib_path = _find_libcrypto() - - self.assertEqual(expected_lib, lib_path) - - # On Big Sur, there's nothing else to fall back on. - with patch.object(glob, "glob", lambda _: []): - with self.assertRaises(OSError): - lib_path = _find_libcrypto() - - def test_find_libcrypto_unsupported(self): - """ - Ensure that _find_libcrypto works correctly on an unsupported host OS. - """ - with patch.object(ctypes.util, "find_library", lambda a: None), patch.object( - glob, "glob", lambda a: [] - ), patch.object(sys, "platform", "unknown"), patch.object( - salt.utils.platform, "is_darwin", lambda: False - ), self.assertRaises( - OSError - ): - _find_libcrypto() - - def test_load_libcrypto(self): - """ - Test _load_libcrypto generically. - """ - lib = _load_libcrypto() - self.assertTrue(isinstance(lib, ctypes.CDLL)) - # Try to cover both pre and post OpenSSL 1.1. - self.assertTrue( - hasattr(lib, "OpenSSL_version_num") - or hasattr(lib, "OPENSSL_init_crypto") - or hasattr(lib, "OPENSSL_no_config") - ) - - def test_find_libcrypto_darwin_onedir(self): - """ - Test _find_libcrypto on a macOS - libcryptos and defaulting to the versioned system libraries. - """ - available = [ - "/usr/lib/libcrypto.0.9.7.dylib", - "/usr/lib/libcrypto.0.9.8.dylib", - "/usr/lib/libcrypto.35.dylib", - "/usr/lib/libcrypto.41.dylib", - "/usr/lib/libcrypto.42.dylib", - "/usr/lib/libcrypto.44.dylib", - "/test/homebrew/prefix/opt/openssl/lib/libcrypto.dylib", - "/opt/local/lib/libcrypto.dylib", - "lib/libcrypto.dylib", - ] - - def test_glob(pattern): - return [lib for lib in available if fnmatch.fnmatch(lib, pattern)] - - with patch.object(glob, "glob", test_glob), patch.object( - salt.utils.platform, "is_darwin", lambda: True - ), patch.object(platform, "mac_ver", lambda: ("10.15.2", (), "")), patch.object( - sys, "platform", "macosx" - ): - lib_path = _find_libcrypto() - self.assertEqual("lib/libcrypto.dylib", lib_path) From b49eb8402771c2a5b9aa37e4afba7b1736d9fb03 Mon Sep 17 00:00:00 2001 From: "Gareth J. Greenaway" Date: Mon, 31 Jul 2023 11:41:34 -0700 Subject: [PATCH 285/393] removing comment --- tests/pytests/unit/utils/test_rsax931.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/pytests/unit/utils/test_rsax931.py b/tests/pytests/unit/utils/test_rsax931.py index 75d176d7020..a1c81e653f8 100644 --- a/tests/pytests/unit/utils/test_rsax931.py +++ b/tests/pytests/unit/utils/test_rsax931.py @@ -13,8 +13,6 @@ import sys import pytest import salt.utils.platform - -# salt libs from salt.utils.rsax931 import ( RSAX931Signer, RSAX931Verifier, From 34e3f90035894568111497e5701ca9214abae848 Mon Sep 17 00:00:00 2001 From: Megan Wilhite Date: Fri, 9 Jun 2023 12:22:04 -0600 Subject: [PATCH 286/393] Add Salt package type to versions report and grain --- changelog/62589.added.md | 1 + changelog/62961.added.md | 1 + doc/ref/grains/all/index.rst | 1 + doc/ref/grains/all/salt.grains.package.rst | 5 ++ salt/grains/package.py | 25 ++++++++ salt/modules/pip.py | 59 ++++++++----------- salt/utils/package.py | 11 ++++ salt/version.py | 13 ++++ tests/pytests/functional/cli/test_salt.py | 8 ++- .../pytests/functional/modules/test_grains.py | 24 ++++++++ tests/pytests/unit/grains/test_package.py | 14 +++++ tests/pytests/unit/utils/test_package.py | 11 ++++ 12 files changed, 136 insertions(+), 37 deletions(-) create mode 100644 changelog/62589.added.md create mode 100644 changelog/62961.added.md create mode 100644 doc/ref/grains/all/salt.grains.package.rst create mode 100644 salt/grains/package.py create mode 100644 salt/utils/package.py create mode 100644 tests/pytests/functional/modules/test_grains.py create mode 100644 tests/pytests/unit/grains/test_package.py create mode 100644 tests/pytests/unit/utils/test_package.py diff --git a/changelog/62589.added.md b/changelog/62589.added.md new file mode 100644 index 00000000000..f7785c3d17f --- /dev/null +++ b/changelog/62589.added.md @@ -0,0 +1 @@ +Added new grain to detect the Salt package type: system or onedir diff --git a/changelog/62961.added.md b/changelog/62961.added.md new file mode 100644 index 00000000000..7f635dbb734 --- /dev/null +++ b/changelog/62961.added.md @@ -0,0 +1 @@ +Add salt package type information. Either system or onedir. diff --git a/doc/ref/grains/all/index.rst b/doc/ref/grains/all/index.rst index 80ee46f7189..15cad059532 100644 --- a/doc/ref/grains/all/index.rst +++ b/doc/ref/grains/all/index.rst @@ -31,6 +31,7 @@ grains modules nvme nxos opts + package panos pending_reboot philips_hue diff --git a/doc/ref/grains/all/salt.grains.package.rst b/doc/ref/grains/all/salt.grains.package.rst new file mode 100644 index 00000000000..7a56421ec6b --- /dev/null +++ b/doc/ref/grains/all/salt.grains.package.rst @@ -0,0 +1,5 @@ +salt.grains.package +=================== + +.. automodule:: salt.grains.package + :members: diff --git a/salt/grains/package.py b/salt/grains/package.py new file mode 100644 index 00000000000..be44fb5c3ce --- /dev/null +++ b/salt/grains/package.py @@ -0,0 +1,25 @@ +""" +Grains for detecting what type of package Salt is using + +.. versionadded:: 3007.0 +""" +import logging + +import salt.utils.package + +log = logging.getLogger(__name__) + + +__virtualname__ = "package" + + +def __virtual__(): + return __virtualname__ + + +def package(): + """ + Function to determine if the user is currently using + onedir package or system level package of Salt. + """ + return {"package": salt.utils.package.pkg_type()} diff --git a/salt/modules/pip.py b/salt/modules/pip.py index c4de0c29846..faa52ef030f 100644 --- a/salt/modules/pip.py +++ b/salt/modules/pip.py @@ -90,6 +90,7 @@ import salt.utils.data import salt.utils.files import salt.utils.json import salt.utils.locales +import salt.utils.package import salt.utils.platform import salt.utils.stringutils import salt.utils.url @@ -136,7 +137,7 @@ def _clear_context(bin_env=None): """ contextkey = "pip.version" if bin_env is not None: - contextkey = "{}.{}".format(contextkey, bin_env) + contextkey = f"{contextkey}.{bin_env}" __context__.pop(contextkey, None) @@ -144,7 +145,7 @@ def _check_bundled(): """ Gather run-time information to indicate if we are running from source or bundled. """ - if hasattr(sys, "RELENV"): + if salt.utils.package.type() == "onedir": return True return False @@ -189,7 +190,7 @@ def _get_pip_bin(bin_env): bin_path, ) raise CommandNotFoundError( - "Could not find a pip binary in virtualenv {}".format(bin_env) + f"Could not find a pip binary in virtualenv {bin_env}" ) # bin_env is the python or pip binary @@ -201,12 +202,10 @@ def _get_pip_bin(bin_env): # We have been passed a pip binary, use the pip binary. return [os.path.normpath(bin_env)] - raise CommandExecutionError( - "Could not find a pip binary within {}".format(bin_env) - ) + raise CommandExecutionError(f"Could not find a pip binary within {bin_env}") else: raise CommandNotFoundError( - "Access denied to {}, could not find a pip binary".format(bin_env) + f"Access denied to {bin_env}, could not find a pip binary" ) @@ -412,9 +411,7 @@ def _format_env_vars(env_vars): val = str(val) ret[key] = val else: - raise CommandExecutionError( - "env_vars {} is not a dictionary".format(env_vars) - ) + raise CommandExecutionError(f"env_vars {env_vars} is not a dictionary") return ret @@ -464,7 +461,7 @@ def install( cache_dir=None, no_binary=None, disable_version_check=False, - **kwargs + **kwargs, ): """ Install packages with pip @@ -757,9 +754,9 @@ def install( if log: if os.path.isdir(log): - raise OSError("'{}' is a directory. Use --log path_to_file".format(log)) + raise OSError(f"'{log}' is a directory. Use --log path_to_file") elif not os.access(log, os.W_OK): - raise OSError("'{}' is not writeable".format(log)) + raise OSError(f"'{log}' is not writeable") cmd.extend(["--log", log]) @@ -784,9 +781,7 @@ def install( raise ValueError("Timeout cannot be a float") int(timeout) except ValueError: - raise ValueError( - "'{}' is not a valid timeout, must be an integer".format(timeout) - ) + raise ValueError(f"'{timeout}' is not a valid timeout, must be an integer") cmd.extend(["--timeout", timeout]) if find_links: @@ -797,9 +792,7 @@ def install( if not ( salt.utils.url.validate(link, VALID_PROTOS) or os.path.exists(link) ): - raise CommandExecutionError( - "'{}' is not a valid URL or path".format(link) - ) + raise CommandExecutionError(f"'{link}' is not a valid URL or path") cmd.extend(["--find-links", link]) if no_index and (index_url or extra_index_url): @@ -809,14 +802,12 @@ def install( if index_url: if not salt.utils.url.validate(index_url, VALID_PROTOS): - raise CommandExecutionError("'{}' is not a valid URL".format(index_url)) + raise CommandExecutionError(f"'{index_url}' is not a valid URL") cmd.extend(["--index-url", index_url]) if extra_index_url: if not salt.utils.url.validate(extra_index_url, VALID_PROTOS): - raise CommandExecutionError( - "'{}' is not a valid URL".format(extra_index_url) - ) + raise CommandExecutionError(f"'{extra_index_url}' is not a valid URL") cmd.extend(["--extra-index-url", extra_index_url]) if no_index: @@ -836,7 +827,7 @@ def install( cmd.append("--use-mirrors") for mirror in mirrors: if not mirror.startswith("http://"): - raise CommandExecutionError("'{}' is not a valid URL".format(mirror)) + raise CommandExecutionError(f"'{mirror}' is not a valid URL") cmd.extend(["--mirrors", mirror]) if disable_version_check: @@ -994,7 +985,7 @@ def install( # Don't allow any recursion into keyword arg definitions # Don't allow multiple definitions of a keyword if isinstance(val, (dict, list)): - raise TypeError("Too many levels in: {}".format(key)) + raise TypeError(f"Too many levels in: {key}") # This is a a normal one-to-one keyword argument cmd.extend([key, val]) # It is a positional argument, append it to the list @@ -1107,7 +1098,7 @@ def uninstall( # TODO make this check if writeable os.path.exists(log) except OSError: - raise OSError("'{}' is not writeable".format(log)) + raise OSError(f"'{log}' is not writeable") cmd.extend(["--log", log]) @@ -1132,9 +1123,7 @@ def uninstall( raise ValueError("Timeout cannot be a float") int(timeout) except ValueError: - raise ValueError( - "'{}' is not a valid timeout, must be an integer".format(timeout) - ) + raise ValueError(f"'{timeout}' is not a valid timeout, must be an integer") cmd.extend(["--timeout", timeout]) if pkgs: @@ -1336,7 +1325,7 @@ def list_(prefix=None, bin_env=None, user=None, cwd=None, env_vars=None, **kwarg user=user, cwd=cwd, env_vars=env_vars, - **kwargs + **kwargs, ) cmd = _get_pip_bin(bin_env) @@ -1394,7 +1383,7 @@ def version(bin_env=None, cwd=None, user=None): cwd = _pip_bin_env(cwd, bin_env) contextkey = "pip.version" if bin_env is not None: - contextkey = "{}.{}".format(contextkey, bin_env) + contextkey = f"{contextkey}.{bin_env}" if contextkey in __context__: return __context__[contextkey] @@ -1650,14 +1639,12 @@ def list_all_versions( if index_url: if not salt.utils.url.validate(index_url, VALID_PROTOS): - raise CommandExecutionError("'{}' is not a valid URL".format(index_url)) + raise CommandExecutionError(f"'{index_url}' is not a valid URL") cmd.extend(["--index-url", index_url]) if extra_index_url: if not salt.utils.url.validate(extra_index_url, VALID_PROTOS): - raise CommandExecutionError( - "'{}' is not a valid URL".format(extra_index_url) - ) + raise CommandExecutionError(f"'{extra_index_url}' is not a valid URL") cmd.extend(["--extra-index-url", extra_index_url]) # Is the `pip index` command available @@ -1669,7 +1656,7 @@ def list_all_versions( if salt.utils.versions.compare(ver1=pip_version, oper=">=", ver2="20.3"): cmd.append("--use-deprecated=legacy-resolver") regex = re.compile(r"\s*Could not find a version.* \(from versions: (.*)\)") - cmd.extend(["install", "{}==versions".format(pkg)]) + cmd.extend(["install", f"{pkg}==versions"]) cmd_kwargs = dict( cwd=cwd, runas=user, output_loglevel="quiet", redirect_stderr=True diff --git a/salt/utils/package.py b/salt/utils/package.py new file mode 100644 index 00000000000..4e76c88e46a --- /dev/null +++ b/salt/utils/package.py @@ -0,0 +1,11 @@ +import sys + + +def pkg_type(): + """ + Gather run-time information to indicate if we are running from onedir or . + """ + if hasattr(sys, "RELENV"): + return "onedir" + else: + return "system" diff --git a/salt/version.py b/salt/version.py index e174d8bfb1f..e37bf4eeea6 100644 --- a/salt/version.py +++ b/salt/version.py @@ -685,6 +685,16 @@ def salt_information(): yield "Salt", __version__ +def package_information(): + + """ + Report package type + """ + import salt.utils.package + + yield "Package Type", salt.utils.package.pkg_type() + + def dependency_information(include_salt_cloud=False): """ Report versions of library dependencies. @@ -867,12 +877,14 @@ def versions_information(include_salt_cloud=False, include_extensions=True): salt_info = list(salt_information()) lib_info = list(dependency_information(include_salt_cloud)) sys_info = list(system_information()) + package_info = list(package_information()) info = { "Salt Version": dict(salt_info), "Python Version": dict(py_info), "Dependency Versions": dict(lib_info), "System Versions": dict(sys_info), + "Salt Package Information": dict(package_info), } if include_extensions: extensions_info = extensions_information() @@ -905,6 +917,7 @@ def versions_report(include_salt_cloud=False, include_extensions=True): "Python Version", "Dependency Versions", "Salt Extensions", + "Salt Package Information", "System Versions", ): if ver_type == "Salt Extensions" and ver_type not in ver_info: diff --git a/tests/pytests/functional/cli/test_salt.py b/tests/pytests/functional/cli/test_salt.py index acd820a17c0..03bae43a46c 100644 --- a/tests/pytests/functional/cli/test_salt.py +++ b/tests/pytests/functional/cli/test_salt.py @@ -1,6 +1,7 @@ import logging import os import shutil +import sys import pytest @@ -56,7 +57,7 @@ def test_versions_report(salt_cli): ret_lines = [line.strip() for line in ret_lines] for header in expected: - assert "{}:".format(header) in ret_lines + assert f"{header}:" in ret_lines ret_dict = {} expected_keys = set() @@ -80,6 +81,11 @@ def test_versions_report(salt_cli): assert key in expected_keys expected_keys.remove(key) assert not expected_keys + if hasattr(sys, "RELENV"): + assert "onedir" in ret_dict["Salt Package Information"]["Package Type"] + else: + assert "system" in ret_dict["Salt Package Information"]["Package Type"] + if os.environ.get("ONEDIR_TESTRUN", "0") == "0": # Stop any more testing return diff --git a/tests/pytests/functional/modules/test_grains.py b/tests/pytests/functional/modules/test_grains.py new file mode 100644 index 00000000000..5992b866eac --- /dev/null +++ b/tests/pytests/functional/modules/test_grains.py @@ -0,0 +1,24 @@ +import sys + +import pytest + + +@pytest.fixture(scope="module") +def grains(modules): + return modules.grains + + +def test_grains_items(grains): + """ + Test running grains.items and assert + certain information is included in + the return + """ + ret = grains.items() + if hasattr(sys, "RELENV"): + assert ret["package"] == "onedir" + else: + assert ret["package"] == "system" + + for key in ["num_cpus", "cpu_model", "os_family"]: + assert key in ret.keys() diff --git a/tests/pytests/unit/grains/test_package.py b/tests/pytests/unit/grains/test_package.py new file mode 100644 index 00000000000..62973b799b9 --- /dev/null +++ b/tests/pytests/unit/grains/test_package.py @@ -0,0 +1,14 @@ +import sys + +import salt.grains.package + + +def test_grain_package_type(tmp_path): + """ + Test grains.package_type for both package types + """ + ret = salt.grains.package.package()["package"] + if hasattr(sys, "RELENV"): + assert ret == "onedir" + else: + assert ret == "system" diff --git a/tests/pytests/unit/utils/test_package.py b/tests/pytests/unit/utils/test_package.py new file mode 100644 index 00000000000..7edca9806c2 --- /dev/null +++ b/tests/pytests/unit/utils/test_package.py @@ -0,0 +1,11 @@ +import sys + +import salt.utils.package + + +def test_pkg_type(): + ret = salt.utils.package.pkg_type() + if hasattr(sys, "RELENV"): + assert ret == "onedir" + else: + assert ret == "system" From e01ceb52844e1454b62ff1861b64f198f80025e7 Mon Sep 17 00:00:00 2001 From: Megan Wilhite Date: Tue, 13 Jun 2023 13:24:32 -0600 Subject: [PATCH 287/393] Use _pkg.txt file for package grain --- _pkg.txt | 1 + changelog/62589.added.md | 2 +- changelog/62961.added.md | 2 +- doc/topics/packaging/index.rst | 7 +++++ .../releases/templates/3007.0.md.template | 5 ++++ pkg/tests/integration/test_salt_grains.py | 9 +++++++ salt/grains/package.py | 2 +- salt/modules/pip.py | 2 +- salt/utils/package.py | 26 +++++++++++++++---- tests/pytests/functional/cli/test_salt.py | 7 ++--- .../pytests/functional/modules/test_grains.py | 8 +++--- tests/pytests/unit/grains/test_package.py | 8 +++--- tests/pytests/unit/utils/test_package.py | 4 +-- tools/pkg/build.py | 4 +++ 14 files changed, 63 insertions(+), 24 deletions(-) create mode 100644 _pkg.txt diff --git a/_pkg.txt b/_pkg.txt new file mode 100644 index 00000000000..a1b589e38a3 --- /dev/null +++ b/_pkg.txt @@ -0,0 +1 @@ +pip diff --git a/changelog/62589.added.md b/changelog/62589.added.md index f7785c3d17f..2d4dcb0116e 100644 --- a/changelog/62589.added.md +++ b/changelog/62589.added.md @@ -1 +1 @@ -Added new grain to detect the Salt package type: system or onedir +Added new grain to detect the Salt package type: onedir, pip or system diff --git a/changelog/62961.added.md b/changelog/62961.added.md index 7f635dbb734..bb33cbdd766 100644 --- a/changelog/62961.added.md +++ b/changelog/62961.added.md @@ -1 +1 @@ -Add salt package type information. Either system or onedir. +Add salt package type information. Either onedir, pip or system. diff --git a/doc/topics/packaging/index.rst b/doc/topics/packaging/index.rst index 58ac77b4f9f..42ae598f30e 100644 --- a/doc/topics/packaging/index.rst +++ b/doc/topics/packaging/index.rst @@ -16,6 +16,13 @@ Docker Containers The Salt Project uses docker containers to build our deb and rpm packages. If you are building your own packages you can use the same containers we build with in the Github piplines. These containers are documented `here `_. +Package Grain +============= +In the 3007.0 release a new package grain was added. This detects how Salt was installed using the `_pkg.txt` +in the root of the Salt repo. By default this is set to ``pip``, but it is set to ``onedir`` when ``tools pkg build salt-onedir`` +is run in our pipelines when building our onedir packages. If you are building your own custom packages, please ensure you set +``_pkg.txt`` contents to be the type of package you are creating. The options are ``pip``, ``onedir`` or ``system``. + How to build onedir only ======================== diff --git a/doc/topics/releases/templates/3007.0.md.template b/doc/topics/releases/templates/3007.0.md.template index 1230db548a1..9b1043c9a44 100644 --- a/doc/topics/releases/templates/3007.0.md.template +++ b/doc/topics/releases/templates/3007.0.md.template @@ -16,6 +16,11 @@ Support for python 3.7 has been dropped since it reached end-of-line in 27 Jun 2 Starting from Salt version 3007.0, the Azure functionality previously available in the Salt code base is fully removed. To continue using Salt's features for interacting with Azure resources, users are required to utilize the Azure Salt extension. For more information, refer to the [Azure Salt Extension GitHub repository](https://github.com/salt-extensions/saltext-azurerm). +## New Package Grain +A new ``package`` grain was added in 3007.0 This detects how Salt was installed using the ``_pkg.txt`` in the root of +the directory. If you are building packages of Salt you need to ensure this file is set to the correct package type +that you are building. The options are ``pip``, ``onedir``, or ``system``. By default this file is already set to ``pip``. +