- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
Sending async command to wait on file transfer
[ Edited ]- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
04-17-2018 05:43 AM - edited 04-17-2018 07:19 AM
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://USERASS@SERVER/{} {}:.format(New_Code_Version,Location_Clean), (360), (""))
Any help would be much appreciated!
Re: Sending async command to wait on file transfer
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
04-18-2018 10:03 AM
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
Twitter: https://twitter.com/sifbaksh
Re: Sending async command to wait on file transfer
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
11-18-2018 11:21 PM
Importing time and setting certain value appeared to be very easy. Thank you!
_______________