Bug 1047378

Summary: Request for XML output ignored when stdin is not a tty
Product: [Community] GlusterFS Reporter: Mikhail T. <mi+redhat>
Component: cliAssignee: Kaushal <kaushal>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: medium Docs Contact:
Priority: unspecified    
Version: 3.4.1CC: bugs, gluster-bugs
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: glusterfs-3.6.0beta1 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1313968 (view as bug list) Environment:
Last Closed: 2014-11-11 08:26:16 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: 1313968    

Description Mikhail T. 2013-12-30 19:24:05 UTC
The --xml option now works in interactive mode -- where it is, perhaps, the least useful. When launching gluster-utility from a script, however -- when the stdin is not a tty -- the option is quietly ignored. Note, how the cli_input_init() unconditionally overwrites the mode-field, when it detects a non-tty input:

        if (isatty (STDIN_FILENO)) {
                state->prompt = "gluster> ";

                cli_rl_enable (state);
        } else {
                state->prompt = "";
                state->mode = GLUSTER_MODE_SCRIPT | GLUSTER_MODE_ERR_FATAL;
        }

Steps to Reproduce:
echo "volume list" | gluster --xml

Actual results:
List of volumes one per line.

Expected results:
XML-blob listing volumes.

Comment 1 Anand Avati 2014-01-13 07:24:10 UTC
REVIEW: http://review.gluster.org/6687 (cli: Don't override cli mode when stdin in not a tty) posted (#1) for review on master by Kaushal M (kaushal)

Comment 2 Anand Avati 2014-01-13 09:15:07 UTC
REVIEW: http://review.gluster.org/6687 (cli: Don't override cli mode when stdin in not a tty) posted (#2) for review on master by Kaushal M (kaushal)

Comment 3 Anand Avati 2014-01-15 06:27:18 UTC
COMMIT: http://review.gluster.org/6687 committed in master by Vijay Bellur (vbellur) 
------
commit f139fc7e44da27670e90bd7ba55ff80e7c8b8ecd
Author: Kaushal M <kaushal>
Date:   Mon Jan 13 12:42:31 2014 +0530

    cli: Don't override cli mode when stdin in not a tty
    
    Change-Id: I801c6e6ecd6c5a91e487e8e54ec5f684d450a080
    BUG: 1047378
    Signed-off-by: Kaushal M <kaushal>
    Reviewed-on: http://review.gluster.org/6687
    Tested-by: Gluster Build System <jenkins.com>
    Reviewed-by: Vijay Bellur <vbellur>

Comment 4 Niels de Vos 2014-09-22 12:34:16 UTC
A beta release for GlusterFS 3.6.0 has been released. Please verify if the release solves this bug report for you. In case the glusterfs-3.6.0beta1 release does not have a resolution for this issue, leave a comment in this bug and move the status to ASSIGNED. If this release fixes the problem for you, leave a note and change the status to VERIFIED.

Packages for several distributions should become available in the near future. Keep an eye on the Gluster Users mailinglist [2] and the update (possibly an "updates-testing" repository) infrastructure for your distribution.

[1] http://supercolony.gluster.org/pipermail/gluster-users/2014-September/018836.html
[2] http://supercolony.gluster.org/pipermail/gluster-users/

Comment 5 Niels de Vos 2014-11-11 08:26:16 UTC
This bug is getting closed because a release has been made available that should address the reported issue. In case the problem is still not fixed with glusterfs-3.6.1, please reopen this bug report.

glusterfs-3.6.1 has been announced [1], packages for several distributions should become available in the near future. Keep an eye on the Gluster Users mailinglist [2] and the update infrastructure for your distribution.

[1] http://supercolony.gluster.org/pipermail/gluster-users/2014-November/019410.html
[2] http://supercolony.gluster.org/mailman/listinfo/gluster-users