[Bugs] [Bug 1352880] New: gluster volume info --xml returns 0 for nonexistent volume

bugzilla at redhat.com bugzilla at redhat.com
Tue Jul 5 11:17:01 UTC 2016


https://bugzilla.redhat.com/show_bug.cgi?id=1352880

            Bug ID: 1352880
           Summary: gluster volume info --xml returns 0 for nonexistent
                    volume
           Product: GlusterFS
           Version: 3.8.0
         Component: glusterd
          Keywords: ZStream
          Severity: low
          Assignee: bugs at gluster.org
          Reporter: sbairagy at redhat.com
                CC: amukherj at redhat.com, bugs at gluster.org,
                    jholloway at redhat.com, nlevinki at redhat.com,
                    sasundar at redhat.com, sbairagy at redhat.com,
                    vbellur at redhat.com
        Depends On: 1319886, 1321836



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

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

Description of problem:
gluster volume info <nonexistent_volname> --xml and gluster volume status
<nonexistent_volname> --xml return 0

Version-Release number of selected component (if applicable):
3.7.5-19 and earlier

How reproducible:
Everytime

Steps to Reproduce:
1. Start glusterd
2. Execute gluster volume info <nonexistent_volume> --xml
     # gluster volume info sdksjsdjl --xml; echo $?
3. Execute gluster volume status <nonexistent_volume> --xml
     # gluster volume info sdksjsdjl --xml; echo $?

Actual results:
Both commands output a return code of 0.
Without --xml, they return 1.

Expected results:
Both commands with nonexistent volume and --xml option should return a non-zero
returncode (preferably 1 to match command without --xml)

Additional info:
[root at x ~]# gluster volume info sdksjsdjl --xml; echo $?
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<cliOutput>
  <opRet>0</opRet>
  <opErrno>0</opErrno>
  <opErrstr/>
  <volInfo>
    <volumes>
      <count>0</count>
    </volumes>
  </volInfo>
</cliOutput>
0

[root at x ~]# gluster volume status sdksjsdjl --xml; echo $?
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<cliOutput>
  <opRet>-1</opRet>
  <opErrno>30800</opErrno>
  <opErrstr>Volume sdksjsdjl does not exist</opErrstr>
  <cliOp>volStatus</cliOp>
  <output>Volume sdksjsdjl does not exist</output>
</cliOutput>
0

[root at x ~]# gluster volume info sdksjsdjl; echo $?
Volume sdksjsdjl does not exist
1

[root at x ~]# gluster volume status sdksjsdjl; echo $?
Volume sdksjsdjl does not exist
1


--- Additional comment from Vijay Bellur on 2016-03-29 07:34:13 EDT ---

REVIEW: http://review.gluster.org/13843 (Fix opRet value for volume info --xml
call on non-existent volume) posted (#1) for review on master by Samikshan
Bairagya (samikshan at gmail.com)

--- Additional comment from Vijay Bellur on 2016-06-08 05:48:26 EDT ---

REVIEW: http://review.gluster.org/13843 (Fix opRet value for volume info --xml
call on non-existent volume) posted (#2) for review on master by Samikshan
Bairagya (samikshan at gmail.com)

--- Additional comment from Vijay Bellur on 2016-06-17 10:01:28 EDT ---

REVIEW: http://review.gluster.org/13843 (Fix opRet value for volume info --xml
call on non-existent volume) posted (#3) for review on master by Samikshan
Bairagya (samikshan at gmail.com)

--- Additional comment from Vijay Bellur on 2016-06-21 03:11:11 EDT ---

COMMIT: http://review.gluster.org/13843 committed in master by Atin Mukherjee
(amukherj at redhat.com) 
------
commit a6e551122c603ab0cba798e7e2b30d3a15191b68
Author: Samikshan Bairagya <samikshan at gmail.com>
Date:   Tue Mar 29 16:24:07 2016 +0530

    Fix opRet value for volume info --xml call on non-existent volume

    The opRet field was being assigned to 0 in the XML output when a
    gluster volume info --xml call is made on a non-existent volume.
    This change assigns a value of -1 to opRet for volume info calls
    for non-existent volumes. Other fields like opErrno and opErrstr
    are also assigned relevant values

    Change-Id: I3920c602328f74252c87bb521f5a43d4bdc7d44d
    BUG: 1321836
    Signed-off-by: Samikshan Bairagya <samikshan at gmail.com>
    Reviewed-on: http://review.gluster.org/13843
    Smoke: Gluster Build System <jenkins at build.gluster.org>
    CentOS-regression: Gluster Build System <jenkins at build.gluster.org>
    Reviewed-by: darshan n <dnarayan at redhat.com>
    Reviewed-by: Atin Mukherjee <amukherj at redhat.com>
    NetBSD-regression: NetBSD Build System <jenkins at build.gluster.org>


Referenced Bugs:

https://bugzilla.redhat.com/show_bug.cgi?id=1319886
[Bug 1319886] gluster volume info --xml returns 0 for nonexistent volume
https://bugzilla.redhat.com/show_bug.cgi?id=1321836
[Bug 1321836] gluster volume info --xml returns 0 for nonexistent volume
-- 
You are receiving this mail because:
You are on the CC list for the bug.
You are the assignee for the bug.


More information about the Bugs mailing list