Skip to content
This repository has been archived by the owner on Dec 1, 2023. It is now read-only.

Commit

Permalink
Pydocstyle fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
glennmatthews committed Jun 24, 2021
1 parent a11aa39 commit 392ddf2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions nautobot_ssot_servicenow/diffsync/adapter_nautobot.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ class NautobotDiffSync(DiffSync):
]

def __init__(self, *args, job=None, sync=None, **kwargs):
"""Initialize the NautobotDiffSync."""
super().__init__(*args, **kwargs)
self.job = job
self.sync = sync
Expand Down
1 change: 1 addition & 0 deletions nautobot_ssot_servicenow/diffsync/adapter_servicenow.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ class ServiceNowDiffSync(DiffSync):
DATA_DIR = os.path.abspath(os.path.join(os.path.dirname(os.path.dirname(__file__)), "data"))

def __init__(self, *args, client=None, job=None, sync=None, **kwargs):
"""Initialize the ServiceNowDiffSync adapter."""
super().__init__(*args, **kwargs)
self.client = client
self.job = job
Expand Down
5 changes: 5 additions & 0 deletions nautobot_ssot_servicenow/jobs.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
"""ServiceNow Data Target Job."""
from django.conf import settings
from django.templatetags.static import static
from django.urls import reverse
Expand Down Expand Up @@ -28,13 +29,15 @@ class ServiceNowDataTarget(DataTarget, Job):
)

class Meta:
"""Metadata about this Job."""
name = "ServiceNow"
data_target = "ServiceNow"
data_target_icon = static("nautobot_ssot_servicenow/ServiceNow_logo.svg")
description = "Synchronize data from Nautobot into ServiceNow."

@classmethod
def data_mappings(cls):
"""List describing the data mappings involved in this DataTarget."""
return (
DataMapping("Region", reverse("dcim:region_list"), "Location", None),
DataMapping("Site", reverse("dcim:site_list"), "Location", None),
Expand All @@ -44,6 +47,7 @@ def data_mappings(cls):

@classmethod
def config_information(cls):
"""Dictionary describing the configuration of this DataTarget."""
configs = settings.PLUGINS_CONFIG.get("nautobot_ssot_servicenow", {})
return {
"ServiceNow instance": configs.get("instance"),
Expand Down Expand Up @@ -85,6 +89,7 @@ def sync_data(self):
self.log_info(message="Sync complete")

def lookup_object(self, model_name, unique_id):
"""Look up a Nautobot object based on the DiffSync model name and unique ID."""
if model_name == "location":
try:
return (Region.objects.get(name=unique_id), None)
Expand Down

0 comments on commit 392ddf2

Please sign in to comment.