cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
642
Views
5
Helpful
1
Replies

Validation failed, skip value and proceed with the NSO execution

BasharAziz
Level 1
Level 1

lb_ipv6_addr is an optional value, not always filled in, any idea how to skip this value and proceed with the NSO execution?

 

Yang:
leaf lb_ipv6_addr {
type inet:ipv6-address;
tailf:info "IPv6 loopback prefix";
}

 

Python:

vars.add('lb-ipv6-addr', f'{serivcelb_ipv6-addr}')

errors: reason: Python cb_create error. Unknown error (66): A variable value has not been assigned to: lb-ipv6-addr

 

XML:

<prefix>{$lb-ipv6-addr}/128</prefix>
1 Reply 1

erdemk
Level 1
Level 1

From other former threads , here are some options :

 

You may try this :

 

<?if {/lb-ipv6-addr != ''}?>
  <prefix>{/lb-ipv6-addr}/128</prefix>

<?end?>

 

or this:


<prefix tags='merge' when={/lb-ipv6-addr != ''}>{/lb-ipv6-addr}/128</prefix>

 

i didnot try myself this time, but you can play around with these ones. 

 

I think you could do like following, if "/128" was not there, or you manage to get a variable somehow.. i used it like that once..

 

<prefix>{/lb-ipv6-addr}/128</prefix>

 

Let us know which one works for you if at all.

 

regards.