Allow customization of driver (Netmiko) configuration on a per-device basis

This commit is contained in:
thatmattlove 2021-12-08 12:00:02 -07:00
parent 6dea685eeb
commit b49b6ea58e
3 changed files with 2 additions and 2 deletions

View file

@ -76,8 +76,6 @@ SCRAPE_HELPERS = {
}
DRIVER_MAP = {
"frr_legacy": "hyperglass_agent",
"bird_legacy": "hyperglass_agent",
"bird": "netmiko",
"frr": "netmiko",
"http": "hyperglass_http_client",

View file

@ -70,6 +70,7 @@ class NetmikoConnection(SSHConnection):
"timeout": math.floor(params.request_timeout * 1.25),
"session_timeout": math.ceil(params.request_timeout - 1),
**global_args,
**self.device.driver_config,
}
if "_telnet" in self.device.platform:

View file

@ -54,6 +54,7 @@ class Device(HyperglassModelWithId, extra="allow"):
structured_output: Optional[StrictBool]
directives: Directives = Directives()
driver: Optional[SupportedDriver]
driver_config: Dict[str, Any] = {}
attrs: Dict[str, str] = {}
def __init__(self, **kw) -> None: