Automation Scripts

Reply
Highlighted

Sending async command to wait on file transfer

[ Edited ]
notanexpert
Techie
Posts: 1
2263     0

Hello all,

I'm working on a python script to download a new version of IOS onto devices. The problem I'm running into is that NetMRI will say the command completed as OK while the file transfer is still ongoing. I was looking in the python library and found async command, but I can't get it to work. 

 

 

Is it possible to use this to make NetMRI wait until the device returns some specified text (seconds)?

How do I kill a long running async job? Now I can't run any more scripts on my test device because it says a command is still running?

 

If so, how can I make that work? Here's my command:

 

easy.send_async_command("copy scp://USERSmiley TongueASS@SERVER/{} {}:.format(New_Code_Version,Location_Clean), (360), (""))

 

Any help would be much appreciated!

Re: Sending async command to wait on file transfer

Adviser
Posts: 373
2264     0

You need to use the following

 

import time

 

 

time.sleep(20)

 

 

NetMRI has a builtin as well

 

easy.send_async_command("SLEEP:60")

This will tell it to sleep for 60 seconds 

Follow me on LinkedIn: https://www.linkedin.com/in/sifbaksh
Twitter: https://twitter.com/sifbaksh

Re: Sending async command to wait on file transfer

mikewesterman
Techie
Posts: 1
2264     0

Importing time and setting certain value appeared to be very easy. Thank you!

 

_______________

buyessays.cheap

Showing results for 
Search instead for 
Do you mean 

Recommended for You