From 62345be916adaf589a64c2cf9eae8f1b40340a9b Mon Sep 17 00:00:00 2001 From: "Steven B." <51370195+sdb9696@users.noreply.github.com> Date: Mon, 16 Dec 2024 12:48:27 +0000 Subject: [PATCH] Add timeout parameter to dump_devinfo (#1381) --- devtools/dump_devinfo.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/devtools/dump_devinfo.py b/devtools/dump_devinfo.py index 02aebae7..cb0032d2 100644 --- a/devtools/dump_devinfo.py +++ b/devtools/dump_devinfo.py @@ -233,6 +233,12 @@ async def handle_device( type=bool, help="Set flag if the device encryption uses https.", ) +@click.option( + "--timeout", + required=False, + default=15, + help="Timeout for queries.", +) @click.option("--port", help="Port override", type=int) async def cli( host, @@ -250,6 +256,7 @@ async def cli( device_family, login_version, port, + timeout, ): """Generate devinfo files for devices. @@ -280,6 +287,7 @@ async def cli( connection_type=connection_type, port_override=port, credentials=credentials, + timeout=timeout, ) device = await Device.connect(config=dc) await handle_device( @@ -301,6 +309,7 @@ async def cli( port_override=port, credentials=credentials, connection_type=ctype, + timeout=timeout, ) if protocol := get_protocol(config): await handle_device(basedir, autosave, protocol, batch_size=batch_size) @@ -315,6 +324,7 @@ async def cli( credentials=credentials, port=port, discovery_timeout=discovery_timeout, + timeout=timeout, on_discovered_raw=capture_raw, ) discovery_info = raw_discovery[device.host] @@ -336,6 +346,7 @@ async def cli( target=target, credentials=credentials, discovery_timeout=discovery_timeout, + timeout=timeout, on_discovered_raw=capture_raw, ) click.echo(f"Detected {len(devices)} devices")