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

ietf-netconf-notification@2008-07-01.yang validation problem #62

Closed
dcornejo opened this issue Jan 9, 2019 · 5 comments
Closed

ietf-netconf-notification@2008-07-01.yang validation problem #62

dcornejo opened this issue Jan 9, 2019 · 5 comments

Comments

@dcornejo
Copy link
Contributor

dcornejo commented Jan 9, 2019

the type statements at lines 122 & 129 are missing the yang: prefix which breaks validating.

the latest revision of this file seems to be ietf-netconf-notifications@2012-02-06.yang, but this file bears little resemblance to the version supplied.

i can't find a source for the supplied version, so i don't know if this is an error in the source or in the clixon repo. a fix to the supplied version is trivially to add "yang:" to add the date-and-time types, but since this is in ietf namespace, in theory the latest version should be used.

@olofhagsand
Copy link
Member

Thanks for putting attention on this.
But no, ietf-netconf-notification@2008-07-01.yang in the clixon repo is an effort to recreate RFC5277 create-subscription and the types around that. RFC5277 does not contain a Yang model, just XML schema, so the yang model was manually created from the RFC.
ietf-notifications@2012-02-06.yang on the other hand, (eg https://github.com/YangModels/yang/blob/master/standard/ietf/RFC/ietf-netconf-notifications@2012-02-06.yang) is RFC 6470, so is a completely different yang model. The confusion is that they are names (almost) the same.
I see Cisco has the original RFC5277 at, for example https://github.com/YangModels/yang/blob/master/vendor/cisco/xr/651/notifications.yang.
There is a relatively recent model at draft-ietf-netconf-rfc5277bis-01 which is modeled by Cisco in for example https://github.com/YangModels/yang/blob/master/vendor/cisco/xe/1681/ietf-event-notifications.yang where create-subscription is still defined. There are also new rpc:s for subscribed-notifications.
So there are a number of different options:

  1. keep the original (maybe rename it for avoiding similar confusion)
  2. Use cisco's "notification.yang" (I would want to have a proper source though)
  3. Upgrade to draft-ietf-netconf-rfc5277bis-01. I have no idea how much work that is.
  4. Follow the more recent work,eg at https://github.com/netconf-wg/rfc5277bis for subscribed-notifications. But there I think create-subscription is obsolete.
  5. someting else?

@dcornejo
Copy link
Contributor Author

dcornejo commented Jan 9, 2019

name confusion noted.

the simplest change is to fix two instances of date-and-time types that are missing the yang: prefix and should be yang:date-and-time (see patch below)

yangval-patch.txt

@olofhagsand
Copy link
Member

This opened up some other issues:

  1. clixon hardcoded some yang types such as date-and-time, ipv4-address, etc. thus bypassing the yang date-and-time regexp. This has now been removed.
  2. cligen didnt properly support time-zone designators (eg 'Z' or +01:00). CLIgen now supports it.
  3. cligen uses posix regex while yang uses XSD. It differs in some aspects. A translator function has been added.

olofhagsand added a commit that referenced this issue Jan 11, 2019
…ors.

* Renamed yang file `ietf-netconf-notification@2008-07-01.yang` to `clixon-rfc5277`.
* Cligen uses posix regex while yang uses XSD. It differs in some aspects. A translator function has been added for `\d` -> `[0-9]` translation, there may be more.
* [ietf-netconf-notification@2008-07-01.yang validation problem #62](#62)
@olofhagsand
Copy link
Member

Note that the yang module has been renamed: ietf-netconf-notifications -> clixon-rfc5277.

@dcornejo
Copy link
Contributor Author

thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants