Skip to content

Commit 5a44647

Browse files
committed
modules CHANGE move schemas to tests
... because they are not needed anywhere else.
1 parent b0f5e0e commit 5a44647

16 files changed

Lines changed: 27 additions & 24 deletions

CMakeLists.txt

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,6 @@ endif()
2626
# osx specific
2727
set(CMAKE_MACOSX_RPATH TRUE)
2828

29-
set(INCLUDE_INSTALL_SUBDIR ${CMAKE_INSTALL_INCLUDEDIR}/libnetconf2)
30-
set(DATA_INSTALL_DIR ${CMAKE_INSTALL_DATADIR}/libnetconf2)
31-
3229
# set default build type if not specified by user
3330
if(NOT CMAKE_BUILD_TYPE)
3431
set(CMAKE_BUILD_TYPE Debug)
@@ -66,7 +63,7 @@ set(READ_INACTIVE_TIMEOUT 20 CACHE STRING "Maximum number of seconds waiting for
6663
set(READ_ACTIVE_TIMEOUT 300 CACHE STRING "Maximum number of seconds for receiving a full message")
6764
set(MAX_PSPOLL_THREAD_COUNT 6 CACHE STRING "Maximum number of threads that could simultaneously access a ps_poll structure")
6865
set(TIMEOUT_STEP 100 CACHE STRING "Number of microseconds tasks are repeated until timeout elapses")
69-
set(SCHEMAS_DIR "${CMAKE_INSTALL_PREFIX}/${DATA_INSTALL_DIR}" CACHE STRING "Directory with internal lnc2 schemas")
66+
set(YANG_MODULE_DIR "${CMAKE_INSTALL_PREFIX}/share/yang/modules" CACHE STRING "Directory with common YANG modules")
7067

7168
if(ENABLE_DNSSEC AND NOT ENABLE_SSH)
7269
message(WARNING "DNSSEC SSHFP retrieval cannot be used without SSH support.")
@@ -231,13 +228,7 @@ install(TARGETS netconf2 DESTINATION ${CMAKE_INSTALL_LIBDIR})
231228
# install headers
232229
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/nc_client.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
233230
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/nc_server.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
234-
install(FILES ${headers} DESTINATION ${INCLUDE_INSTALL_SUBDIR})
235-
236-
# install schemas
237-
install(
238-
CODE "file(GLOB yin_schemas \"${CMAKE_SOURCE_DIR}/schemas/*.yin\")"
239-
CODE "file(INSTALL \${yin_schemas} DESTINATION ${CMAKE_INSTALL_PREFIX}/${DATA_INSTALL_DIR})"
240-
)
231+
install(FILES ${headers} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/libnetconf2)
241232

242233
# install pkg-config file
243234
find_package(PkgConfig)

src/config.h.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,9 @@
6363
#cmakedefine HAVE_CRYPT
6464

6565
/*
66-
* Location of installed basic YIN/YANG schemas
66+
* Location of installed basic YANG modules on the system
6767
*/
68-
#define NC_SCHEMAS_DIR "@SCHEMAS_DIR@"
68+
#define NC_YANG_DIR "@YANG_MODULE_DIR@"
6969

7070
/*
7171
* Inactive read timeout

src/session_client.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ nc_session_new_ctx(struct nc_session *session, struct ly_ctx *ctx)
226226
if (client_opts.schema_searchpath) {
227227
ly_ctx_set_searchdir(ctx, client_opts.schema_searchpath);
228228
}
229-
ly_ctx_set_searchdir(ctx, NC_SCHEMAS_DIR);
229+
ly_ctx_set_searchdir(ctx, NC_YANG_DIR);
230230

231231
/* set callback for getting schemas, if provided */
232232
ly_ctx_set_module_imp_clb(ctx, client_opts.schema_clb, client_opts.schema_clb_data);
@@ -950,10 +950,6 @@ nc_ctx_fill_ietf_netconf(struct nc_session *session, struct schema_info *modules
950950
ietfnc = ly_ctx_get_module(session->ctx, "ietf-netconf", NULL, 1);
951951
if (!ietfnc) {
952952
nc_ctx_load_module(session, "ietf-netconf", NULL, modules, user_clb, user_data, has_get_schema, &ietfnc);
953-
if (!ietfnc) {
954-
WRN("Unable to find correct \"ietf-netconf\" schema, trying to use backup from \"%s\".", NC_SCHEMAS_DIR"/ietf-netconf.yin");
955-
ietfnc = lys_parse_path(session->ctx, NC_SCHEMAS_DIR"/ietf-netconf.yin", LYS_IN_YIN);
956-
}
957953
}
958954
if (!ietfnc) {
959955
ERR("Loading base NETCONF schema failed.");
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)