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 822113 - sosreport handles --name and --ticket-number parameters incorrectly
Summary: sosreport handles --name and --ticket-number parameters incorrectly
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: sos
Version: 6.2
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Bryn M. Reeves
QA Contact: David Kutálek
URL:
Whiteboard:
Depends On:
Blocks: 982194 982195 1185093 1232945
TreeView+ depends on / blocked
 
Reported: 2012-05-16 11:18 UTC by David Kutálek
Modified: 2018-11-30 22:02 UTC (History)
6 users (show)

Fixed In Version: sos-2.2-37.el6
Doc Type: Bug Fix
Doc Text:
When using sosreport in interactive mode, the "--name" and "--ticket-number" command-line options did not have any effect. As a consequence, the default option values in interactive sosreport prompts were not updated with the provided options. Now, "--name" and "--ticket-number" work as expected, and when either of them is provided in sosreport's interactive mode, the interactive prompts reflect it accordingly.
Clone Of:
: 982194 982195 1185093 (view as bug list)
Environment:
Last Closed: 2013-02-21 10:57:22 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2013:0474 0 normal SHIPPED_LIVE sos bug fix and enhancement update 2013-02-20 21:06:54 UTC

Description David Kutálek 2012-05-16 11:18:49 UTC
Description of problem:

1) --name and --ticket-number do not have any effect in interactive mode. I propose to make these entered values defaults when asking interactively for them.

2) --ticket-number is not sanitized correctly, eg:

'a0.x12' => '012'
'one' => ''

3) --name being eg '#' translates into empty name, resulting in sosreport names like:

/tmp/sosreport--20120516131727-5aad.tar.xz
/tmp/sosreport-.1-20120516131747-2013.tar.xz

Version-Release number of selected component (if applicable):

sos-2.2-17.el6.noarch

How reproducible:

Always

Steps to Reproduce:
1. see above
2.
3.
  
Actual results:


Expected results:


Additional info:

Comment 1 David Kutálek 2012-05-17 06:20:38 UTC
Additional case to consider:

# sosreport --batch --build -o general --name general
...
sosreport build tree is located at : /tmp/dhcp-25-214-2012051708151337235309

Would be nice to have it eg. in /tmp/sosreport-general-2012051708151337235309

Comment 2 Bryn M. Reeves 2012-05-17 07:48:55 UTC
Setting the defaults for interactive mode is definitely a change we should make. This is how a reasonable user might expect the options to behave and there's no reason not to.

For changing directory or report name structures I think this needs a bit of thought; we need to understand what dependencies people might have on these names and avoid breaking that unnecessarily. I don't personally like the current scheme much but it has been around for some time and we may have to honour it at least for the life of already-released versions.

Comment 3 David Kutálek 2012-05-17 08:15:10 UTC
> For changing directory or report name structures I think this needs a bit of
> thought; we need to understand what dependencies people might have on these
> names and avoid breaking that unnecessarily. I don't personally like the
> current scheme much but it has been around for some time and we may have to
> honour it at least for the life of already-released versions.

Ah, correct. I didn't notice that this is actually same directory (name) as present in the tarball. Hence it is not --build dependent and change could harm users, therefore I agree to let it be as is for now.

Comment 4 Bryn M. Reeves 2012-06-07 14:26:13 UTC
fwiw I think --build is a stupid name. I'd be open to changing this upstream to something more obvious like --keep or --no-package.

Comment 5 Bryn M. Reeves 2012-10-15 18:20:10 UTC
Actually with the current el6 package I do see --name and --ticket-number propagating correctly in both interactive and batch mode (happens in preWork outside the !batch branch):

# sosreport 
[..]
Please enter your first initial and last name [rhel6-vm1]: brubble
Please enter the case number that you are generating this report for: 12345
[...]
Your sosreport has been generated and saved in:
  /tmp/sosreport-brubble.12345-20121015184743-c947.tar.xz

# sosreport --batch --name fflintstone --ticket-number 54321
Your sosreport has been generated and saved in:
  /tmp/sosreport-fflintstone.54321-20121015184821-8273.tar.xz

I'll add a check for an empty name for 6.3 and replace it with the string 'default'; I think for the numbers there's not much sense in changing it now. We've never strongly checked these before and the existing behaviour is to just drop the ticket number from the format strings if it is empty. I'd rather not change that in RHEL6 for now (I doubt anyone relies on it but you never know) - at least we manage to generate something even if the user enters nonsense.

Comment 13 Bryn M. Reeves 2013-01-09 10:45:10 UTC
Now behaves like this:

# sosreport --name batman --ticket 314159

sosreport (version 2.2)

This utility will collect some detailed  information about the
hardware and setup of your Red Hat Enterprise Linux system.
The information is collected and an archive is  packaged under
/tmp, which you can send to a support representative.
Red Hat Enterprise Linux will use this information for diagnostic purposes ONLY
and it will be considered confidential information.

This process may take a while to complete.
No changes will be made to your system.

Press ENTER to continue, or CTRL-C to quit.

Please enter your first initial and last name [batman]: 
Please enter the case number that you are generating this report for [314159]: 

  Running plugins. Please wait ...

[...]

Comment 29 errata-xmlrpc 2013-02-21 10:57:22 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, and where to find the updated
files, follow the link below.

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

http://rhn.redhat.com/errata/RHBA-2013-0474.html


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