[sysrepo-devel] sr_list_schema
Rastislav Szabo -X (raszabo - PANTHEON TECHNOLOGIES at Cisco)
raszabo at cisco.com
Wed Nov 30 08:10:47 UTC 2016
Hi,
It should work, we test list schemas with this unit-test which prints a similar list correctly:
https://github.com/sysrepo/sysrepo/blob/master/tests/cl_test.c#L282-L332
Can you please check whether this test works for you?
I guess you will most likely have something wrong with your setup - maybe you are actually using older version of sysrepo libraries - look at this comment: https://github.com/sysrepo/sysrepo/pull/516
Thanks,
Rastislav
From: sysrepo-devel [mailto:sysrepo-devel-bounces at sysrepo.org] On Behalf Of Joan Landry
Sent: Tuesday, November 29, 2016 9:35 PM
To: sysrepo-devel at sysrepo.org
Subject: [sysrepo-devel] sr_list_schema
Is there a known issue with using sr_list_schema function?
I upgraded to the master branch and prior to this the printing of the schema looked like this
======= iana-if-type ============
======= ietf-interfaces ============
======= ietf-ip ============
======= ietf-inet-types ============
======= ietf-yang-types ============
======= ietf-netconf-monitoring ============
======= ietf-netconf-acm ============
======= ietf-netconf ============
======= ietf-netconf-with-defaults ============
======= iana-crypt-hash ============
======= ietf-system ============
==
I did not change the code to printout the schemas and now I get this:
======= iana-if-type ============
======= hX\ufffd\ufffd\ufffd ============
======= (null) ============
======= (null) ============
======= (null) ============
======= (null) ============
======= (null) ============
======= /etc/sysrepo/yang/ietf-yang-types at 2013-07-15.yang<mailto:/etc/sysrepo/yang/ietf-yang-types at 2013-07-15.yang> ============
======= 2016-09-21 ============
======= (null) ============
======= ncwd ============
======= urn:ietf:params:xml:ns:netconf:base:1.0 ============
code:
rc = sr_list_schemas(session, &schemas, &cnt);
if (SR_ERR_OK != rc) {
fprintf(stderr, "failed to retrieve schemas: %s\n", sr_strerror(rc));
}
else
{
size_t idx;
for (idx=0; idx < cnt; idx++)
{
printf("======= %s ============\n",schemas[idx].module_name);
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sysrepo.org/archives/sysrepo-devel/attachments/20161130/33e67197/attachment.html>
More information about the sysrepo-devel
mailing list