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

Cut(eos_designs): Remove automatic conversion of dict-of-dicts to lists #4321

Conversation

ClausHolbechArista
Copy link
Contributor

Change Summary

Remove automatic conversion of dict-of-dicts to lists

Component(s) name

arista.avd.eos_designs
arista.avd.dhcp_provisioner

Proposed changes

  • Remove convert_types: [ dict ] from schema
  • Remove convert_dicts() calls from Python code
  • Remove | arista.avd.convert_dicts from eos_designs fabric documentation templates since it is reading eos_designs models.
  • Remove | arista.avd.convert_dicts from dhcp_provisioner template since it is reading eos_designs models.
  • Remove tests of dict-of-dicts from eos_designs_deprecated_vars molecule

How to test

Molecule scenarios should only use the new models so no impact.
Deprecated vars tests are being cleaned up.
Manually tested deprecated vars after cleaning up schema:

ERROR! [host1]: 'Validation Error: routers': {'ROUTER01': {'rack': 'RackB', 'adapters': [{'endpoint_ports': ['Eth1'], 'switch_ports': ['Ethernet10'], 'switches': ['host1'], 'profile': 'Tenant_X_LT'}]}} is not of type 'list'
ERROR! [host1]: 'Validation Error: l3leaf.node_groups': {'sflow-tests-leaf-mlag': {'bgp_as': 65105, 'nodes': {'host1': {'id': 5, 'mgmt_ip': '192.168.0.103/24'}}}} is not of type 'list'
ERROR! [host1]: 'Validation Error: l3leaf.nodes': {'host1': {'id': 101, 'bgp_as': 101}} is not of type 'list'
ERROR! [host1]: 'Validation Error: l3_edge.p2p_links_ip_pools': {'pool-leaf': '11.1.0.0/24', 'pool-spine': '11.1.1.0/24', 'pool-super-spine': '11.1.2.0/24'} is not of type 'list'
ERROR! [host1]: 'Validation Error: l3_edge.p2p_links_profiles': {'generic-profile': {'mtu': 1499, 'bfd': False, 'ptp': {'enabled': True}}} is not of type 'list'
ERROR! [host1]: 'Validation Error: platform_speed_groups': {'7280R': {'25G': [3, 2], '10G': [1, 2, 4]}} is not of type 'list'
ERROR! [host1]: 'Validation Error: port_profiles': {'TENANT_A_B': {'mode': 'trunk', 'vlans': '110-111,210-211'}} is not of type 'list'
ERROR! [host1]: 'Validation Error: svi_profiles': {'GENERIC': {'mtu': 1560, 'enabled': True}, 'GENERIC_FULL': {'name': 'GENERIC Name', 'mtu': 1560, 'enabled': False, 'ip_address_virtual': '10.1.10.254/24'}, 'TEST_SVI_NODE_INHERIT': {'name': 'Test the SVI and node config inheritance', 'mtu': 1560, 'enabled': False, 'ip_address_virtual': '10.4.13.254/24', 'ipv6_address_virtual': '2001:db8:413::1/64', 'ip_helpers': {'1.1.1.1': {'source_interface': 'lo101', 'source_vrf': 'TEST'}}, 'nodes': {'evpn_services_l2_only_false': {'ip_address': '12.4.13.2/24', 'ipv6_address': '2012:db9:413::2/64', 'ip_virtual_router_addresses': ['12.4.13.1'], 'ipv6_virtual_router_addresses': ['2012:db9:413::1']}}}} is not of type 'list'
ERROR! [host2]: 'Validation Error: tenants': {'TENANT_B': {'bgp_peer_groups': {'Tenant_C_BGP_PEER_GROUP': {'remote_as': '666', 'description': 'Tenant C peer group', 'send_community': 'all', 'next_hop_self': True, 'maximum_routes': 1000}}, 'l2vlans': {'160': {'name': 'Tenant_A_VMOTION', 'tags': ['opzone']}}, 'vrfs': {'TENANT_B_WAN': {'vrf_id': 20, 'svis': {110: {'vni_override': 50110, 'name': 'Tenant_A_OP_Zone_1', 'enabled': True, 'ipv6_address_virtual': '2001:db8:413::1/64'}, 111: {'vni_override': 50111, 'name': 'Tenant_A_OP_Zone_2', 'tags': ['opzone'], 'enabled': True, 'ipv6_address_virtual': '2001:db8:310::1/64', 'ipv6_address_virtuals': ['2001:db8:311::1/64'], 'ip_helpers': {'1.1.1.1': {'source_interface': 'lo100', 'source_vrf': 'MGMT'}}, 'nodes': {'DC1-LEAF2A': {'ip_address': '10.3.11.2/24', 'ipv6_address': '2001:db8:311::2/64'}}}}, 'bgp_peers': {'1.1.1.1': {'peer_group': 'Tenant_C_WAN_Zone_BGP_PEER_GROUP', 'description': 'test_description', 'nodes': ['DC1-BL2B'], 'set_ipv4_next_hop': '1.1.1.1'}}, 'ip_helpers': {'1.1.1.1': {'source_interface': 'lo100', 'source_vrf': 'MGMT'}}}}}} is not of type 'list'
ERROR! [host2]: 'Validation Error: node_type_keys': {'pe': {'type': 'pe', 'mpls_lsr': True, 'default_mpls_overlay_role': 'client', 'default_evpn_role': 'client', 'network_services': {'l1': True, 'l2': True, 'l3': True}, 'default_overlay_routing_protocol': 'ibgp', 'default_overlay_address_families': ['evpn'], 'default_evpn_encapsulation': 'mpls'}} is not of type 'list'

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 requested review from a team as code owners August 5, 2024 13:17
Copy link

github-actions bot commented Aug 5, 2024

Review docs on Read the Docs

To test this pull request:

# Create virtual environment for this testing below the current directory
python -m venv test-avd-pr-4321
# Activate the virtual environment
source test-avd-pr-4321/bin/activate
# Install all requirements including PyAVD
pip install "pyavd[ansible] @ git+https://github.com/ClausHolbechArista/avd.git@cut/eos_designs/convert-dicts#subdirectory=python-avd" --force
# Point Ansible collections path to the Python virtual environment
export ANSIBLE_COLLECTIONS_PATH=$VIRTUAL_ENV/ansible_collections
# Install Ansible collection
ansible-galaxy collection install git+https://github.com/ClausHolbechArista/avd.git#/ansible_collections/arista/avd/,cut/eos_designs/convert-dicts --force
# Optional: Install AVD examples
cd test-avd-pr-4321
ansible-playbook arista.avd.install_examples

Copy link

github-actions bot commented Aug 6, 2024

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@github-actions github-actions bot added the state: conflict PR with conflict label Aug 6, 2024
@github-actions github-actions bot removed the state: conflict PR with conflict label Aug 6, 2024
Copy link

github-actions bot commented Aug 6, 2024

Conflicts have been resolved. A maintainer will review the pull request shortly.

@github-actions github-actions bot added the state: conflict PR with conflict label Aug 6, 2024
Copy link

github-actions bot commented Aug 6, 2024

This pull request has conflicts, please resolve those before we can evaluate the pull request.

Copy link

github-actions bot commented Aug 6, 2024

Conflicts have been resolved. A maintainer will review the pull request shortly.

@github-actions github-actions bot removed the state: conflict PR with conflict label Aug 6, 2024
Copy link

sonarcloud bot commented Aug 6, 2024

Copy link
Contributor

@MaheshGSLAB MaheshGSLAB 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 592a52f into aristanetworks:devel Aug 6, 2024
41 checks passed
jrecchia1029 pushed a commit to jrecchia1029/ansible-avd that referenced this pull request Aug 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rn: Cut(eos_designs) role: dhcp_provisioner role: eos_designs issue related to eos_designs role state: CI Updated CI scenario have been updated in the PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove support for automatic conversion from dict-of-dicts to list-of-dicts
3 participants