Skip to content

Commit

Permalink
fix pylint
Browse files Browse the repository at this point in the history
  • Loading branch information
gsnider2195 committed Aug 8, 2024
1 parent 5050261 commit e36bca3
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 9 deletions.
4 changes: 2 additions & 2 deletions nautobot_bgp_models/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ class PeerGroupFilterForm(NautobotFilterForm, RoleModelFilterFormMixin):
class PeerGroupTemplateFilterForm(NautobotFilterForm, RoleModelFilterFormMixin):
"""Form for filtering PeerGroupTemplate records in combination with PeerGroupTemplateFilterSet."""

model = models.PeerGroup
model = models.PeerGroupTemplate

q = forms.CharField(required=False, label="Search")

Expand Down Expand Up @@ -620,7 +620,7 @@ class PeerEndpointAddressFamilyForm(NautobotModelForm):
multipath = forms.NullBooleanField(required=False, widget=utilities_forms.BulkEditNullBooleanSelect())

class Meta:
model = models.PeerGroupAddressFamily
model = models.PeerEndpointAddressFamily
fields = (
"peer_endpoint",
"afi_safi",
Expand Down
13 changes: 9 additions & 4 deletions nautobot_bgp_models/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from nautobot.core.models.generics import OrganizationalModel, PrimaryModel
from nautobot.core.utils.data import deepmerge
from nautobot.dcim.fields import ASNField
from nautobot.extras.models import RoleField, StatusModel
from nautobot.extras.models import RoleField, StatusField
from nautobot.ipam.models import IPAddress, IPAddressToInterface
from nautobot.tenancy.models import Tenant
from netutils.asn import int_to_asdot
Expand Down Expand Up @@ -129,12 +129,13 @@ class Meta:
"statuses",
"webhooks",
)
class AutonomousSystem(PrimaryModel, StatusModel):
class AutonomousSystem(PrimaryModel):
"""Autonomous System information."""

asn = ASNField(unique=True, verbose_name="ASN", help_text="32-bit autonomous system number")
description = models.CharField(max_length=200, blank=True)
provider = models.ForeignKey(to=Provider, on_delete=models.PROTECT, blank=True, null=True)
status = StatusField(null=True)

class Meta:
ordering = ["asn"]
Expand Down Expand Up @@ -203,7 +204,7 @@ def get_next_available_asn(self):
"statuses",
"webhooks",
)
class BGPRoutingInstance(PrimaryModel, StatusModel, BGPExtraAttributesMixin):
class BGPRoutingInstance(PrimaryModel, BGPExtraAttributesMixin):
"""BGP instance definition."""

description = models.CharField(max_length=200, blank=True)
Expand All @@ -228,6 +229,8 @@ class BGPRoutingInstance(PrimaryModel, StatusModel, BGPExtraAttributesMixin):
on_delete=models.PROTECT,
)

status = StatusField(null=True)

def __str__(self):
"""String representation of a BGPRoutingInstance."""
return f"{self.device} - {self.autonomous_system}"
Expand Down Expand Up @@ -593,9 +596,11 @@ def clean(self):
"statuses",
"webhooks",
)
class Peering(OrganizationalModel, StatusModel):
class Peering(OrganizationalModel):
"""Linkage between two PeerEndpoint records."""

status = StatusField(null=True)

natural_key_field_names = ["id"]

class Meta:
Expand Down
10 changes: 7 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,13 @@ ignore=".venv"
no-docstring-rgx="^(_|test_|Meta$)"

[tool.pylint.messages_control]
disable = """,
line-too-long
"""
disable = [
"line-too-long",
"nb-use-fields-all",
"too-few-public-methods",
"too-many-ancestors",
"too-many-lines",
]

[tool.pylint.miscellaneous]
# Don't flag TODO as a failure, let us commit with things that still need to be done in the code
Expand Down

0 comments on commit e36bca3

Please sign in to comment.