[jboss-as7-dev] Couple of minor changes to jboss-admin.sh script
Alexey Loubyansky
alexey.loubyansky at redhat.com
Fri May 20 04:04:55 EDT 2011
This header echoed before the cli is launched could be removed
altogether, instead there could be a command that would print the
environment and relevant version numbers.
On 05/19/2011 04:34 PM, Alexey Loubyansky wrote:
> It's not looking nice to me. With this change in quiet mode you won't
> see logs from connect command (no matter whether it's executed on start
> up or later) but the output of all the other commands will go through.
> And since there doesn't seem to be an intention to do anything more than
> that, it's a bit strange to me.
>
> I'd propose what I described in my previous email instead. What do you
> think, Scott?
>
> If anybody has any other suggestions, let's hear.
>
> Alexey
>
> On 05/19/2011 04:05 PM, Brian Stansberry wrote:
>> I see there is a pull request related to this. I believe sent before
>> Alexey's comment.
>>
>> Alexey, can you keep an eye out for pull requests related to this and
>> act as the reviewer? Just reply to the list if they look ok and I'll
>> merge them.
>>
>> On 5/19/11 4:30 AM, Alexey Loubyansky wrote:
>>> If we want to introduce --quite then it has be defined better what's
>>> logged in either mode and what's affected by it.
>>>
>>> The header isn't a problem. But "Connected..."/"Closed..." is an output
>>> from a command, much like the one specified in --command.
>>>
>>> Perhaps, if --command is present then the log should contain only the
>>> output produced by the command specified in --command.
>>>
>>> About quoting arguments, what is hard quoting? Currently, it's "$@" in
>>> the script. I found that the following will work
>>>
>>> ./jboss-admin.sh --connect "command='ls deployment'"
>>>
>>> Alexey
>>>
>>> On 05/19/2011 01:38 AM, Scott Stark wrote:
>>>> The feature request is:
>>>> https://issues.jboss.org/browse/AS7-846
>>>>
>>>> On 5/18/11 4:29 PM, Scott Stark wrote:
>>>>> I want to be able to find out what deployments exist in a server in a
>>>>> scripting environment. There are a couple of issues in the
>>>>> jboss-admin.sh that prevent this from being done. The first is the dump
>>>>> of the environment header:
>>>>>
>>>>> =========================================================================
>>>>>
>>>>> JBoss Admin Command-line Interface
>>>>>
>>>>> JBOSS_HOME:
>>>>> /home/git/JBossAS/jboss-as/build/target/jboss-7.0.0.Beta4-SNAPSHOT
>>>>>
>>>>> JAVA:
>>>>> /System/Library/Frameworks/JavaVM.framework/Versions/1.6/Home/bin/java
>>>>>
>>>>> JAVA_OPTS:
>>>>>
>>>>> =========================================================================
>>>>>
>>>>> 1. I would like to add a -q/--quiet option that disables the output of
>>>>> this header. It would also suppress the "Connected..." and "Closed..."
>>>>> msgs as all I want to see is the output of the command that is being
>>>>> executed to simplify the script's parsing of the returned information.
>>>>>
>>>>> 2. The second is the handling of arguments with strings. The way the
>>>>> launch of the org.jboss.as.cli module is done, arguments to the
>>>>> jboss-admin.sh with quotes around spaces are incorrectly interpretted as
>>>>> multiple arguments. For example, trying to list the deployments using:
>>>>>
>>>>> [130](ironmaiden:bin)> ./jboss-admin.sh --connect command='ls deployment'
>>>>> Connected to standalone controller at localhost:9999
>>>>> extension path subsystem
>>>>> deployment management-interfaces management
>>>>> interface socket-binding-group
>>>>> Closed connection to localhost:9999
>>>>>
>>>>> produced just the result of an "ls" command without any arguments. The
>>>>> reason is that the CommandLineMain.main saw 3 arguments instead of 2:
>>>>> {"--connect", "command=ls", "deployment"}. The "$@" list of arguments
>>>>> to the shell script needs to be hard quoted so that the eval command
>>>>> properly expands the arguments. With this, the previous command now
>>>>> produces the expected listing of the deployment node:
>>>>>
>>>>> [131](ironmaiden:bin)> ./jboss-admin.sh --connect command='ls deployment'
>>>>> Connected to standalone controller at localhost:9999
>>>>> ROOT.war
>>>>> Closed connection to localhost:9999
>>>>>
>>>>> In these examples I have not yet suppressed the "Connected..." and
>>>>> "Closed..." msgs coming from the CommandLineMain class.
>>>>>
>>>>> _______________________________________________
>>>>> jboss-as7-dev mailing list
>>>>> jboss-as7-dev at lists.jboss.org
>>>>> https://lists.jboss.org/mailman/listinfo/jboss-as7-dev
>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> jboss-as7-dev mailing list
>>>> jboss-as7-dev at lists.jboss.org
>>>> https://lists.jboss.org/mailman/listinfo/jboss-as7-dev
>>> _______________________________________________
>>> jboss-as7-dev mailing list
>>> jboss-as7-dev at lists.jboss.org
>>> https://lists.jboss.org/mailman/listinfo/jboss-as7-dev
>>
>>
> _______________________________________________
> jboss-as7-dev mailing list
> jboss-as7-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/jboss-as7-dev
More information about the jboss-as7-dev
mailing list