- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
Hit enter after a send_command in python/netmri
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-30-2020 09:56 PM
Hi Team,
I'm trying to write a python script in netmri to copy dap.xml file from ASA to my FTP server but once I issue copy it will ask for multiple prompt (we need just press 'enter' for 4 to 5 times) but I couldn't do this, could you please help? I've tried /r,/n and combination but no luck
# BEGIN-SCRIPT-BLOCK
# Script-Filter:
# true
# END-SCRIPT-BLOCK
from python_helper import send_multiline
from python_helper import init_helper
from pprint import pprint
import re
# initiate API connector
cli = init_helper(api_url, http_username, http_password, job_id, device_id, batch_id)
#get current dap xml file
sh_disk = cli.send_command('sh disk0: | include dap.xml')
#Copy dap file to ftp
#cli.send_command('copy disk0:dap.xml ftp://ftpuser:ftppw@1.1.1.1/VPNDAP_$device_dap.xml\n\n\n')
cli.send_command('\n')
cli.close_session()
Output:
vpn-rnd-1# sh disk0: | include dap.xml
352 59869 Mar 24 2020 04:28:20 dap.xml
290 9468 Jun 21 2018 11:47:16 original_dap.xml
vpn-rnd-1# copy disk0:dap.xml ftp://ftpuser:ftppw@1.1.1.1/VPNDAP_$device_dap.xml
Source filename [dap.xml]?
*** Job Failed Due to Timeout ***
Re: Hit enter after a send_command in python/netmri
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-31-2020 08:20 AM
Change the "\n" to "\r"
Twitter: https://twitter.com/sifbaksh
https://sifbaksh.com