Bug 1047378 - Request for XML output ignored when stdin is not a tty
Summary: Request for XML output ignored when stdin is not a tty
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: GlusterFS
Classification: Community
Component: cli
Version: 3.4.1
Hardware: All
OS: All
unspecified
medium
Target Milestone: ---
Assignee: Kaushal
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks: 1313968
TreeView+ depends on / blocked
 
Reported: 2013-12-30 19:24 UTC by Mikhail T.
Modified: 2016-03-08 12:18 UTC (History)
2 users (show)

Fixed In Version: glusterfs-3.6.0beta1
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 1313968 (view as bug list)
Environment:
Last Closed: 2014-11-11 08:26:16 UTC
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Embargoed:


Attachments (Terms of Use)

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


Note You need to log in before you can comment on or make changes to this bug.