- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2023 11:34 AM
Hi Team,
I'm writing a python action that create some data models and I want to log all the errors that will occurs when applying the transaction.
For example I have in my YANG data model two mandatory leafs:
leaf Leaf-X {
type string;
mandatory true;
}
leaf Leaf-Y {
type string;
mandatory true;
}
and for any reason the code won't set these two leafs, so when I will apply the transaction I will get this error (Only the error that will occur first will be displayed):
Error: notset (12): /ncs:services/serviceX:serviceX/services{Test}/Leaf-X is not configured
and I want it to display like this:
Error: notset : /ncs:services/serviceX:serviceX/services{Test}/Leaf-X is not configured
Error: notset : /ncs:services/serviceX:serviceX/services{Test}/Leaf-Y is not configured
Is there any way to achieve this ?
Thanks in advance.
Solved! Go to Solution.
- Labels:
-
Developer
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-28-2023 11:04 AM
Let's recognize that NSO worked as designed. It develops a message on first found error. It is not expected to continue validating input in error conditions.
The simple workaround solution would be programmatically check the leaf values before applying the transaction and, if needed, develop error statements.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-28-2023 11:04 AM
Let's recognize that NSO worked as designed. It develops a message on first found error. It is not expected to continue validating input in error conditions.
The simple workaround solution would be programmatically check the leaf values before applying the transaction and, if needed, develop error statements.
