Bug 1313968 - 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.5.9
Hardware: All
OS: All
unspecified
medium
Target Milestone: ---
Assignee: Niels de Vos
QA Contact:
URL:
Whiteboard:
Depends On: 1047378
Blocks: glusterfs-3.5.9
TreeView+ depends on / blocked
 
Reported: 2016-03-02 17:28 UTC by Joe Julian
Modified: 2016-06-17 16:22 UTC (History)
5 users (show)

Fixed In Version: glusterfs-3.5.9
Doc Type: Bug Fix
Doc Text:
Clone Of: 1047378
Environment:
Last Closed: 2016-04-14 18:40:00 UTC
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Embargoed:


Attachments (Terms of Use)

Description Joe Julian 2016-03-02 17:28:57 UTC
Please backport this fix to release-3.5


+++ This bug was initially created as a clone of Bug #1047378 +++

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.

--- Additional comment from Anand Avati on 2014-01-13 02:24:10 EST ---

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)

--- Additional comment from Anand Avati on 2014-01-13 04:15:07 EST ---

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)

--- Additional comment from Anand Avati on 2014-01-15 01:27:18 EST ---

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>

--- Additional comment from Niels de Vos on 2014-09-22 08:34:16 EDT ---

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/

--- Additional comment from Niels de Vos on 2014-11-11 03:26:16 EST ---

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

Comment 1 Niels de Vos 2016-03-08 12:18:19 UTC
Needs a backport of http://review.gluster.org/6687

Comment 2 Vijay Bellur 2016-03-08 12:41:57 UTC
REVIEW: http://review.gluster.org/13648 (cli: Don't override cli mode when stdin in not a tty) posted (#1) for review on release-3.5 by Niels de Vos (ndevos)

Comment 3 Vijay Bellur 2016-03-11 16:59:12 UTC
COMMIT: http://review.gluster.org/13648 committed in release-3.5 by Niels de Vos (ndevos) 
------
commit 2492bbc3bb8a115be0b0a6fe85fd42f906df8395
Author: Niels de Vos <ndevos>
Date:   Tue Mar 8 13:31:28 2016 +0100

    cli: Don't override cli mode when stdin in not a tty
    
    Cherry picked from commit f139fc7e44da27670e90bd7ba55ff80e7c8b8ecd:
    > 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>
    
    Change-Id: I801c6e6ecd6c5a91e487e8e54ec5f684d450a080
    BUG: 1313968
    Signed-off-by: Niels de Vos <ndevos>
    Reviewed-on: http://review.gluster.org/13648
    NetBSD-regression: NetBSD Build System <jenkins.org>
    Smoke: Gluster Build System <jenkins.com>
    CentOS-regression: Gluster Build System <jenkins.com>
    Reviewed-by: Raghavendra Talur <rtalur>

Comment 4 Niels de Vos 2016-04-14 18:40:00 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.5.9, please open a new bug report.

glusterfs-3.5.9 has been announced on the Gluster mailinglists [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://www.gluster.org/pipermail/announce/2016-April/000055.html
[2] http://thread.gmane.org/gmane.comp.file-systems.gluster.user

Comment 5 Niels de Vos 2016-06-17 16:22:42 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.5.9, please open a new bug report.

glusterfs-3.5.9 has been announced on the Gluster mailinglists [1] a while back, and packages for several distributions should be available by now.

[1] http://thread.gmane.org/gmane.comp.file-systems.gluster.maintainers/486


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