mbj4668 / rfcstrip

Extracts code components, YANG modules and SMIv2 modules from RFCs and Internet Drafts
Other
10 stars 7 forks source link

extract YANG modules from RFCs/IDs only if marked with <CODE BEGINS> #4

Closed GianmarcoBruno closed 4 years ago

GianmarcoBruno commented 4 years ago

Hi there are cases like this: draft-ietf-teas-yang-te-topo-22.txt that embed YANG modules which are just examples and lack the marker. They are not guaranteed to work. rfcstrip 1.2 still extract them and this messes up subsequent validation. I suggest to extract YANG modules only if marked with . Kind regards Gianmarco

mbj4668 commented 4 years ago

Thanks for this PR. I like the idea, but I think it is better to add an option to control the behavior. Also, the code already handles CODE BEGINS, so your proposed change is a no-op. I implemented the new option in a slightly different way in 3eaef88.

GianmarcoBruno commented 4 years ago

Hi I think I was not clear. Please download the said ID: wget https://tools.ietf.org/id/draft-ietf-teas-yang-te-topo-22.txt

If you run your latest version of rfcstrip (1.2): rfcstrip draft-ietf-teas-yang-te-topo-22.txt You get three YANG modules, one of which is the unwanted example-topology.yang

If you run my PR, you get onyl two YANG modules because the example-topology.yang is skipped because it lacks the CODE BEGINS marker.

cheers Gianmarco

mbj4668 commented 4 years ago

Hi,

Try the latest version (1.2.1), with flag -c.

/martin

GianmarcoBruno commented 4 years ago

Hi Martin that's perfect :-) thanks Gianmarco