Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some xml tags are missed from edit-config body #3

Open
hrk091 opened this issue Jan 16, 2018 · 0 comments
Open

Some xml tags are missed from edit-config body #3

hrk091 opened this issue Jan 16, 2018 · 0 comments

Comments

@hrk091
Copy link

hrk091 commented Jan 16, 2018

I've tried to compile OpenConfig model and to install sample config( not include IdentityRef ) to openconfig emulator via DynamicDeviceConfigSynchronizer. The config sample is

{
    "openconfig-system:system": {
        "clock": {
            "config": {
                "timezone-name": "UST"
            }
        }
    }
}

I successfully wrote the config to Dynamic Config Store without error, but OpenConfig emulator returned rpc-error like

<rpc-reply message-id="3" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
  <rpc-error>
    <error-type>application</error-type>
    <error-tag>unknown-element</error-tag>
    <error-severity>error</error-severity>
    <error-path>
      /rpc/edit-config/config/oc-sys:clock
    </error-path>
    <error-info>
      <bad-element>clock</bad-element>
    </error-info>
  </rpc-error>
</rpc-reply>

The edit-config msg sent from netconf-driver may cause this error. I expect to DCS and netconf-driver to send edit-config msg as below

<rpc message-id="5" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
  <edit-config xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0">
    <target>
      <running/>
    </target>
    <config>
      <system xmlns="http://openconfig.net/yang/system">
        <clock>
          <config>
            <timezone-name>UTC</timezone-name>
          </config>
        </clock>
      </system>
    </config>
  </edit-config>
</rpc>

but the onos netconf-driver sent these edit-config msgs according to a netconf trace log in emulator:

<rpc message-id="2" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
  <edit-config>
    <target>
      <running/>
    </target>
    <config xmlns:xc="urn:ietf:params:xml:ns:netconf:base:1.0"/>
  </edit-config>
</rpc>

<rpc message-id="3" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
  <edit-config>
    <target>
      <running/>
    </target>
    <config xmlns:xc="urn:ietf:params:xml:ns:netconf:base:1.0">
      <clock xmlns="http://openconfig.net/yang/system">
        <config>  
          <timezone-name>
            UTC
          </timezone-name>
        </config>
      </clock>
    </config>
  </edit-config>
</rpc>

<rpc message-id="4" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
  <edit-config>
    <target>
      <running/>
    </target>
    <config xmlns:xc="urn:ietf:params:xml:ns:netconf:base:1.0">
      <config xmlns="http://openconfig.net/yang/system">
        <timezone-name>UTC</timezone-name>
      </config>
    </config>
  </edit-config>
</rpc>

<rpc message-id="5" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
  <edit-config>
    <target>
      <running/>
    </target>
    <config xmlns:xc="urn:ietf:params:xml:ns:netconf:base:1.0">
      <timezone-name xmlns="http://openconfig.net/yang/system">UTC</timezone-name>
    </config>
  </edit-config>
</rpc>

<rpc message-id="6" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
  <edit-config>
    <target>
      <running/>
    </target>
    <config xmlns:xc="urn:ietf:params:xml:ns:netconf:base:1.0"/>
  </edit-config>
</rpc>

All of these edit-configs caused rpc-error reply.
Sample app code is below

       DefaultSystem system = new DefaultSystem();

        DefaultClock clock = new DefaultClock();
        system.clock(clock);

        DefaultConfig config = new DefaultConfig();
        clock.config(config);

        TimezoneNameType timezone = new TimezoneNameType("UTC");
        config.timezoneName(timezone);

        ModelObjectData modelData = DefaultModelObjectData.builder()
                    .addModelObject(system)
                    .identifier(null)
                    .build();

In edit-config of message-id="3" above, system tag for system container is not written in config body. If the system tag is included, the rpc message will be accepted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant