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 SSoT Adapter #207

Merged
merged 1 commit into from
Dec 18, 2024
Merged
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

from diffsync import Adapter

from {{ cookiecutter.app_name }}.diffsync.models import DiffsyncDevice
from {{ cookiecutter.app_name }}.diffsync.models import DeviceSSoTModel


class {{ cookiecutter.system_of_record_camel }}RemoteAdapter(Adapter):
"""DiffSync adapter for {{ cookiecutter.system_of_record }}."""

device = DiffsyncDevice
device = DeviceSSoTModel

top_level = ["device"]

Expand All @@ -17,7 +17,7 @@ def __init__(self, *args, job=None, sync=None, client=None, **kwargs):

Args:
job (object, optional): {{ cookiecutter.system_of_record }} job. Defaults to None.
sync (object, optional): {{ cookiecutter.system_of_record }} DiffSync. Defaults to None.
sync (object, optional): {{ cookiecutter.system_of_record }} SSoT. Defaults to None.
client (object): {{ cookiecutter.system_of_record }} API client connection object.
"""
super().__init__(*args, **kwargs)
Expand All @@ -26,19 +26,19 @@ def __init__(self, *args, job=None, sync=None, client=None, **kwargs):
self.conn = client

def load(self):
"""Load data from {{ cookiecutter.system_of_record }} into DiffSync models."""
"""Load data from {{ cookiecutter.system_of_record }} into SSoT models."""
raise NotImplementedError()


class {{ cookiecutter.system_of_record_camel }}NautobotAdapter(NautobotAdapter):
"""DiffSync adapter for Nautobot."""

device = NautobotDevice
device = DeviceSSoTModel

top_level = ["device"]

{% if cookiecutter.direction_of_sync == "From Nautobot" %}
def load(self):
"""Load data from Nautobot into DiffSync models."""
"""Load data from Nautobot into SSoT models."""
raise NotImplementedError()
{% endif %}