Skip to content

Commit

Permalink
vyos.configtree: T4918: Allow set tag flag to true or false
Browse files Browse the repository at this point in the history
  • Loading branch information
natali-rs1985 committed Oct 7, 2024
1 parent 2f554ae commit 66c98c0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions python/vyos/configtree.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ def __init__(self, config_string=None, address=None, libpath=LIBPATH):
self.__is_tag.restype = c_int

self.__set_tag = self.__lib.set_tag
self.__set_tag.argtypes = [c_void_p, c_char_p]
self.__set_tag.argtypes = [c_void_p, c_char_p, c_bool]
self.__set_tag.restype = c_int

self.__is_leaf = self.__lib.is_leaf
Expand Down Expand Up @@ -359,11 +359,11 @@ def is_tag(self, path):
else:
return False

def set_tag(self, path):
def set_tag(self, path, value=True):
check_path(path)
path_str = " ".join(map(str, path)).encode()

res = self.__set_tag(self.__config, path_str)
res = self.__set_tag(self.__config, path_str, value)
if (res == 0):
return True
else:
Expand Down

0 comments on commit 66c98c0

Please sign in to comment.