Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
salyas0v opened this issue Mar 9, 2022 · 1 comment

Comments

@salyas0v
Copy link

salyas0v commented Mar 9, 2022

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 salyas0v changed the title Close run_cmd() 's session as soon as the process starts running on remote machine Close run_cmd() 's session as soon as the process starts running on remote machine and start executing the next line Mar 9, 2022
@Wd3Curry30
Copy link

I have the same problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants