summaryrefslogtreecommitdiff
path: root/python/vyos/remote.py
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2023-12-17 08:23:24 +0100
committerGitHub <noreply@github.com>2023-12-17 08:23:24 +0100
commitf991faab2c0d95cbec5d46996b154145955572d7 (patch)
tree7b6157e73946826cdb4128cf5100ba627934136d /python/vyos/remote.py
parentd5375ce02376a91c07ec68f8d410a08dcdc57ef9 (diff)
parent8809d2e799ae1130b3328b081466b7d772a3da23 (diff)
downloadvyos-1x-f991faab2c0d95cbec5d46996b154145955572d7.tar.gz
vyos-1x-f991faab2c0d95cbec5d46996b154145955572d7.zip
Merge pull request #2648 from jestabro/sagitta-image-tools
image-tools: T4516: revise system image tools
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 f86d2ef35..b1efcd10b 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.')