From 48008e151016121ef570813b44cbd8166191aab0 Mon Sep 17 00:00:00 2001 From: "Zach Biles @bile0026" Date: Mon, 6 Jan 2025 09:30:09 -0600 Subject: [PATCH 1/7] =?UTF-8?q?fix:=20=F0=9F=90=9B=20fix=20imports=20for?= =?UTF-8?q?=20ipam=20models?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bootstrap/diffsync/models/bootstrap.py | 178 +++++++++--------- 1 file changed, 89 insertions(+), 89 deletions(-) diff --git a/nautobot_ssot/integrations/bootstrap/diffsync/models/bootstrap.py b/nautobot_ssot/integrations/bootstrap/diffsync/models/bootstrap.py index 86729e06..8d288063 100755 --- a/nautobot_ssot/integrations/bootstrap/diffsync/models/bootstrap.py +++ b/nautobot_ssot/integrations/bootstrap/diffsync/models/bootstrap.py @@ -402,148 +402,148 @@ def delete(self): return self -if LIFECYCLE_MGMT: +class BootstrapNamespace(Namespace): + """Bootstrap implementation of Bootstrap Namespace model.""" - class BootstrapSoftware(Software): - """Bootstrap implementation of Bootstrap Software model.""" + @classmethod + def create(cls, diffsync, ids, attrs): + """Create Namespace in Bootstrap from BootstrapNamespace object.""" + return super().create(diffsync=diffsync, ids=ids, attrs=attrs) - @classmethod - def create(cls, diffsync, ids, attrs): - """Create Software in Bootstrap from BootstrapSoftware object.""" - return super().create(diffsync=diffsync, ids=ids, attrs=attrs) + def update(self, attrs): + """Update Namespace in Bootstrap from BootstrapNamespace object.""" + return super().update(attrs) - def update(self, attrs): - """Update Software in Bootstrap from BootstrapSoftware object.""" - return super().update(attrs) + def delete(self): + """Delete Namespace in Bootstrap from BootstrapNamespace object.""" + return self - def delete(self): - """Delete Software in Bootstrap from BootstrapSoftware object.""" - return self +class BootstrapRiR(RiR): + """Bootstrap implementation of Bootstrap RiR model.""" - class BootstrapSoftwareImage(SoftwareImage): - """Bootstrap implementation of Bootstrap SoftwareImage model.""" + @classmethod + def create(cls, diffsync, ids, attrs): + """Create RiR in Bootstrap from BootstrapRiR object.""" + return super().create(diffsync=diffsync, ids=ids, attrs=attrs) - @classmethod - def create(cls, diffsync, ids, attrs): - """Create SoftwareImage in Bootstrap from BootstrapSoftwareImage object.""" - return super().create(diffsync=diffsync, ids=ids, attrs=attrs) + def update(self, attrs): + """Update RiR in Bootstrap from BootstrapRiR object.""" + return super().update(attrs) - def update(self, attrs): - """Update SoftwareImage in Bootstrap from BootstrapSoftwareImage object.""" - return super().update(attrs) + def delete(self): + """Delete RiR in Bootstrap from BootstrapRiR object.""" + return self - def delete(self): - """Delete SoftwareImage in Bootstrap from BootstrapSoftwareImage object.""" - return self +class BootstrapVLANGroup(VLANGroup): + """Bootstrap implementation of Bootstrap VLANGroup model.""" - class BootstrapValidatedSoftware(ValidatedSoftware): - """Bootstrap implementation of Bootstrap ValidatedSoftware model.""" + @classmethod + def create(cls, diffsync, ids, attrs): + """Create VLANGroup in Bootstrap from BootstrapVLANGroup object.""" + return super().create(diffsync=diffsync, ids=ids, attrs=attrs) - @classmethod - def create(cls, diffsync, ids, attrs): - """Create ValidatedSoftware in Bootstrap from BootstrapValidatedSoftware object.""" - return super().create(diffsync=diffsync, ids=ids, attrs=attrs) + def update(self, attrs): + """Update VLANGroup in Bootstrap from BootstrapVLANGroup object.""" + return super().update(attrs) - def update(self, attrs): - """Update ValidatedSoftware in Bootstrap from BootstrapValidatedSoftware object.""" - return super().update(attrs) + def delete(self): + """Delete VLANGroup in Bootstrap from BootstrapVLANGroup object.""" + return self - def delete(self): - """Delete ValidatedSoftware in Bootstrap from BootstrapValidatedSoftware object.""" - return self +class BootstrapVLAN(VLAN): + """Bootstrap implementation of Bootstrap VLAN model.""" - class BootstrapNamespace(Namespace): - """Bootstrap implementation of Bootstrap Namespace model.""" + @classmethod + def create(cls, diffsync, ids, attrs): + """Create VLAN in Bootstrap from BootstrapVLAN object.""" + return super().create(diffsync=diffsync, ids=ids, attrs=attrs) - @classmethod - def create(cls, diffsync, ids, attrs): - """Create Namespace in Bootstrap from BootstrapNamespace object.""" - return super().create(diffsync=diffsync, ids=ids, attrs=attrs) + def update(self, attrs): + """Update VLAN in Bootstrap from BootstrapVLAN object.""" + return super().update(attrs) - def update(self, attrs): - """Update Namespace in Bootstrap from BootstrapNamespace object.""" - return super().update(attrs) + def delete(self): + """Delete VLAN in Bootstrap from BootstrapVLAN object.""" + return self - def delete(self): - """Delete Namespace in Bootstrap from BootstrapNamespace object.""" - return self +class BootstrapVRF(VRF): + """Bootstrap implementation of Bootstrap VRF model.""" - class BootstrapRiR(RiR): - """Bootstrap implementation of Bootstrap RiR model.""" + @classmethod + def create(cls, diffsync, ids, attrs): + """Create VRF in Bootstrap from BootstrapVRF object.""" + return super().create(diffsync=diffsync, ids=ids, attrs=attrs) - @classmethod - def create(cls, diffsync, ids, attrs): - """Create RiR in Bootstrap from BootstrapRiR object.""" - return super().create(diffsync=diffsync, ids=ids, attrs=attrs) + def update(self, attrs): + """Update VRF in Bootstrap from BootstrapVRF object.""" + return super().update(attrs) - def update(self, attrs): - """Update RiR in Bootstrap from BootstrapRiR object.""" - return super().update(attrs) + def delete(self): + """Delete VRF in Bootstrap from BootstrapVRF object.""" + return self - def delete(self): - """Delete RiR in Bootstrap from BootstrapRiR object.""" - return self +class BootstrapPrefix(Prefix): + """Bootstrap implementation of Bootstrap Prefix model.""" - class BootstrapVLANGroup(VLANGroup): - """Bootstrap implementation of Bootstrap VLANGroup model.""" + @classmethod + def create(cls, diffsync, ids, attrs): + """Create Prefix in Bootstrap from BootstrapPrefix object.""" + return super().create(diffsync=diffsync, ids=ids, attrs=attrs) - @classmethod - def create(cls, diffsync, ids, attrs): - """Create VLANGroup in Bootstrap from BootstrapVLANGroup object.""" - return super().create(diffsync=diffsync, ids=ids, attrs=attrs) + def update(self, attrs): + """Update Prefix in Bootstrap from BootstrapPrefix object.""" + return super().update(attrs) - def update(self, attrs): - """Update VLANGroup in Bootstrap from BootstrapVLANGroup object.""" - return super().update(attrs) + def delete(self): + """Delete Prefix in Bootstrap from BootstrapPrefix object.""" + return self - def delete(self): - """Delete VLANGroup in Bootstrap from BootstrapVLANGroup object.""" - return self +if LIFECYCLE_MGMT: - class BootstrapVLAN(VLAN): - """Bootstrap implementation of Bootstrap VLAN model.""" + class BootstrapSoftware(Software): + """Bootstrap implementation of Bootstrap Software model.""" @classmethod def create(cls, diffsync, ids, attrs): - """Create VLAN in Bootstrap from BootstrapVLAN object.""" + """Create Software in Bootstrap from BootstrapSoftware object.""" return super().create(diffsync=diffsync, ids=ids, attrs=attrs) def update(self, attrs): - """Update VLAN in Bootstrap from BootstrapVLAN object.""" + """Update Software in Bootstrap from BootstrapSoftware object.""" return super().update(attrs) def delete(self): - """Delete VLAN in Bootstrap from BootstrapVLAN object.""" + """Delete Software in Bootstrap from BootstrapSoftware object.""" return self - class BootstrapVRF(VRF): - """Bootstrap implementation of Bootstrap VRF model.""" + class BootstrapSoftwareImage(SoftwareImage): + """Bootstrap implementation of Bootstrap SoftwareImage model.""" @classmethod def create(cls, diffsync, ids, attrs): - """Create VRF in Bootstrap from BootstrapVRF object.""" + """Create SoftwareImage in Bootstrap from BootstrapSoftwareImage object.""" return super().create(diffsync=diffsync, ids=ids, attrs=attrs) def update(self, attrs): - """Update VRF in Bootstrap from BootstrapVRF object.""" + """Update SoftwareImage in Bootstrap from BootstrapSoftwareImage object.""" return super().update(attrs) def delete(self): - """Delete VRF in Bootstrap from BootstrapVRF object.""" + """Delete SoftwareImage in Bootstrap from BootstrapSoftwareImage object.""" return self - class BootstrapPrefix(Prefix): - """Bootstrap implementation of Bootstrap Prefix model.""" + class BootstrapValidatedSoftware(ValidatedSoftware): + """Bootstrap implementation of Bootstrap ValidatedSoftware model.""" @classmethod def create(cls, diffsync, ids, attrs): - """Create Prefix in Bootstrap from BootstrapPrefix object.""" + """Create ValidatedSoftware in Bootstrap from BootstrapValidatedSoftware object.""" return super().create(diffsync=diffsync, ids=ids, attrs=attrs) def update(self, attrs): - """Update Prefix in Bootstrap from BootstrapPrefix object.""" + """Update ValidatedSoftware in Bootstrap from BootstrapValidatedSoftware object.""" return super().update(attrs) def delete(self): - """Delete Prefix in Bootstrap from BootstrapPrefix object.""" - return self + """Delete ValidatedSoftware in Bootstrap from BootstrapValidatedSoftware object.""" + return self \ No newline at end of file From 44eea95a9513179437242120a23bf46ed1cb8a72 Mon Sep 17 00:00:00 2001 From: "Zach Biles @bile0026" Date: Mon, 6 Jan 2025 09:35:25 -0600 Subject: [PATCH 2/7] =?UTF-8?q?fix:=20=F0=9F=93=9D=20add=20change=20fragme?= =?UTF-8?q?nt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- changes/641.fixed | 1 + 1 file changed, 1 insertion(+) create mode 100644 changes/641.fixed diff --git a/changes/641.fixed b/changes/641.fixed new file mode 100644 index 00000000..7f67f028 --- /dev/null +++ b/changes/641.fixed @@ -0,0 +1 @@ +Fixed incorrectly nested imports within if block used for Device Lifecycle Models. \ No newline at end of file From 96b3b2db080c178bc536fb5945984d2a5a9c6f45 Mon Sep 17 00:00:00 2001 From: "Zach Biles @bile0026" Date: Mon, 6 Jan 2025 09:39:52 -0600 Subject: [PATCH 3/7] =?UTF-8?q?style:=20=F0=9F=8E=A8=20fix=20formatting?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../integrations/bootstrap/diffsync/models/bootstrap.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/nautobot_ssot/integrations/bootstrap/diffsync/models/bootstrap.py b/nautobot_ssot/integrations/bootstrap/diffsync/models/bootstrap.py index 8d288063..88edaa72 100755 --- a/nautobot_ssot/integrations/bootstrap/diffsync/models/bootstrap.py +++ b/nautobot_ssot/integrations/bootstrap/diffsync/models/bootstrap.py @@ -418,6 +418,7 @@ def delete(self): """Delete Namespace in Bootstrap from BootstrapNamespace object.""" return self + class BootstrapRiR(RiR): """Bootstrap implementation of Bootstrap RiR model.""" @@ -434,6 +435,7 @@ def delete(self): """Delete RiR in Bootstrap from BootstrapRiR object.""" return self + class BootstrapVLANGroup(VLANGroup): """Bootstrap implementation of Bootstrap VLANGroup model.""" @@ -450,6 +452,7 @@ def delete(self): """Delete VLANGroup in Bootstrap from BootstrapVLANGroup object.""" return self + class BootstrapVLAN(VLAN): """Bootstrap implementation of Bootstrap VLAN model.""" @@ -466,6 +469,7 @@ def delete(self): """Delete VLAN in Bootstrap from BootstrapVLAN object.""" return self + class BootstrapVRF(VRF): """Bootstrap implementation of Bootstrap VRF model.""" @@ -482,6 +486,7 @@ def delete(self): """Delete VRF in Bootstrap from BootstrapVRF object.""" return self + class BootstrapPrefix(Prefix): """Bootstrap implementation of Bootstrap Prefix model.""" @@ -498,6 +503,7 @@ def delete(self): """Delete Prefix in Bootstrap from BootstrapPrefix object.""" return self + if LIFECYCLE_MGMT: class BootstrapSoftware(Software): @@ -546,4 +552,4 @@ def update(self, attrs): def delete(self): """Delete ValidatedSoftware in Bootstrap from BootstrapValidatedSoftware object.""" - return self \ No newline at end of file + return self From d2001ae4f3485270676c2832e55f8dca4bd2c7d7 Mon Sep 17 00:00:00 2001 From: "Zach Biles @bile0026" Date: Mon, 6 Jan 2025 09:57:06 -0600 Subject: [PATCH 4/7] =?UTF-8?q?fix:=20=F0=9F=91=B7=20test=20pinning=20poet?= =?UTF-8?q?ry=20version?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 92f1bdba..fe0f607d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -83,6 +83,7 @@ jobs: matrix: python-version: ["3.11"] nautobot-version: ["2.2.1"] + poetry-version: ["1.8.4"] env: INVOKE_NAUTOBOT_SSOT_PYTHON_VER: "${{ matrix.python-version }}" INVOKE_NAUTOBOT_SSOT_NAUTOBOT_VER: "${{ matrix.nautobot-version }}" From 8e50a8616e29553506b8b9a93b6f98eda04392d1 Mon Sep 17 00:00:00 2001 From: "Zach Biles @bile0026" Date: Mon, 6 Jan 2025 09:58:28 -0600 Subject: [PATCH 5/7] =?UTF-8?q?fix:=20=F0=9F=91=B7=20test=20another=20fix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fe0f607d..5a0d0749 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -51,6 +51,9 @@ jobs: run: "poetry run invoke build-and-check-docs" poetry: runs-on: "ubuntu-22.04" + strategy: + matrix: + poetry-version: ["1.8.4"] env: INVOKE_NAUTOBOT_SSOT_LOCAL: "True" steps: From 9980210d9d74e38c109576040619dec892f272d9 Mon Sep 17 00:00:00 2001 From: "Zach Biles @bile0026" Date: Mon, 6 Jan 2025 10:05:37 -0600 Subject: [PATCH 6/7] =?UTF-8?q?ci:=20=F0=9F=91=B7=20use=20suggested=20upda?= =?UTF-8?q?te=20to=20CI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci.yml | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5a0d0749..14642f4c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,6 +25,8 @@ jobs: uses: "actions/checkout@v4" - name: "Setup environment" uses: "networktocode/gh-action-setup-poetry-environment@v6" + with: + poetry-version: "1.8.4" - name: "Linting: ruff format" run: "poetry run invoke ruff --action format" ruff-lint: @@ -36,6 +38,8 @@ jobs: uses: "actions/checkout@v4" - name: "Setup environment" uses: "networktocode/gh-action-setup-poetry-environment@v6" + with: + poetry-version: "1.8.4" - name: "Linting: ruff" run: "poetry run invoke ruff --action lint" check-docs-build: @@ -47,13 +51,12 @@ jobs: uses: "actions/checkout@v4" - name: "Setup environment" uses: "networktocode/gh-action-setup-poetry-environment@v6" + with: + poetry-version: "1.8.4" - name: "Check Docs Build" run: "poetry run invoke build-and-check-docs" poetry: runs-on: "ubuntu-22.04" - strategy: - matrix: - poetry-version: ["1.8.4"] env: INVOKE_NAUTOBOT_SSOT_LOCAL: "True" steps: @@ -61,6 +64,8 @@ jobs: uses: "actions/checkout@v4" - name: "Setup environment" uses: "networktocode/gh-action-setup-poetry-environment@v6" + with: + poetry-version: "1.8.4" - name: "Checking: poetry lock file" run: "poetry run invoke lock --check" yamllint: @@ -72,6 +77,8 @@ jobs: uses: "actions/checkout@v4" - name: "Setup environment" uses: "networktocode/gh-action-setup-poetry-environment@v6" + with: + poetry-version: "1.8.4" - name: "Linting: yamllint" run: "poetry run invoke yamllint" check-in-docker: @@ -86,7 +93,6 @@ jobs: matrix: python-version: ["3.11"] nautobot-version: ["2.2.1"] - poetry-version: ["1.8.4"] env: INVOKE_NAUTOBOT_SSOT_PYTHON_VER: "${{ matrix.python-version }}" INVOKE_NAUTOBOT_SSOT_NAUTOBOT_VER: "${{ matrix.nautobot-version }}" @@ -95,6 +101,8 @@ jobs: uses: "actions/checkout@v4" - name: "Setup environment" uses: "networktocode/gh-action-setup-poetry-environment@v6" + with: + poetry-version: "1.8.4" - name: "Constrain Nautobot version and regenerate lock file" env: INVOKE_NAUTOBOT_SSOT_LOCAL: "true" @@ -150,6 +158,8 @@ jobs: uses: "actions/checkout@v4" - name: "Setup environment" uses: "networktocode/gh-action-setup-poetry-environment@v6" + with: + poetry-version: "1.8.4" - name: "Constrain Nautobot version and regenerate lock file" env: INVOKE_NAUTOBOT_SSOT_LOCAL: "true" @@ -191,6 +201,8 @@ jobs: fetch-depth: "0" - name: "Setup environment" uses: "networktocode/gh-action-setup-poetry-environment@v6" + with: + poetry-version: "1.8.4" - name: "Check for changelog entry" run: | git fetch --no-tags origin +refs/heads/${{ github.base_ref }}:refs/remotes/origin/${{ github.base_ref }} From 58f2f84122b2be108e925beed33529de26422129 Mon Sep 17 00:00:00 2001 From: Justin Drew <2396364+jdrew82@users.noreply.github.com> Date: Tue, 7 Jan 2025 13:59:44 -0600 Subject: [PATCH 7/7] =?UTF-8?q?test:=20=E2=9C=85=20Tweak=20creation=20of?= =?UTF-8?q?=20Prefix=20to=20account=20for=20bug=20in=20stable.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nautobot_ssot/tests/infoblox/test_tags_and_cfs.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/nautobot_ssot/tests/infoblox/test_tags_and_cfs.py b/nautobot_ssot/tests/infoblox/test_tags_and_cfs.py index f4113c49..e5b91dda 100644 --- a/nautobot_ssot/tests/infoblox/test_tags_and_cfs.py +++ b/nautobot_ssot/tests/infoblox/test_tags_and_cfs.py @@ -127,8 +127,7 @@ def test_objects_synced_to_infoblox_are_tagged(self): """Ensure objects synced to Infoblox have 'SSoT Synced to Infoblox' tag applied.""" create_prefix_relationship() nb_prefix = Prefix( - network="10.0.0.0", - prefix_length=8, + prefix="10.0.0.0/8", description="Test Network", type="network", status=Status.objects.get_for_model(Prefix).first(), @@ -204,8 +203,7 @@ def test_cfs_have_correct_content_types_set(self): def test_cf_updated_for_objects_synced_to_infoblox(self): """Ensure objects synced to Infoblox have cf 'ssot_synced_to_infoblox' correctly updated.""" nb_prefix = Prefix( - network="10.0.0.0", - prefix_length=8, + prefix="10.0.0.0/8", description="Test Network", type="network", status=Status.objects.get_for_model(Prefix).first(),