Remove the quotes around r2check.

i.e. the line should be:
r2response = dev.rpc.get_route_information(table='inet.0', destination=r2check)

--Stacy

> On Sep 3, 2018, at 6:33 PM, Jason Taranto <[email protected]> wrote:
> 
> Hi All,
> 
> After a while of my head colliding with the wall beside me, would anyone know 
> how to get a variable into an rpc command via pyez.
> 
> My latest attempt is below.
> 
>  r2check = raw_input("Route to check e.g XXX.XXX.XXX.XXX : ")
>  print ("Checking if route is in the table......")
>  time.sleep(2)
>  r2response = dev.rpc.get_route_information(table='inet.0', 
> destination='r2check')
>  time.sleep(2)
>  
> print("################################################################################")
>  print("                                                                      
>           ")
>  print("                      Response from router below...                   
>           ")
>  print (etree.tostring(r2response))
> 
> 
> The error message I get is:
> jnpr.junos.exception.RpcError: RpcError(severity: error, bad_element: 
> r2check, message: could not resolve name: r2check)
> 
> 
> 
> Thanks in advance,
> Jason
> 
> 
> 
> _______________________________________________
> juniper-nsp mailing list [email protected]
> https://puck.nether.net/mailman/listinfo/juniper-nsp

_______________________________________________
juniper-nsp mailing list [email protected]
https://puck.nether.net/mailman/listinfo/juniper-nsp

Reply via email to