View Single Post
  #4  
Old 12-05-2017, 12:04 PM
bgagnon bgagnon is offline
VanDyke Technical Support
 
Join Date: Oct 2008
Posts: 4,322
Hi Jack,

I am not really sure what you are trying to accomplish with this script. It seems you are making it more complicated than it needs to be.

If this is a true statement:

Quote:
in it i want to replace string STM64-L1 with 10G-L100 then apply configuration to router again as string

And this is the output resulting from your Send() command (at least as much as you are capturing in the x variable):

Code:
#set policy-options policy-statement STM64-L1 term ARI from route-filter 1.1.1.1/32 exact
Then:
  • You cannot split on a comma because there is none in the output:
    Code:
    x.split(",")
  • This seems like it would be a simple replace operation:
Code:
strCommand = x.replace("STM64-L1", "10G-L100")

' Since commands don't typically begin with #, replace it also
strCommand = x.replace("#", "")

Additionally, you should be using \r (which simulates pressing Enter) not \n for the Send() commands.
__________________
Thanks,
--Brenda

VanDyke Software
Technical Support
support@vandyke.com
(505) 332-5730
Reply With Quote