Management CLI using try/catch inside if/else

Latest response

Can somebody confirm this for me. I have tried to use a try/catch inside a if/else statement the management cli but it always says the command is not available in the current context. I am assuming this means you cannot embed the try/catch inside a if/else. In the same vein you cannot embed a if/else inside another if/else.

if (outcome == success) of /core-service=management/security-realm=ldap-mngmnt-realm/authentication=ldap:read-resource
    try
        /core-service=management/security-realm=ldap-mngmnt-realm/authentication=ldap:remove
    catch
        /core-service=management/security-realm=ldap-mngmnt-realm/authentication=ldap:remove
    end-try
end-if

Responses

Apologies for the delay in answering this, What version of EAP are you using? Did you get it resolved?

I received a reply from a similar question in a support case that the if statement in the CLI is rather limited and I should use a real scripting language like groovy. So I just figured that is the case here. It's just something that is not supported in the CLI.

Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.