Skip to content

Commit ece6a4f

Browse files
author
menckend
committed
Cleanup
1 parent fe20c30 commit ece6a4f

9 files changed

+20
-21
lines changed

.flake8.purge

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
[flake8]
2-
max-line-length = 120
2+
max-line-length = 180

netbox-plugin.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: 0.0.3.5
1+
version: 0.0.3.5.8
22
package_name: netbox_rpki
33
compatibility:
44
- release: 0.0.2.21

netbox_rpki/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
from netbox.plugins import PluginConfig
22
from netbox_rpki.version import __version__
33

4-
# import api
54

65
class RpkiConfig(PluginConfig):
76
name = 'netbox_rpki'
@@ -18,4 +17,5 @@ class RpkiConfig(PluginConfig):
1817
'top_level_menu': True
1918
}
2019

20+
2121
config = RpkiConfig

netbox_rpki/choices.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@ class CertificateStatusChoices(ChoiceSet):
99
STATUS_REVOKED = 'revoked'
1010

1111
CHOICES = [
12-
(STATUS_ACTIVE, 'Active', 'blue'),
13-
(STATUS_RESERVED, 'Reserved', 'cyan'),
14-
(STATUS_DEPRECATED, 'Deprecated', 'red'),
12+
(STATUS_VALID, 'valid', 'blue'),
13+
(STATUS_PLANNED, 'planned', 'cyan'),
14+
(STATUS_REVOKED, 'revoked', 'red'),
1515
]
16-

netbox_rpki/filtersets.py

+6
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ def search(self, queryset, name, value):
2020
)
2121
return queryset.filter(qs_filter)
2222

23+
2324
class OrganizationFilterSet(NetBoxModelFilterSet, TenancyFilterSet):
2425
class Meta:
2526
model = netbox_rpki.models.Organization
@@ -35,6 +36,7 @@ def search(self, queryset, name, value):
3536
)
3637
return queryset.filter(qs_filter)
3738

39+
3840
class RoaFilterSet(NetBoxModelFilterSet, TenancyFilterSet):
3941
class Meta:
4042
model = netbox_rpki.models.Roa
@@ -50,6 +52,7 @@ def search(self, queryset, name, value):
5052
)
5153
return queryset.filter(qs_filter)
5254

55+
5356
class RoaPrefixFilterSet(NetBoxModelFilterSet, TenancyFilterSet):
5457
class Meta:
5558
model = netbox_rpki.models.RoaPrefix
@@ -81,6 +84,7 @@ def search(self, queryset, name, value):
8184
)
8285
return queryset.filter(qs_filter)
8386

87+
8488
class CertificateAsnFilterSet(NetBoxModelFilterSet, TenancyFilterSet):
8589
class Meta:
8690
model = netbox_rpki.models.CertificateAsn
@@ -96,3 +100,5 @@ def search(self, queryset, name, value):
96100
)
97101
return queryset.filter(qs_filter)
98102

103+
# def search(self, queryset, name, value):
104+
# """Perform the filtered search."""

netbox_rpki/forms.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ class CertificateFilterForm(NetBoxModelFilterSetForm):
5757
class OrganizationForm(NetBoxModelForm):
5858
tenant = DynamicModelChoiceField(queryset=Tenant.objects.all(), required=False)
5959
comments = CommentField()
60-
60+
6161
class Meta:
6262
model = Organization
6363
fields = ['org_id', 'name', 'parent_rir', 'ext_url', 'tenant', 'comments', 'tags']
@@ -66,6 +66,7 @@ class Meta:
6666
class RoaForm(NetBoxModelForm):
6767
tenant = DynamicModelChoiceField(queryset=Tenant.objects.all(), required=False)
6868
comments = CommentField()
69+
6970
class Meta:
7071
model = Roa
7172
fields: list[str] = ['name', 'origin_as', 'valid_from', 'valid_to', "auto_renews", 'signed_by', 'tenant', 'comments', 'tags']
@@ -74,6 +75,7 @@ class Meta:
7475
class RoaPrefixForm(NetBoxModelForm):
7576
tenant = DynamicModelChoiceField(queryset=Tenant.objects.all(), required=False)
7677
comments = CommentField()
78+
7779
class Meta:
7880
model = RoaPrefix
7981
fields = ['prefix', 'max_length', 'roa_name', 'tenant', 'comments', 'tags']
@@ -82,13 +84,15 @@ class Meta:
8284
class CertificatePrefixForm(NetBoxModelForm):
8385
tenant = DynamicModelChoiceField(queryset=Tenant.objects.all(), required=False)
8486
comments = CommentField()
87+
8588
class Meta:
8689
model = CertificatePrefix
8790
fields = ['prefix', 'certificate_name', 'tenant', 'comments', 'tags']
8891

8992
class CertificateAsnForm(NetBoxModelForm):
9093
tenant = DynamicModelChoiceField(queryset=Tenant.objects.all(), required=False)
9194
comments = CommentField()
95+
9296
class Meta:
9397
model = CertificateAsn
9498
fields = ['asn', 'certificate_name2', 'tenant', 'comments', 'tags']

netbox_rpki/navigation.py

-5
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,6 @@
33
from netbox.plugins.utils import get_plugin_config
44

55

6-
from django.conf import settings
7-
8-
from netbox.plugins import PluginMenuButton, PluginMenuItem, PluginMenu
9-
10-
116
resource_menu_items = (
127
PluginMenuItem(
138
link='plugins:netbox_rpki:organization_list',

netbox_rpki/tables.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
import django_tables2 as tables
33
from django.utils.safestring import mark_safe
4-
from django_tables2.utils import A
4+
# from django_tables2.utils import A
55

66
from netbox.tables import NetBoxTable
77
from netbox.tables.columns import ChoiceFieldColumn, TagColumn
@@ -25,6 +25,7 @@ class CertificateTable(NetBoxTable):
2525
tags = TagColumn(
2626
url_name='plugins:netbox_rpki:certificate_list'
2727
)
28+
2829
class Meta(NetBoxTable.Meta):
2930
model = netbox_rpki.models.Certificate
3031
fields = ("pk", "id", "name", "issuer", "subject", "serial", "valid_from", "valid_to", "auto_renews", "publicKey", "private_key", "publication_url", "ca_repository", "self_hosted", "rpki_org", "comments", "tenant", "tags")
@@ -43,7 +44,7 @@ class OrganizationTable(NetBoxTable):
4344
class Meta(NetBoxTable.Meta):
4445
model = netbox_rpki.models.Organization
4546
fields = ("pk", "id", "org_id", "name", "parent_rir", "ext_url", "comments", "tenant", "tags")
46-
default_columns = ("org_id", "name","parent_rir", "ext_url", "comments", "tenant", "tags")
47+
default_columns = ("org_id", "name", "parent_rir", "ext_url", "comments", "tenant", "tags")
4748

4849

4950
class RoaTable(NetBoxTable):
@@ -104,4 +105,3 @@ class Meta(NetBoxTable.Meta):
104105
model = netbox_rpki.models.CertificateAsn
105106
fields = ("pk", "id", "asn", "certificate_name2", "comments", "tenant", "tags")
106107
default_columns = ("asn", "comments", "tenant", "tags")
107-

requirements_dev.txt.purge

-5
This file was deleted.

0 commit comments

Comments
 (0)