Hello,
I have a tailf:action
with input
block that takes 3 leaf nodes: vpn-id, source-ip and interface. I have a constraint that vpn-id must be configured if the interface is configured. Both vpn-id and interface are of type leafref, pointing to a valid config tree.
input {
leaf vpn-id {
type leafref {
path "<valid-path-here>";
tailf:cli-expose-key-name;
}
}
leaf interface {
must "(../vpn-id)" {
error-message "vpn-id must be configured";
}
type leafref {
path "<valid path here>";
}
}
leaf source-ip { };
}
-
When I configure only interface and give a ‘?’, it shows
cr
even though vpn-id is not configured. The command shouldn’t showcr
unless vpn-id is configured when the interface is also configured. How can I fix it? -
If I hit enter after configuring only the interface, instead of throwing the error-message under
must
, it throws theError: illegal reference
which I believe is coming from the leafref ofinterface
. How can I print the error-message undermust
instead of the illegal reference error?
Please suggest.