summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorerkin <e.altunbas@vyos.io>2021-03-15 14:47:05 +0300
committererkin <e.altunbas@vyos.io>2021-03-15 14:47:05 +0300
commit661597538e0ec140914470522e5b10444d19e12d (patch)
tree48b01daecf2b3d4d6af128f7173abefb3e49fe9d /python
parent9e694b73e6b8c6808fbb9c095bd22b01cca48538 (diff)
downloadvyos-1x-661597538e0ec140914470522e5b10444d19e12d.tar.gz
vyos-1x-661597538e0ec140914470522e5b10444d19e12d.zip
Properly raise an error instead of exiting
Diffstat (limited to 'python')
-rw-r--r--python/vyos/remote.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/python/vyos/remote.py b/python/vyos/remote.py
index 492c9e9de..ad9706a82 100644
--- a/python/vyos/remote.py
+++ b/python/vyos/remote.py
@@ -87,7 +87,7 @@ def download(local_path, urlstring):
elif url.scheme == 'tftp':
download_tftp(local_path, url.hostname, url.path)
else:
- sys.exit('Unsupported URL scheme')
+ ValueError(f'Unsupported URL scheme: {url.scheme}')
def upload(local_path, urlstring):
"""
@@ -103,7 +103,7 @@ def upload(local_path, urlstring):
elif url.scheme == 'tftp':
upload_tftp(local_path, url.hostname, url.path)
else:
- sys.exit('Unsupported URL scheme')
+ ValueError(f'Unsupported URL scheme: {url.scheme}')
def get_remote_config(urlstring):
"""