Bug 1106405 - beah-beaker-backend fails to set default HOSTNAME configuration variable
Summary: beah-beaker-backend fails to set default HOSTNAME configuration variable
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Beaker
Classification: Retired
Component: beah
Version: 0.16
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: 0.17.1
Assignee: Dan Callaghan
QA Contact: tools-bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-06-09 09:32 UTC by Jun'ichi NOMURA
Modified: 2018-02-06 00:41 UTC (History)
8 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2014-06-17 00:14:00 UTC
Embargoed:


Attachments (Terms of Use)

Description Jun'ichi NOMURA 2014-06-09 09:32:07 UTC
Description of the problem:
beah-beaker-backend fails to set HOSTNAME configuration variable by default and emits a warning message.

Version-Release number of selected component (if applicable):
systemd-208-11.el7.x86_64
beah-0.7.3-1.el7eng.noarch

How reproducible:
Always

Steps to Reproduce:
1. Run a recipe in beaker
2. Check the output of "systemctl status beah-beaker-backend"

Actual behavior:
# systemctl status -l beah-beaker-backend | grep -i warning || echo OK
Jun 09 01:06:38 myhost beah-beaker-backend[1839]: --- WARNING: Value for DEFAULT.HOSTNAME (None) is not an string.

Expected behavior:
# systemctl status -l beah-beaker-backend | grep -i warning || echo OK
OK

Additional Information:

beakerlc.py tries to obtain hostname via "HOSTNAME" env:
  def defaults():
    ...
    d.update({
            ...
            'HOSTNAME':os.getenv('HOSTNAME'),

However, os.getenv('HOSTNAME') returns empty.

Using the output of '/bin/hostname' instead solves the problem.
Or there might be better systemd-way to get the equivalent information.

Comment 2 Nick Coghlan 2014-06-10 03:57:37 UTC
We've had to do some intricate dances in kickstart files to get the correct hostname information during %post, but I wasn't previously aware of troubles with HOSTNAME not being set when beah starts up. We'll investigate further.

Comment 3 Dan Callaghan 2014-06-10 04:06:18 UTC
HOSTNAME (the environment variable) is a bash-ism, it was always previously available because SysV init does everything through bash. However with systemd bash is removed from the equation entirely.

It should probably be using socket.gethostname() as the default, although it actually doesn't matter since HOSTNAME (the beah config option) is not used for anything important anymore.

Comment 4 Dan Callaghan 2014-06-10 06:01:38 UTC
On Gerrit: http://gerrit.beaker-project.org/3132

Comment 7 Amit Saha 2014-06-17 00:14:00 UTC
Beah 0.7.5 has been released on beaker-project.org.


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