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(plugins): Updated convert_dicts filter for list values in dictionary #1694

Merged

Conversation

Shivani-chourasiya
Copy link
Contributor

@Shivani-chourasiya Shivani-chourasiya commented Apr 8, 2022

Change Summary

Updated convert_dicts filter for list values in dictionary

Related Issue(s)

Some of the data models have list of dictionaries inside nested dictionary, for which we need to introduce a new key in the data model schema and templates of eos_cli_config_gen_v4.0 , which is affecting molecule execution of older templates(eos_cli_config_gen) as the key is not found.
Example:
OLD

ip_extcommunity_lists:
  TEST1:
      - type: permit
        extcommunities: "65000:65000"
      - type: deny
        extcommunities: "65002:65002"
  TEST2:
      - type: deny
        extcommunities: "65001:65001"

NEW

ip_extcommunity_lists:
  - name: TEST1
    types:
      - type: permit
        extcommunities: "65000:65000"
      - type: deny
        extcommunities: "65002:65002"
  - name: TEST2
    types:
      - type: deny
        extcommunities: "65001:65001"

Component(s) name

arista.avd.convert_dicts

Proposed changes

Checks if the nested dictionary value is list, a new key (secondary_key) will be inserted in the inner dictionary.

How to test

The update to ip_extcommunity_lists.yml in this PR will fail with the older code.

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)

@Shivani-chourasiya Shivani-chourasiya requested a review from a team as a code owner April 8, 2022 13:07
@github-actions github-actions bot added role: eos_cli_config_gen issue related to eos_cli_config_gen role state: CI Updated CI scenario have been updated in the PR state: Documentation role Updated type: Python filters labels Apr 8, 2022
@Shivani-chourasiya Shivani-chourasiya marked this pull request as draft April 8, 2022 13:11
@Shivani-chourasiya Shivani-chourasiya changed the title Feat(convert_dicts filter): Updated convert_dicts filter for list values in dictionary Feat(convert_dicts): Updated convert_dicts filter for list values in dictionary Apr 8, 2022
@Shivani-chourasiya Shivani-chourasiya changed the title Feat(convert_dicts): Updated convert_dicts filter for list values in dictionary Feat(plugins): Updated convert_dicts filter for list values in dictionary Apr 8, 2022
@Shivani-chourasiya Shivani-chourasiya marked this pull request as ready for review April 8, 2022 13:45
@Shivani-chourasiya Shivani-chourasiya force-pushed the convert_dicts branch 2 times, most recently from 6547f56 to 184d606 Compare April 12, 2022 10:44
Copy link
Contributor

@ClausHolbechArista ClausHolbechArista left a comment

Choose a reason for hiding this comment

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

LGTM

@Shivani-chourasiya Shivani-chourasiya force-pushed the convert_dicts branch 2 times, most recently from dc4d88b to 5f4bce2 Compare April 14, 2022 07:02
@ClausHolbechArista ClausHolbechArista merged commit aeba213 into aristanetworks:devel Apr 19, 2022
@Shivani-chourasiya Shivani-chourasiya removed their assignment Sep 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
role: eos_cli_config_gen issue related to eos_cli_config_gen role state: CI Updated CI scenario have been updated in the PR state: Documentation role Updated type: Python filters
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants