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

Various Bugfixes #594

Merged
merged 26 commits into from
Nov 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
ad6c218
feat: ✨ Add PrefixLocation DiffSyncModel to track location assignment…
jdrew82 Oct 30, 2024
cc70ad4
fix: 🐛 Correct check when using location_map to use network name.
jdrew82 Nov 1, 2024
4e0ee4f
feat: ✨ Add ability to rename network if name key found in location_m…
jdrew82 Nov 1, 2024
19942c6
feat: ✨ Add ability to rename Building in DNA Center with location_map.
jdrew82 Nov 1, 2024
a4cecbe
test: ✅ Update Prefix model tests to remove use of Location as it's n…
jdrew82 Nov 1, 2024
75fe450
fix: 🐛 Ensure name key is used.
jdrew82 Nov 1, 2024
900127e
fix: 🐛 Fix name of Building if found in location_map and only load Fl…
jdrew82 Nov 1, 2024
94f1a59
docs: 📝 Update docs for job var.
jdrew82 Nov 1, 2024
7702b3e
test: ✅ Fix tests for load_floors()
jdrew82 Nov 1, 2024
c0233b3
fix: 🐛 Correct bug where wrong building name was used due to overwrite.
jdrew82 Nov 1, 2024
637d59a
fix: 🐛 Fix Nautobot loading wrong Location names for site and floor.
jdrew82 Nov 5, 2024
b6d715a
build: 👷 Add missing code owners for DNAC, Meraki, and Itential integ…
jdrew82 Nov 6, 2024
15e8608
docs: 📝 Add changelog fragment
jdrew82 Nov 6, 2024
f248cea
fix: 🐛 Add check for port existing in uplink_settings before loading …
jdrew82 Nov 6, 2024
4377108
fix: 🐛 Fix creation of PrefixLocationAssignment in Meraki.
jdrew82 Nov 6, 2024
0a5caa2
fix: 🐛 Correct PrefixLocationAssignment to use location as site_map h…
jdrew82 Nov 6, 2024
258bf8f
fix: 🐛 Change check for location attribute to be done only if locatio…
jdrew82 Nov 7, 2024
0ec75e0
fix: 🐛 Fix bug in Bootstrap integration from loading ValidatedSoftwar…
jdrew82 Nov 8, 2024
1306805
refactor: ♻️ Refactor load_validated_software to not grab SoftwareLCM…
jdrew82 Nov 8, 2024
c66a7e9
fix: 🐛 Check for device_platform attribute on Software and resort to …
jdrew82 Nov 8, 2024
c04d6fa
fix: 🐛 Change getattr to hasattr
jdrew82 Nov 8, 2024
af0256c
fix: 🐛 Correct identifiers for validated_software
jdrew82 Nov 8, 2024
9bd98d4
fix: 🐛 Catch DoesNotExist thrown when attempting to find ContentType …
jdrew82 Nov 8, 2024
2c9e632
feat: ✨ Added support for SoftwareVersion to Bootstrap integration.
jdrew82 Nov 8, 2024
fa1bf75
fix: 🐛 Correct logging var
jdrew82 Nov 8, 2024
438b7fd
revert: ⏪️ Restore checks around DLM classes
jdrew82 Nov 8, 2024
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
3 changes: 3 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
/nautobot_ssot/integrations/aristacv/ @qduk @jdrew82 @nautobot/plugin-ssot
/nautobot_ssot/integrations/bootstrap/ @bile0026 @nautobot/plugin-ssot
/nautobot_ssot/integrations/device42/ @jdrew82 @nautobot/plugin-ssot
/nautobot_ssot/integrations/dna_center/ @jdrew82 @nautobot/plugin-ssot
/nautobot_ssot/integrations/infoblox/ @qduk @jdrew82 @nautobot/plugin-ssot
/nautobot_ssot/integrations/ipfabric/ @alhogan @nautobot/plugin-ssot
/nautobot_ssot/integrations/itential/ @jtdub @nautobot/plugin-ssot
/nautobot_ssot/integrations/meraki/ @jdrew82 @nautobot/plugin-ssot
/nautobot_ssot/integrations/servicenow/ @glennmatthews @qduk @nautobot/plugin-ssot
2 changes: 2 additions & 0 deletions changes/593.added
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Added ability to rename Network in Meraki and Datacenter in DNA Center integrations using location_map.
Added support for SoftwareVersion in Bootstrap integration.
5 changes: 5 additions & 0 deletions changes/593.fixed
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Fixed Meraki loading of Nautobot Prefixes that have multiple Locations assigned.
Fixed DNA Center loading incorrect location names for Devices.
Fixed KeyError being thrown when port is missing from uplink_settings dict in Meraki integration.
Fixed error in Bootstrap integration in loading ValidatedSoftwareLCM when SoftwareLCM doesn't exist.
Fixed DoesNotExist thrown when attempting to load ContentType that doesn't exist in Bootstrap integration.
1 change: 1 addition & 0 deletions changes/593.housekeeping
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add code owners for DNA Center, Meraki, and Itential integrations.
Original file line number Diff line number Diff line change
Expand Up @@ -1252,59 +1252,48 @@ def load_validated_software(self):
for nb_validated_software in ORMValidatedSoftware.objects.all():
if self.job.debug:
self.job.logger.debug(f"Loading Nautobot ValidatedSoftwareLCM {nb_validated_software}")
try:
_software = ORMSoftware.objects.get(
version=nb_validated_software.software.version,
device_platform=nb_validated_software.software.device_platform.id,
)
self.get(
self.validated_software,
{
"software": {nb_validated_software.software},
"valid_since": {nb_validated_software.start},
"valid_until": {nb_validated_software.end},
},
)
except ObjectNotFound:
_val_software = ORMValidatedSoftware.objects.get(
software=_software,
start=nb_validated_software.start,
end=nb_validated_software.end,
)
_tags = sorted(list(_val_software.tags.all().values_list("name", flat=True)))
_devices = sorted(list(_val_software.devices.all().values_list("name", flat=True)))
_device_types = sorted(list(_val_software.device_types.all().values_list("model", flat=True)))
_device_roles = sorted(list(_val_software.device_roles.all().values_list("name", flat=True)))
_inventory_items = sorted(list(_val_software.inventory_items.all().values_list("name", flat=True)))
_object_tags = sorted(list(_val_software.object_tags.all().values_list("name", flat=True)))
_sor = ""
if "system_of_record" in nb_validated_software.custom_field_data:
_sor = (
nb_validated_software.custom_field_data["system_of_record"]
if nb_validated_software.custom_field_data["system_of_record"] is not None
else ""
)
new_validated_software = self.validated_software(
software=f"{nb_validated_software.software.device_platform} - {nb_validated_software.software.version}",
software_version=nb_validated_software.software.version,
platform=nb_validated_software.software.device_platform.name,
valid_since=nb_validated_software.start,
valid_until=nb_validated_software.end,
preferred_version=nb_validated_software.preferred,
devices=_devices,
device_types=_device_types,
device_roles=_device_roles,
inventory_items=_inventory_items,
object_tags=_object_tags,
tags=_tags,
system_of_record=_sor,
uuid=nb_validated_software.id,
)

if not check_sor_field(nb_validated_software):
new_validated_software.model_flags = DiffSyncModelFlags.SKIP_UNMATCHED_DST

self.add(new_validated_software)
_tags = sorted(list(nb_validated_software.tags.all().values_list("name", flat=True)))
_devices = sorted(list(nb_validated_software.devices.all().values_list("name", flat=True)))
_device_types = sorted(list(nb_validated_software.device_types.all().values_list("model", flat=True)))
_device_roles = sorted(list(nb_validated_software.device_roles.all().values_list("name", flat=True)))
_inventory_items = sorted(list(nb_validated_software.inventory_items.all().values_list("name", flat=True)))
_object_tags = sorted(list(nb_validated_software.object_tags.all().values_list("name", flat=True)))
_sor = ""
if "system_of_record" in nb_validated_software.custom_field_data:
_sor = (
nb_validated_software.custom_field_data["system_of_record"]
if nb_validated_software.custom_field_data["system_of_record"] is not None
else ""
)
if hasattr(nb_validated_software.software, "device_platform"):
platform = nb_validated_software.software.device_platform.name
else:
platform = nb_validated_software.software.platform.name
new_validated_software, _ = self.get_or_instantiate(
self.validated_software,
ids={
"software": str(nb_validated_software.software),
"valid_since": nb_validated_software.start,
"valid_until": nb_validated_software.end,
},
attrs={
"software_version": nb_validated_software.software.version,
"platform": platform,
"preferred_version": nb_validated_software.preferred,
"devices": _devices,
"device_types": _device_types,
"device_roles": _device_roles,
"inventory_items": _inventory_items,
"object_tags": _object_tags,
"tags": _tags,
"system_of_record": _sor,
"uuid": nb_validated_software.id,
},
)

if not check_sor_field(nb_validated_software):
new_validated_software.model_flags = DiffSyncModelFlags.SKIP_UNMATCHED_DST

def load(self):
"""Load data from Nautobot into DiffSync models."""
Expand Down
Loading