forked from mirrors/thatmattlove-hyperglass
Allow customization of driver (Netmiko) configuration on a per-device basis
This commit is contained in:
parent
6dea685eeb
commit
b49b6ea58e
3 changed files with 2 additions and 2 deletions
|
|
@ -76,8 +76,6 @@ SCRAPE_HELPERS = {
|
||||||
}
|
}
|
||||||
|
|
||||||
DRIVER_MAP = {
|
DRIVER_MAP = {
|
||||||
"frr_legacy": "hyperglass_agent",
|
|
||||||
"bird_legacy": "hyperglass_agent",
|
|
||||||
"bird": "netmiko",
|
"bird": "netmiko",
|
||||||
"frr": "netmiko",
|
"frr": "netmiko",
|
||||||
"http": "hyperglass_http_client",
|
"http": "hyperglass_http_client",
|
||||||
|
|
|
||||||
|
|
@ -70,6 +70,7 @@ class NetmikoConnection(SSHConnection):
|
||||||
"timeout": math.floor(params.request_timeout * 1.25),
|
"timeout": math.floor(params.request_timeout * 1.25),
|
||||||
"session_timeout": math.ceil(params.request_timeout - 1),
|
"session_timeout": math.ceil(params.request_timeout - 1),
|
||||||
**global_args,
|
**global_args,
|
||||||
|
**self.device.driver_config,
|
||||||
}
|
}
|
||||||
|
|
||||||
if "_telnet" in self.device.platform:
|
if "_telnet" in self.device.platform:
|
||||||
|
|
|
||||||
|
|
@ -54,6 +54,7 @@ class Device(HyperglassModelWithId, extra="allow"):
|
||||||
structured_output: Optional[StrictBool]
|
structured_output: Optional[StrictBool]
|
||||||
directives: Directives = Directives()
|
directives: Directives = Directives()
|
||||||
driver: Optional[SupportedDriver]
|
driver: Optional[SupportedDriver]
|
||||||
|
driver_config: Dict[str, Any] = {}
|
||||||
attrs: Dict[str, str] = {}
|
attrs: Dict[str, str] = {}
|
||||||
|
|
||||||
def __init__(self, **kw) -> None:
|
def __init__(self, **kw) -> None:
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue