freenetconf / freenetconfd Goto Github PK
View Code? Open in Web Editor NEWNETCONF server
Home Page: http://www.freenetconf.org
License: GNU General Public License v2.0
NETCONF server
Home Page: http://www.freenetconf.org
License: GNU General Public License v2.0
It seems that the replace
operation on lists is not working as expected. This is the result of such an operation on user-authentication-order:
root@myrouter:/# dmctrl dump system.authentication.user-authentication-order
<?xml version="1.0" encoding="UTF-8"?>
<data>
<user-authentication-order instance='1'>
<user-authentication-order>local-users</user-authentication-order>
</user-authentication-order>
<user-authentication-order instance='2'>
<user-authentication-order />
</user-authentication-order>
</data>
The second instance is empty, but this is not permitted by the YANG model. So this basically creates an invalid running configuration.
According to https://github.com/opencpe/yang/blob/master/specs/opencpe-firmware-mgmt%402014-02-06.yang#L121 the "firmware-job" has a single attribute "install-target", which is a leafref referencing a "firmware-slot".
Adding such a setup with
root@openwrt:/# dmctrl add system-state.firmware-slot
new instance: system-state.firmware-slot.32769
root@openwrt:/# dmctrl set system-state.firmware-slot.32769.active=true
root@openwrt:/# dmctrl set system-state.firmware-slot.32769.name=firmware
root@openwrt:/# dmctrl set system-state.firmware-slot.32769.path=/dev/mtd3
root@openwrt:/# dmctrl set system-state.firmware-slot.32769.version=1234
root@openwrt:/# dmctrl add system-state.firmware-job
new instance: system-state.firmware-job.32769
root@openwrt:/# dmctrl set system-state.firmware-job.32769.job-id=1
root@openwrt:/# dmctrl set system-state.firmware-job.32769.install-target=system-state.firmware-slot.32769
root@openwrt:/# dmctrl set system-state.firmware-job.32769.status.status-msg=foobar
will create that data, but it will not be correctly resolved/translated. When browsing the "Live Config" on NCS:
request:
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="9">
<get>
<filter>
<system-state xmlns='urn:ietf:params:xml:ns:yang:ietf-system'>
<firmware-job xmlns='urn:opencpe:firmware-mgmt'></firmware-job>
</system-state></filter>
</get>
</rpc>
response:
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="9">
<data>
<system-state xmlns="urn:ietf:params:xml:ns:yang:ietf-system">
<firmware-job>
<firmware-job>
<job-id>1</job-id>
<install-target>system-state.firmware-slot.32769</install-target>
<status>planned</status>
<status-msg>foobar</status-msg>
<progress>0</progress>
</firmware-job>
</firmware-job>
</system-state>
</data>
I noticed several (potential) issues:
a) firmware-job is double grouped (''''''''). This might come from the "grouping" of the yang model.
b) neither has their correct namespace
c) install-target is not resolved to "firmware" (the "name" of system-state.firmware-slot.32769).
At least one of these, or the combination causes firmware-jobs to be not displayed in NCS; i.e. the list is empty. Firmware-slots are properly displayed.
b) is probably an easy fix, but for c) I only see code replacing the mand-references within lists of leafrefs, but not those single leafrefs attributes.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.