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

[WIP] DNA Center Integration #446

Closed
wants to merge 69 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
3e645a8
build: ⬆️ Upgrade project dependencies
jdrew82 Nov 1, 2023
70a6515
test: ✅ Add initial test for VRFGroup class
jdrew82 Nov 1, 2023
4555eb9
test: ✅ Add test validating VRFGroup.update()
jdrew82 Nov 2, 2023
868ec12
test: ✅ Add test validating delete() function for NautobotVRFGroup wo…
jdrew82 Nov 2, 2023
e6f5854
test: ✅ Add test validating NautobotSubnet.create() functionality
jdrew82 Nov 2, 2023
c640391
test: ✅ Add test validating NautobotSubnet.update() functionality.
jdrew82 Nov 2, 2023
c4df9c8
test: ✅ Add test validating NautobotSubnet.delete() functionality.
jdrew82 Nov 2, 2023
ece83b5
fix: 🐛 Correct attribute to be ip_version
jdrew82 Nov 3, 2023
5dca067
test: ✅ Add test validating NautobotIPAddress.create() with existing …
jdrew82 Nov 3, 2023
356d206
refactor: Move ids and attrs to setUp to be shared
jdrew82 Nov 3, 2023
7dd78a7
test: ✅ Add test showing IPAddress handling when missing Prefix.
jdrew82 Nov 3, 2023
15b66ad
test: 🚨 Ignore pylint warning
jdrew82 Nov 3, 2023
dc403b3
test: ✅ Add test validating NautobotIPAddress.create() with missing I…
jdrew82 Nov 3, 2023
e06b5fb
fix: 🐛 Correct IPAddress Status to be Active if available, else Reser…
jdrew82 Nov 6, 2023
2c5c415
fix: 🐛 Correct IPAddress update() for assigning to new Interface and …
jdrew82 Nov 6, 2023
0094f3e
test: ✅ Add tests validating IPAddress.update() for new available, la…
jdrew82 Nov 6, 2023
59d4aad
fix: 🐛 Correct var used when updating Device for IPAddress to use sel…
jdrew82 Nov 8, 2023
353ee51
style: 🔥 Remove unused import
jdrew82 Nov 8, 2023
0ef1d55
test: ♻️ Redo IPAddress update tests to be more DRY.
jdrew82 Nov 8, 2023
9610046
test: ✅ Add test validating NautobotIPAddress.update() for new Device.
jdrew82 Nov 8, 2023
c67f36f
style: 🚚 Rename test name to be clearer about test.
jdrew82 Nov 8, 2023
d8e11a3
test: ✅ Add test validating NautobotIPAddress.update() with changing …
jdrew82 Nov 8, 2023
ed3bcf3
test: ✅ Add test validating NautobotIPAddress.update() when setting p…
jdrew82 Nov 8, 2023
277a21a
test: ✅ Add test validating NautobotIPAddress.update() when changing …
jdrew82 Nov 8, 2023
2fb94c2
test: ✅ Add a test validating NautobotIPAddress.update() updating Cus…
jdrew82 Nov 8, 2023
a5d550f
test: ♻️ Use mock_addr for create/update calls instead of calling Nau…
jdrew82 Nov 9, 2023
ff247e2
test: ✅ Add test validating NautobotiPAddress.update() handles a Vali…
jdrew82 Nov 9, 2023
9e00393
test: ✅ Add test validating NautobotVLAN.create() works with missing …
jdrew82 Nov 10, 2023
2368aaa
style: ♻️ Update super().create() to match order of func signature.
jdrew82 Nov 10, 2023
4ae184f
fix: 🔥 Remove unused secondary None
jdrew82 Nov 10, 2023
d58ce56
fix: 🐛 Update check for building definition to ensure Global is used …
jdrew82 Nov 10, 2023
c83c0d3
test: ✅ Add test validating NautobotVLAN.create() functionality with …
jdrew82 Nov 10, 2023
652477e
test: ✅ Validate NautobotVLAN.update() functionality with updating VL…
jdrew82 Nov 10, 2023
077ed70
test: ✅ Add test validating NautobotVLAN.update() functions updating …
jdrew82 Nov 13, 2023
8fbb0cf
test: ✅ Add test validating NautobotVLAN.update() updates CustomField…
jdrew82 Nov 13, 2023
a3122ac
test: ✅ Add a test validating NautobotVLAN.update() updates VLAN tags.
jdrew82 Nov 13, 2023
41ca2b8
test: ♻️ Redo VRF create/update tests to include tags and CustomFields.
jdrew82 Nov 13, 2023
2a3f05c
test: ✅ Add test validating NautobotVRFGroup.update() clears tags in …
jdrew82 Nov 13, 2023
cfc0a73
test: ♻️ Update test for NautobotSubnet.create() to include tags and …
jdrew82 Nov 13, 2023
1fe1270
test: ✅ Add test validating NautobotSubnet.create() functionality wit…
jdrew82 Nov 15, 2023
9d45803
build: Update lockfile
jdrew82 Apr 23, 2024
c35de29
style: 🚨 Fix formatting for black
jdrew82 Apr 23, 2024
a254fce
test: 🚨 Add ignores for pylint
jdrew82 Apr 23, 2024
d4d979a
test: ✅ Correct CustomField key to use underscore
jdrew82 Apr 23, 2024
92c24d6
fix: 🐛 Correct VLAN attribute to be location instead of location_id
jdrew82 Apr 23, 2024
24b18e0
docs: 📝 Add changelog snippets
jdrew82 Apr 23, 2024
44cbd1b
docs: 📝 Update changelog snippet.
jdrew82 Apr 23, 2024
d2621e9
ci: 💚 Change check-in-docker CI step to use NB 2.2.0
jdrew82 Apr 23, 2024
8797a6b
ci: Use NB 2.2.1 to readd setup() for pylint
jdrew82 Apr 23, 2024
42884cf
ci: Update unittest to use 2.2.1 instead of 2.1.0
jdrew82 Apr 23, 2024
8c04858
[Infoblox] Replace requests.request with requests.Session.
progala Apr 25, 2024
477f443
Add change fragment.
progala Apr 25, 2024
380c5f6
Fix reference to cookie var.
progala Apr 25, 2024
2eb2782
Fix typo.
progala Apr 25, 2024
a42ab6f
Merge pull request #438 from progala/inf-req-session
jdrew82 Apr 25, 2024
6130be9
Merge pull request #436 from nautobot/patch-d42_tests_fixes
jdrew82 Apr 29, 2024
a3648e2
build: 🏗️ Bump to 2.6.1 and add release notes.
jdrew82 Apr 29, 2024
7dc4823
docs: 📝 Tweak release notes per PR comments.
jdrew82 Apr 29, 2024
159ea06
docs: Correct mispelling
jdrew82 Apr 29, 2024
1a40602
docs: 📝 Reword release note
jdrew82 Apr 29, 2024
cd88356
Merge pull request #440 from nautobot/release-v2.6.1
jdrew82 Apr 29, 2024
ab2e34b
Merge pull request #441 from nautobot/main
Kircheneer Apr 30, 2024
134d86d
feat: ✨ Add DiffSync Adapter, Models, and utility methods for DNA Cen…
jdrew82 May 2, 2024
cad96ad
test: ✅ Add tests for DNA Center integration.
jdrew82 May 2, 2024
26c6d9a
feat: ✨ Add original project name to conflicting apps list.
jdrew82 May 2, 2024
a0f3ef1
fix: 🐛 Correct tests folder for dna_center and correct imports for ne…
jdrew82 May 3, 2024
47b6db3
build: ➕ Add dnacentersdk dependency for DNA Center integration.
jdrew82 May 3, 2024
b59841e
fix: 🐛 Fix imports for new pathing
jdrew82 May 3, 2024
342c94c
build: 🏗️ Add settings for DNA Center integration.
jdrew82 May 3, 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
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ jobs:
fail-fast: true
matrix:
python-version: ["3.11"]
nautobot-version: ["2.1.0"]
nautobot-version: ["2.2.1"]
env:
INVOKE_NAUTOBOT_SSOT_PYTHON_VER: "${{ matrix.python-version }}"
INVOKE_NAUTOBOT_SSOT_NAUTOBOT_VER: "${{ matrix.nautobot-version }}"
Expand Down Expand Up @@ -152,7 +152,7 @@ jobs:
include:
- python-version: "3.11"
db-backend: "postgresql"
nautobot-version: "2.1.0"
nautobot-version: "2.2.1"
- python-version: "3.11"
db-backend: "mysql"
nautobot-version: "stable"
Expand Down
1 change: 0 additions & 1 deletion changes/431.fixed

This file was deleted.

1 change: 0 additions & 1 deletion changes/435.fixed

This file was deleted.

1 change: 1 addition & 0 deletions development/app_config_schema.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""App Config Schema Generator and Validator."""

import json
from importlib import import_module
from os import getenv
Expand Down
6 changes: 6 additions & 0 deletions development/nautobot_config.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Nautobot development configuration file."""

import os
import sys

Expand Down Expand Up @@ -193,6 +194,7 @@
"enable_aci": is_truthy(os.getenv("NAUTOBOT_SSOT_ENABLE_ACI")),
"enable_aristacv": is_truthy(os.getenv("NAUTOBOT_SSOT_ENABLE_ARISTACV")),
"enable_device42": is_truthy(os.getenv("NAUTOBOT_SSOT_ENABLE_DEVICE42")),
"enable_dna_center": is_truthy(os.getenv("NAUTOBOT_SSOT_ENABLE_DNA_CENTER")),
"enable_infoblox": is_truthy(os.getenv("NAUTOBOT_SSOT_ENABLE_INFOBLOX")),
"enable_ipfabric": is_truthy(os.getenv("NAUTOBOT_SSOT_ENABLE_IPFABRIC")),
"enable_servicenow": is_truthy(os.getenv("NAUTOBOT_SSOT_ENABLE_SERVICENOW")),
Expand All @@ -213,6 +215,10 @@
"device42_role_prepend": "",
"device42_ignore_tag": "",
"device42_hostname_mapping": [],
"dna_center_import_global": is_truthy(os.getenv("NAUTOBOT_DNAC_SSOT_DNA_CENTER_IMPORT_GLOBAL", True)),
"dna_center_import_merakis": is_truthy(os.getenv("NAUTOBOT_DNAC_SSOT_DNA_CENTER_IMPORT_MERAKIS", False)),
"dna_center_update_locations": is_truthy(os.getenv("NAUTOBOT_DNAC_SSOT_DNA_CENTER_UPDATE_LOCATIONS", True)),
"dna_center_show_failures": is_truthy(os.getenv("NAUTOBOT_DNAC_SSOT_DNA_CENTER_SHOW_FAILURES", True)),
"infoblox_default_status": os.getenv("NAUTOBOT_SSOT_INFOBLOX_DEFAULT_STATUS", "active"),
"infoblox_enable_sync_to_infoblox": is_truthy(os.getenv("NAUTOBOT_SSOT_INFOBLOX_ENABLE_SYNC_TO_INFOBLOX")),
"infoblox_import_objects_ip_addresses": is_truthy(
Expand Down
23 changes: 23 additions & 0 deletions docs/admin/release_notes/version_2.6.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,26 @@

- [#418](https://github.com/nautobot/nautobot-app-ssot/issues/418) - Unpins multiple dependencies.
- [#421](https://github.com/nautobot/nautobot-app-ssot/issues/421) - Opened prometheus-client dependency range and removed direct drf-spectacular dependency.

## [v2.6.1 (2024-04-29)](https://github.com/nautobot/nautobot-app-ssot/releases/tag/v2.6.1)

### Added

- [#436](https://github.com/nautobot/nautobot-app-ssot/issues/436) - Added additional unit tests for Device42 integration.

### Changed

- [#437](https://github.com/nautobot/nautobot-app-ssot/issues/437) - Improved performance of the Infoblox client by using `requests.Session` for API calls instead of `requests.request`.

### Fixed

- [#435](https://github.com/nautobot/nautobot-app-ssot/issues/435) - Fixed handling of DLM App installed but not enabled throwing RuntimeError.
- [#436](https://github.com/nautobot/nautobot-app-ssot/issues/436) - Fixed IPAddress attribute to be ip_version.
- [#436](https://github.com/nautobot/nautobot-app-ssot/issues/436) - Fixed IPAddress Status incorrectly being set to Reserved when the status in Device42 showed as "available".
- [#436](https://github.com/nautobot/nautobot-app-ssot/issues/436) - Fixed multiple bugs when assigning IPAddresses to Interfaces.
- [#436](https://github.com/nautobot/nautobot-app-ssot/issues/436) - Fixed check for Building definiton when creating a VLAN.
- [#436](https://github.com/nautobot/nautobot-app-ssot/issues/436) - Fixed VLAN to use location instead of location_id in create().

### Housekeeping

- [#431](https://github.com/nautobot/nautobot-app-ssot/issues/431) - Updated note on nautobot_ssot/integrations/ipfabric/diffsync/adapter_ipfabric.py IPFabricDiffSync from Nautobot to IPFabric.
2 changes: 2 additions & 0 deletions nautobot_ssot/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""App declaration for nautobot_ssot."""

import os
from importlib import metadata

Expand All @@ -16,6 +17,7 @@
"nautobot_ssot_aci",
"nautobot_ssot_aristacv",
"nautobot_ssot_device42",
"nautobot_ssot_dna_center",
"nautobot_ssot_infoblox",
"nautobot_ssot_ipfabric",
"nautobot_ssot_servicenow",
Expand Down
1 change: 1 addition & 0 deletions nautobot_ssot/contrib/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""SSoT Contrib."""

from nautobot_ssot.contrib.adapter import NautobotAdapter
from nautobot_ssot.contrib.model import NautobotModel
from nautobot_ssot.contrib.types import (
Expand Down
1 change: 1 addition & 0 deletions nautobot_ssot/contrib/types.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Contrib type classes for interfacing with Nautobot in SSoT."""

# pylint: disable=protected-access
# Diffsync relies on underscore-prefixed attributes quite heavily, which is why we disable this here.

Expand Down
1 change: 1 addition & 0 deletions nautobot_ssot/integrations/aci/constant.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Constants for use with the ACI SSoT app."""

from django.conf import settings


Expand Down
1 change: 1 addition & 0 deletions nautobot_ssot/integrations/aci/diffsync/adapters/aci.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""DiffSync Adapter for Cisco ACI.""" # pylint: disable=too-many-lines, too-many-instance-attributes, too-many-arguments

# pylint: disable=duplicate-code


Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""DiffSync Adapter for Nautobot."""

# pylint: disable=duplicate-code

import logging
Expand Down
1 change: 1 addition & 0 deletions nautobot_ssot/integrations/aci/diffsync/client.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""All interactions with ACI.""" # pylint: disable=too-many-lines, too-many-instance-attributes, too-many-arguments

# pylint: disable=invalid-name

import sys
Expand Down
1 change: 1 addition & 0 deletions nautobot_ssot/integrations/aci/diffsync/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Initialize models for Nautobot and ACI."""

from .nautobot import (
NautobotTenant,
NautobotVrf,
Expand Down
1 change: 1 addition & 0 deletions nautobot_ssot/integrations/aci/diffsync/models/base.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Base Shared Models for Cisco ACI integration with SSoT app."""

from typing import List, Optional
from diffsync import DiffSyncModel

Expand Down
1 change: 1 addition & 0 deletions nautobot_ssot/integrations/aci/diffsync/utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""ACI Utilities."""

# pylint: disable=invalid-name
import logging
import re
Expand Down
1 change: 1 addition & 0 deletions nautobot_ssot/integrations/aci/jobs.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Jobs for ACI SSoT app."""

from django.templatetags.static import static
from django.urls import reverse
from diffsync import DiffSyncFlags
Expand Down
1 change: 1 addition & 0 deletions nautobot_ssot/integrations/aci/signals.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Signals for ACI integration."""

# pylint: disable=logging-fstring-interpolation, invalid-name
import logging
import random
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""DiffSync adapter for Arista CloudVision."""

import distutils
import ipaddress
import re
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""DiffSync adapter for Nautobot."""

from collections import defaultdict
from django.contrib.contenttypes.models import ContentType
from django.db.models import ProtectedError
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""DiffSyncModel subclasses for Nautobot-to-AristaCV data sync."""

from uuid import UUID
from diffsync import DiffSyncModel
from typing import List, Optional
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""CloudVision DiffSync models for AristaCV SSoT."""

from nautobot_ssot.integrations.aristacv.diffsync.models.base import (
Device,
CustomField,
Expand Down
8 changes: 5 additions & 3 deletions nautobot_ssot/integrations/aristacv/utils/cloudvision.py
Original file line number Diff line number Diff line change
Expand Up @@ -665,9 +665,11 @@ def get_ip_interfaces(client: CloudvisionApi, dId: str):
ip_intfs.append(
{
"interface": results["intfId"],
"address": results["addrWithMask"]
if results["addrWithMask"] != "0.0.0.0/0"
else results.get("virtualAddrWithMask"),
"address": (
results["addrWithMask"]
if results["addrWithMask"] != "0.0.0.0/0"
else results.get("virtualAddrWithMask")
),
}
)
return ip_intfs
Expand Down
56 changes: 35 additions & 21 deletions nautobot_ssot/integrations/device42/diffsync/adapters/device42.py
Original file line number Diff line number Diff line change
Expand Up @@ -468,18 +468,26 @@ def load_vendor_and_model(self, hwmodel_name: str, manuf: str):
hwmodel = self.hardware(
name=hwmodel_name,
manufacturer=manuf,
size=float(round(self.d42_hardware_map[hwmodel_name]["size"]))
if self.d42_hardware_map.get(hwmodel_name) and self.d42_hardware_map[hwmodel_name].get("size")
else 1.0,
depth=self.d42_hardware_map[hwmodel_name]["depth"]
if self.d42_hardware_map.get(hwmodel_name) and self.d42_hardware_map[hwmodel_name].get("depth")
else "Half Depth",
part_number=self.d42_hardware_map[hwmodel_name]["part_no"]
if self.d42_hardware_map.get(hwmodel_name) and self.d42_hardware_map[hwmodel_name].get("part_no")
else "",
custom_fields=get_custom_field_dict(self.d42_hardware_map[hwmodel_name]["custom_fields"])
if self.d42_hardware_map.get(hwmodel_name)
else {},
size=(
float(round(self.d42_hardware_map[hwmodel_name]["size"]))
if self.d42_hardware_map.get(hwmodel_name) and self.d42_hardware_map[hwmodel_name].get("size")
else 1.0
),
depth=(
self.d42_hardware_map[hwmodel_name]["depth"]
if self.d42_hardware_map.get(hwmodel_name) and self.d42_hardware_map[hwmodel_name].get("depth")
else "Half Depth"
),
part_number=(
self.d42_hardware_map[hwmodel_name]["part_no"]
if self.d42_hardware_map.get(hwmodel_name) and self.d42_hardware_map[hwmodel_name].get("part_no")
else ""
),
custom_fields=(
get_custom_field_dict(self.d42_hardware_map[hwmodel_name]["custom_fields"])
if self.d42_hardware_map.get(hwmodel_name)
else {}
),
uuid=None,
)
self.add(hwmodel)
Expand Down Expand Up @@ -762,9 +770,11 @@ def load_connections(self):
continue
try:
new_conn = self.conn(
src_device=self.d42_device_map[_conn["second_src_device"]]["name"]
if _conn.get("second_src_device")
else self.d42_device_map[_conn["src_device"]]["name"],
src_device=(
self.d42_device_map[_conn["second_src_device"]]["name"]
if _conn.get("second_src_device")
else self.d42_device_map[_conn["src_device"]]["name"]
),
src_port=self.d42_port_map[_conn["src_port"]]["port"],
src_port_mac=self.d42_port_map[_conn["src_port"]]["hwaddress"],
src_type="interface",
Expand Down Expand Up @@ -839,9 +849,11 @@ def load_providers_and_circuits(self):
a_side_conn = self.conn(
src_device=origin_dev,
src_port=origin_int,
src_port_mac=self.d42_port_map[_tc["origin_netport_fk"]]["hwaddress"]
if _tc["origin_type"] == "Device"
else None,
src_port_mac=(
self.d42_port_map[_tc["origin_netport_fk"]]["hwaddress"]
if _tc["origin_type"] == "Device"
else None
),
src_type="interface" if _tc["origin_type"] == "Device Port" else "patch panel",
dst_device=_tc["circuit_id"],
dst_port=_tc["circuit_id"],
Expand All @@ -859,9 +871,11 @@ def load_providers_and_circuits(self):
src_type="circuit",
dst_device=endpoint_dev,
dst_port=endpoint_int,
dst_port_mac=self.d42_port_map[_tc["end_point_netport_fk"]]["hwaddress"]
if _tc["end_point_type"] == "Device"
else None,
dst_port_mac=(
self.d42_port_map[_tc["end_point_netport_fk"]]["hwaddress"]
if _tc["end_point_type"] == "Device"
else None
),
dst_type="interface" if _tc["end_point_type"] == "Device Port" else "patch panel",
src_port_mac=None,
tags=None,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def create(cls, diffsync, ids, attrs):
try:
patch_panel.validated_save()
diffsync.device_map[ids["name"]] = patch_panel.id
return super().create(ids=ids, diffsync=diffsync, attrs=attrs)
return super().create(diffsync, ids=ids, attrs=attrs)
except ValidationError as err:
if diffsync.job.debug:
diffsync.job.logger.warning(f"Unable to create {ids['name']} patch panel. {err}")
Expand Down Expand Up @@ -165,7 +165,7 @@ def create(cls, diffsync, ids, attrs):
if ids["patchpanel"] not in diffsync.rp_map:
diffsync.rp_map[ids["patchpanel"]] = {}
diffsync.rp_map[ids["patchpanel"]][ids["name"]] = rear_port.id
return super().create(ids=ids, diffsync=diffsync, attrs=attrs)
return super().create(diffsync, ids=ids, attrs=attrs)
except ValidationError as err:
if diffsync.job.debug:
diffsync.job.logger.debug(f"Unable to create patch panel {ids['name']}. {err}")
Expand Down Expand Up @@ -216,7 +216,7 @@ def create(cls, diffsync, ids, attrs):
if ids["patchpanel"] not in diffsync.fp_map:
diffsync.fp_map[ids["patchpanel"]] = {}
diffsync.fp_map[ids["patchpanel"]][ids["name"]] = front_port.id
return super().create(ids=ids, diffsync=diffsync, attrs=attrs)
return super().create(diffsync, ids=ids, attrs=attrs)
except ValidationError as err:
diffsync.job.logger.debug(f"Unable to create patch panel front port {ids['name']}. {err}")
return None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def create(cls, diffsync, ids, attrs):
try:
_provider.validated_save()
diffsync.provider_map[ids["name"]] = _provider.id
return super().create(ids=ids, diffsync=diffsync, attrs=attrs)
return super().create(diffsync, ids=ids, attrs=attrs)
except ValidationError as err:
if diffsync.job.debug:
diffsync.job.logger.warning(f"Unable to create {ids['name']} provider. {err}")
Expand Down Expand Up @@ -122,7 +122,7 @@ def create(cls, diffsync, ids, attrs):
term_side="Z",
circuit=_circuit,
)
return super().create(ids=ids, diffsync=diffsync, attrs=attrs)
return super().create(diffsync, ids=ids, attrs=attrs)

def update(self, attrs):
"""Update Circuit object in Nautobot."""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def create(cls, diffsync, ids, attrs):
nautobot.update_custom_fields(new_cfields=attrs["custom_fields"], update_obj=new_site)
new_site.validated_save()
diffsync.site_map[ids["name"]] = new_site.id
return super().create(ids=ids, diffsync=diffsync, attrs=attrs)
return super().create(diffsync, ids=ids, attrs=attrs)

def update(self, attrs):
"""Update Site object in Nautobot."""
Expand Down Expand Up @@ -137,7 +137,7 @@ def create(cls, diffsync, ids, attrs):
if ids["building"] not in diffsync.room_map:
diffsync.room_map[ids["building"]] = {}
diffsync.room_map[ids["building"]][ids["name"]] = new_rg.id
return super().create(ids=ids, diffsync=diffsync, attrs=attrs)
return super().create(diffsync, ids=ids, attrs=attrs)

def update(self, attrs):
"""Update RackGroup object in Nautobot."""
Expand Down Expand Up @@ -188,7 +188,7 @@ def create(cls, diffsync, ids, attrs):
if ids["room"] not in diffsync.rack_map[ids["building"]]:
diffsync.rack_map[ids["building"]][ids["room"]] = {}
diffsync.rack_map[ids["building"]][ids["room"]][ids["name"]] = new_rack.id
return super().create(ids=ids, diffsync=diffsync, attrs=attrs)
return super().create(diffsync, ids=ids, attrs=attrs)

def update(self, attrs):
"""Update Rack object in Nautobot."""
Expand Down Expand Up @@ -240,7 +240,7 @@ def create(cls, diffsync, ids, attrs):
nautobot.update_custom_fields(new_cfields=attrs["custom_fields"], update_obj=new_manu)
new_manu.validated_save()
diffsync.vendor_map[ids["name"]] = new_manu.id
return super().create(ids=ids, diffsync=diffsync, attrs=attrs)
return super().create(diffsync, ids=ids, attrs=attrs)

def update(self, attrs):
"""Update Manufacturer object in Nautobot."""
Expand Down Expand Up @@ -287,7 +287,7 @@ def create(cls, diffsync, ids, attrs):
nautobot.update_custom_fields(new_cfields=attrs["custom_fields"], update_obj=new_dt)
new_dt.validated_save()
diffsync.devicetype_map[ids["name"]] = new_dt.id
return super().create(ids=ids, diffsync=diffsync, attrs=attrs)
return super().create(diffsync, ids=ids, attrs=attrs)

def update(self, attrs):
"""Update DeviceType object in Nautobot."""
Expand Down Expand Up @@ -346,7 +346,7 @@ def create(cls, diffsync, ids, attrs):
nautobot.update_custom_fields(new_cfields=attrs["custom_fields"], update_obj=new_vc)
new_vc.validated_save()
diffsync.cluster_map[ids["name"]] = new_vc.id
return super().create(ids=ids, diffsync=diffsync, attrs=attrs)
return super().create(diffsync, ids=ids, attrs=attrs)

def update(self, attrs):
"""Update Virtual Chassis object in Nautobot."""
Expand Down Expand Up @@ -699,7 +699,7 @@ def create(cls, diffsync, ids, attrs): # pylint: disable=inconsistent-return-st
diffsync.port_map[ids["device"]][ids["name"]] = new_intf.id
if attrs.get("mac_addr"):
diffsync.port_map[attrs["mac_addr"][:12]] = new_intf.id
return super().create(ids=ids, diffsync=diffsync, attrs=attrs)
return super().create(diffsync, ids=ids, attrs=attrs)

def update(self, attrs):
"""Update Interface object in Nautobot."""
Expand Down
Loading
Loading