Trying to pass cwd to unless fails on windows #58790
Labels
Bug
broken, incorrect, or confusing behavior
Confirmed
Salt engineer has confirmed bug/feature - often including a MCVE
severity-medium
3rd level, incorrect or bad functionality, confusing and lacks a work around
Windows
Milestone
I am trying to run cmd.run on windows, which relies on cwd, setting it under cmd.run works just fine, however i can't pass it to unless or onlyif no matter what i try.
The error i get is
salt.exceptions.CommandExecutionError: Unable to run command 'keytool -list -keystore "C:\Program Files\Java\jre1.8.0_251\lib\security\cacerts" -storepass changeit -alias eyn3nhupzs' with the context '{'cwd': 'C:\\Program Files\\Java\\jre1.8.0_251\\bin\', 'shell': False, 'env': {'ALLUSERSPROFILE': 'C:\ProgramData', 'APPDATA': 'C:\windows\system32\config\systemprofile\AppData\Roaming', 'CommonProgramFiles': 'C:\Program Files\Common Files', 'CommonProgramFiles(x86)': 'C:\Program Files (x86)\Common Files', 'CommonProgramW6432': 'C:\Program Files\Common Files', 'COMPUTERNAME': 'java-test', 'ComSpec': 'C:\windows\system32\cmd.exe', 'FP_NO_HOST_CHECK': 'NO', 'LOCALAPPDATA': 'C:\windows\system32\config\systemprofile\AppData\Local', 'NUMBER_OF_PROCESSORS': '1', 'OS': 'Windows_NT', 'Path': 'C:\windows\system32;C:\windows;C:\windows\System32\Wbem;C:\windows\System32\WindowsPowerShell\v1.0\;c:\salt;', 'PATHEXT': '.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC', 'PROCESSOR_ARCHITECTURE': 'AMD64', 'PROCESSOR_IDENTIFIER': 'Intel64 Family 6 Model 79 Stepping 1, GenuineIntel', 'PROCESSOR_LEVEL': '6', 'PROCESSOR_REVISION': '4f01', 'ProgramData': 'C:\ProgramData', 'ProgramFiles': 'C:\Program Files', 'ProgramFiles(x86)': 'C:\Program Files (x86)', 'ProgramW6432': 'C:\Program Files', 'PSModulePath': 'C:\windows\system32\WindowsPowerShell\v1.0\Modules\', 'PUBLIC': 'C:\Users\Public', 'SystemDrive': 'C:', 'SystemRoot': 'C:\windows', 'TEMP': 'C:\windows\TEMP', 'TMP': 'C:\windows\TEMP', 'USERDOMAIN': 'WORKGROUP', 'USERNAME': 'java-test$', 'USERPROFILE': 'C:\windows\system32\config\systemprofile', 'windir': 'C:\windows'}, 'stdin': None, 'stdout': -1, 'stderr': -2, 'with_communicate': True, 'timeout': None, 'bg': False}', reason: [WinError 2] The system cannot find the file specified
The text was updated successfully, but these errors were encountered: