style: ruff format and the lint rules of the driver standard
Mechanical: ruff format, and ruff check --fix with the rule set every NAPALM driver uses (E, F, I, UP, B at line length 100, Python 3.10). What ruff cannot fix comes in the next commit.
This commit is contained in:
1 parent
6ceac1d526
commit
ad69c0e643
2 files changed
+9
-6
No files matched your search
@@ -4,7 +4,6 @@ import socket
|
||||
from typing import Any
|
||||
|
||||
from napalm.base.exceptions import ConnectionException
|
||||
|
||||
from napalm_device_types import FingerprintRule, MediaDriver, PortSpec
|
||||
|
||||
"""NAPALM driver for Sonos speakers.
|
||||
@@ -15,7 +14,6 @@ media-playback controls.
|
||||
"""
|
||||
|
||||
|
||||
|
||||
class SonosDriver(MediaDriver):
|
||||
"""NAPALM driver for controlling Sonos speakers.
|
||||
|
||||
@@ -74,9 +72,7 @@ class SonosDriver(MediaDriver):
|
||||
if self._device is None:
|
||||
return {"is_alive": False}
|
||||
try:
|
||||
sock = socket.create_connection(
|
||||
(self.hostname, 1400), timeout=5
|
||||
)
|
||||
sock = socket.create_connection((self.hostname, 1400), timeout=5)
|
||||
sock.close()
|
||||
return {"is_alive": True}
|
||||
except OSError:
|
||||
|
||||
Reference in new issue
Block a user