Juniper / jsnapy

Python version of Junos Snapshot Administrator
Apache License 2.0
115 stars 58 forks source link

fixes #394 #395

Closed p-sherratt closed 2 years ago

p-sherratt commented 2 years ago

What does this PR do?

Fixes issue #394

Previous Behavior

None value is passed to _get_nodevalue in the case where a node cannot be found

New Behavior

etree.Element("NoNode") is passed to _get_nodevalue

Tests written?

No

chidanandpujar commented 2 years ago

Hi,

Verified the fix , here is the output after your fix .

~/jsnapy_issue_392/jsnapy/samples# jsnapy --check pre post -f config.yaml **** Device: 10.220.12.56 **** Tests Included: chassis_environment Command: show chassis environment Test FAILED: ./status before was < OK > now it is < None > Test FAILED: ./status before was < None > now it is < OK > Test FAILED: ./status before was < OK > now it is < None > Test FAILED: ./status before was < OK > now it is < None > Test FAILED: ./status before was < OK > now it is < None > Test FAILED: ./status before was < None > now it is < OK > Test FAILED: ./status before was < None > now it is < OK > Test FAILED: ./status before was < OK > now it is < None > Test FAILED: ./status before was < OK > now it is < None > Test FAILED: ./status before was < None > now it is < OK > Test FAILED: ./status before was < None > now it is < OK > Test FAILED: ./status before was < None > now it is < OK > FAIL | All "./status" is not same in pre and post snapshot [ 130 value matched / 12 value failed ] ------------------------------- Final Result!! ------------------------------- chassis_environment : Failed Total No of tests passed: 0 Total No of tests failed: 1 Overall Tests failed!!!

ddivins commented 2 years ago

I believe from 1.3.7 this needs to be applied to lines: 2899 from None, to etree.Element("NoNode") 2917 from None, to etree.Element("NoNode")

ydnath commented 2 years ago

Addressed in https://github.com/Juniper/jsnapy/pull/399