Open
Description
Using the example in README, there are at least 2 ways to hit segmentation fault, using v3.0.2.
Requesting a fix or guide towards proper usage if the below seems incorrect.
Intention is to delete nodes based on some conditions.
>>> import libyang
>>> ctx = libyang.Context()
>>> module = ctx.parse_module_str('''
module example {
namespace "urn:example";
prefix "ex";
container data {
list interface {
key name;
leaf name {
type string;
}
leaf address {
type string;
}
}
leaf hostname {
type string;
}
}
}
''')
>>> node = module.parse_data_dict({
'data': {
'hostname': 'foobar',
'interface': [
{'name': 'eth0', 'address': '1.2.3.4/24'},
{'name': 'lo', 'address': '127.0.0.1'},
],
},
})
>>> nodes = list(node.find_all("/example:data"))
>>> nodes[0].free(with_siblings=False)
>>> print(node.print_mem('json', pretty=True)) # OR print(node.find_path("/example:data"))
Metadata
Metadata
Assignees
Labels
No labels