Skip to content

Bugfix - fix searching logic for property set#42

Merged
that1guy15 merged 1 commit intoApstra:mainfrom
rahul-sundaresan:bugfix/fix_get_property_set
Nov 10, 2022
Merged

Bugfix - fix searching logic for property set#42
that1guy15 merged 1 commit intoApstra:mainfrom
rahul-sundaresan:bugfix/fix_get_property_set

Conversation

@rahul-sundaresan
Copy link
Copy Markdown
Contributor

get_property_set() should compare based on label since a key called display_name does not exist in the response. The original implementation causes this function to always fail.

Here's the response sent by apstra 4.0 and 4.1 for get_all() property sets

[{'created_at': '2022-10-25T21:10:50.155661+0000',
  'id': '4eb212b7-977b-487d-bddf-7bc71b1fe374',
  'label': 'common vlans',
  'updated_at': '2022-10-26T14:33:58.654534+0000',
  'values': {'com_vlan': '1002,1003,1151'}},
 {'created_at': '2022-10-26T18:58:26.485253+0000',
  'id': '9ddb3808-92d8-4819-a8c9-ac35b3719239',
  'label': 'common_vlans',
  'updated_at': '2022-10-26T18:58:26.485253+0000',
  'values': {'com_vlan': '1002,1003,1151'}},
 {'created_at': '2022-10-26T19:28:07.008530+0000',
  'id': '8dc16efd-0ac4-4075-b924-d9d503a4ffbc',
  'label': 'foo bar',
  'updated_at': '2022-10-26T19:28:07.008530+0000',
  'values': {'ett': 'adfadg'}}]

This PR fixes the search logic and rewords the error message

@that1guy15 that1guy15 merged commit ea5b1f8 into Apstra:main Nov 10, 2022
@rahul-sundaresan rahul-sundaresan deleted the bugfix/fix_get_property_set branch November 10, 2022 19:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants