Skip to content

Commit

Permalink
Ignore E712 errors
Browse files Browse the repository at this point in the history
  • Loading branch information
luqasz committed Oct 20, 2023
1 parent 9d44e21 commit f014191
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
16 changes: 6 additions & 10 deletions napalm_ros/ros.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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))
Expand All @@ -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),
Expand Down Expand Up @@ -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,
Expand Down
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,6 @@ split_arguments_when_comma_terminated = true

[tool.ruff]
line-length = 160
ignore = [
"E712",
]

0 comments on commit f014191

Please sign in to comment.