[jboss-jira] [JBoss JIRA] (WFLY-3662) CLI: non-batchable commands appearing in control flow statements executed regardless of condition

Alexey Loubyansky (JIRA) issues at jboss.org
Tue Aug 12 10:12:29 EDT 2014


     [ https://issues.jboss.org/browse/WFLY-3662?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alexey Loubyansky updated WFLY-3662:
------------------------------------

             Summary: CLI: non-batchable commands appearing in control flow statements executed regardless of condition  (was: CLI control flow statements not working for commands)
       Fix Version/s: 9.0.0.Beta1
    Git Pull Request: https://github.com/wildfly/wildfly-core/pull/92


I am changing the title to make it more precise (from my point of view). Feel free to object and suggest a better one.
I have fixed the issue in the linked PR.
Thanks for the report!

> CLI: non-batchable commands appearing in control flow statements executed regardless of condition
> -------------------------------------------------------------------------------------------------
>
>                 Key: WFLY-3662
>                 URL: https://issues.jboss.org/browse/WFLY-3662
>             Project: WildFly
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>          Components: CLI
>    Affects Versions: 8.1.0.Final
>            Reporter: Stanley Hillner
>            Assignee: Alexey Loubyansky
>            Priority: Critical
>              Labels: cli, command, command-line, script
>             Fix For: 9.0.0.Beta1
>
>
> The CLI control flows, such as if-then-else, are not working for CLI commands, such as echo or module. Using commands in control flows results in the strange behavior that these commands are executed in each case without respecting to what the if-statement evaluated.
> I am trying to customize a fresh wildfly server with some modules and settings for our development process. I decided to add modules using a CLI script that gets executed by maven, but when the script declares the following the module command in the 'then' block is executed in each case:
> {noformat}
> if (outcome == failed) of /core-service=module-loading:list-resource-loader-paths(module=oracle.jdbcaq)
>   module add --name=oracle.jdbcaq ...
> end-if
> ...
> {noformat}
> I've also verified this behavior with another structure that just checks a property and echos something and both echos were executed:
> {noformat}
> /system-property=x:add(value=123)
> if (result == 123) of /system-property=x:read-attribute(name=value)
>   echo "If block"
>   /system-property=x:read-attribute(name=value)
> else
>   echo "Else block"
>   /system-property=x:read-attribute(name=value)
> end-if
> {noformat}
> The next thing is that if you just put echos into the if and else blocks, the CLI processor complains about an empty if-block. Try this one:
> {noformat}
> /system-property=x:add(value=123)
> if (result == 123) of /system-property=x:read-attribute(name=value)
>   echo "If block"
> else
>   echo "Else block"
> end-if
> {noformat}
> This behavior has also been observed by other users (see the forum reference) and for me it is critical to our setup since the only alternative would be copying modules manually to the modules folder. Furthermore, there might be other commands required for us to adapt the standalone configuration that need to be nested in an if-statement.



--
This message was sent by Atlassian JIRA
(v6.2.6#6264)


More information about the jboss-jira mailing list