Bug 580014

Summary: sosreport does not work if hostname is without a dot
Product: [Fedora] Fedora Reporter: Michal Schmidt <mschmidt>
Component: sosAssignee: Adam Stokes <adam.stokes>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 13CC: adam.stokes, astokes
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 580015 (view as bug list) Environment:
Last Closed: 2010-07-20 21:40:38 EDT Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
Bug Depends On:    
Bug Blocks: 580015    
Description Flags
always trim the newline character from hostname none

Description Michal Schmidt 2010-04-07 05:53:29 EDT
Created attachment 404880 [details]
always trim the newline character from hostname

Description of problem:
On my system /bin/hostname returns a name without a domain name:
$ /bin/hostname

This confuses sosreport, because it expects to find a dot (".") in the returned hostname. The 'hostName' function then returns the name including the newline character, which has funny results:

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

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

  Running plugins. Please wait ...

Creating compressed archive...
/bin/tar: leela: Cannot stat: No such file or directory
/bin/tar: Exiting with failure status due to previous errors
/bin/sh: line 1: -2010040711481270633713: command not found
sh: line 1: -2010040711481270633713: command not found

Your sosreport has been generated and saved in:

The md5sum is: 8dc5aea5b03dff8595f096f9e368e888

Please send this file to your support representative.

The resulting file is only 32 bytes long and is thus useless.

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

How reproducible:

Steps to Reproduce:
1. Configure HOSTNAME=somename in /etc/sysconfig/network
2. Run sosreport
Actual results:
sosreport does not generate a useful archive.

Expected results:
sosreport should generate a several MB long report file.

Additional info:
Patch attached.