Skip to content

Commit cfb2a5e

Browse files
authored
Merge pull request #4844 from jestabro/show-config
T7988: adjust function name to distinguish compare from show config
2 parents b02565c + e74b9a1 commit cfb2a5e

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
lines changed

libvyosconfig/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ all: sharedlib
4242
PHONY: depends
4343
depends:
4444
sudo sh -c 'eval $$(opam env --root=/opt/opam --set-root) ;\
45-
opam pin add vyos1x-config https://github.com/vyos/vyos1x-config.git#6e2a6efc5de6c2e395df377fcd273231ad8ed683 -y ; \
46-
opam pin add vyconf https://github.com/vyos/vyconf.git#591dd5ee3dc353655a3c9b17eababaf0864c5514 -y'
45+
opam pin add vyos1x-config https://github.com/vyos/vyos1x-config.git#5f1d834561ce9463ce1900fef7a2614418a412bc -y ; \
46+
opam pin add vyconf https://github.com/vyos/vyconf.git#b5a3d62714bc47f5187a10c8ad0773c9e655e9e4 -y'
4747

4848
sharedlib: depends $(BUILDDIR)/libvyosconfig$(EXTDLL)
4949

libvyosconfig/lib/bindings.ml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ let diff_tree path c_ptr_l c_ptr_r =
378378
| CD.Incommensurable -> error_message := "Incommensurable"; Ctypes.null
379379
| CD.Empty_comparison -> error_message := "Empty comparison"; Ctypes.null
380380

381-
let show_diff cmds path c_ptr_l c_ptr_r =
381+
let diff_compare cmds path c_ptr_l c_ptr_r =
382382
(* alert exn CD.show_diff:
383383
[Config_diff.Incommensurable] caught
384384
[Config_diff.Empty_comparison] caught
@@ -387,7 +387,7 @@ let show_diff cmds path c_ptr_l c_ptr_r =
387387
let ct_l = Root.get c_ptr_l in
388388
let ct_r = Root.get c_ptr_r in
389389
try
390-
(CD.show_diff[@alert "-exn"]) ~cmds:cmds path ct_l ct_r
390+
(CD.diff_compare[@alert "-exn"]) ~cmds:cmds path ct_l ct_r
391391
with
392392
| CD.Incommensurable -> error_message := "Incommensurable"; "#1@"
393393
| CD.Empty_comparison -> error_message := "Empty comparison"; "#1@"
@@ -499,7 +499,7 @@ struct
499499
let () = I.internal "return_value" ((ptr void) @-> string @-> returning string) return_value
500500
let () = I.internal "return_values" ((ptr void) @-> string @-> returning string) return_values
501501
let () = I.internal "diff_tree" (string @-> (ptr void) @-> (ptr void) @-> returning (ptr void)) diff_tree
502-
let () = I.internal "show_diff" (bool @-> string @-> (ptr void) @-> (ptr void) @-> returning string) show_diff
502+
let () = I.internal "diff_compare" (bool @-> string @-> (ptr void) @-> (ptr void) @-> returning string) diff_compare
503503
let () = I.internal "tree_union" ((ptr void) @-> (ptr void) @-> returning (ptr void)) tree_union
504504
let () = I.internal "tree_merge" (bool @-> (ptr void) @-> (ptr void) @-> returning (ptr void)) tree_merge
505505
let () = I.internal "reference_tree_to_json" (string @-> string @-> string @-> returning int) reference_tree_to_json

python/vyos/config_mgmt.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
from vyos.configtree import ConfigTreeError
3838
from vyos.configsession import ConfigSession
3939
from vyos.configsession import ConfigSessionError
40-
from vyos.configtree import show_diff
40+
from vyos.configtree import diff_compare
4141
from vyos.load_config import load
4242
from vyos.load_config import LoadConfigError
4343
from vyos.defaults import directories
@@ -413,9 +413,9 @@ def compare(
413413
path = [] if commands else self.edit_path
414414
try:
415415
if commands:
416-
out = show_diff(ct1, ct2, path=path, commands=True)
416+
out = diff_compare(ct1, ct2, path=path, commands=True)
417417
else:
418-
out = show_diff(ct1, ct2, path=path)
418+
out = diff_compare(ct1, ct2, path=path)
419419
except ConfigTreeError as e:
420420
return e, 1
421421

python/vyos/configtree.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -473,7 +473,7 @@ def get_subtree(self, path, with_node=False):
473473
return subt
474474

475475

476-
def show_diff(left, right, path=[], commands=False, libpath=LIBPATH):
476+
def diff_compare(left, right, path=[], commands=False, libpath=LIBPATH):
477477
if left is None:
478478
left = ConfigTree(config_string='\n')
479479
if right is None:
@@ -488,14 +488,14 @@ def show_diff(left, right, path=[], commands=False, libpath=LIBPATH):
488488
path_str = ' '.join(map(str, path)).encode()
489489

490490
__lib = cdll.LoadLibrary(libpath)
491-
__show_diff = __lib.show_diff
492-
__show_diff.argtypes = [c_bool, c_char_p, c_void_p, c_void_p]
493-
__show_diff.restype = c_char_p
491+
__diff_compare = __lib.diff_compare
492+
__diff_compare.argtypes = [c_bool, c_char_p, c_void_p, c_void_p]
493+
__diff_compare.restype = c_char_p
494494
__get_error = __lib.get_error
495495
__get_error.argtypes = []
496496
__get_error.restype = c_char_p
497497

498-
res = __show_diff(commands, path_str, left._get_config(), right._get_config())
498+
res = __diff_compare(commands, path_str, left._get_config(), right._get_config())
499499
res = res.decode()
500500
if res == '#1@':
501501
msg = __get_error().decode()

0 commit comments

Comments
 (0)