mirror of
https://github.com/checktheroads/hyperglass
synced 2024-05-11 05:55:08 +00:00
Allow customization of driver (Netmiko) configuration on a per-device basis
This commit is contained in:
@@ -76,8 +76,6 @@ SCRAPE_HELPERS = {
|
||||
}
|
||||
|
||||
DRIVER_MAP = {
|
||||
"frr_legacy": "hyperglass_agent",
|
||||
"bird_legacy": "hyperglass_agent",
|
||||
"bird": "netmiko",
|
||||
"frr": "netmiko",
|
||||
"http": "hyperglass_http_client",
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user