summaryrefslogtreecommitdiff
path: root/python/vyos
diff options
context:
space:
mode:
Diffstat (limited to 'python/vyos')
-rw-r--r--python/vyos/configtree.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/python/vyos/configtree.py b/python/vyos/configtree.py
index 9308bdde4..19b9838d4 100644
--- a/python/vyos/configtree.py
+++ b/python/vyos/configtree.py
@@ -373,6 +373,19 @@ def union(left, right, libpath=LIBPATH):
return tree
+def reference_tree_to_json(from_dir, to_file, libpath=LIBPATH):
+ __lib = cdll.LoadLibrary(libpath)
+ __reference_tree_to_json = __lib.reference_tree_to_json
+ __reference_tree_to_json.argtypes = [c_char_p, c_char_p]
+ __get_error = __lib.get_error
+ __get_error.argtypes = []
+ __get_error.restype = c_char_p
+
+ res = __reference_tree_to_json(from_dir.encode(), to_file.encode())
+ if res == 1:
+ msg = __get_error().decode()
+ raise ConfigTreeError(msg)
+
class DiffTree:
def __init__(self, left, right, path=[], libpath=LIBPATH):
if left is None: