Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1843520

Summary: sosreport gluster volume specific commands not collected
Product: Red Hat Enterprise Linux 7 Reporter: Miroslav Hradílek <mhradile>
Component: sosAssignee: Jan Jansky <jjansky>
Status: CLOSED ERRATA QA Contact: Miroslav Hradílek <mhradile>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.9CC: agk, bmr, coughlan, fkrska, jjansky, jreznik, khoes, plambri, pmoravec, sbradley, wchadwic
Target Milestone: rcKeywords: ZStream
Target Release: 7.9   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: sos-3.9-3.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1843562 (view as bug list) Environment:
Last Closed: 2020-09-29 21:17:57 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:
Bug Depends On:    
Bug Blocks: 1843562    

Description Miroslav Hradílek 2020-06-03 13:18:13 UTC
Description of problem:
Gluster plugin is supposed to collect additional commands per each volume name found by listing "gluster volume info".

Turns out that after rebase to sos 3.9 gluster plugin was edited and is iterating over string characters rather than lines.
Apart from it not working properly, it is also regression of Bug 1036752.


Version-Release number of selected component (if applicable):
sos-3.9-2.el7.noarch (unreleased)

How reproducible:
100%

Steps to Reproduce:
1. cat foo.sh 
#!/bin/bash
echo "Volume Name: abcd"
2. cp foo.sh /usr/sbin/gluster
3. chmod +x /usr/sbin/gluster
4. sosreport -o gluster --batch
5. tar -tf /var/tmp/sosreport-host-date.tar.xz | grep gluster

Actual results:
sosreport-host-date/sos_commands/gluster/
sosreport-host-date/sos_commands/gluster/gluster_volume_info
sosreport-host-date/sos_commands/gluster/gluster_peer_status
sosreport-host-date/sos_commands/gluster/gluster_pool_list
sosreport-host-date/sos_commands/gluster/gluster_volume_status

Expected results:
sosreport-host-date/sos_commands/gluster/
sosreport-host-date/sos_commands/gluster/gluster_volume_info
sosreport-host-date/sos_commands/gluster/gluster_peer_status
sosreport-host-date/sos_commands/gluster/gluster_pool_list
sosreport-host-date/sos_commands/gluster/gluster_volume_status
sosreport-host-date/sos_commands/gluster/gluster_volume_get_abcd_all
sosreport-host-date/sos_commands/gluster/gluster_volume_geo-replication_abcd_status
sosreport-host-date/sos_commands/gluster/gluster_volume_heal_abcd_info
sosreport-host-date/sos_commands/gluster/gluster_volume_heal_abcd_info_split-brain
sosreport-host-date/sos_commands/gluster/gluster_volume_status_abcd_clients
sosreport-host-date/sos_commands/gluster/gluster_snapshot_list_abcd
sosreport-host-date/sos_commands/gluster/gluster_volume_quota_abcd_list
sosreport-host-date/sos_commands/gluster/gluster_volume_rebalance_abcd_status
sosreport-host-date/sos_commands/gluster/gluster_snapshot_info_abcd
sosreport-host-date/sos_commands/gluster/gluster_snapshot_status_abcd

Additional info:
I believe following changes should fix this but please review.

--- gluster.py	2020-06-03 11:47:35.488111051 +0200
+++ /usr/lib/python2.7/site-packages/sos/plugins/gluster.py	2020-06-03 11:49:54.343111051 +0200
@@ -103,10 +103,10 @@
 
         volume_cmd = self.collect_cmd_output("gluster volume info")
         if volume_cmd['status'] == 0:
-            for line in volume_cmd['output']:
+            for line in volume_cmd['output'].splitlines():
                 if not line.startswith("Volume Name:"):
                     continue
-                volname = line[12:-1]
+                volname = line[12:]
                 self.add_cmd_output([
                     "gluster volume get %s all" % volname,
                     "gluster volume geo-replication %s status" % volname,

Comment 16 errata-xmlrpc 2020-09-29 21:17:57 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (sos bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2020:4068