Coder Social home page Coder Social logo

Comments (3)

selfuryon avatar selfuryon commented on June 19, 2024

I think that the problem is in IOS-XR prompt because it doesn't like "hostname<delimeter>". I never tested netdev on IOS-XR, but it's not difficult for me. I will try to add IOS-XR support this weekend :) I will add information about it here

from netdev.

selfuryon avatar selfuryon commented on June 19, 2024

@dhanakane I have tested IOS XR with IOS class - it works fine (but I mention about send_config_set - it doesn't make commit so you need to make it by hand. I will implement it in new IOS XR Class soon). In your case you made this:

RP/0/0/CPU0:ios#show run interface loopback0
Sat Nov  4 12:22:41.504 YEKAT
% No such configuration item(s)

RP/0/0/CPU0:ios#exit
<--- No more information (and prompt too) in buffer here because of you close session. 
Connection to 10.1.64.100 closed by remote host.
Connection to 10.1.64.100 closed.

As you see you made exit and close connection by hand but you don't need it - netdev make it himself: your session automatically will be closed after exiting async context manager (async with *** as ***). The reason of problem is that nedev doesn't check that session alive or not in reading. It only reads buffer from the connection. But asyncssh allows to reading it without any exception (don't know why I will research it)

And the other thing: if you want to test exactly applying configuration you should use send_config_set instead of send_command (but you can use and send_command too but in this case, you need manually enter and exit to configuration mode). It will be like this:

# Testing sending configuration set
commands = ["line console 0", "exit"]
out = await ios.send_config_set(commands)
RP/0/0/CPU0:ios#show run interface loopback0
Sat Nov  4 12:32:45.852 YEKAT
% No such configuration item(s)

RP/0/0/CPU0:ios#conf t   <------ automatically enter to config mode
Sat Nov  4 12:32:55.662 YEKAT
RP/0/0/CPU0:ios(config)#line console 0
RP/0/0/CPU0:ios(config-line)#exit
RP/0/0/CPU0:ios(config)#end    <------- automatically exit from config mode
RP/0/0/CPU0:ios#

Command send_config_set automatically enters to configuration mode and after applying command exits from it (but without commiting right now).

from netdev.

selfuryon avatar selfuryon commented on June 19, 2024

I added some support for IOS XR (adding with_commit parameter for IOX XR send_config_set. We can see example for IOS XR in example folder) at 2d413d0. You can use now device_type "cisco_xr" for IOS XR.

from netdev.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.