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

Feat(eos_validate_state): skip lldp topology for shutdown #2221

Conversation

chetryan
Copy link
Contributor

@chetryan chetryan commented Oct 25, 2022

Change Summary

Skip checking LLDP topology for interfaces that are shutdown: true.

When a device in the inventory has is_deployed: false and the global value shutdown_interfaces_towards_undeployed_peers: true is set, the interfaces towards devices that have not been deployed will be in the shutdown state.
In the above case, we should skip checking for lldp neighborships as we will not find any lldp peers if the interface is shutdown.

Related Issue(s)

Fixes #2110

Component(s) name

arista.avd.eos_validate_state

Proposed changes

Adds a check to make sure interface is not shutdown before checking lldp neighborship.
not (ethernet_interface.value.shutdown is undefined or ethernet_interface.value.shutdown) and so that the logic becomes:

when: |
    (ethernet_interfaces is defined and ethernet_interfaces is not none) and
    not (ethernet_interface.value.shutdown is undefined or ethernet_interface.value.shutdown) and
    (ethernet_interface.value.peer is defined and ethernet_interface.value.peer is not none) and
    (ethernet_interface.value.peer_interface is defined and ethernet_interface.value.peer_interface is not none) and
    (hostvars[ethernet_interface.value.peer] is defined and hostvars[ethernet_interface.value.peer] is not none) and
    (hostvars[ethernet_interface.value.peer]['dns_domain'] is defined and hostvars[ethernet_interface.value.peer]['dns_domain'] is not none)

How to test

There are currently no Molecule tests for eos_validate_state

Checklist

User Checklist

  • Tested on actual topology inside Lab.

Repository Checklist

  • My code has been rebased from devel before I start
  • I have read the CONTRIBUTING document.
  • My change requires a change to the documentation and documentation have been updated accordingly.
  • I have updated molecule CI testing accordingly. (check the box if not applicable)

@chetryan chetryan requested a review from a team as a code owner October 25, 2022 12:23
@chetryan chetryan marked this pull request as draft October 25, 2022 12:50
Correct the logic for skipping lldp neighborship
validation when interface is shut down.
@chetryan chetryan marked this pull request as ready for review October 27, 2022 15:40
@chetryan chetryan changed the title Draft: Feat(eos_validate_state): skip lldp topology for shutdown Feat(eos_validate_state): skip lldp topology for shutdown Oct 27, 2022
Update the documentation to mention that validate
tests for both interface and lldp_topology will be
changed
@ClausHolbechArista
Copy link
Contributor

ClausHolbechArista commented Oct 27, 2022

For the case of shutdown being undefined I don't think we should skip this test. EOS has global knobs that can inverse the default state of the interface, so you cannot deduct it the interface is shutdown or not based on a missing variable. Apart from that, I support the rest of the change. I did some fundamental changes to validate_state in another PR, so we will probably need some rebasing and fix merge conflicts when the first one merges.

The logic could be ... and ethernet_interface.shutdown is not arista.avd.defined(true) and ...

chetryan and others added 2 commits November 3, 2022 14:06
…lldp_topology_fqdn.yml

Co-authored-by: Tony Reddy Goda <tgoda@arista.com>
…lldp_topology_no_fqdn.yml

Co-authored-by: Tony Reddy Goda <tgoda@arista.com>
@ClausHolbechArista
Copy link
Contributor

@tgodaA tgodaA self-requested a review November 3, 2022 20:02
Copy link
Contributor

@tgodaA tgodaA left a comment

Choose a reason for hiding this comment

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

LGTM

@ClausHolbechArista ClausHolbechArista merged commit 76bb285 into aristanetworks:devel Nov 4, 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.

eos_validate_state lldp_topology check skip shutdown interfaces
3 participants