X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?p=sim%2Fo1-interface.git;a=blobdiff_plain;f=ntsimulator%2Fntsim-ng%2Fcore%2Fcontext.c;h=801966244e2f7c1d0c2968e933469d42a6a6e077;hp=9bc57f24a1b6250229e6ebd0f04d297efeeeeea3;hb=97567d86ca17b852ea76144639770e079f3745fc;hpb=0b419c5cc86de3d87da31a672eea1f0ec5ea8a89 diff --git a/ntsimulator/ntsim-ng/core/context.c b/ntsimulator/ntsim-ng/core/context.c index 9bc57f2..8019662 100644 --- a/ntsimulator/ntsim-ng/core/context.c +++ b/ntsimulator/ntsim-ng/core/context.c @@ -260,6 +260,18 @@ bool context_module_install(const char *name, const char *path) { } free(data_path); + data_path = str_replace(path, ".yang", ".json"); + if(file_exists(data_path)) { + rc = sr_install_module_data(session_connection, name, 0, data_path, LYD_JSON); + if(rc != SR_ERR_OK) { + log_message(1, " json error "); + sr_remove_module(session_connection, name); + context_apply_changes(); + return false; + } + } + free(data_path); + //apply changes if(!context_apply_changes()) { sr_remove_module(session_connection, name);