summaryrefslogtreecommitdiff
path: root/python/vyos/configtree.py
diff options
context:
space:
mode:
authorJohn Estabrook <jestabro@vyos.io>2025-01-31 15:48:33 -0600
committerJohn Estabrook <jestabro@vyos.io>2025-03-16 23:55:12 -0500
commitdbe09d4c3dac302ad7b24cdd4f2b1ed123436442 (patch)
tree347c012fe492ce439f0959a115c7ad28f08f4407 /python/vyos/configtree.py
parentaeb25214ecddab10953b322fc39bc4dc09b15ed5 (diff)
downloadveeos-1x-dbe09d4c3dac302ad7b24cdd4f2b1ed123436442.tar.gz
veeos-1x-dbe09d4c3dac302ad7b24cdd4f2b1ed123436442.zip
T6946: add wrapper for show_commit_data and test function
Diffstat (limited to 'python/vyos/configtree.py')
-rw-r--r--python/vyos/configtree.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/python/vyos/configtree.py b/python/vyos/configtree.py
index 4ad0620a5..2b8930882 100644
--- a/python/vyos/configtree.py
+++ b/python/vyos/configtree.py
@@ -488,6 +488,22 @@ def mask_inclusive(left, right, libpath=LIBPATH):
return tree
+def show_commit_data(active_tree, proposed_tree, libpath=LIBPATH):
+ if not (
+ isinstance(active_tree, ConfigTree) and isinstance(proposed_tree, ConfigTree)
+ ):
+ raise TypeError('Arguments must be instances of ConfigTree')
+
+ __lib = cdll.LoadLibrary(libpath)
+ __show_commit_data = __lib.show_commit_data
+ __show_commit_data.argtypes = [c_void_p, c_void_p]
+ __show_commit_data.restype = c_char_p
+
+ res = __show_commit_data(active_tree._get_config(), proposed_tree._get_config())
+
+ return res.decode()
+
+
def reference_tree_to_json(from_dir, to_file, internal_cache='', libpath=LIBPATH):
try:
__lib = cdll.LoadLibrary(libpath)