Comments (7)
In devel branch the error is different:
[ERR] (sr_check_value_conform_to_schema:807) Value doesn't conform to schema expected 0 instead of 19
[ERR] (sr_val_to_str:1070) Value doesn't conform to schema node testunion
[ERR] (rp_dt_set_item:373) Copy new value to string failed
[ERR] (rp_dt_set_item_wrapper:574) Set item failed
[ERR] (rp_set_item_req_process:919) Set item failed for '/test:testunion', session id=921487922.
with the following model:
module test {
namespace "test";
prefix t;
typedef u {
type union {
type string {
pattern "disabled";
}
type uint8 {
range "1..100";
}
}
default "disabled";
}
leaf testunion {
type u;
}
}
and edit-config:
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="2">
<edit-config>
<target>
<candidate/>
</target>
<config>
<testunion xmlns="test">10</testunion>
</config>
</edit-config>
</rpc>
It is unclear to me what kind of data are expected to be stored in sr_val_t
in case of union. Netopeer actually know the type (SR_UINT8_T
in this case) so the type detection in sysrepo could be skipped. Just storing the value as uint8_t
and declaring type SR_UNION_T
does not work:
netopeer2-server[21115]: (sr_set_val_t_type_in_gpb:1105) Type can not be mapped to gpb type '(null)' type 6
netopeer2-server[21115]: (sr_dup_val_t_to_gpb:1249) Setting type in gpb failed for xpath '(null)'
netopeer2-server[21115]: (sr_set_item:1695) value duplication failed.
from netopeer2.
The value should be declared as actual type SR_UINT8_T
in this case
from netopeer2.
That's how it is done currently in devel branch, but the result is following.
netopeer2-server log:
netopeer2-server[27919]: Resolving unresolved data nodes and their constraints...
netopeer2-server[27919]: All data nodes and constraints resolved.
netopeer2-server[27919]: (cl_request_process:483) Error by processing of the set-item request (session id=547989496): Invalid argument.
netopeer2-server[27919]: (sr_set_item:1699) Error by processing of the request.
sysrepod log:
[ERR] (sr_check_value_conform_to_schema:803) Value doesn't conform to schema expected 0 instead of 18
[ERR] (sr_val_to_str:1066) Value doesn't conform to schema node testunion
[ERR] (rp_dt_set_item:373) Copy new value to string failed
[ERR] (rp_dt_set_item_wrapper:574) Set item failed
[ERR] (rp_set_item_req_process:919) Set item failed for '/test:testunion', session id=547989496.
from netopeer2.
OK, the issue was in sysrepo's typedef hadling. Should be fixed now
from netopeer2.
is the fix on the master branch?
from netopeer2.
yes it is
from netopeer2.
Thanks!
from netopeer2.
Related Issues (20)
- netopeer2.conf and pam_nologin.so does not exist in Yocto Scarthgap HOT 3
- netopeer2-server: /home/ubuntn/libyang-2.0.112/src/parser_xml.c:696: lydxml_subtree_r: Assertion `xmlctx->status == LYXML_ELEM_CLOSE' failed. Aborted (core dumped) HOT 1
- TLS server cipher regarding HOT 7
- Complete example for callback mechanism e.g when changing/reading some field via netopeer2-server HOT 2
- NOT support password customization authentication function in new version HOT 8
- Call home to loopback IP is failing HOT 4
- Netopeer2-cli does not detect connection breakage in the background HOT 3
- A potential mistake need to be tested and verified HOT 1
- Does netopeer-cli support public key based authentication HOT 4
- Cannot connect Server HOT 8
- Query on listing existing subscriptions HOT 15
- Query: any API to terminate the particular client's netconf session with particular user from application HOT 5
- New SSH server key added every time I trigger a call-home, not checking the known_host file. HOT 1
- Failed changing permissions of directory "/usr/lib64/netopeer2-server" (Read-only file system) HOT 2
- Unable to receive callback when trying to subscribe custom yang model using sr_oper_get_subscribe() HOT 1
- Delete subinterface and network-instance not working with netopeer2 HOT 5
- Error with TLS Call Home connection using netopeer2-cli HOT 2
- netopeer2-server dont open port in openwrt HOT 6
- Example configuration xml tags are not aligned with yang modules HOT 5
- The "apkg build" breaks due pam.de/netopeer2.conf path issue HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from netopeer2.