diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 21d662a8..6fa384f8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -95,7 +95,7 @@ jobs: fail-fast: true matrix: python-version: ["3.11"] - nautobot-version: ["2.1"] + nautobot-version: ["1.6"] env: INVOKE_NAUTOBOT_DESIGN_BUILDER_PYTHON_VER: "${{ matrix.python-version }}" INVOKE_NAUTOBOT_DESIGN_BUILDER_NAUTOBOT_VER: "${{ matrix.nautobot-version }}" @@ -138,7 +138,7 @@ jobs: fail-fast: true matrix: python-version: ["3.11"] - nautobot-version: ["2.1"] + nautobot-version: ["1.6"] env: INVOKE_NAUTOBOT_DESIGN_BUILDER_PYTHON_VER: "${{ matrix.python-version }}" INVOKE_NAUTOBOT_DESIGN_BUILDER_NAUTOBOT_VER: "${{ matrix.nautobot-version }}" @@ -177,14 +177,14 @@ jobs: matrix: python-version: ["3.8", "3.11"] db-backend: ["postgresql"] - nautobot-version: ["1.6", "stable"] + nautobot-version: ["1.6"] include: - python-version: "3.11" db-backend: "postgresql" nautobot-version: "1.6.0" - python-version: "3.11" db-backend: "mysql" - nautobot-version: "stable" + nautobot-version: "1.6" runs-on: "ubuntu-22.04" env: INVOKE_NAUTOBOT_DESIGN_BUILDER_PYTHON_VER: "${{ matrix.python-version }}" diff --git a/development/docker-compose.base.yml b/development/docker-compose.base.yml index ff38d9c6..d2988c76 100644 --- a/development/docker-compose.base.yml +++ b/development/docker-compose.base.yml @@ -13,7 +13,6 @@ x-nautobot-base: &nautobot-base - "creds.env" tty: true -version: "3.8" services: nautobot: depends_on: diff --git a/development/docker-compose.dev.yml b/development/docker-compose.dev.yml index 2201007b..dcfcfa7f 100644 --- a/development/docker-compose.dev.yml +++ b/development/docker-compose.dev.yml @@ -3,7 +3,6 @@ # any override will need to include these volumes to use them. # see: https://github.com/docker/compose/issues/3729 --- -version: "3.8" services: nautobot: command: "nautobot-server runserver 0.0.0.0:8080" diff --git a/development/docker-compose.mysql.yml b/development/docker-compose.mysql.yml index dc2641a2..83cbd477 100644 --- a/development/docker-compose.mysql.yml +++ b/development/docker-compose.mysql.yml @@ -1,6 +1,4 @@ --- -version: "3.8" - services: nautobot: environment: @@ -25,8 +23,6 @@ services: - "development_mysql.env" db: image: "mysql:8" - command: - - "--default-authentication-plugin=mysql_native_password" env_file: - "development.env" - "creds.env" diff --git a/development/docker-compose.postgres.yml b/development/docker-compose.postgres.yml index 12d1de31..8d96fdba 100644 --- a/development/docker-compose.postgres.yml +++ b/development/docker-compose.postgres.yml @@ -1,6 +1,4 @@ --- -version: "3.8" - services: nautobot: environment: diff --git a/development/docker-compose.redis.yml b/development/docker-compose.redis.yml index 6da9fa01..b5e266a3 100644 --- a/development/docker-compose.redis.yml +++ b/development/docker-compose.redis.yml @@ -1,5 +1,4 @@ --- -version: "3.8" services: redis: image: "redis:6-alpine" diff --git a/development/docker-compose.test-designs.yml b/development/docker-compose.test-designs.yml index af1dd803..055672ab 100644 --- a/development/docker-compose.test-designs.yml +++ b/development/docker-compose.test-designs.yml @@ -1,5 +1,4 @@ --- -version: "3.8" services: nautobot: volumes: diff --git a/docs/admin/release_notes/version_1.2.md b/docs/admin/release_notes/version_1.2.md index aadab6fd..3e5de204 100644 --- a/docs/admin/release_notes/version_1.2.md +++ b/docs/admin/release_notes/version_1.2.md @@ -4,7 +4,7 @@ The 1.2 release of Design Builder removes support for Nautobot 2.x from the long term support branch. Support for Nautobot 1.x will continue in the ltm-1.6 branch while Nautobot 2.0 support will remain in the develop branch. -## [v1.1.0] - 2024-05 +## [v1.2.0] - 2024-05 ### Removed diff --git a/nautobot_design_builder/contrib/tests/test_ext.py b/nautobot_design_builder/contrib/tests/test_ext.py index f2ed2293..03f0ca54 100644 --- a/nautobot_design_builder/contrib/tests/test_ext.py +++ b/nautobot_design_builder/contrib/tests/test_ext.py @@ -5,29 +5,8 @@ from django.test import TestCase from nautobot_design_builder.tests.test_builder import builder_test_case -from nautobot_design_builder.util import nautobot_version @builder_test_case(os.path.join(os.path.dirname(__file__), "testdata")) class TestAgnosticExtensions(TestCase): - """Test contrib extensions against any version of Nautobot.""" - - -@builder_test_case(os.path.join(os.path.dirname(__file__), "testdata", "nautobot_v1")) -class TestV1Extensions(TestCase): - """Test contrib extensions against Nautobot V1.""" - - def setUp(self): - if nautobot_version >= "2.0.0": - self.skipTest("These tests are only supported in Nautobot 1.x") - super().setUp() - - -@builder_test_case(os.path.join(os.path.dirname(__file__), "testdata", "nautobot_v2")) -class TestV2Extensions(TestCase): - """Test contrib extensions against Nautobot V2.""" - - def setUp(self): - if nautobot_version < "2.0.0": - self.skipTest("These tests are only supported in Nautobot 2.x") - super().setUp() + """Test contrib extensions.""" diff --git a/nautobot_design_builder/contrib/tests/testdata/nautobot_v1/bgp_extension.yaml b/nautobot_design_builder/contrib/tests/testdata/bgp_extension.yaml similarity index 100% rename from nautobot_design_builder/contrib/tests/testdata/nautobot_v1/bgp_extension.yaml rename to nautobot_design_builder/contrib/tests/testdata/bgp_extension.yaml diff --git a/nautobot_design_builder/contrib/tests/testdata/nautobot_v1/cable_connections.yaml b/nautobot_design_builder/contrib/tests/testdata/cable_connections.yaml similarity index 100% rename from nautobot_design_builder/contrib/tests/testdata/nautobot_v1/cable_connections.yaml rename to nautobot_design_builder/contrib/tests/testdata/cable_connections.yaml diff --git a/nautobot_design_builder/contrib/tests/testdata/nautobot_v1/child_prefix.yaml b/nautobot_design_builder/contrib/tests/testdata/child_prefix.yaml similarity index 100% rename from nautobot_design_builder/contrib/tests/testdata/nautobot_v1/child_prefix.yaml rename to nautobot_design_builder/contrib/tests/testdata/child_prefix.yaml diff --git a/nautobot_design_builder/contrib/tests/testdata/nautobot_v2/bgp_extension.yaml b/nautobot_design_builder/contrib/tests/testdata/nautobot_v2/bgp_extension.yaml deleted file mode 100644 index e0a7614d..00000000 --- a/nautobot_design_builder/contrib/tests/testdata/nautobot_v2/bgp_extension.yaml +++ /dev/null @@ -1,87 +0,0 @@ ---- -extensions: - - "nautobot_design_builder.contrib.ext.BGPPeeringExtension" -designs: - - roles: - - name: "test-role" - content_types: - - "!get:app_label": "dcim" - "!get:model": "device" - prefixes: - - status__name: "Active" - prefix: "192.168.1.0/24" - - location_types: - - name: "Site" - content_types: - - "!get:app_label": "dcim" - "!get:model": "device" - locations: - - name: "Site" - status__name: "Active" - - manufacturers: - - "!create_or_update:name": "test-manufacturer" - - device_types: - - manufacturer__name: "test-manufacturer" - "!create_or_update:model": "test-type" - - autonomous_systems: - - "!create_or_update:asn": 64500 - status__name: "Active" - - devices: - - "!create_or_update:name": "device1" - status__name: "Active" - location__name: "Site" - role__name: "test-role" - device_type__model: "test-type" - interfaces: - - "!create_or_update:name": "Ethernet1/1" - type: "virtual" - status__name: "Active" - ip_address_assignments: - - ip_address: - "!create_or_update:address": "192.168.1.1/24" - status__name: "Active" - bgp_routing_instances: - - "!create_or_update:autonomous_system__asn": 64500 - "!ref": "device1-instance" - status__name: "Active" - - - "!create_or_update:name": "device2" - status__name: "Active" - location__name: "Site" - role__name: "test-role" - device_type__model: "test-type" - interfaces: - - "!create_or_update:name": "Ethernet1/1" - type: "virtual" - status__name: "Active" - ip_address_assignments: - - ip_address: - "!create_or_update:address": "192.168.1.2/24" - status__name: "Active" - bgp_routing_instances: - - "!create_or_update:autonomous_system__asn": 64500 - "!ref": "device2-instance" - status__name: "Active" - - bgp_peerings: - - "!bgp_peering": - endpoint_a: - "!create_or_update:routing_instance__device__name": "device1" - "!create_or_update:source_ip__address": "192.168.1.1/24" - endpoint_z: - "!create_or_update:routing_instance__device__name": "device2" - "!create_or_update:source_ip__address": "192.168.1.2/24" - status__name: "Active" -checks: - - equal: - - model: "nautobot_bgp_models.models.PeerEndpoint" - query: {routing_instance__device__name: "device1"} - attribute: "peering" - - model: "nautobot_bgp_models.models.PeerEndpoint" - query: {routing_instance__device__name: "device2"} - attribute: "peering" diff --git a/nautobot_design_builder/contrib/tests/testdata/nautobot_v2/cable_connections.yaml b/nautobot_design_builder/contrib/tests/testdata/nautobot_v2/cable_connections.yaml deleted file mode 100644 index f7aef4ed..00000000 --- a/nautobot_design_builder/contrib/tests/testdata/nautobot_v2/cable_connections.yaml +++ /dev/null @@ -1,68 +0,0 @@ ---- -extensions: - - "nautobot_design_builder.contrib.ext.CableConnectionExtension" -designs: - - location_types: - - "!create_or_update:name": "Site" - content_types: - - "!get:app_label": "dcim" - "!get:model": "device" - locations: - - location_type__name: "Site" - "!create_or_update:name": "Site" - status__name: "Active" - roles: - - "!create_or_update:name": "test-role" - content_types: - - "!get:app_label": "dcim" - "!get:model": "device" - manufacturers: - - "!create_or_update:name": "test-manufacturer" - device_types: - - manufacturer__name: "test-manufacturer" - "!create_or_update:model": "test-type" - devices: - - "!create_or_update:name": "Device 1" - "!ref": "device1" - location__name: "Site" - status__name: "Active" - role__name: "test-role" - device_type__model: "test-type" - interfaces: - - "!create_or_update:name": "GigabitEthernet1" - type: "1000base-t" - status__name: "Active" - - "!create_or_update:name": "Device 2" - location__name: "Site" - status__name: "Active" - role__name: "test-role" - device_type__model: "test-type" - interfaces: - - "!create_or_update:name": "GigabitEthernet1" - type: "1000base-t" - status__name: "Active" - "!connect_cable": - status__name: "Planned" - to: - device: "!ref:device1" - name: "GigabitEthernet1" - # Second design, same as the first, checks for - # cable connection idempotence - - devices: - - "!create_or_update:name": "Device 1" - "!ref": "device1" - - "!create_or_update:name": "Device 2" - interfaces: - - "!create_or_update:name": "GigabitEthernet1" - "!connect_cable": - status__name: "Planned" - to: - device: "!ref:device1" - name: "GigabitEthernet1" - -checks: - - connected: - - model: "nautobot.dcim.models.Interface" - query: {device__name: "Device 1", name: "GigabitEthernet1"} - - model: "nautobot.dcim.models.Interface" - query: {device__name: "Device 2", name: "GigabitEthernet1"} diff --git a/nautobot_design_builder/contrib/tests/testdata/nautobot_v2/child_prefix.yaml b/nautobot_design_builder/contrib/tests/testdata/nautobot_v2/child_prefix.yaml deleted file mode 100644 index d4ed1d17..00000000 --- a/nautobot_design_builder/contrib/tests/testdata/nautobot_v2/child_prefix.yaml +++ /dev/null @@ -1,49 +0,0 @@ ---- -extensions: - - "nautobot_design_builder.contrib.ext.NextPrefixExtension" - - "nautobot_design_builder.contrib.ext.ChildPrefixExtension" -designs: - - tenants: - - name: "Nautobot Airports" - roles: - - name: "Video" - content_types: - - "!get:app_label": "ipam" - "!get:model": "prefix" - - name: "Servers" - content_types: - - "!get:app_label": "ipam" - "!get:model": "prefix" - - prefixes: - - prefix: "10.0.0.0/23" - status__name: "Active" - tenant__name: "Nautobot Airports" - role__name: "Servers" - - prefix: "10.0.2.0/23" - status__name: "Active" - tenant__name: "Nautobot Airports" - role__name: "Video" - - "!next_prefix": - prefix: - - "10.0.0.0/23" - length: 24 - status__name: "Active" - "!ref": "parent_prefix" - - "!child_prefix": - parent: "!ref:parent_prefix" - offset: "0.0.0.0/25" - status__name: "Active" - - "!child_prefix": - parent: "!ref:parent_prefix" - offset: "0.0.0.128/25" - status__name: "Active" -checks: - - model_exists: - model: "nautobot.ipam.models.Prefix" - query: {prefix: "10.0.0.0/24"} - - model_exists: - model: "nautobot.ipam.models.Prefix" - query: {prefix: "10.0.0.0/25"} - - model_exists: - model: "nautobot.ipam.models.Prefix" - query: {prefix: "10.0.0.128/25"} diff --git a/nautobot_design_builder/contrib/tests/testdata/nautobot_v2/next_prefix.yaml b/nautobot_design_builder/contrib/tests/testdata/nautobot_v2/next_prefix.yaml deleted file mode 100644 index bceb228c..00000000 --- a/nautobot_design_builder/contrib/tests/testdata/nautobot_v2/next_prefix.yaml +++ /dev/null @@ -1,61 +0,0 @@ ---- -extensions: - - "nautobot_design_builder.contrib.ext.NextPrefixExtension" -designs: - - tenants: - - name: "Nautobot Airports" - roles: - - name: "Video" - content_types: - - "!get:app_label": "ipam" - "!get:model": "prefix" - - name: "Servers" - content_types: - - "!get:app_label": "ipam" - "!get:model": "prefix" - - prefixes: - - prefix: "10.0.0.0/23" - status__name: "Active" - tenant__name: "Nautobot Airports" - role__name: "Servers" - - prefix: "10.0.2.0/23" - status__name: "Active" - tenant__name: "Nautobot Airports" - role__name: "Video" - - "!next_prefix": - prefix: - - "10.0.0.0/23" - - "10.0.2.0/23" - length: 24 - status__name: "Active" - - "!next_prefix": - prefix: - - "10.0.0.0/23" - - "10.0.2.0/23" - length: 24 - status__name: "Active" - - "!next_prefix": - prefix: - - "10.0.0.0/23" - - "10.0.2.0/23" - length: 24 - status__name: "Active" - - "!next_prefix": - prefix: - - "10.0.0.0/23" - - "10.0.2.0/23" - length: 24 - status__name: "Active" -checks: - - model_exists: - model: "nautobot.ipam.models.Prefix" - query: {prefix: "10.0.0.0/24"} - - model_exists: - model: "nautobot.ipam.models.Prefix" - query: {prefix: "10.0.1.0/24"} - - model_exists: - model: "nautobot.ipam.models.Prefix" - query: {prefix: "10.0.2.0/24"} - - model_exists: - model: "nautobot.ipam.models.Prefix" - query: {prefix: "10.0.3.0/24"} diff --git a/nautobot_design_builder/contrib/tests/testdata/nautobot_v2/next_prefix_by_role_and_tenant.yaml b/nautobot_design_builder/contrib/tests/testdata/nautobot_v2/next_prefix_by_role_and_tenant.yaml deleted file mode 100644 index 40faf41f..00000000 --- a/nautobot_design_builder/contrib/tests/testdata/nautobot_v2/next_prefix_by_role_and_tenant.yaml +++ /dev/null @@ -1,33 +0,0 @@ ---- -extensions: - - "nautobot_design_builder.contrib.ext.NextPrefixExtension" -designs: - - tenants: - - name: "Nautobot Airports" - roles: - - name: "Video" - content_types: - - "!get:app_label": "ipam" - "!get:model": "prefix" - - name: "Servers" - content_types: - - "!get:app_label": "ipam" - "!get:model": "prefix" - - prefixes: - - prefix: "10.0.0.0/23" - status__name: "Active" - tenant__name: "Nautobot Airports" - role__name: "Servers" - - prefix: "10.0.2.0/23" - status__name: "Active" - tenant__name: "Nautobot Airports" - role__name: "Video" - - "!next_prefix": - role__name: "Video" - tenant__name: "Nautobot Airports" - length: 24 - status__name: "Active" -checks: - - model_exists: - model: "nautobot.ipam.models.Prefix" - query: {prefix: "10.0.2.0/24"} diff --git a/nautobot_design_builder/contrib/tests/testdata/nautobot_v1/next_prefix.yaml b/nautobot_design_builder/contrib/tests/testdata/next_prefix.yaml similarity index 100% rename from nautobot_design_builder/contrib/tests/testdata/nautobot_v1/next_prefix.yaml rename to nautobot_design_builder/contrib/tests/testdata/next_prefix.yaml diff --git a/nautobot_design_builder/contrib/tests/testdata/nautobot_v1/next_prefix_by_role_and_tenant.yaml b/nautobot_design_builder/contrib/tests/testdata/next_prefix_by_role_and_tenant.yaml similarity index 100% rename from nautobot_design_builder/contrib/tests/testdata/nautobot_v1/next_prefix_by_role_and_tenant.yaml rename to nautobot_design_builder/contrib/tests/testdata/next_prefix_by_role_and_tenant.yaml diff --git a/nautobot_design_builder/design_job.py b/nautobot_design_builder/design_job.py index 61e88d14..8a147435 100644 --- a/nautobot_design_builder/design_job.py +++ b/nautobot_design_builder/design_job.py @@ -8,19 +8,16 @@ import yaml from django.db import transaction -from django.core.files.base import ContentFile from jinja2 import TemplateError from nautobot.extras.jobs import Job -from nautobot.extras.models import FileProxy from nautobot_design_builder.errors import DesignImplementationError, DesignModelError from nautobot_design_builder.jinja2 import new_template_environment from nautobot_design_builder.logging import LoggingMixin from nautobot_design_builder.design import Environment from nautobot_design_builder.context import Context -from .util import nautobot_version class DesignJob(Job, ABC, LoggingMixin): # pylint: disable=too-many-instance-attributes @@ -31,11 +28,6 @@ class DesignJob(Job, ABC, LoggingMixin): # pylint: disable=too-many-instance-at a Meta class. """ - if nautobot_version >= "2.0.0": - from nautobot.extras.jobs import DryRunVar # pylint: disable=no-name-in-module,import-outside-toplevel - - dryrun = DryRunVar() - @classmethod @abstractmethod def Meta(cls) -> Job.Meta: # pylint: disable=invalid-name @@ -48,7 +40,6 @@ def __init__(self, *args, **kwargs): self.designs = {} # TODO: Remove this when we no longer support Nautobot 1.x self.rendered = None - self.rendered_design = None self.failed = False self.report = None @@ -120,14 +111,12 @@ def render_design(self, context, design_file): context (Context object): a tree of variables that can include templates for values design_file (str): Filename of the design file to render. """ - self.rendered_design = design_file self.rendered = self.render(context, design_file) design = yaml.safe_load(self.rendered) self.designs[design_file] = design # no need to save the rendered content if yaml loaded # it okay - self.rendered_design = None self.rendered = None return design @@ -156,22 +145,7 @@ def implement_design(self, context, design_file, commit): def run(self, **kwargs): # pylint: disable=arguments-differ """Render the design and implement it within a build Environment object.""" - try: - return self._run_in_transaction(**kwargs) - finally: - if self.rendered: - rendered_design = path.basename(self.rendered_design) - rendered_design, _ = path.splitext(rendered_design) - if not rendered_design.endswith(".yaml") and not rendered_design.endswith(".yml"): - rendered_design = f"{rendered_design}.yaml" - self.save_design_file(rendered_design, self.rendered) - for design_file, design in self.designs.items(): - output_file = path.basename(design_file) - # this should remove the .j2 - output_file, _ = path.splitext(output_file) - if not output_file.endswith(".yaml") and not output_file.endswith(".yml"): - output_file = f"{output_file}.yaml" - self.save_design_file(output_file, yaml.safe_dump(design)) + return self._run_in_transaction(**kwargs) @transaction.atomic def _run_in_transaction(self, **kwargs): # pylint: disable=too-many-branches @@ -186,12 +160,8 @@ def _run_in_transaction(self, **kwargs): # pylint: disable=too-many-branches design_files = None - if nautobot_version < "2.0.0": - commit = kwargs["commit"] - data = kwargs["data"] - else: - commit = not kwargs.pop("dryrun", True) - data = kwargs + commit = kwargs["commit"] + data = kwargs["data"] if hasattr(self.Meta, "context_class"): context = self.Meta.context_class(data=data, job_result=self.job_result) @@ -218,8 +188,6 @@ def _run_in_transaction(self, **kwargs): # pylint: disable=too-many-branches if hasattr(self.Meta, "report"): self.report = self.render_report(context, self.environment.journal) self.log_success(message=self.report) - if nautobot_version >= "2.0": - self.save_design_file("report.md", self.report) else: transaction.savepoint_rollback(sid) self.log_info( @@ -230,27 +198,7 @@ def _run_in_transaction(self, **kwargs): # pylint: disable=too-many-branches self.log_failure(message="Failed to implement design") self.log_failure(message=str(ex)) self.failed = True - if nautobot_version >= "2": - raise ex except Exception as ex: transaction.savepoint_rollback(sid) self.failed = True raise ex - - def save_design_file(self, filename, content): - """Save some content to a job file. - - This is only supported on Nautobot 2.0 and greater. - - Args: - filename (str): The name of the file to save. - content (str): The content to save to the file. - """ - if nautobot_version < "2.0": - return - - FileProxy.objects.create( - name=filename, - job_result=self.job_result, - file=ContentFile(content.encode("utf-8"), name=filename), - ) diff --git a/nautobot_design_builder/fields.py b/nautobot_design_builder/fields.py index 66f40103..265ec320 100644 --- a/nautobot_design_builder/fields.py +++ b/nautobot_design_builder/fields.py @@ -52,7 +52,6 @@ from nautobot_design_builder.errors import DesignImplementationError from nautobot_design_builder.debug import debug_set -from nautobot_design_builder.util import nautobot_version if TYPE_CHECKING: from .design import ModelInstance @@ -295,10 +294,7 @@ def __init__(self, model_class, relationship: Relationship): self.related_model = relationship.source_type.model_class() field_name = str(self.relationship.get_label("destination")) self.__set_name__(model_class, str_to_var_name(field_name)) - if nautobot_version < "2.0.0": - self.key_name = self.relationship.slug - else: - self.key_name = self.relationship.key + self.key_name = self.relationship.slug @debug_set def __set__(self, obj: "ModelInstance", values): # noqa:D105 diff --git a/nautobot_design_builder/logging.py b/nautobot_design_builder/logging.py index e3ff4126..3d30f668 100644 --- a/nautobot_design_builder/logging.py +++ b/nautobot_design_builder/logging.py @@ -5,36 +5,18 @@ from nautobot.extras.choices import LogLevelChoices from nautobot.extras.models import JobResult -from .util import nautobot_version - -if nautobot_version < "2.0.0": - # MIN_VERSION: 2.0.0 - _logger_to_level_choices = { - logging.DEBUG: LogLevelChoices.LOG_INFO, - logging.INFO: LogLevelChoices.LOG_INFO, - logging.WARNING: LogLevelChoices.LOG_WARNING, - logging.ERROR: LogLevelChoices.LOG_FAILURE, # pylint: disable=no-member - logging.CRITICAL: LogLevelChoices.LOG_FAILURE, # pylint: disable=no-member - } - LOG_INFO = LogLevelChoices.LOG_INFO - LOG_DEBUG = LogLevelChoices.LOG_INFO - LOG_SUCCESS = LogLevelChoices.LOG_SUCCESS # pylint: disable=no-member - LOG_WARNING = LogLevelChoices.LOG_WARNING - LOG_FAILURE = LogLevelChoices.LOG_FAILURE # pylint: disable=no-member - # /MIN_VERSION: 2.0.0 -else: - _logger_to_level_choices = { - logging.DEBUG: LogLevelChoices.LOG_DEBUG, # pylint: disable=no-member - logging.INFO: LogLevelChoices.LOG_INFO, - logging.WARNING: LogLevelChoices.LOG_WARNING, - logging.ERROR: LogLevelChoices.LOG_ERROR, # pylint: disable=no-member - logging.CRITICAL: LogLevelChoices.LOG_CRITICAL, # pylint: disable=no-member - } - LOG_INFO = LogLevelChoices.LOG_INFO - LOG_DEBUG = LogLevelChoices.LOG_DEBUG # pylint: disable=no-member - LOG_SUCCESS = LogLevelChoices.LOG_INFO - LOG_WARNING = LogLevelChoices.LOG_WARNING - LOG_FAILURE = LogLevelChoices.LOG_ERROR # pylint: disable=no-member +_logger_to_level_choices = { + logging.DEBUG: LogLevelChoices.LOG_INFO, + logging.INFO: LogLevelChoices.LOG_INFO, + logging.WARNING: LogLevelChoices.LOG_WARNING, + logging.ERROR: LogLevelChoices.LOG_FAILURE, # pylint: disable=no-member + logging.CRITICAL: LogLevelChoices.LOG_FAILURE, # pylint: disable=no-member +} +LOG_INFO = LogLevelChoices.LOG_INFO +LOG_DEBUG = LogLevelChoices.LOG_INFO +LOG_SUCCESS = LogLevelChoices.LOG_SUCCESS # pylint: disable=no-member +LOG_WARNING = LogLevelChoices.LOG_WARNING +LOG_FAILURE = LogLevelChoices.LOG_FAILURE # pylint: disable=no-member class JobResultHandler(logging.Handler): diff --git a/nautobot_design_builder/tests/__init__.py b/nautobot_design_builder/tests/__init__.py index 992523d5..2bc58e18 100644 --- a/nautobot_design_builder/tests/__init__.py +++ b/nautobot_design_builder/tests/__init__.py @@ -11,7 +11,6 @@ from django.test import TestCase from nautobot_design_builder.design_job import DesignJob -from nautobot_design_builder.util import nautobot_version logging.disable(logging.CRITICAL) @@ -36,19 +35,7 @@ def get_mocked_job(self, design_class: Type[DesignJob]): job = design_class() job.job_result = mock.Mock() job.save_design_file = lambda filename, content: None - if nautobot_version < "2.0.0": - job.request = mock.Mock() - else: - # TODO: Remove this when we no longer support Nautobot 1.x - job.job_result.data = {} - old_run = job.run - - def new_run(data, commit): - kwargs = {**data} - kwargs["dryrun"] = not commit - old_run(**kwargs) - - job.run = new_run + job.request = mock.Mock() self.logged_messages = [] def record_log(message, obj, level_choice, grouping=None, logger=None): # pylint: disable=unused-argument diff --git a/nautobot_design_builder/tests/designs/test_designs.py b/nautobot_design_builder/tests/designs/test_designs.py index 6dfebab4..a4003ddf 100644 --- a/nautobot_design_builder/tests/designs/test_designs.py +++ b/nautobot_design_builder/tests/designs/test_designs.py @@ -2,7 +2,6 @@ from nautobot_design_builder.design_job import DesignJob from nautobot_design_builder.ext import Extension -from nautobot_design_builder.util import nautobot_version class SimpleDesign(DesignJob): @@ -81,17 +80,3 @@ class DesignWithValidationError(DesignJob): class Meta: # pylint: disable=too-few-public-methods name = "Design with validation errors" design_file = "templates/design_with_validation_error.yaml.j2" - - -if nautobot_version >= "2.0": - from nautobot.apps.jobs import register_jobs # pylint: disable=import-error, no-name-in-module - - register_jobs( - SimpleDesign, - SimpleDesignReport, - MultiDesignJob, - MultiDesignJobWithError, - DesignJobWithExtensions, - DesignWithRefError, - DesignWithValidationError, - ) diff --git a/nautobot_design_builder/tests/test_builder.py b/nautobot_design_builder/tests/test_builder.py index 36588b59..122b9498 100644 --- a/nautobot_design_builder/tests/test_builder.py +++ b/nautobot_design_builder/tests/test_builder.py @@ -12,7 +12,6 @@ from nautobot.dcim.models import Cable from nautobot_design_builder.design import Environment -from nautobot_design_builder.util import nautobot_version class BuilderChecks: @@ -150,24 +149,4 @@ def test_runner(self, roll_back: Mock): @builder_test_case(os.path.join(os.path.dirname(__file__), "testdata")) class TestGeneralDesigns(TestCase): - """Designs that should work with all versions of Nautobot.""" - - -@builder_test_case(os.path.join(os.path.dirname(__file__), "testdata", "nautobot_v1")) -class TestV1Designs(TestCase): - """Designs that only work in Nautobot 1.x""" - - def setUp(self): - if nautobot_version >= "2.0.0": - self.skipTest("These tests are only supported in Nautobot 1.x") - super().setUp() - - -@builder_test_case(os.path.join(os.path.dirname(__file__), "testdata", "nautobot_v2")) -class TestV2Designs(TestCase): - """Designs that only work in Nautobot 1.x""" - - def setUp(self): - if nautobot_version < "2.0.0": - self.skipTest("These tests are only supported in Nautobot 2.x") - super().setUp() + """Designs that should work with all Nautobot Version 1.""" diff --git a/nautobot_design_builder/tests/test_design_job.py b/nautobot_design_builder/tests/test_design_job.py index 57f89bbb..0927b5ee 100644 --- a/nautobot_design_builder/tests/test_design_job.py +++ b/nautobot_design_builder/tests/test_design_job.py @@ -9,7 +9,6 @@ from nautobot_design_builder.errors import DesignImplementationError, DesignValidationError from nautobot_design_builder.tests import DesignTestCase from nautobot_design_builder.tests.designs import test_designs -from nautobot_design_builder.util import nautobot_version class TestDesignJob(DesignTestCase): @@ -33,10 +32,7 @@ def test_simple_design_rollback(self): self.assertFalse(job1.failed) self.assertEqual(1, Manufacturer.objects.all().count()) job2 = self.get_mocked_job(test_designs.SimpleDesign3) - if nautobot_version < "2": - job2.run(data={}, commit=True) - else: - self.assertRaises(DesignValidationError, job2.run, data={}, commit=True) + job2.run(data={}, commit=True) self.assertTrue(job2.failed) self.assertEqual(1, Manufacturer.objects.all().count()) @@ -61,10 +57,7 @@ def test_multiple_design_files(self): def test_multiple_design_files_with_roll_back(self): self.assertEqual(0, Manufacturer.objects.all().count()) job = self.get_mocked_job(test_designs.MultiDesignJobWithError) - if nautobot_version < "2": - job.run(data={}, commit=True) - else: - self.assertRaises(DesignValidationError, job.run, data={}, commit=True) + job.run(data={}, commit=True) self.assertEqual(0, Manufacturer.objects.all().count()) @@ -85,29 +78,20 @@ class TestDesignJobLogging(DesignTestCase): def test_simple_design_implementation_error(self, environment: Mock): environment.return_value.implement_design.side_effect = DesignImplementationError("Broken") job = self.get_mocked_job(test_designs.SimpleDesign) - if nautobot_version < "2": - job.run(data={}, commit=True) - else: - self.assertRaises(DesignImplementationError, job.run, data={}, commit=True) + job.run(data={}, commit=True) self.assertTrue(job.failed) job.job_result.log.assert_called() self.assertEqual("Broken", self.logged_messages[-1]["message"]) def test_invalid_ref(self): job = self.get_mocked_job(test_designs.DesignWithRefError) - if nautobot_version < "2": - job.run(data={}, commit=True) - else: - self.assertRaises(DesignImplementationError, job.run, data={}, commit=True) + job.run(data={}, commit=True) message = self.logged_messages[-1]["message"] self.assertEqual("No ref named manufacturer has been saved in the design.", message) def test_failed_validation(self): job = self.get_mocked_job(test_designs.DesignWithValidationError) - if nautobot_version < "2": - job.run(data={}, commit=True) - else: - self.assertRaises(DesignValidationError, job.run, data={}, commit=True) + job.run(data={}, commit=True) message = self.logged_messages[-1]["message"] want_error = DesignValidationError("Manufacturer") diff --git a/nautobot_design_builder/tests/testdata/nautobot_v1/assign_tags_by_name.yaml b/nautobot_design_builder/tests/testdata/assign_tags_by_name.yaml similarity index 100% rename from nautobot_design_builder/tests/testdata/nautobot_v1/assign_tags_by_name.yaml rename to nautobot_design_builder/tests/testdata/assign_tags_by_name.yaml diff --git a/nautobot_design_builder/tests/testdata/nautobot_v1/assign_tags_by_ref.yaml b/nautobot_design_builder/tests/testdata/assign_tags_by_ref.yaml similarity index 100% rename from nautobot_design_builder/tests/testdata/nautobot_v1/assign_tags_by_ref.yaml rename to nautobot_design_builder/tests/testdata/assign_tags_by_ref.yaml diff --git a/nautobot_design_builder/tests/testdata/nautobot_v1/complex_design1.yaml b/nautobot_design_builder/tests/testdata/complex_design1.yaml similarity index 100% rename from nautobot_design_builder/tests/testdata/nautobot_v1/complex_design1.yaml rename to nautobot_design_builder/tests/testdata/complex_design1.yaml diff --git a/nautobot_design_builder/tests/testdata/nautobot_v1/create_or_update_by_ref.yaml b/nautobot_design_builder/tests/testdata/create_or_update_by_ref.yaml similarity index 100% rename from nautobot_design_builder/tests/testdata/nautobot_v1/create_or_update_by_ref.yaml rename to nautobot_design_builder/tests/testdata/create_or_update_by_ref.yaml diff --git a/nautobot_design_builder/tests/testdata/nautobot_v1/create_or_update_mlag.yaml b/nautobot_design_builder/tests/testdata/create_or_update_mlag.yaml similarity index 100% rename from nautobot_design_builder/tests/testdata/nautobot_v1/create_or_update_mlag.yaml rename to nautobot_design_builder/tests/testdata/create_or_update_mlag.yaml diff --git a/nautobot_design_builder/tests/testdata/nautobot_v1/create_or_update_rack.yaml b/nautobot_design_builder/tests/testdata/create_or_update_rack.yaml similarity index 100% rename from nautobot_design_builder/tests/testdata/nautobot_v1/create_or_update_rack.yaml rename to nautobot_design_builder/tests/testdata/create_or_update_rack.yaml diff --git a/nautobot_design_builder/tests/testdata/nautobot_v1/create_or_update_relationships.yaml b/nautobot_design_builder/tests/testdata/create_or_update_relationships.yaml similarity index 100% rename from nautobot_design_builder/tests/testdata/nautobot_v1/create_or_update_relationships.yaml rename to nautobot_design_builder/tests/testdata/create_or_update_relationships.yaml diff --git a/nautobot_design_builder/tests/testdata/nautobot_v1/create_tags.yaml b/nautobot_design_builder/tests/testdata/create_tags.yaml similarity index 100% rename from nautobot_design_builder/tests/testdata/nautobot_v1/create_tags.yaml rename to nautobot_design_builder/tests/testdata/create_tags.yaml diff --git a/nautobot_design_builder/tests/testdata/nautobot_v1/custom_relationship_by_label.yaml b/nautobot_design_builder/tests/testdata/custom_relationship_by_label.yaml similarity index 98% rename from nautobot_design_builder/tests/testdata/nautobot_v1/custom_relationship_by_label.yaml rename to nautobot_design_builder/tests/testdata/custom_relationship_by_label.yaml index 34c1d209..95e3e2cd 100644 --- a/nautobot_design_builder/tests/testdata/nautobot_v1/custom_relationship_by_label.yaml +++ b/nautobot_design_builder/tests/testdata/custom_relationship_by_label.yaml @@ -48,7 +48,7 @@ checks: model: "nautobot.ipam.models.VLAN" query: {vid: "43"} - - equal: + - count_equal: - model: "nautobot.extras.models.RelationshipAssociation" query: {relationship__name: "Device to VLANS"} attribute: "destination" diff --git a/nautobot_design_builder/tests/testdata/nautobot_v1/custom_relationship_by_slug.yaml b/nautobot_design_builder/tests/testdata/custom_relationship_by_slug.yaml similarity index 98% rename from nautobot_design_builder/tests/testdata/nautobot_v1/custom_relationship_by_slug.yaml rename to nautobot_design_builder/tests/testdata/custom_relationship_by_slug.yaml index fae287b7..8a5f1c04 100644 --- a/nautobot_design_builder/tests/testdata/nautobot_v1/custom_relationship_by_slug.yaml +++ b/nautobot_design_builder/tests/testdata/custom_relationship_by_slug.yaml @@ -48,7 +48,7 @@ checks: model: "nautobot.ipam.models.VLAN" query: {vid: "43"} - - equal: + - count_equal: - model: "nautobot.extras.models.RelationshipAssociation" query: {relationship__name: "Device to VLANS"} attribute: "destination" diff --git a/nautobot_design_builder/tests/testdata/nautobot_v1/device_primary_ip.yaml b/nautobot_design_builder/tests/testdata/device_primary_ip.yaml similarity index 100% rename from nautobot_design_builder/tests/testdata/nautobot_v1/device_primary_ip.yaml rename to nautobot_design_builder/tests/testdata/device_primary_ip.yaml diff --git a/nautobot_design_builder/tests/testdata/nautobot_v1/git_repo.yaml b/nautobot_design_builder/tests/testdata/git_repo.yaml similarity index 100% rename from nautobot_design_builder/tests/testdata/nautobot_v1/git_repo.yaml rename to nautobot_design_builder/tests/testdata/git_repo.yaml diff --git a/nautobot_design_builder/tests/testdata/nautobot_v1/interface_addresses.yaml b/nautobot_design_builder/tests/testdata/interface_addresses.yaml similarity index 100% rename from nautobot_design_builder/tests/testdata/nautobot_v1/interface_addresses.yaml rename to nautobot_design_builder/tests/testdata/interface_addresses.yaml diff --git a/nautobot_design_builder/tests/testdata/nautobot_v2/custom_relationship_by_key.yaml b/nautobot_design_builder/tests/testdata/nautobot_v2/custom_relationship_by_key.yaml deleted file mode 100644 index 88a9bc11..00000000 --- a/nautobot_design_builder/tests/testdata/nautobot_v2/custom_relationship_by_key.yaml +++ /dev/null @@ -1,64 +0,0 @@ ---- -extensions: - - "nautobot_design_builder.contrib.ext.LookupExtension" -designs: - - relationships: - - label: "Device to VLANS" - key: "device_to_vlans" - type: "many-to-many" - "!lookup:source_type": - app_label: "dcim" - model: "device" - "!lookup:destination_type": - app_label: "ipam" - model: "vlan" - - manufacturers: - - name: "manufacturer1" - - device_types: - - manufacturer__name: "manufacturer1" - model: "model name" - u_height: 1 - - roles: - - name: "device role" - content_types: - - "!get:app_label": "dcim" - "!get:model": "device" - - location_types: - - name: "Site" - content_types: - - "!get:app_label": "dcim" - "!get:model": "device" - locations: - - name: "site_1" - status__name: "Active" - - vlans: - - "!create_or_update:vid": 42 - name: "The Answer" - status__name: "Active" - - devices: - - name: "device_1" - location__name: "site_1" - status__name: "Active" - device_type__model: "model name" - role__name: "device role" - device_to_vlans: - - "!get:vid": 42 - - vid: "43" - name: "Better Answer" - status__name: "Active" -checks: - - model_exists: - model: "nautobot.ipam.models.VLAN" - query: {vid: "43"} - - - count_equal: - - model: "nautobot.extras.models.RelationshipAssociation" - query: {relationship__label: "Device to VLANS"} - attribute: "destination" - - model: "nautobot.ipam.models.VLAN" diff --git a/nautobot_design_builder/tests/testdata/nautobot_v2/custom_relationship_by_label.yaml b/nautobot_design_builder/tests/testdata/nautobot_v2/custom_relationship_by_label.yaml deleted file mode 100644 index c63782bc..00000000 --- a/nautobot_design_builder/tests/testdata/nautobot_v2/custom_relationship_by_label.yaml +++ /dev/null @@ -1,64 +0,0 @@ ---- -extensions: - - "nautobot_design_builder.contrib.ext.LookupExtension" -designs: - - relationships: - - label: "Device to VLANS" - key: "device_to_vlans" - type: "many-to-many" - "!lookup:source_type": - app_label: "dcim" - model: "device" - "!lookup:destination_type": - app_label: "ipam" - model: "vlan" - - manufacturers: - - name: "manufacturer1" - - device_types: - - manufacturer__name: "manufacturer1" - model: "model name" - u_height: 1 - - roles: - - name: "device role" - content_types: - - "!get:app_label": "dcim" - "!get:model": "device" - - location_types: - - name: "Site" - content_types: - - "!get:app_label": "dcim" - "!get:model": "device" - locations: - - name: "site_1" - status__name: "Active" - - vlans: - - "!create_or_update:vid": 42 - name: "The Answer" - status__name: "Active" - - devices: - - name: "device_1" - location__name: "site_1" - status__name: "Active" - device_type__model: "model name" - role__name: "device role" - vlans: - - "!get:vid": 42 - - vid: "43" - name: "Better Answer" - status__name: "Active" -checks: - - model_exists: - model: "nautobot.ipam.models.VLAN" - query: {vid: "43"} - - - count_equal: - - model: "nautobot.extras.models.RelationshipAssociation" - query: {relationship__label: "Device to VLANS"} - attribute: "destination" - - model: "nautobot.ipam.models.VLAN" diff --git a/nautobot_design_builder/tests/testdata/nautobot_v2/git_repo.yaml b/nautobot_design_builder/tests/testdata/nautobot_v2/git_repo.yaml deleted file mode 100644 index 9a06aa0c..00000000 --- a/nautobot_design_builder/tests/testdata/nautobot_v2/git_repo.yaml +++ /dev/null @@ -1,11 +0,0 @@ ---- -designs: - - git_repositories: - - name: "backups" - remote_url: "https://github.com/nautobot/demo-gc-backups" - branch: "main" - -checks: - - model_exists: - model: "nautobot.extras.models.GitRepository" - query: {name: "backups"} diff --git a/nautobot_design_builder/tests/testdata/nautobot_v2/interface_addresses.yaml b/nautobot_design_builder/tests/testdata/nautobot_v2/interface_addresses.yaml deleted file mode 100644 index 5f18e090..00000000 --- a/nautobot_design_builder/tests/testdata/nautobot_v2/interface_addresses.yaml +++ /dev/null @@ -1,54 +0,0 @@ ---- -designs: - - manufacturers: - - name: "manufacturer1" - - device_types: - - manufacturer__name: "manufacturer1" - model: "model name" - u_height: 1 - - roles: - - name: "device role" - content_types: - - "!get:app_label": "dcim" - "!get:model": "device" - - location_types: - - name: "Site" - content_types: - - "!get:app_label": "dcim" - "!get:model": "device" - locations: - - name: "site_1" - status__name: "Active" - - prefixes: - - prefix: "192.168.56.0/24" - status__name: "Active" - "!ref": "parent_prefix" - - devices: - - name: "device_1" - location__name: "site_1" - status__name: "Active" - device_type__model: "model name" - role__name: "device role" - interfaces: - - name: "Ethernet1/1" - type: "virtual" - status__name: "Active" - ip_address_assignments: - - ip_address: - "!create_or_update:address": "192.168.56.1/24" - "!create_or_update:parent": "!ref:parent_prefix" - status__name: "Active" -checks: - - model_exists: - model: "nautobot.ipam.models.IPAddress" - query: {address: "192.168.56.1/24"} - - equal: - - model: "nautobot.ipam.models.IPAddressToInterface" - query: {interface__name: "Ethernet1/1"} - attribute: "ip_address" - - model: "nautobot.ipam.models.IPAddress" diff --git a/nautobot_design_builder/tests/testdata/nautobot_v2/ip_address_with_namespace.yaml b/nautobot_design_builder/tests/testdata/nautobot_v2/ip_address_with_namespace.yaml deleted file mode 100644 index ec511f8a..00000000 --- a/nautobot_design_builder/tests/testdata/nautobot_v2/ip_address_with_namespace.yaml +++ /dev/null @@ -1,25 +0,0 @@ ---- -designs: - - namespaces: - - name: "VRF Namespace" - "!ref": "parent_namespace" - - prefixes: - - namespace__name: "VRF Namespace" - status__name: "Active" - prefix: "192.168.56.0/24" - - ip_addresses: - - address: "192.168.56.1/24" - # Note: `namespace` is a keyword argument in the IPAddress constructor, - # therefore, reflection cannot take place. This means that attribute action tags - # (like !lookup:`) and query params (like `namespace__name`) can't be used. - # If an IPAddress needs to be assigned to a namespace it can only be - # done via a !ref. - namespace: "!ref:parent_namespace" - status__name: "Active" - -checks: - - model_exists: - model: "nautobot.ipam.models.IPAddress" - query: {address: "192.168.56.1/24"} diff --git a/nautobot_design_builder/tests/testdata/nautobot_v2/nested_create.yaml b/nautobot_design_builder/tests/testdata/nautobot_v2/nested_create.yaml deleted file mode 100644 index 9122a160..00000000 --- a/nautobot_design_builder/tests/testdata/nautobot_v2/nested_create.yaml +++ /dev/null @@ -1,49 +0,0 @@ ---- -designs: - - manufacturers: - - name: "manufacturer1" - - device_types: - - manufacturer__name: "manufacturer1" - model: "model name" - u_height: 1 - - roles: - - name: "device role" - content_types: - - "!get:app_label": "dcim" - "!get:model": "device" - - location_types: - - name: "Site" - content_types: - - "!get:app_label": "dcim" - "!get:model": "device" - locations: - - name: "site_1" - status__name: "Active" - - devices: - - name: "device_1" - location__name: "site_1" - status__name: "Active" - device_type__model: "model name" - role__name: "device role" - interfaces: - - name: "Ethernet1/1" - type: "virtual" - status__name: "Active" - description: "description for Ethernet1/1" -checks: - - equal: - - model: "nautobot.dcim.models.Interface" - query: {name: "Ethernet1/1"} - attribute: "device" - - model: "nautobot.dcim.models.Device" - query: {name: "device_1"} - - equal: - - model: "nautobot.dcim.models.Device" - query: {name: "device_1"} - attribute: "location" - - model: "nautobot.dcim.models.Location" - query: {name: "site_1"} diff --git a/nautobot_design_builder/tests/testdata/nautobot_v2/prefixes.yaml b/nautobot_design_builder/tests/testdata/nautobot_v2/prefixes.yaml deleted file mode 100644 index d6d18c19..00000000 --- a/nautobot_design_builder/tests/testdata/nautobot_v2/prefixes.yaml +++ /dev/null @@ -1,28 +0,0 @@ ---- -designs: - - location_types: - - name: "Site" - content_types: - - "!get:app_label": "ipam" - "!get:model": "prefix" - locations: - - name: "site_1" - status__name: "Active" - "!ref": "site_1" - - prefixes: - - locations: - - "!ref:site_1" - status__name: "Active" - prefix: "192.168.0.0/24" - - "!create_or_update:prefix": "192.168.56.0/24" - locations: - - "!ref:site_1" - status__name: "Active" - -checks: - - equal: - - model: "nautobot.ipam.models.Prefix" - query: {locations__name: "site_1"} - attribute: "__str__" - - value: ["192.168.0.0/24", "192.168.56.0/24"] diff --git a/nautobot_design_builder/tests/testdata/nautobot_v1/nested_create.yaml b/nautobot_design_builder/tests/testdata/nested_create.yaml similarity index 100% rename from nautobot_design_builder/tests/testdata/nautobot_v1/nested_create.yaml rename to nautobot_design_builder/tests/testdata/nested_create.yaml diff --git a/nautobot_design_builder/tests/testdata/nautobot_v1/nested_update.yaml b/nautobot_design_builder/tests/testdata/nested_update.yaml similarity index 100% rename from nautobot_design_builder/tests/testdata/nautobot_v1/nested_update.yaml rename to nautobot_design_builder/tests/testdata/nested_update.yaml diff --git a/nautobot_design_builder/tests/testdata/nautobot_v1/one_to_one.yaml b/nautobot_design_builder/tests/testdata/one_to_one.yaml similarity index 100% rename from nautobot_design_builder/tests/testdata/nautobot_v1/one_to_one.yaml rename to nautobot_design_builder/tests/testdata/one_to_one.yaml diff --git a/nautobot_design_builder/tests/testdata/nautobot_v1/prefixes.yaml b/nautobot_design_builder/tests/testdata/prefixes.yaml similarity index 100% rename from nautobot_design_builder/tests/testdata/nautobot_v1/prefixes.yaml rename to nautobot_design_builder/tests/testdata/prefixes.yaml