Skip to content
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions .github/workflows/main_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ jobs:
strategy:
max-parallel: 4
matrix:
python-version: ["3.11"]
netbox-version: ["v4.0.3"]
python-version: ["3.12"]
netbox-version: ["v4.3.5"]
services:
redis:
image: redis
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pr_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ jobs:
strategy:
max-parallel: 4
matrix:
python-version: ["3.11"]
netbox-version: ["v4.0.3"]
python-version: ["3.12"]
netbox-version: ["v4.3.5"]
services:
redis:
image: redis
Expand Down
4 changes: 2 additions & 2 deletions netbox_cloudflare_plugin/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ class NetBoxCloudflareConfig(PluginConfig):
name = "netbox_cloudflare_plugin"
verbose_name = " NetBox Cloudflare Plugin"
description = "Manage Cloudflare"
version = "0.3.0"
version = "0.4.0"
base_url = "cloudflare"
min_version = "4.0.0"
min_version = "4.3.0"
author= "Vincent Simonin <vincent@saashup.com>"
author_email= "vincent@saashup.com"
default_settings = {
Expand Down
8 changes: 8 additions & 0 deletions netbox_cloudflare_plugin/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ def get_absolute_url(self):
class DnsRecord(NetBoxModel):
"""DNS entry definition class"""

is_deleted_manually = False

CNAME = "CNAME"
A = "A"

Expand Down Expand Up @@ -142,3 +144,9 @@ def __str__(self):
def get_absolute_url(self):
"""override"""
return reverse("plugins:netbox_cloudflare_plugin:dnsrecord", args=[self.pk])

def delete(self, using=None, keep_parents=False):
"""override"""
self.is_deleted_manually = True

return super().delete(using, keep_parents)
4 changes: 2 additions & 2 deletions netbox_cloudflare_plugin/signals.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ def create_dnsrecord(instance, **_kwargs):

@receiver(pre_delete, sender=DnsRecord)
def delete_dnsrecord(instance, **_kwargs):
"""Delte a DNS Record on Cloudflare"""
"""Delete a DNS Record on Cloudflare"""

if isinstance(_kwargs["origin"], DnsRecord):
if instance.is_deleted_manually is True:
client = CloudflareDnsClient(
instance.zone,
settings.PLUGINS_CONFIG["netbox_cloudflare_plugin"]["cloudflare_base_url"],
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ build-backend = "setuptools.build_meta"

[project]
name = "netbox-cloudflare-plugin"
version = "0.3.0"
version = "0.4.0"
authors = [
{ name="Vincent Simonin", email="vincent@saashup.com" }
]
description = "Manage Cloudflare with Netbox & style."
readme = "README.md"
requires-python = ">=3.8"
requires-python = ">=3.12"
classifiers = [
"Programming Language :: Python :: 3",
]
Expand Down