From f0141912c66050d6ec1cd8994476cbc5411e880c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Kostka?= Date: Fri, 20 Oct 2023 18:47:18 +0200 Subject: [PATCH] Ignore E712 errors --- napalm_ros/ros.py | 16 ++++++---------- pyproject.toml | 3 +++ 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/napalm_ros/ros.py b/napalm_ros/ros.py index 7b6b676..d8aa7f4 100644 --- a/napalm_ros/ros.py +++ b/napalm_ros/ros.py @@ -45,13 +45,10 @@ ) -# pylint: disable=too-many-public-methods -# pylint: disable=too-many-instance-attributes class ROSDriver(NetworkDriver): platform = 'ros' - # pylint: disable=super-init-not-called def __init__(self, hostname, username, password, timeout=60, optional_args=None): self.hostname = hostname self.username = username @@ -106,7 +103,6 @@ def get_interfaces_counters(self): return result - # pylint: disable=invalid-name def get_bgp_neighbors(self): bgp_neighbors = defaultdict(lambda: dict(peers={})) sent_prefixes = defaultdict(lambda: defaultdict(int)) @@ -126,10 +122,12 @@ def get_bgp_neighbors(self): # the routing table if more than one address family is present on a peer if len(peer["address-families"].split(",")) > 1: for af in peer["address-families"].split(","): - prefix_count = len(self.api.path(f"/{af}/route").select(Keys.dst_addr).where( - Keys.bgp == True, # pylint: disable=singleton-comparison - Keys.rcv_from == peer["name"], - )) + prefix_count = len( + self.api.path(f"/{af}/route").select(Keys.dst_addr).where( + Keys.bgp == True, + Keys.rcv_from == peer["name"], + ) + ) family = "ipv4" if af == "ip" else af prefix_stats[family] = { "sent_prefixes": sent_prefixes.get(peer["name"], {}).get(family, 0), @@ -466,10 +464,8 @@ def open(self): ssl_wrapper=self.ssl_wrapper, ) except (TrapError, FatalError, socket.timeout, socket.error, MultiTrapError) as exc: - # pylint: disable=raise-missing-from raise ConnectionException(f"Could not connect to {self.hostname}:{self.port} - [{exc!r}]") - # pylint: disable=too-many-arguments def ping( self, destination, diff --git a/pyproject.toml b/pyproject.toml index 1dfd8d4..3ccba4c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -42,3 +42,6 @@ split_arguments_when_comma_terminated = true [tool.ruff] line-length = 160 +ignore = [ + "E712", +]