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.
DescriptionMiroslav Hradílek
2020-06-03 14:36:35 UTC
I just confirmed that
sos-3.9.1-2.el8.noarch (unreleased)
is also affected.
+++ This bug was initially created as a clone of Bug #1843520 +++
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,
It's accounting for the different behaviour of "fp.read().splitlines()" vs. "fp.readlines()": the former strips the trailing newline from the line whereas the latter does not:
$ echo -e "foo\nbar\nbaz\n" > /tmp/dat
$ python
[...]
>>> fp = open("/tmp/dat", "r")
>>> fp.readlines()
['foo\n', 'bar\n', 'baz\n', '\n']
>>> fp = open("/tmp/dat", "r")
>>> fp.read().splitlines()
['foo', 'bar', 'baz', '']
>>>
So as we are now using splitlines() instead of readlines() the -1 index should be dropped as Miroslav suggests.
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/RHEA-2020:4534