Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deviation statement not yet support #211

Closed
nowaits opened this issue Apr 23, 2021 · 5 comments
Closed

deviation statement not yet support #211

nowaits opened this issue Apr 23, 2021 · 5 comments
Labels

Comments

@nowaits
Copy link
Contributor

nowaits commented Apr 23, 2021

hi olof,
deviation is a very important feature but yet not support. Is there any plan for it?

olofhagsand added a commit that referenced this issue May 3, 2021
- Added "depth" parameter to yang_apply
- Added extra API function to yang_cardinality to check individual relation
@olofhagsand
Copy link
Member

not-supported and add is now supported.

@olofhagsand
Copy link
Member

Deviation now completed

@nowaits
Copy link
Contributor Author

nowaits commented May 5, 2021

I tried deviation and find no effect with openconfig-system.yang, is there some error with it ?

   import openconfig-system { prefix oc-sys; }
  deviation /oc-sys:system/oc-sys:config/oc-sys:hostname {
    deviate not-supported;
  }

Following is the log:

May  5 20:40:45: filename2revision /home/dev/code/net-base/dist/script/../share/openconfig/models/system/openconfig-aaa.yang
May  5 20:40:45: yang_parse_filename /home/dev/code/net-base/dist/script/../share/openconfig/models/system/openconfig-aaa-types.yang
May  5 20:40:45: filename2revision /home/dev/code/net-base/dist/script/../share/openconfig/models/system/openconfig-aaa-types.yang
May  5 20:40:45: yang_parse_filename /home/dev/code/net-base/dist/script/../share/openconfig/models/system/openconfig-aaa-tacacs.yang
May  5 20:40:45: filename2revision /home/dev/code/net-base/dist/script/../share/openconfig/models/system/openconfig-aaa-tacacs.yang
May  5 20:40:45: yang_parse_filename /home/dev/code/net-base/dist/script/../share/openconfig/models/system/openconfig-aaa-radius.yang
May  5 20:40:45: filename2revision /home/dev/code/net-base/dist/script/../share/openconfig/models/system/openconfig-aaa-radius.yang
May  5 20:40:45: yang_parse_filename /home/dev/code/net-base/dist/script/../share/openconfig/models/system/openconfig-system-logging.yang
May  5 20:40:45: filename2revision /home/dev/code/net-base/dist/script/../share/openconfig/models/system/openconfig-system-logging.yang
May  5 20:40:45: yang_parse_filename /home/dev/code/net-base/dist/script/../share/openconfig/models/system/openconfig-system-management.yang
May  5 20:40:45: filename2revision /home/dev/code/net-base/dist/script/../share/openconfig/models/system/openconfig-system-management.yang
May  5 20:40:45: yang_parse_filename /home/dev/code/net-base/dist/script/../share/openconfig/models/system/openconfig-system-terminal.yang
May  5 20:40:45: filename2revision /home/dev/code/net-base/dist/script/../share/openconfig/models/system/openconfig-system-terminal.yang
May  5 20:40:45: yang_parse_filename /home/dev/code/net-base/dist/script/../share/openconfig/models/system/openconfig-procmon.yang
May  5 20:40:45: filename2revision /home/dev/code/net-base/dist/script/../share/openconfig/models/system/openconfig-procmon.yang
May  5 20:40:45: yang_parse_filename /home/dev/code/net-base/dist/script/../share/openconfig/models/system/openconfig-alarms.yang
May  5 20:40:45: filename2revision /home/dev/code/net-base/dist/script/../share/openconfig/models/system/openconfig-alarms.yang
May  5 20:40:45: yang_parse_filename /home/dev/code/net-base/dist/script/../share/openconfig/models/system/openconfig-alarm-types.yang
May  5 20:40:45: filename2revision /home/dev/code/net-base/dist/script/../share/openconfig/models/system/openconfig-alarm-types.yang
May  5 20:40:45: yang_parse_filename /home/dev/code/net-base/dist/script/../share/openconfig/models/platform/openconfig-platform.yang
May  5 20:40:45: filename2revision /home/dev/code/net-base/dist/script/../share/openconfig/models/platform/openconfig-platform.yang
May  5 20:40:45: yang_parse_filename /home/dev/code/net-base/dist/script/../share/openconfig/models/platform/openconfig-platform-types.yang
May  5 20:40:45: filename2revision /home/dev/code/net-base/dist/script/../share/openconfig/models/platform/openconfig-platform-types.yang
May  5 20:40:45: yang_parse_filename /home/dev/code/net-base/dist/script/../share/openconfig/models/system/openconfig-messages.yang
May  5 20:40:45: filename2revision /home/dev/code/net-base/dist/script/../share/openconfig/models/system/openconfig-messages.yang
May  5 20:40:45: yang_parse_filename /home/dev/code/net-base/dist/script/../share/openconfig/models/system/openconfig-license.yang
May  5 20:40:45: filename2revision /home/dev/code/net-base/dist/script/../share/openconfig/models/system/openconfig-license.yang
May  5 20:40:45: schema_nodeid_iterate: system not found

The test case is copied from : https://github.com/YangModels/yang/blob/master/vendor/cisco/nx/10.1-1/cisco-nx-openconfig-system-deviations.yang

@nowaits
Copy link
Contributor Author

nowaits commented May 6, 2021

The follow config also get syntax error:

module example-deviations{
   yang-version 1.1;
   prefix md;
   namespace "urn:example:deviations";
   import example-base {
         prefix base;
   }
   deviation /base:system/base:daytime {
      deviate "not-supported";
   }
}
May  6 10:30:32: filename2revision example-deviations.yang
May  6 10:30:32: yang_parse_filename /home/dev/code/net-base/dist/script/../share/mgmt/modules/example-deviations.yang
May  6 10:30:32: clixon_yang_parseerror: 360: Yang error: /home/dev/code/net-base/dist/script/../share/mgmt/modules/example-deviations.yang on line 9: syntax error at or before: '"'
May  6 10:30:32: Yang error: /home/dev/code/net-base/dist/script/../share/mgmt/modules/example-deviations.yang on line 9
May  6 10:30:32: clixon_backend: 15276 Terminated retval:-1
May  6 10:30:32: backend_terminate
May  6 10:30:32: backend_terminate done

@olofhagsand
Copy link
Member

@nowaits yes, the deviations were checked before uses/groups were expanded, and most openconfig constructs use that.
Please verify fixes.

@nowaits nowaits closed this as completed May 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants