fix(driver): leave the caller's optional_args unchanged

__init__ popped "port" out of the dict it was handed, so the caller's
own optional_args lost its port. The driver now works on a copy.

Closes #19
This commit is contained in:
Christian Manivong committed 2026-11-01 21:43:09 +01:00
1 parent d78a55dd1a
commit 45f5b65427
3 files changed
+14 -2

No files matched your search

+2 -2
View File
@@ -109,8 +109,8 @@ class OpenWrtDriver(
self.timeout = timeout
self.device: ConnectHandler | None = None
if optional_args is None:
optional_args = {}
# A copy: the caller's dict stays as it was.
optional_args = dict(optional_args or {})
self.port = optional_args.pop("port", 22)
self.netmiko_optional_args = netmiko_args(optional_args)