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). Mapping and Iterable come from collections.abc, imports are sorted. What ruff cannot fix comes in the next commit.
This commit is contained in:
1 parent
5b24675a12
commit
09029ca0a4
29 files changed
+985
-456
No files matched your search
@@ -87,10 +87,11 @@ These follow the other drivers in the `NAPALM` organisation:
|
||||
import napalm
|
||||
|
||||
driver = napalm.get_network_driver("redfish")
|
||||
with driver("bmc01.example.net", "netork", "secret",
|
||||
optional_args={"verify_ssl": "/etc/netork/bmc-ca.pem"}) as bmc:
|
||||
bmc.get_facts() # the BMC: firmware as os_version, its ports
|
||||
bmc.get_power_state() # the server: {"state": "On", "actions": [...]}
|
||||
with driver(
|
||||
"bmc01.example.net", "netork", "secret", optional_args={"verify_ssl": "/etc/netork/bmc-ca.pem"}
|
||||
) as bmc:
|
||||
bmc.get_facts() # the BMC: firmware as os_version, its ports
|
||||
bmc.get_power_state() # the server: {"state": "On", "actions": [...]}
|
||||
bmc.get_hardware_inventory()
|
||||
```
|
||||
|
||||
|
||||
Reference in new issue
Block a user