Commit bf5ff439 authored by Pavel Spirek's avatar Pavel Spirek

Version bump

parent 5deb7174
PROJECT = jetconf
VERSION = 0.2.3
VERSION = 0.2.4
.PHONY = tags deps install-deps test
tags:
......
......@@ -325,7 +325,6 @@ class BaseDatastore:
# Notify data observers about change in datastore
def run_conf_edit_handler(self, ii: InstanceRoute, ch: DataChange):
try:
sch_pth_list = list(filter(lambda n: isinstance(n, MemberName), ii))
if ch.change_type == ChangeType.CREATE:
......@@ -371,8 +370,6 @@ class BaseDatastore:
info("handler for superior data node triggered, replace_item")
h.replace_item(ii, ch)
sn = sn.parent
except NonexistentInstance:
warn("Cannnot notify {}, parent container removed".format(ii))
# Get data node, evaluate NACM if required
def get_node_rpc(self, rpc: RpcInfo, staging=False) -> InstanceNode:
......
import json
from yangson.datamodel import DataModel
from yangson.instance import InstanceRoute
module_dir = "../yang-data/"
yang_library_file = "../yang-data/yang-library-data.json"
MODULE_DIR = "yang-data"
YANG_LIBRARY = "yang-library-data.json"
DATA_FILE = "data.json"
with open(yang_library_file) as ylfile:
with open(YANG_LIBRARY) as ylfile:
yl = ylfile.read()
dm = DataModel(yl, [module_dir])
dm = DataModel(yl, [MODULE_DIR])
with open("data.json", "rt") as fp:
with open(DATA_FILE, "rt") as fp:
json_data = dm.from_raw(json.load(fp))
handler_sn = dm.get_data_node("/dns-server:dns-server-state/zone")
handler_generated = [
{
'domain': 'example.com',
'class': 'IN',
'server-role': 'master',
'serial': 2010111201
}
]
cooked_val = handler_sn.from_raw(handler_generated)
ii_str_abs = "/dns-server:dns-server-state/zone=example.com/class"
ii_abs = dm.parse_resource_id(ii_str_abs)
print("Absolute II: {}".format(ii_abs))
ii_rel = InstanceRoute(ii_abs[2:])
print("Relative II (hardcoded for now): {}".format(ii_rel))
handler_n = handler_sn.orphan_instance(cooked_val)
n_desired = handler_n.goto(ii_rel)
# crashes here
print(n_desired.value)
n = handler_n[0]
print(n.value)
for i in n:
print(i)
print(type(i))
json_data.validate()
print("end")
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment