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(eos_validate_state): ANTA VerifyRoutingProtocolModel now only run if there is BGP configuration #3212

Merged
merged 7 commits into from
Oct 12, 2023

Conversation

carl-baillargeon
Copy link
Contributor

Change Summary

VerifyRoutingProtocolModel is now run only if there is a BGP configuration and service_routing_protocols_model is set to 'multi-agent' in the structured_config.

Related Issue(s)

Fixes #3189

Component(s) name

arista.avd.eos_validate_state in ANTA Mode

Proposed changes

AvdTestBGP test definition is now added only if router_bgp and service_routing_protocols_model exist and service_routing_protocols_model is set to 'multi-agent' in the structured_config.

How to test

Tested with eos_validate_state molecule. VerifyRoutingProtocolModel test is now removed from L2 leafs test catalog.

Checklist

User Checklist

  • N/A

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)

@ClausHolbechArista ClausHolbechArista changed the title Fix(eos_validate_state): (ANTA) VerifyRoutingProtocolModel is now run only if there is a BGP configuration Fix(eos_validate_state): (ANTA) VerifyRoutingProtocolModel now only run if there is BGP configuration Oct 6, 2023
@ClausHolbechArista ClausHolbechArista changed the title Fix(eos_validate_state): (ANTA) VerifyRoutingProtocolModel now only run if there is BGP configuration Fix(eos_validate_state): ANTA VerifyRoutingProtocolModel now only run if there is BGP configuration Oct 6, 2023
Comment on lines 163 to 165
else:
LOGGER.warning("Variable 'service_routing_protocols_model' is NOT set to 'multi-agent'. %s is skipped.", self.__class__.__name__)
return None
Copy link
Contributor

Choose a reason for hiding this comment

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

Could invert if and else and return first

          if service_routing_protocols_model != "multi-agent":
            LOGGER.warning("Variable 'service_routing_protocols_model' is NOT set to 'multi-agent'. %s is skipped.", self.__class__.__name__)
            return None
          ...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agreed. Fixed in 6fbead6

Copy link
Contributor

@gmuloc gmuloc left a comment

Choose a reason for hiding this comment

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

Can be merged like this - made one comment on changing some if/else logic but non blocking

@ClausHolbechArista ClausHolbechArista merged commit 9a3b9bb into aristanetworks:devel Oct 12, 2023
36 checks passed
@carl-baillargeon carl-baillargeon deleted the fix/3189 branch November 16, 2023 12:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants