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

Fix #1554: Improve compare_config for NXOS partial merging #1567

Merged
merged 6 commits into from
Mar 25, 2022

Conversation

cmsirbu
Copy link
Contributor

@cmsirbu cmsirbu commented Feb 13, 2022

NXOS partial merges were not aware of command hierarchy when showing the differences to be applied via the compare_config method. We (myself and @mundruid) have changed the merge diffing to use the netutils package. Docstrings and documentation updated as well.

Tests would be a stretch goal for another day since this code path is not tested at the moment.

See an example below of old and new behavior:

Intended configuration:

candidate_cfg = """
interface loopback0
  ip address 10.1.4.5/32
  ip router ospf 100 area 0.0.0.1
"""

Base - full configuration on device with the relevant section below:
...
interface loopback0
  ip address 10.1.4.4/32
  ip router ospf 100 area 0.0.0.1
...

nxos1.load_merge_candidate(config=candidate_cfg)

Before:

print(nxos1.compare_config())
  ip address 10.1.4.5/32


With netutils, respecting required command hierarchy:

print(nxos1.compare_config())
interface loopback0
  ip address 10.1.4.5/32

Fixes #1554

docs/support/nxos.rst Outdated Show resolved Hide resolved
@mirceaulinic mirceaulinic added this to the 4.0.0 milestone Feb 14, 2022
@mirceaulinic mirceaulinic merged commit 4c748fa into napalm-automation:develop Mar 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Partial Idempotent Configuration Push
3 participants