Coder Social home page Coder Social logo

Comments (11)

ravenblue12 avatar ravenblue12 commented on June 12, 2024

send_config_set(<commands, commit=True) is working, but without commit is not wokring!

from netmiko.

ktbyers avatar ktbyers commented on June 12, 2024

I want to look at this behavior on Juniper too.

from netmiko.

ktbyers avatar ktbyers commented on June 12, 2024

This change was merged in...need to decide if this is best way to handle this.

diff cisco_xr_ssh.py ~/netmiko_old/netmiko/netmiko/cisco/cisco_xr_ssh.py
30,48d29
< def exit_config_mode(self, exit_config='end'):
< '''
< First check whether in configuration mode.
<
< If so, exit config mode
< '''
< DEBUG = False
< output = ''
<
< if self.check_config_mode():
< output = self.send_command(exit_config, strip_prompt=False, strip_command=False)
< if "Uncommitted changes found" in output:
< output += self.send_command('yes\n', strip_prompt=False, strip_command=False)
< if DEBUG:
< print output
< if self.check_config_mode():
< raise ValueError("Failed to exit configuration mode")
<
< return output

from netmiko.

supertylerc avatar supertylerc commented on June 12, 2024

Wouldn't this commit the changes and then exit? It seems that the Principle of Least Surprise would suggest abandoning the change. If I wanted to commit the change, I would have a line that says "commit" in it, right?

from netmiko.

ktbyers avatar ktbyers commented on June 12, 2024

Yes, I agree this is a mistake. It should do "no" and probably print a warning.

I will just change the action for now to 'no'.

from netmiko.

ktbyers avatar ktbyers commented on June 12, 2024

Okay, I have changed this action to no.

from netmiko.

supertylerc avatar supertylerc commented on June 12, 2024

I'm not sure if you have access to Juniper devices, but the opposite behavior is necessary with Juniper, which should be easy to handle. Only mentioning this because you noted you wanted to look into the Juniper side as well.

root@bananas> edit
Entering configuration mode
The configuration has been changed but not committed

[edit]
root@bananas# set system host-name apple

[edit]
root@bananas# quit
The configuration has been changed but not committed
Exit with uncommitted changes? [yes,no] (yes) yes

Exiting configuration mode

root@bananas>

from netmiko.

ktbyers avatar ktbyers commented on June 12, 2024

Okay, there is a Juniper specific method so we can change the behavior in
this class.

I want to address the commit/confirm/rollback in a more systematic way for
Juniper and IOS-XR. Hopefully, this week.

Kirk

On Sat, Mar 7, 2015 at 9:18 AM, Tyler Christiansen <[email protected]

wrote:

I'm not sure if you have access to Juniper devices, but the opposite
behavior is necessary with Juniper, which should be easy to handle.

root@bananas> edit
Entering configuration mode
The configuration has been changed but not committed

[edit]
root@bananas# set system host-name apple

[edit]
root@bananas# quit
The configuration has been changed but not committed
Exit with uncommitted changes? yes,no yes

Exiting configuration mode

root@bananas>


Reply to this email directly or view it on GitHub
#34 (comment).

Kirk Byers
CCIE #6243 emeritus
[email protected]
http://pynet.twb-tech.com http://pynet.twb-tech.com/blog
(415) 264-6270
Simplify your network management through automation

from netmiko.

ktbyers avatar ktbyers commented on June 12, 2024

Referencing from master issue #60 (design spec). Leaving this open separately as the current behavior is a bug.

from netmiko.

supertylerc avatar supertylerc commented on June 12, 2024

The Juniper issue was resolved by recent commits.

from netmiko.

ktbyers avatar ktbyers commented on June 12, 2024

Duplicate with issue #88 also see master issue #89 for IOS-XR commit

from netmiko.

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.