From e36bca3488893b8237ddc62b220cf44e717ebe1e Mon Sep 17 00:00:00 2001 From: Gary Snider <75227981+gsnider2195@users.noreply.github.com> Date: Thu, 8 Aug 2024 18:30:01 -0500 Subject: [PATCH] fix pylint --- nautobot_bgp_models/forms.py | 4 ++-- nautobot_bgp_models/models.py | 13 +++++++++---- pyproject.toml | 10 +++++++--- 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/nautobot_bgp_models/forms.py b/nautobot_bgp_models/forms.py index 1dd67bd..a4dd3c3 100644 --- a/nautobot_bgp_models/forms.py +++ b/nautobot_bgp_models/forms.py @@ -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") @@ -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", diff --git a/nautobot_bgp_models/models.py b/nautobot_bgp_models/models.py index 520ccc3..2ba019f 100644 --- a/nautobot_bgp_models/models.py +++ b/nautobot_bgp_models/models.py @@ -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 @@ -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"] @@ -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) @@ -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}" @@ -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: diff --git a/pyproject.toml b/pyproject.toml index f10a58b..be4610a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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