Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change order of netmiko_options #216

Closed
wants to merge 6 commits into from

Conversation

ktbyers
Copy link
Collaborator

@ktbyers ktbyers commented Aug 1, 2018

netmiko_options should override inventory arguments.

Add unit tests corresponding to this.

@coveralls
Copy link

coveralls commented Aug 1, 2018

Pull Request Test Coverage Report for Build 859

  • 7 of 8 (87.5%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.02%) to 93.441%

Changes Missing Coverage Covered Lines Changed/Added Lines %
nornir/plugins/connections/netmiko.py 7 8 87.5%
Totals Coverage Status
Change from base Build 854: 0.02%
Covered Lines: 1154
Relevant Lines: 1235

💛 - Coveralls

@ktbyers
Copy link
Collaborator Author

ktbyers commented Aug 1, 2018

Fixing the mypy issue.

@dbarrosop
Copy link
Contributor

Everything looks good, the only comment I'd make is that I'd implement the test here, in the DummyConnectionPlugin:

https://github.com/nornir-automation/nornir/blob/2.0/tests/core/test_connections.py#L8

Basically the order of parameters is resolved by nornir itself so there is no inherent logic in the drivers for it so, conceptually, the test would fit better there I think.

@ktbyers
Copy link
Collaborator Author

ktbyers commented Aug 3, 2018

Okay, let me look at that DummyConnectionPlugin. I hadn't seen that earlier.

Copy link
Collaborator

@dmfigol dmfigol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

connection_options = {}

netmiko_connection_args = parameters
netmiko_connection_args.update(connection_options)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not critical, but something that crossed my mind:
we could name things in the connection plugin as plugin-agnostic as possible. For example:
napalm_to_netmiko_map -> PLATFORM_MAPPING
netmiko_connection_args -> connection_args
(naming is just an example, not saying it should be named this way)

The benefit would be that if a user wants to implement a custom plugin, he could take literally any existing plugin, do minimal changes and have a new connection plugin.
I don't want to force my ideology here, so I will leave the decision to you.

@ktbyers
Copy link
Collaborator Author

ktbyers commented Aug 8, 2018

I will redo this once #224 is done.

@dbarrosop
Copy link
Contributor

Closing this one as I think it's obsolete, feel free to reopen otherwise.

@dbarrosop dbarrosop closed this Aug 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants