CESNET / libnetconf

C NETCONF library
Other
113 stars 83 forks source link

an error occurred while checking the data. in function check_edit_ops() #240

Open xingcanhui opened 7 years ago

xingcanhui commented 7 years ago

configuration date with "operation=create",has no keys,we expect an missing keys error, but in funciont check_edit_ops() we returned NC_ERR_DATA_EXISTS errors, is that suitable ? thanks. for example: the running datastore:

<capable-switch xmlns="urn:onf:config:yang">
    <id>capable-switch-1</id>
    <config-version>1.2</config-version>
    <logical-switches>
      <switch>
        <id>logic-switch-1</id>
        <datapath-id>11:11:11:11:11:11:11:11</datapath-id>
        <enabled>true</enabled>
      </switch>
    </logical-switches>
    <resources>
      <G.8113.1_MEG>
        <resource-id>1</resource-id>
        <index>1</index>
        <name>tpoam_lsp_w42</name>
        <managedInstanceType>lsp</managedInstanceType>
        <Local_MEP>
          <openFlowMpId>42</openFlowMpId>
          <serveropenFlowMpId>42</serveropenFlowMpId>
          <mepId>540</mepId>
          <enable>true</enable>
          <CCM>
            <phb>EF</phb>
            <period>1MIN</period>
            <enable>true</enable>
          </CCM>
          <Proactive_LM>
            <destinationType>MEP</destinationType>
            <destination>123</destination>
            <phb>CS7</phb>
            <enable>true</enable>
            <toolTypes>CCM</toolTypes>
            <period>3.33MS</period>
          </Proactive_LM>
        </Local_MEP>
        <Remote_MEP>
          <openFlowMpId>42</openFlowMpId>
          <mepId>640</mepId>
        </Remote_MEP>
      </G.8113.1_MEG>
    </resources>
  </capable-switch>
netconf> 

the config data:

<capable-switch xmlns="urn:onf:config:yang">
    <id>capable-switch-1</id>
    <resources>
      <G.8113.1_MEG>
        <index>2</index>
        <name>tpoam_lsp_w42</name>
        <managedInstanceType>lsp</managedInstanceType>
        <Local_MEP>
          <openFlowMpId>42</openFlowMpId>
          <serveropenFlowMpId>42</serveropenFlowMpId>
          <mepId>540</mepId>
          <enable>true</enable>
          <CCM>
            <phb>EF</phb>
            <period>1MIN</period>
            <enable>true</enable>
          </CCM>
          <Proactive_LM>
            <destinationType>MEP</destinationType>
            <destination>123</destination>
            <phb>CS7</phb>
            <enable>true</enable>
            <toolTypes>CCM</toolTypes>
            <period>3.33MS</period>
          </Proactive_LM>
        </Local_MEP>
        <Remote_MEP>
          <openFlowMpId>42</openFlowMpId>
          <mepId>640</mepId>
        </Remote_MEP>
      </G.8113.1_MEG>
    </resources>
  </capable-switch>

the only key is <resource-id>