summaryrefslogtreecommitdiff
path: root/python/vyos/remote.py
diff options
context:
space:
mode:
authorJohn Estabrook <jestabro@vyos.io>2023-11-27 21:30:00 -0600
committerJohn Estabrook <jestabro@vyos.io>2023-11-27 21:32:13 -0600
commit35f69340ef189e27b380074bb687ad58f29e9433 (patch)
tree1146ad3c5e4210e7eed30f9152fe3ba1b59478cd /python/vyos/remote.py
parent0fae5b412a359874f1d61a5330064e87a7e6b899 (diff)
downloadvyos-1x-35f69340ef189e27b380074bb687ad58f29e9433.tar.gz
vyos-1x-35f69340ef189e27b380074bb687ad58f29e9433.zip
image-tools: T5751: restore arg raise_error for non-interactive use
Diffstat (limited to 'python/vyos/remote.py')
-rw-r--r--python/vyos/remote.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/python/vyos/remote.py b/python/vyos/remote.py
index 8928cce67..fec44b571 100644
--- a/python/vyos/remote.py
+++ b/python/vyos/remote.py
@@ -437,11 +437,13 @@ def urlc(urlstring, *args, **kwargs):
raise ValueError(f'Unsupported URL scheme: "{scheme}"')
def download(local_path, urlstring, progressbar=False, check_space=False,
- source_host='', source_port=0, timeout=10.0):
+ source_host='', source_port=0, timeout=10.0, raise_error=False):
try:
progressbar = progressbar and is_interactive()
urlc(urlstring, progressbar, check_space, source_host, source_port, timeout).download(local_path)
except Exception as err:
+ if raise_error:
+ raise
print_error(f'Unable to download "{urlstring}": {err}')
except KeyboardInterrupt:
print_error('\nDownload aborted by user.')