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 DNAC SSoT Empty Locations #645

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
55ccf0a
feat: ✨ Add ability to rename Area if name key found and Building key…
jdrew82 Dec 13, 2024
6bc3b28
refactor: ♻️ Extract determination of device role into own function.
jdrew82 Dec 13, 2024
d7f3c4f
refactor: ♻️ Refactor build_dnac_location_map to integrate Job locati…
jdrew82 Dec 17, 2024
da5a089
test: ✅ Update tests to adjust for refactor of build_dnac_location_map
jdrew82 Dec 17, 2024
040db06
refactor: ♻️ Refactor Device platform determination into own function.
jdrew82 Dec 17, 2024
738fcf6
refactor: ♻️ Update loading of areas, buildings, and floors to be don…
jdrew82 Dec 17, 2024
7596067
test: ✅ Add a test validating load_device_location_tree() when a floo…
jdrew82 Dec 17, 2024
1dd3c51
test: ✅ Add a test fixture for the expected building_map to use with …
jdrew82 Dec 17, 2024
e3eba4a
fix: 🐛 Have parent_of_parent for a Building passed to the function to…
jdrew82 Dec 18, 2024
8c896a5
style: 🧑‍💻 Add debug logging for DNAC location map
jdrew82 Dec 18, 2024
5a4adbf
refactor: ♻️ Remove area_parent None for load_area as it's unneeded.
jdrew82 Dec 18, 2024
e2a10aa
fix: 🐛 Only update name for Floor to include Building name if it's no…
jdrew82 Dec 18, 2024
5049675
test: ✅ Add tests validating load_device_location_tree() with and wit…
jdrew82 Dec 18, 2024
f2a5e8d
fix: 🐛 Update floor name when loading a Device to consider if Buildin…
jdrew82 Dec 18, 2024
5a3ba52
fix: 🐛 Use dnac_location_map for Floor area_name instead of name from…
jdrew82 Dec 18, 2024
d30e2e7
style: 📝 Tweak logging to include area and area parent names.
jdrew82 Dec 18, 2024
c522aa0
refactor: ♻️ Update floors in dnac_location_map to have parent_of_par…
jdrew82 Dec 18, 2024
023de58
refactor: ♻️ Change update of parent and parent_of_parent to happen f…
jdrew82 Dec 19, 2024
8fce370
fix: 🐛 Update parent_of_parent for building if parent on parent is fo…
jdrew82 Dec 19, 2024
5992cfb
fix: 🐛 Refactor loading of DNAC location_map to set defaults and then…
jdrew82 Dec 20, 2024
907124d
test: ✅ Update test to account for change to function
jdrew82 Dec 20, 2024
24814e4
test: 🚨 Add ignore for pylint
jdrew82 Dec 20, 2024
df85eb7
fix: 🐛 Add check for parent_id existing in dnac_location_map
jdrew82 Dec 21, 2024
77309af
fix: 🐛 Check for area_id in location_map before using
jdrew82 Dec 21, 2024
0659e07
test: ✅ Add test fixture for expected locations without Global and up…
jdrew82 Dec 21, 2024
78d5d98
fix: 🐛 Update building name to pull from dnac_location_map
jdrew82 Dec 21, 2024
cd4981e
test: ✅ Update tests to add missing pieces like id key
jdrew82 Dec 21, 2024
314f479
refactor: ♻️ Simplify building of dnac_location_map.
jdrew82 Dec 22, 2024
fa42e21
docs: 📝 Add changelog snippet
jdrew82 Jan 7, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changes/643.fixed
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed DNA Center bug where empty Locations were imported.
369 changes: 227 additions & 142 deletions nautobot_ssot/integrations/dna_center/diffsync/adapters/dna_center.py

Large diffs are not rendered by default.

8 changes: 5 additions & 3 deletions nautobot_ssot/tests/dna_center/fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,15 @@ def load_json(path):


LOCATION_FIXTURE = load_json(path="./nautobot_ssot/tests/dna_center/fixtures/get_locations.json")
LOCATION_WO_GLOBAL_FIXTURE = load_json(path="./nautobot_ssot/tests/dna_center/fixtures/get_locations_wo_global.json")
EXPECTED_BUILDING_MAP = load_json(path="./nautobot_ssot/tests/dna_center/fixtures/expected_building_map.json")
EXPECTED_DNAC_LOCATION_MAP = load_json(path="./nautobot_ssot/tests/dna_center/fixtures/expected_dnac_location_map.json")
EXPECTED_DNAC_LOCATION_MAP_WO_GLOBAL = load_json(
path="./nautobot_ssot/tests/dna_center/fixtures/expected_dnac_location_map_wo_global.json"
)
EXPECTED_DNAC_LOCATION_MAP_W_JOB_LOCATION_MAP = load_json(
path="./nautobot_ssot/tests/dna_center/fixtures/expected_dnac_location_map_w_job_location_map.json"
)
RECV_LOCATION_FIXTURE = load_json(path="./nautobot_ssot/tests/dna_center/fixtures/get_locations_recv.json")
DEVICE_FIXTURE = load_json(path="./nautobot_ssot/tests/dna_center/fixtures/get_devices.json")
RECV_DEVICE_FIXTURE = load_json(path="./nautobot_ssot/tests/dna_center/fixtures/get_devices_recv.json")
Expand All @@ -22,7 +27,4 @@ def load_json(path):
PORT_FIXTURE = load_json(path="./nautobot_ssot/tests/dna_center/fixtures/get_port_info.json")
RECV_PORT_FIXTURE = load_json(path="./nautobot_ssot/tests/dna_center/fixtures/get_port_info_recv.json")

EXPECTED_AREAS = load_json(path="./nautobot_ssot/tests/dna_center/fixtures/expected_areas.json")
EXPECTED_AREAS_WO_GLOBAL = load_json(path="./nautobot_ssot/tests/dna_center/fixtures/expected_areas_wo_global.json")
EXPECTED_BUILDINGS = load_json(path="./nautobot_ssot/tests/dna_center/fixtures/expected_buildings.json")
EXPECTED_FLOORS = load_json(path="./nautobot_ssot/tests/dna_center/fixtures/expected_floors.json")
299 changes: 0 additions & 299 deletions nautobot_ssot/tests/dna_center/fixtures/expected_areas.json

This file was deleted.

Loading