Skip to content

Commit

Permalink
Allow customization of driver (Netmiko) configuration on a per-device…
Browse files Browse the repository at this point in the history
… basis
  • Loading branch information
thatmattlove committed Dec 8, 2021
1 parent 6dea685 commit b49b6ea
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 2 deletions.
2 changes: 0 additions & 2 deletions hyperglass/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,6 @@
}

DRIVER_MAP = {
"frr_legacy": "hyperglass_agent",
"bird_legacy": "hyperglass_agent",
"bird": "netmiko",
"frr": "netmiko",
"http": "hyperglass_http_client",
Expand Down
1 change: 1 addition & 0 deletions hyperglass/execution/drivers/ssh_netmiko.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ async def collect(self, host: str = None, port: int = None) -> Iterable:
"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:
Expand Down
1 change: 1 addition & 0 deletions hyperglass/models/config/devices.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit b49b6ea

Please sign in to comment.