Giter Site home page Giter Site logo

freenetconfd's People

Contributors

lperkov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

freenetconfd's Issues

[OpenCPE] "Sync to device" with "replace" invalidates device config

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.

OpenCPE: opencpe:firmware-mgmt:firmware-job is not properly translated

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.