Bug 580014 - sosreport does not work if hostname is without a dot
Summary: sosreport does not work if hostname is without a dot
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: sos
Version: 13
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Adam Stokes
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 580015
TreeView+ depends on / blocked
 
Reported: 2010-04-07 09:53 UTC by Michal Schmidt
Modified: 2010-07-21 01:40 UTC (History)
2 users (show)

Fixed In Version:
Clone Of:
: 580015 (view as bug list)
Environment:
Last Closed: 2010-07-21 01:40:38 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
always trim the newline character from hostname (602 bytes, patch)
2010-04-07 09:53 UTC, Michal Schmidt
no flags Details | Diff

Description Michal Schmidt 2010-04-07 09:53:29 UTC
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
leela

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:
  /tmp/sosreport-MSchmidt.123-20100407114902-e888.tar.xz

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):
sos-1.9-1.fc12.noarch

How reproducible:
always

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.


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