Bug 815190

Summary: Make `gluster volume list' script friendly
Product: [Community] GlusterFS Reporter: Sachidananda Urs <sac>
Component: cliAssignee: Amar Tumballi <amarts>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: high Docs Contact:
Priority: low    
Version: pre-releaseCC: gluster-bugs, vraman
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: glusterfs-3.4.0 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-07-24 17:43:34 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 817967    

Description Sachidananda Urs 2012-04-23 05:00:11 UTC
Currently `gluster volume list` prints:


[root@gqac026 ~]# gluster volume list
5 volumes present in cluster
        1. nfs-test-0
        2. nfs-test-3
        3. nfs-test-2
        4. lockt
        5. nfs-test-big

Making it script friendly is more useful. The number of volumes can be got by piping to `wc -l' and we can get the numbering by piping to nl. The above pretty printing is quite redundant when we can use some good old unix tools.

The proposed volume list could be like:

[root@gqac026 ~]# gluster volume list
nfs-test-0
nfs-test-3
nfs-test-2
lockt
nfs-test-big

So that I can script it. For eg:

var=`gluster volume list | grep big`
gluster volume start $var
.
.
.

so on...

Currently, if I need something like above I have to take all the pain of doing a sed/cut etc.

Comment 1 Anand Avati 2012-04-24 01:47:58 UTC
CHANGE: http://review.gluster.com/3207 (cli: fix the output of 'gluster volume list') merged in master by Anand Avati (avati)

Comment 2 Sachidananda Urs 2012-04-30 18:10:24 UTC
Works as expected on qa39