I run the following command in git bash terminal (not the windows command line or mac's terminal).
ssh username@code.companyname.com -p 12356 gerrit query --format=JSON --current-patch-set --files change: 878545
This generates a JSON output when I run it in git bash. I am trying to do the same in Python file using the following:
import subprocess
result = subprocess.run(
[
"ssh",
"-c",
"aes128-cbc", #adds necessary ciphers
"username@code.companyname.com",
"-p",
"12356",
"gerrit",
"query",
"--format=JSON",
"--current-patch-set",
"--files",
"change: ",
"878545",
], stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
shell=True
)
result_process = result.stdout.decode("utf-8")
print(result_process)
But this produced an error: 'ssh' is not recognized as internal or external command, operable program or batch file.
The ssh
works in command line.