summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorJohn Estabrook <jestabro@vyos.io>2023-11-28 08:33:30 -0600
committerGitHub <noreply@github.com>2023-11-28 08:33:30 -0600
commit6d9feb9df38bfcad7c68c2cbbdba7868a715ccef (patch)
tree1da0672cfcdc943c0cddf2627a3d31184296a77d /python
parent5f575360b0c996187e7f05cccc5caff6a658544d (diff)
parent2ccb567bba6dba69a1523daf9096ba39a18b35d1 (diff)
downloadvyos-1x-6d9feb9df38bfcad7c68c2cbbdba7868a715ccef.tar.gz
vyos-1x-6d9feb9df38bfcad7c68c2cbbdba7868a715ccef.zip
Merge pull request #2550 from jestabro/non-interactive-add-delete-image
image-tools: T5751: allow non-interactive add/delete image
Diffstat (limited to 'python')
-rw-r--r--python/vyos/configsession.py6
-rw-r--r--python/vyos/remote.py4
2 files changed, 7 insertions, 3 deletions
diff --git a/python/vyos/configsession.py b/python/vyos/configsession.py
index 9802ebae4..90842b749 100644
--- a/python/vyos/configsession.py
+++ b/python/vyos/configsession.py
@@ -30,8 +30,10 @@ SHOW_CONFIG = ['/bin/cli-shell-api', 'showConfig']
LOAD_CONFIG = ['/bin/cli-shell-api', 'loadFile']
MIGRATE_LOAD_CONFIG = ['/usr/libexec/vyos/vyos-load-config.py']
SAVE_CONFIG = ['/usr/libexec/vyos/vyos-save-config.py']
-INSTALL_IMAGE = ['/opt/vyatta/sbin/install-image', '--url']
-REMOVE_IMAGE = ['/opt/vyatta/bin/vyatta-boot-image.pl', '--del']
+INSTALL_IMAGE = ['/usr/libexec/vyos/op_mode/image_installer.py',
+ '--action', 'add', '--no-prompt', '--image-path']
+REMOVE_IMAGE = ['/usr/libexec/vyos/op_mode/image_manager.py',
+ '--action', 'delete', '--no-prompt', '--image-name']
GENERATE = ['/opt/vyatta/bin/vyatta-op-cmd-wrapper', 'generate']
SHOW = ['/opt/vyatta/bin/vyatta-op-cmd-wrapper', 'show']
RESET = ['/opt/vyatta/bin/vyatta-op-cmd-wrapper', 'reset']
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.')