diff options
| author | John Estabrook <jestabro@vyos.io> | 2025-11-20 08:51:17 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-11-20 08:51:17 -0600 |
| commit | cfb2a5ee7fe9bd68498edbb232c3e71160eaeff3 (patch) | |
| tree | b8c8b46f51e82199791a263a6147026dc6aefaae /python | |
| parent | b02565cb1ad928926d411fbaa48290c9f347154c (diff) | |
| parent | e74b9a1b4d9dd28cef7cf8455f3a7c81d1afbe4f (diff) | |
| download | vyos-1x-cfb2a5ee7fe9bd68498edbb232c3e71160eaeff3.tar.gz vyos-1x-cfb2a5ee7fe9bd68498edbb232c3e71160eaeff3.zip | |
Merge pull request #4844 from jestabro/show-config
T7988: adjust function name to distinguish compare from show config
Diffstat (limited to 'python')
| -rw-r--r-- | python/vyos/config_mgmt.py | 6 | ||||
| -rw-r--r-- | python/vyos/configtree.py | 10 |
2 files changed, 8 insertions, 8 deletions
diff --git a/python/vyos/config_mgmt.py b/python/vyos/config_mgmt.py index 0dbfcc504..6bc9ff333 100644 --- a/python/vyos/config_mgmt.py +++ b/python/vyos/config_mgmt.py @@ -37,7 +37,7 @@ from vyos.configtree import ConfigTree from vyos.configtree import ConfigTreeError from vyos.configsession import ConfigSession from vyos.configsession import ConfigSessionError -from vyos.configtree import show_diff +from vyos.configtree import diff_compare from vyos.load_config import load from vyos.load_config import LoadConfigError from vyos.defaults import directories @@ -413,9 +413,9 @@ Proceed ?""" path = [] if commands else self.edit_path try: if commands: - out = show_diff(ct1, ct2, path=path, commands=True) + out = diff_compare(ct1, ct2, path=path, commands=True) else: - out = show_diff(ct1, ct2, path=path) + out = diff_compare(ct1, ct2, path=path) except ConfigTreeError as e: return e, 1 diff --git a/python/vyos/configtree.py b/python/vyos/configtree.py index e6ea4b40d..e57cd5205 100644 --- a/python/vyos/configtree.py +++ b/python/vyos/configtree.py @@ -473,7 +473,7 @@ class ConfigTree(object): return subt -def show_diff(left, right, path=[], commands=False, libpath=LIBPATH): +def diff_compare(left, right, path=[], commands=False, libpath=LIBPATH): if left is None: left = ConfigTree(config_string='\n') if right is None: @@ -488,14 +488,14 @@ def show_diff(left, right, path=[], commands=False, libpath=LIBPATH): path_str = ' '.join(map(str, path)).encode() __lib = cdll.LoadLibrary(libpath) - __show_diff = __lib.show_diff - __show_diff.argtypes = [c_bool, c_char_p, c_void_p, c_void_p] - __show_diff.restype = c_char_p + __diff_compare = __lib.diff_compare + __diff_compare.argtypes = [c_bool, c_char_p, c_void_p, c_void_p] + __diff_compare.restype = c_char_p __get_error = __lib.get_error __get_error.argtypes = [] __get_error.restype = c_char_p - res = __show_diff(commands, path_str, left._get_config(), right._get_config()) + res = __diff_compare(commands, path_str, left._get_config(), right._get_config()) res = res.decode() if res == '#1@': msg = __get_error().decode() |
