Bug 1339560 - traceback if answers file is missing info on rhua host
Summary: traceback if answers file is missing info on rhua host
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Update Infrastructure for Cloud Providers
Classification: Red Hat
Component: Tools
Version: 2.1.3
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ---
: ---
Assignee: Patrick Creech
QA Contact: Irina Gulina
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-05-25 10:32 UTC by Irina Gulina
Modified: 2017-03-01 22:12 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-03-01 22:12:07 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2017:0367 0 normal SHIPPED_LIVE Red Hat Update Infrastructure 3.0 Release 2017-03-02 03:05:22 UTC

Description Irina Gulina 2016-05-25 10:32:45 UTC
Description of problem:
If info on RHUA host is missing in answers file, rhui-installer returns the traceback

Version-Release number of selected component (if applicable):
RHUI-2.1.3.3-RHEL-6-20160523.t.3-Server-x86_64-dvd1.iso

How reproducible:
always, if answers file is not configured

Steps to Reproduce:

1. >> vi /etc/rhui/answers.sample

....
# == RHUA ===========================================================================

# The [rhua] section contains attributes describing a particular RHUA instance.
[rhua]

# Name of the RHUA configuration RPM created by RHUI tools.
rpm_name: rh-rhua-config

# Fully qualified hostname of the RHUA instance.
hostname: rhua.example.com

# SSL certificate and private key to be installed on the RHUA. The CN of this certificate
# must match the hostname listed above.
ssl_cert:
ssl_key:

# CA certificate used to sign the RHUA's SSL certificate. This is needed by the CDS
# instances when connecting back to the RHUA to synchronize content to verify the
# RHUA certificate during the handshake.
ca_cert:

# If a proxy server is needed for the RHUA to connect to the internet, this is the hostname
# of that server. If this is not specified, no proxy server will be used.
# proxy_server_host: proxy.example.com

# Port to access on the proxy server. This value has no effect if proxy_server_host is
# not specified.
# proxy_server_port: 443

# Proxy server username. Omit if the proxy server does not require authentication.
# proxy_server_username: admin

# Proxy server password.
# proxy_server_password: password

>> rhui-installer /etc/rhui/answers.sample

rhui-installer /etc/rhui/answers.sample 
Generating RHUA configuration RPM
Traceback (most recent call last):
  File "/usr/bin/rhui-installer", line 16, in <module>
    rhui.installer.launcher.main()
  File "/usr/lib/python2.6/site-packages/rhui/installer/launcher.py", line 98, in main
    rhua_rpm_path = rhua.build_rpm(rhua_bundle, CONFIG_DIR)
  File "/usr/lib/python2.6/site-packages/rhui/rpm/rhua.py", line 79, in build_rpm
    _do_ssl(builder, answers)
  File "/usr/lib/python2.6/site-packages/rhui/rpm/rhua.py", line 180, in _do_ssl
    shutil.copy(answers['ssl_cert'], os.path.join(rpm_builder.source_gz_dir, 'rhua-ssl-cert.crt'))
  File "/usr/lib64/python2.6/shutil.py", line 84, in copy
    copyfile(src, dst)
  File "/usr/lib64/python2.6/shutil.py", line 50, in copyfile
    with open(src, 'rb') as fsrc:
IOError: [Errno 2] No such file or directory: ''



Expected results:
Message: Please update $file with info on RHUA machine

Comment 4 Irina Gulina 2016-07-22 11:19:03 UTC
In RHUI3 there is no traceback, it shows the error message: 

for both RHEL6 and RHEL7 iso 20160719

>> rhui-installer
Parameter rhua-hostname invalid
Error during configuration, exiting

or 

>> rhui-installer
Parameter cds-lb-hostname invalid
Error during configuration, exiti

I would add: Please check /etc/rhui-installer/answers.yaml file and 'rhua-hostname --help'

Comment 5 Irina Gulina 2016-09-12 09:17:38 UTC
Parameter rhua-hostname invalid
Error during configuration, exiting
Please check the settings in /etc/rhui-installer/answers.yaml

Comment 6 errata-xmlrpc 2017-03-01 22:12:07 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.

https://access.redhat.com/errata/RHBA-2017:0367


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