CESNET / libnetconf

C NETCONF library
Other
113 stars 83 forks source link

Configure failed when I tried to add a list item with different keys. #190

Closed xiazg closed 8 years ago

xiazg commented 8 years ago

LOG:

netopeer-server[15977]: Received message (session 1): <?xml version="1.0" encoding="UTF-8"?>
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="1">
  <edit-config>
    <target>
      <running/>
    </target>
    <config>
      <dhcp xmlns="http://example.com/my-dhcp" xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0">
        <SubNets>
          <subNet nc:operation="create">
            <net>192.168.128.0</net>
            <mask>255.255.255.0</mask>
            <range>
              <lowAddr>192.168.128.60</lowAddr>
              <hiAddr>192.168.128.89</hiAddr>
            </range>
          </subNet>
        </SubNets>
      </dhcp>
    </config>
  </edit-config>
</rpc>
netopeer-server[15977]: Creating the parent dhcp (src/datastore/edit_config.c:1772)
netopeer-server[15977]: Creating the parent SubNets (src/datastore/edit_config.c:1786)
netopeer-server[15977]: Creating the node subNet (src/datastore/edit_config.c:1492)
netopeer-server[15977]: Deleting the node subNet (src/datastore/edit_config.c:1008)
netopeer-server[15977]: Merging the node dhcp (src/datastore/edit_config.c:2330)
netopeer-server[15977]: Merging the node SubNets (src/datastore/edit_config.c:2388)
netopeer-server[15977]: Deleting the node dhcp (src/datastore/edit_config.c:1008)
netopeer-server[15977]: RelaxNG validation on subdatastore 719885387
netopeer-server[15977]: Schematron validation on subdatastore 719885387
netopeer-server[15977]: Adding new event (3)
netopeer-server[15977]: Writing message (session 1): <?xml version="1.0" encoding="UTF-8"?>
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="1">
  <ok/>
</rpc-reply>
netopeer-server[15977]: Received message (session 1): <?xml version="1.0" encoding="UTF-8"?>
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="2">
  <edit-config>
    <target>
      <running/>
    </target>
    <config>
      <dhcp xmlns="http://example.com/my-dhcp" xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0">
        <SubNets>
          <subNet nc:operation="create">
            <net>192.168.128.1</net>
            <mask>255.255.0.0</mask>
          </subNet>
        </SubNets>
      </dhcp>
    </config>
  </edit-config>
</rpc>
netopeer-server[15977]: Writing message (session 1): <?xml version="1.0" encoding="UTF-8"?>
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="2">
  <rpc-error>
    <error-type>application</error-type>
    <error-tag>data-exists</error-tag>
    <error-severity>error</error-severity>
    <error-message>Request could not be completed because the relevant data model content already exists.</error-message>
  </rpc-error>
</rpc-reply>

Attached files are the yang model.

thanks! my-dhcp.yang.txt my-dhcp-impl.yang.txt

michalvasko commented 8 years ago

Hi, I am actually unsure how you even got this far, because I was not even able to create a transAPI module for your modules because lnctool (actually some other tool it directly uses) cannot work with submodules. I think this will be the cause of your problem.

Regards, Michal