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: Description key not considered with connected endpoints #2745
Fix: Description key not considered with connected endpoints #2745
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great catch - could you also please implement the same for Port-channels?
@@ -75,7 +75,7 @@ def _get_ethernet_interface_cfg(self, adapter: dict, node_index: int, connected_ | |||
"peer_interface": peer_interface, | |||
"peer_type": connected_endpoint["type"], | |||
"port_profile": adapter.get("profile"), | |||
"description": self.shared_utils.interface_descriptions.connected_endpoints_ethernet_interfaces(peer, peer_interface), | |||
"description": adapter.get("description") or self.shared_utils.interface_descriptions.connected_endpoints_ethernet_interfaces(peer, peer_interface), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"description": adapter.get("description") or self.shared_utils.interface_descriptions.connected_endpoints_ethernet_interfaces(peer, peer_interface), | |
"description": default(adapter.get("description"), self.shared_utils.interface_descriptions.connected_endpoints_ethernet_interfaces(peer, peer_interface)), |
loopback_ipv4_pool: 192.168.0.0/24 | ||
|
||
port_profiles: | ||
common: | ||
spanning_tree_portfast: edge | ||
spanning_tree_bpduguard: true | ||
storm_control: | ||
all: | ||
level: 1 | ||
desktop_phone-1234-2345: | ||
parent_profile: common | ||
mode: trunk phone | ||
structured_config: | ||
# profile: dot1x | ||
phone: | ||
trunk: tagged | ||
vlan: "2345" | ||
native_vlan: "1234" | ||
|
||
type: l2leaf | ||
l2leaf: | ||
defaults: | ||
nodes: | ||
connected_endpoints: | ||
|
||
servers: | ||
OLD_SW-1/4: | ||
adapters: | ||
- switches: [connected_endpoints] | ||
switch_ports: [Ethernet4] | ||
profile: desktop_phone-1234-2345 | ||
description: VVxx:abcd123 | ||
native_vlan: 2020 | ||
raw_eos_cli: |- | ||
!! VoIP/PC |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you limit even further the test?
It was implemented as part of network_ports, where we want a more generic description, but makes perfect sense to include here as well. I would prefer to move the logic to the description module, so anyone customizing those keep full control. Similar to how it is done with port_channel_description. |
On this topic @ClausHolbechArista - should port-channel description also take into account this special description at the adapter level as currently it is doing |
That would be good |
If I follow, won't we need to modify the method signature in the base class and all the subclasses? |
Hi @pvinci-arista so basically the suggestion is to add as an optional keyword argument the adapter.description key so that you don't break possible subclasses (though for now nobody has been using this functionality as it has not been officially released anyway). Let's take the opportunity in this PR to also document better how the descriptions are built! Let me know if you need some help |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The fix looks good - As mentioned in one of the comments, we should add an explanation of how the descriptions are built for physical ports and port-channels.
Docstrings were added to the methods. Do you want something additional? See, as an example: https://github.com/aristanetworks/ansible-avd/pull/2745/files#diff-bbfc03125089c9310eb2bebb44079e7849bbf1e5031bae6df3024d280c0f306dR94 |
We have added addition information in schema/documentation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Change Summary
description key under connected endpoints not used.
Related Issue(s)
Fixes #2744
Component(s) name
arista.avd.eos_designs
Proposed changes
How to test
molecule test
Checklist
User Checklist
Repository Checklist