Open Gmasquelier opened 1 month ago
Hi there! Welcome to the Salt Community! Thank you for making your first contribution. We have a lengthy process for issues and PRs. Someone from the Core Team will follow up as soon as possible. In the meantime, here’s some information that may help as you continue your Salt journey. Please be sure to review our Code of Conduct. Also, check out some of our community resources including:
There are lots of ways to get involved in our community. Every month, there are around a dozen opportunities to meet with other contributors and the Salt Core team and collaborate in real time. The best way to keep track is by subscribing to the Salt Community Events Calendar. If you have additional questions, email us at saltproject@vmware.com. We’re glad you’ve joined our community and look forward to doing awesome things with you!
it seems related to this recent change:
PS C:\WINDOWS\system32> & {ls /tmp}
ls : Impossible de trouver le chemin d'accès « C:\tmp », car il n'existe pas.
Au caractère Ligne:1 : 5
+ & {ls /tmp}
+ ~~~~~~~
+ CategoryInfo : ObjectNotFound: (C:\tmp:String) [Get-ChildItem], ItemNotFoundException
+ FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetChildItemCommand
PS C:\WINDOWS\system32> echo $?
True
PS C:\WINDOWS\system32> ls /tmp
ls : Impossible de trouver le chemin d'accès « C:\tmp », car il n'existe pas.
Au caractère Ligne:1 : 1
+ ls /tmp
+ ~~~~~~~
+ CategoryInfo : ObjectNotFound: (C:\tmp:String) [Get-ChildItem], ItemNotFoundException
+ FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetChildItemCommand
PS C:\WINDOWS\system32> echo $?
False
PS C:\WINDOWS\system32>
Best regards,
Could you try changing line 293 from this:
new_cmd.extend(["-Command", f"& {{{cmd.strip()}}}"])
to this
new_cmd.extend(["-Command", f'& "{cmd.strip()}"'])
Yes I confirm that this modification correct the issue.
Best regards,
Description
Unless or Onlyif requisite isn't working anymore in 3007.1 with cmd.run and shell powershell.
for example:
Here the unless test is alway true whatever the command we use. If we remove the "shell: powershell" the behavior is working as expected.
Setup
salt-minion 3007.1 on windows 10 Virtual Machine
Steps to Reproduce the behavior
It can be reproduce with the command line
The command "ls /tmp" is False but still the module cmd.retcode is sending back 0.
Expected behavior
It used to work in 3007.0.