cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
330
Views
0
Helpful
1
Replies

Print all erros when applying a transaction

ajebnoun
Cisco Employee
Cisco Employee

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.

1 Accepted Solution

Accepted Solutions

ygorelik
Cisco Employee
Cisco Employee

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.

View solution in original post

1 Reply 1

ygorelik
Cisco Employee
Cisco Employee

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.