clicon / clixon-controller

Clixon network controller
Apache License 2.0
14 stars 5 forks source link

OpenConfig: Error when validating/committing #32

Closed krihal closed 1 year ago

krihal commented 1 year ago
debian@khn-dev[/]# set devices device r* config interfaces interface test config name test
debian@khn-dev[/]# set devices device r* config interfaces interface test config type iana:ethernetCsmacd
Aug 23 11:13:44: Editing configuration: application invalid-value identityref: "iana:ethernetCsmacd": prefix "iana" has no associated namespace
debian@khn-dev[/]# set devices device r* config interfaces interface test config type ethernetCsmacd
debian@khn-dev[/]# vali
 local                 push                  |
debian@khn-dev[/]# validate p
 |
debian@khn-dev[/]# validate push
Transaction 11 failed Error Identityref validation failed, ethernetCsmacd not derived from interface-type in ietf-interfaces.yang:68 in state PUSH-VALIDATE of device r2
debian@khn-dev[/]#
debian@khn-dev[/]# commit
Transaction 12 failed Error Identityref validation failed, ethernetCsmacd not derived from interface-type in ietf-interfaces.yang:68 in state PUSH-VALIDATE of device r1
krihal commented 1 year ago

Getting the same error:

debian@khn-dev[/]# set devices device r* config interfaces interface test config name test
debian@khn-dev[/]# set devices device r* config interfaces interface test config type ethernetCsmacd
debian@khn-dev[/]# validate
debian@khn-dev[/]# validate push
Transaction 6 failed Error Identityref validation failed, ethernetCsmacd not derived from interface-type in ietf-interfaces.yang:68 in state PUSH-VALIDATE of device r1
debian@khn-dev[/]# commit push
Transaction 7 failed Error Identityref validation failed, ethernetCsmacd not derived from interface-type in ietf-interfaces.yang:68 in state PUSH-VALIDATE of device r1
debian@khn-dev[/]#
olofhagsand commented 1 year ago

There are some problems with the use of namespaces in the issue: The type should have prefix: ianaift: as in: set devices device openconfig1 config interfaces interface test config type ianaift:ethernetCsmacd If you use expand it should only offer types with proper prefixes. However, you can text in a type without prefix, as in: ethernetCsmacd But then the local validation should fail: olof@alarik[/]# validate local Sep 27 10:58:32: Validate failed. Edit and try again or discard changes: application operation-failed Identityref validation failed, ethernetCsmacd not derived from interface-type in ietf-interfaces.yang:68 But if yang-config is not VALIDATE, ie: <yang-config>BIND</yang-config> then local validation will not work, and the error will only be detected at push as the issue request shows. Therefore I guess that the target is (1) type is manually texted, (2) yang-config is set to BIND. Please change that, and check if it works.

krihal commented 1 year ago

As you write, setting yang-config to VALIDATE works. Closing.