Coder Social home page Coder Social logo

Comments (11)

ktbyers avatar ktbyers commented on June 12, 2024

Other references issues, issue #57 (commit confirm).

See issue #34 for reference to messages for uncommited changed.

See issue #8 (IOS-XR rollback)

See issue #7 Commit on IOS-XR

from netmiko.

supertylerc avatar supertylerc commented on June 12, 2024

There is also an IOS XR and Junos configure exclusive to lock the candidate config from other users.

from netmiko.

ktbyers avatar ktbyers commented on June 12, 2024

commit() is currently a separate method both for Juniper and IOS-XR.

For Juniper it has a delay_factor attribute which defaults to 10 (give sufficient time for commit to complete.

It is also used by send_config_set(). Note, send_config_set() has no way to modify the delay_factor.

IOS-XR currently has no delay_factor.

from netmiko.

ktbyers avatar ktbyers commented on June 12, 2024

commit() method parameters should have:

JUNIPER

delay_factor (integer)
confirm (boolean)
confirm_delay (how many minutes to wait for confirm, defaults to 10) -- need to verify what default is for IOX-XR
check (boolean), defaults to False, has precedence over confirm (i.e. if check = True) then confirm is N/A.
comment Message to commit log

Do we need 'commit at ?' -- I would say probably not as a person could always manually do something via send_command(), if needed (open to discussion on this)

Should send_config_set() explicitly support commit() calling or should these be separate actions (send_config_set() and then commit() ). If send_config_set() calls commit() then commit arguments must be able to be passed into send_config_set.

from netmiko.

supertylerc avatar supertylerc commented on June 12, 2024

I think send_config_set() should not call commit(). "Do one thing and do it well." IMHO (and feel free to disagree since you're the creator/maintainer :)), this should be a framework around which solutions are built. Trying to do too much magic overcomplicates said framework and potentially reduces its flexibility for building tools.

from netmiko.

supertylerc avatar supertylerc commented on June 12, 2024

Also, one issue to be aware of is what happens if someone calls it like this:

commit(delay_factor=10, confirm_delay=5)

confirm will need to be set to True any time confirm_delay is used but check is not. Which means confirm_delay cannot have a default value (it must be None), or it will automatically set confirm = True. There are a few possibilities. One is to remove confirm, default confirm_delay to None, and use if confirm_delay is not None: to flip the bit on confirm. The other option is to continue to use confirm and confirm_delay in the method parameters, and raise an exception whenever confirm_delay != 10 and confirm = False.

from netmiko.

ktbyers avatar ktbyers commented on June 12, 2024

I agree on the send_config_set(), commit should not be a part of this. Besides your "do one thing well statement" which I agree with. It also will really complicate the passing of arguments for commit.

from netmiko.

ktbyers avatar ktbyers commented on June 12, 2024

commit(delay_factor=10, confirm_delay=5) --> should generate an exception

So confirm_delay will need to default to None (good point on this). We can then use the platform's default confirm_delay (i.e. only pass in a confirm_delay if the end-user specified an argument). This is a better way to do it.

commit(confirm=True, delay_factor=10) --> send to juniper 'commit confirmed'

commit(confirm=True, confirm_delay=5, delay_factor=10) --> send to Juniper 'commit confirmed 5'

Let me know if you see issues with this.

from netmiko.

supertylerc avatar supertylerc commented on June 12, 2024

Looks good to me.

from netmiko.

ktbyers avatar ktbyers commented on June 12, 2024

Juniper is done. Still need to do IOS-XR.

from netmiko.

ktbyers avatar ktbyers commented on June 12, 2024

Closing this issue. See issue #89 for IOS-XR.

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.