12-10-2019 09:48 AM - edited 12-10-2019 09:58 AM
Hello folks,
I have 2 revisions of same model which i want to compare for backward incompatibility.
augment "/ios:native/ios:interface/ios:TwentyFiveGigE/ios:ip" {
uses config-interface-ip-nbar-grouping;
}
In the first model i have the above, and in the 2nd model i removed the same statement.
How do i validate using pyang as the structure of ios:interface/ios:TwentyFiveGigE/ is defined in a different file and it seems pyang is not really considering the augmented statement when i remove it.
I ran these 2 commands but it never showed me the expected output that TwentyFiveGigE is being removed
pyang --strict --check-update-from ../16.12.1/Cisco-IOS-XE-nbar.yang Cisco-IOS-XE-nbar.yang --check-update-from-path ~/newncs/nso-5.2.1.1/src/ncs/yang/
pyang --strict --check-update-from ../16.12.1/*.yang *.yang --check-update-from-path ~/newncs/nso-5.2.1.1/src/ncs/yang/
There is a way to do using ncsc compiler though when i do a revision merge of fxs files, it gives me the expected output which is good, but i want a way without doing all the revision merge and determine before hand if there is any incompatibility
ncsc: Revision <<"2020-03-01">> deletes item /devices/device/config/native/interface/ATM/encapsulation/dot1Q/second-dot1q
Also, any other tool apart from pyang which could be useful like yanger,confdc etc please let me know. Just want a way to catch these things via script
12-13-2019 06:59 AM
Hello,
which version of pyang are you using? with 2.0.1 I manage to get the error:
cisco@server # pyang --strict --check-update-from ../16121/Cisco-IOS-XE-nbar.yang Cisco-IOS-XE-nbar.yang Cisco-IOS-XE-nbar.yang:1: error: new revision 2019-07-01 is not newer than old revision 2019-07-01 (RFC 6020: 10, p2) Cisco-IOS-XE-nbar.yang:1: error: the augment '/ios:native/ios:interface/ios:TwentyFiveGigE/ios:ip', defined at ../16121/Cisco-IOS-XE-nbar.yang:1066 is illegally removed
[... truncated]
I have just done the following:
pyang --version # output pyang 2.0.1
git clone https://github.com/YangModels/yang cd yang/vendor/cisco/xe/ cp -r 16121 test cd test # edit by removing the same augment as you in the same file pyang --strict --check-update-from ../16121/Cisco-IOS-XE-nbar.yang Cisco-IOS-XE-nbar.yang
Note: the version that comes with NSO is pyang 1.5 which is much older and which should not be used I think - it indeed does not detect the augment on my laptop
cisco@server # pyang --strict --check-update-from ../16121/Cisco-IOS-XE-nbar.yang Cisco-IOS-XE-nbar.yang Cisco-IOS-XE-nbar.yang:1: error: new revision 2019-07-01 is not newer than old revision 2019-07-01 (RFC 6020: 10, p2)
I looked at yanger but could not find similar option.
regards
12-13-2019 09:47 AM
Thank you so muchh for your help! This worked!
I installed pyang using pip3.7 install pyang
PRALALA-M-27BM:17.2.1 pratik$ /usr/local/bin/pyang --strict --check-update-from ../16.12.1/Cisco-IOS-XE-nbar.yang Cisco-IOS-XE-nbar.yang -p /Users/pratik/confd/src/confd/yang/ -P /Users/pratik/confd/src/confd/yang/
/usr/local/bin/pyang --strict --check-update-from ../16.12.1/Cisco-IOS-XE-nbar.yang Cisco-IOS-XE-nbar.yang -p /Users/pratik/newncs/ncs-5.2.1/src/ncs/yang/ -P /Users/pratik/newncs/ncs-5.2.1/src/ncs/yang/ --verbose
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide