pywinrm icon indicating copy to clipboard operation
pywinrm copied to clipboard

Close run_cmd() 's session as soon as the process starts running on remote machine and start executing the next line

Open salyas0v opened this issue 3 years ago • 1 comments

I'm using the session.run_cmd() to launch a swarm agent on remote machine, the code for which is print("Launching swarm agent") result = sess.run_cmd(f'cd /D D:\\workdir\\utils\\swarm-client && start /max start-swarm-client.bat "{jenkins_config.jenkins_server_url}" {jenkins_config.jenkins_username} {jenkins_config.jenkins_pwd} {name} {vapp_ip_address} -labelsFile={file_path}') print("This part doesn't execute!") Now the command works completely fine and I can see the process running on the remote machine. But on my pc, as long as I don't stop the swarm agent process manually on remote pc, control doesn't go to next line i.e. the line print("This part doesn't execute!") after result. Is there any walkaround to go to the second print when the run_cmd()'s process starts running on remote, start executing the next line after run_cmd(), currently It gets stuck inside of run_cmd() command!

salyas0v avatar Mar 09 '22 06:03 salyas0v

I have the same problem

Wd3Curry30 avatar May 02 '22 16:05 Wd3Curry30