diff options
author | John Estabrook <jestabro@vyos.io> | 2023-08-24 13:38:20 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-24 13:38:20 -0500 |
commit | 5ea0428a08ae9e85fe2ebb6bb85dca07c5eb694f (patch) | |
tree | 3872c70363ac05d5af49c95a622fae12062aaa78 /python/vyos | |
parent | 250a5d13c9e463b04fde0216b133065f26f11430 (diff) | |
parent | e4831c7ac93c50d80e0bad4b66c034030ad0bce9 (diff) | |
download | vyos-1x-5ea0428a08ae9e85fe2ebb6bb85dca07c5eb694f.tar.gz vyos-1x-5ea0428a08ae9e85fe2ebb6bb85dca07c5eb694f.zip |
Merge pull request #2164 from jestabro/save-config
save-config: T4292: rewrite vyatta-save-config.pl to Python
Diffstat (limited to 'python/vyos')
-rw-r--r-- | python/vyos/config.py | 5 | ||||
-rw-r--r-- | python/vyos/config_mgmt.py | 2 | ||||
-rw-r--r-- | python/vyos/configsession.py | 2 |
3 files changed, 7 insertions, 2 deletions
diff --git a/python/vyos/config.py b/python/vyos/config.py index 6fececd76..0ca41718f 100644 --- a/python/vyos/config.py +++ b/python/vyos/config.py @@ -113,6 +113,11 @@ class Config(object): (self._running_config, self._session_config) = self._config_source.get_configtree_tuple() + def get_config_tree(self, effective=False): + if effective: + return self._running_config + return self._session_config + def _make_path(self, path): # Backwards-compatibility stuff: original implementation used string paths # libvyosconfig paths are lists, but since node names cannot contain whitespace, diff --git a/python/vyos/config_mgmt.py b/python/vyos/config_mgmt.py index 4ddabd6c2..0fc72e660 100644 --- a/python/vyos/config_mgmt.py +++ b/python/vyos/config_mgmt.py @@ -34,7 +34,7 @@ from vyos.utils.io import ask_yes_no from vyos.utils.process import is_systemd_service_active from vyos.utils.process import rc_cmd -SAVE_CONFIG = '/opt/vyatta/sbin/vyatta-save-config.pl' +SAVE_CONFIG = '/usr/libexec/vyos/vyos-save-config.py' # created by vyatta-cfg-postinst commit_post_hook_dir = '/etc/commit/post-hooks.d' diff --git a/python/vyos/configsession.py b/python/vyos/configsession.py index e8918d577..6d4b2af59 100644 --- a/python/vyos/configsession.py +++ b/python/vyos/configsession.py @@ -29,7 +29,7 @@ DISCARD = '/opt/vyatta/sbin/my_discard' 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 = ['/opt/vyatta/sbin/vyatta-save-config.pl'] +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'] GENERATE = ['/opt/vyatta/bin/vyatta-op-cmd-wrapper', 'generate'] |