Resume on error while executing multiple CLI commands via file

Solution Unverified - Updated -

Environment

  • Red Hat JBoss Enterprise Application Platform (EAP)
    • 6.x

Issue

When running a bunch of CLI commands via file it is desired to continue running all the cli commands even if some of the commands fails to execute.

commands.cli consists of below cli command

/subsystem=logging/logger=com.sample:remove()
/subsystem=logging/logger=com.sample.abc:remove()
/subsystem=logging/logger=com.sample.abc.xyz:remove()

If second cli command fails, but I wish to resume with next command?

Resolution

  • If execution of any CLI command fails it will be terminated and won't execute other CLI commands specified in the file. However there us a feature request raised [PRODMGT-1021] requesting resume on error feature in cli.

  • Currently users can break the CLI commands in multiple commands as following:

$JBOSS_HOME/bin/jboss-cli.sh --connect --controller=$JBOSS_IP:$Port --user=$USER --password=$PASSWORD --command="/subsystem=logging/logger=com.sample.abc.xyz:remove()"
$JBOSS_HOME/bin/jboss-cli.sh --connect --controller=$JBOSS_IP:$Port --user=$USER --password=$PASSWORD --command="/subsystem=logging/logger=com.sample.abc.:remove()"
$JBOSS_HOME/bin/jboss-cli.sh --connect --controller=$JBOSS_IP:$Port --user=$USER --password=$PASSWORD --command="/subsystem=logging/logger=com.sample:remove()"

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments