diff --git a/nautobot_ssot_servicenow/diffsync/adapter_nautobot.py b/nautobot_ssot_servicenow/diffsync/adapter_nautobot.py index 0999049..ea02435 100644 --- a/nautobot_ssot_servicenow/diffsync/adapter_nautobot.py +++ b/nautobot_ssot_servicenow/diffsync/adapter_nautobot.py @@ -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 diff --git a/nautobot_ssot_servicenow/diffsync/adapter_servicenow.py b/nautobot_ssot_servicenow/diffsync/adapter_servicenow.py index 9182289..c02bb5f 100644 --- a/nautobot_ssot_servicenow/diffsync/adapter_servicenow.py +++ b/nautobot_ssot_servicenow/diffsync/adapter_servicenow.py @@ -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 diff --git a/nautobot_ssot_servicenow/jobs.py b/nautobot_ssot_servicenow/jobs.py index 94017bd..59bf2d4 100644 --- a/nautobot_ssot_servicenow/jobs.py +++ b/nautobot_ssot_servicenow/jobs.py @@ -1,3 +1,4 @@ +"""ServiceNow Data Target Job.""" from django.conf import settings from django.templatetags.static import static from django.urls import reverse @@ -28,6 +29,7 @@ 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") @@ -35,6 +37,7 @@ class Meta: @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), @@ -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"), @@ -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)