I have a requirement where I have to run these few commands in the terminal using a python script.The requirement is as such:
ssh abc.xyz.com
After ssh to that machine, ssh to the environment
ssh qa
and then run few commands in the environment
I have tried achieving this using os.system() and using subprocess.call() but no luck.
Specifically, I tried doing this :
import subprocess
from time import sleep
subprocess.call("ssh abc.def.com", shell=True)
subprocess.call("python", shell=True)
sleep(0.3)
subprocess.call("ssh qa", shell=True)