Skip to content
This repository was archived by the owner on Nov 5, 2024. It is now read-only.

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

@hrk091

Description

@hrk091

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions