Bug 1098787

Summary: when compiled with --disable-xml-output "gluster" cli tool returns human readable output instead of error
Product: [Community] GlusterFS Reporter: Peter Krempa <pkrempa>
Component: cliAssignee: bugs <bugs>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: mainlineCC: amukherj, bugs, smohan
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-10-05 03:58:55 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:
Attachments:
Description Flags
patch none

Description Peter Krempa 2014-05-18 14:58:50 UTC
Created attachment 896781 [details]
patch

Description of problem:
When XML output is requested (usually due to machine parsing) the cli tool returns human readable output if the XML output isn't compiled in. The human readable output will not be parsed by XML parsers.

Version-Release number of selected component (if applicable):
3.5.0, 3.4.0 and possibly others

How reproducible:
100%

Steps to Reproduce:
1. have the CLI tool compiled with --disable-xml-output
2. try to run cli with XML output

Actual results:
$ ./gluster --xml volume info
XML output not supported. Ignoring '--xml' option
 
Volume Name: gv0
Type: Distribute
Volume ID: 1784c1e7-45ed-448e-815b-84c668971ce0
Status: Started
Number of Bricks: 1
Transport-type: tcp
Bricks:
Brick1: gluster-node-1:/mnt/gluster-brick
Options Reconfigured:
auth.allow: *
nfs.rpc-auth-allow: *
server.allow-insecure: on
$ echo $?
0

Expected results:
$ ./gluster --xml volume info
XML output not supported.
$ echo $?
1

Additional info:
See attached patch for suggested fix.

Comment 2 Atin Mukherjee 2018-10-05 03:58:55 UTC
You shouldn't be seeing this behavior any longer. Please give it a try with the latest releases.