Can tailf:confirm-text be made conditional?

In YANG, we can add a tailf:confirm-text to an action to make the CLI automatically prompt the user to confirm ‘yes’ or ‘no’ before performing that action.

Question:
Can the confirm-text be made conditional upon whether the action has a certain argument supplied to it? That is, if the action command has an argument ‘force’, the command should proceed without prompting the user. If there is no argument, then the user should be prompted.

Perhaps you want to replace the action in the CLI with a user defined wizard? See ConfD 6.4 UG Chapter 16.22. User defined wizards.

Thanks. That seems like an extensive rework of our code, which could hopefully be avoided. There should be a simpler solution.

One of our problems is that we have some MAAPI code which calls this action.

The maapi_request_action_str_th() API call fails when it is called on an action that has a tailf:confirm-text attached to it. It used to work when we didn’t have the tailf:confirm-text.

A few lines added to a clispec and a few lines of script or some other code doesn’t seem to be “extensive”.
MAAPI doesn’t wait for your tailf:confirm-text. Check that you are not calling maapi_request_action() from the same thread that handle the action (entering a deadlock).

@PeterP corrected me here:

1 Like