Bug 1218732 - gluster snapshot status --xml gives back unexpected non xml output
Summary: gluster snapshot status --xml gives back unexpected non xml output
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: GlusterFS
Classification: Community
Component: snapshot
Version: 3.6.2
Hardware: x86_64
OS: Linux
unspecified
high
Target Milestone: ---
Assignee: Avra Sengupta
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks: 1245895 1245897 glusterfs-3.6.5 1253607
TreeView+ depends on / blocked
 
Reported: 2015-05-05 17:13 UTC by Phil Kauffman
Modified: 2015-08-27 13:06 UTC (History)
4 users (show)

Fixed In Version: glusterfs-3.6.5
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 1245895 (view as bug list)
Environment:
Last Closed: 2015-08-27 13:06:40 UTC
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:


Attachments (Terms of Use)

Description Phil Kauffman 2015-05-05 17:13:12 UTC
Description of problem:
Command 'gluster snapshot status --xml' outputs text that is not part of the xml. This inconsistency breaks my code which only has a reason to expect xml data as input.

Version-Release number of selected component (if applicable):
Seen in 3.6.2.

How reproducible:
Always.

Steps to Reproduce: 
1. Create at least a 2 node cluster.
2. Create 1 volume.
3. Make sure you don't have any snapshots.

Actual results:
root@gfs-test-1:~# gluster snapshot status --xml
No snapshots present
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<cliOutput>
  <opRet>0</opRet>
  <opErrno>0</opErrno>
  <opErrstr>(null)</opErrstr>
  <snapStatus>
    <snapshots/>
  </snapStatus>
</cliOutput> 

Expected results:
root@gfs-test-1:~# gluster snapshot status --xml
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<cliOutput>
  <opRet>0</opRet>
  <opErrno>0</opErrno>
  <opErrstr>(null)</opErrstr>
  <snapStatus>
    <snapshots/>
  </snapStatus>
</cliOutput> 


Additional info:
Is this 'null' in the output on purpose? 
  <opErrstr>(null)</opErrstr> 
Other commands like 'gluster snapshot info --xml' show '<opErrstr/>'.


I am marking this as high priority since I parse this output and expect the output to be consistent.

Comment 1 Avra Sengupta 2015-08-05 09:20:31 UTC
IMHO "<opErrstr>(null)</opErrstr>" makes more sense than just <opErrstr/>. Making it uniform for all gluster commands to show "<opErrstr>(null)</opErrstr>" will be a much better approach.

Comment 2 Avra Sengupta 2015-08-05 11:05:57 UTC
As per discussion in gluster-devel, sticking to <opErrstr/>, for all commands.

Comment 3 Anand Avati 2015-08-14 09:04:59 UTC
REVIEW: http://review.gluster.org/11921 (xml output: Fix non-uniform opErrstr xml output) posted (#1) for review on release-3.6 by Avra Sengupta (asengupt@redhat.com)

Comment 4 Anand Avati 2015-08-17 03:38:17 UTC
REVIEW: http://review.gluster.org/11921 (xml output: Fix non-uniform opErrstr xml output) posted (#2) for review on release-3.6 by Avra Sengupta (asengupt@redhat.com)

Comment 5 Anand Avati 2015-08-18 10:34:27 UTC
COMMIT: http://review.gluster.org/11921 committed in release-3.6 by Raghavendra Bhat (raghavendra@redhat.com) 
------
commit a17257727ce00b25ea88800c0dd54deec4d999ba
Author: Avra Sengupta <asengupt@redhat.com>
Date:   Wed Aug 5 16:36:06 2015 +0530

    xml output: Fix non-uniform opErrstr xml output
    
        Backport of http://review.gluster.org/#/c/11835/
    
    Display <opErrstr/> in case of no operrstr for
    all xml output of gluster commands
    
    Change-Id: Ie16f749f90b4642357c562012408c434cd38661f
    BUG: 1218732
    Signed-off-by: Avra Sengupta <asengupt@redhat.com>
    Reviewed-on: http://review.gluster.org/11921
    Tested-by: Gluster Build System <jenkins@build.gluster.com>
    Reviewed-by: Raghavendra Bhat <raghavendra@redhat.com>
    Reviewed-by: mohammed rafi  kc <rkavunga@redhat.com>

Comment 6 Raghavendra Bhat 2015-08-27 13:06:40 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.5, please open a new bug report.

glusterfs-3.6.5 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/gluster-devel/2015-August/046570.html
[2] http://thread.gmane.org/gmane.comp.file-systems.gluster.user


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