CESNET / libnetconf

C NETCONF library
Other
113 stars 83 forks source link

Validation failed for edit-config rpc contain node with mixed prefixes #209

Closed SantoshJena closed 8 years ago

SantoshJena commented 8 years ago

Hi, Valiation failed with netopeer-cli, when a rpc entered with mixed prefixes for edit-config. If I do xml validation with xmllint, this rpc validates correctly.

<configs xmlns="http://www.ABC.com/ns/yang/ABC">
  <profiles xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" nc:operation="create">
    <xyz:profile xmlns:xyz="http://www.ABC.com/ns/yang/ABC">
      <xyz:name>A_B</xyz:name >
    </xyz:profile >
  </profiles >
</configs >

NETCONF error: operation-failed (application) - Datastore fails to validate (Did not expect element profiles there)

If I add prefixes to all the nodes, like below, it validates correctly. But when it stores into datastore, it doesnot store prefixes for the root node(configs).

<xyz:configs xmlns:xyz="http://www.ABC.com/ns/yang/ABC">
  <xyz:profiles xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" nc:operation="create">
    <xyz:profile xmlns:xyz="http://www.ABC.com/ns/yang/ABC">
      <xyz:name>A_B</xyz:name >
    </xyz:profile >
  </xyz:profiles >
</xyz:configs >

Could you please help check it?

Thanks Santosh

michalvasko commented 8 years ago

Hi Santosh, can you please provide the module for this data?

Regards, Michal

SantoshJena commented 8 years ago

Thanks Michal for your responce. I have added module in a zip file.

yang.zip

Regards Santosh

michalvasko commented 8 years ago

Hi Santosh, this generation of libnetconf does not support submodules and never will, so that is likely the cause of your problems.

Regards, Michal

SantoshJena commented 8 years ago

ok. Thanks.

SantoshJena commented 8 years ago

Hi Michal, This issue is still valid without submodule. Here I attached models.

Regards Santosh my-example.zip

michalvasko commented 8 years ago

Hi Santosh, please verify the fix.

Regards, Michal

SantoshJena commented 8 years ago

Hi Michal,

I verified, the rpc is passing now but still you dont store prefixes to the root node. Am I correct ?

Regards Santosh

michalvasko commented 8 years ago

Hi, yeah, the root node is stored without the prefix for some reason, but the namespaces are generally correct.

Michal

SantoshJena commented 8 years ago

Ok. Thanks & Regards, Santosh.