Bug 1281728 - atomic-openshift-installer should give friendly prompt when some facts missing in installer.cfg.yml
Summary: atomic-openshift-installer should give friendly prompt when some facts missin...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Installer
Version: 3.1.0
Hardware: Unspecified
OS: Unspecified
medium
low
Target Milestone: ---
: ---
Assignee: Samuel Munilla
QA Contact: Ma xiaoqiang
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-11-13 10:14 UTC by Gaoyun Pei
Modified: 2016-07-04 00:47 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-05-12 16:37:11 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2016:1065 0 normal SHIPPED_LIVE Red Hat OpenShift Enterprise atomic-openshift-utils bug fix update 2016-05-12 20:32:56 UTC

Description Gaoyun Pei 2015-11-13 10:14:49 UTC
Description of problem:
Run 'atomic-openshift-installer install' in unattended way, once no "connect_to", "master" or "node" facts defined in the installer config yaml file, the installer would throw an exception, which is unfriendly. 

Version-Release number of selected component (if applicable):
atomic-openshift-utils-3.0.12-1.git.0.4c09c5b.el7aos.noarch

How reproducible:
Always

Steps to Reproduce:
1.Prepare an installer config yaml file which not contains "connect_to" facts
2.[root@openshift-v3 ~]# atomic-openshift-installer -u -c installer.cfg.yml install
Traceback (most recent call last):
  File "/usr/bin/atomic-openshift-installer", line 9, in <module>
    load_entry_point('ooinstall==3.0.0', 'console_scripts', 'oo-install')()
  File "/usr/lib/python2.7/site-packages/click/core.py", line 664, in __call__
    return self.main(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/click/core.py", line 644, in main
    rv = self.invoke(ctx)
  File "/usr/lib/python2.7/site-packages/click/core.py", line 988, in invoke
    Command.invoke(self, ctx)
  File "/usr/lib/python2.7/site-packages/click/core.py", line 837, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/lib/python2.7/site-packages/click/core.py", line 464, in invoke
    return callback(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/ooinstall/cli_installer.py", line 442, in cli
    oo_cfg = OOConfig(ctx.obj['configuration'])
  File "/usr/lib/python2.7/site-packages/ooinstall/oo_config.py", line 85, in __init__
    self._read_config()
  File "/usr/lib/python2.7/site-packages/ooinstall/oo_config.py", line 104, in _read_config
    self.hosts.append(Host(**host))
  File "/usr/lib/python2.7/site-packages/ooinstall/oo_config.py", line 48, in __init__
    raise OOConfigInvalidHostError("You must specify either and 'ip' " \
ooinstall.oo_config.OOConfigInvalidHostError: You must specify either and 'ip' or 'hostname' to connect to.

3. Prepare an installer config yaml file which not contains "master" or "node" facts
4. [root@openshift-v3 ~]# atomic-openshift-installer -u -c installer.cfg.yml install
Traceback (most recent call last):
  File "/usr/bin/atomic-openshift-installer", line 9, in <module>
    load_entry_point('ooinstall==3.0.0', 'console_scripts', 'oo-install')()
  File "/usr/lib/python2.7/site-packages/click/core.py", line 664, in __call__
    return self.main(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/click/core.py", line 644, in main
    rv = self.invoke(ctx)
  File "/usr/lib/python2.7/site-packages/click/core.py", line 988, in invoke
    Command.invoke(self, ctx)
  File "/usr/lib/python2.7/site-packages/click/core.py", line 837, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/lib/python2.7/site-packages/click/core.py", line 464, in invoke
    return callback(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/ooinstall/cli_installer.py", line 442, in cli
    oo_cfg = OOConfig(ctx.obj['configuration'])
  File "/usr/lib/python2.7/site-packages/ooinstall/oo_config.py", line 85, in __init__
    self._read_config()
  File "/usr/lib/python2.7/site-packages/ooinstall/oo_config.py", line 104, in _read_config
    self.hosts.append(Host(**host))
  File "/usr/lib/python2.7/site-packages/ooinstall/oo_config.py", line 53, in __init__
    "You must specify each host as either a master or a node.")
ooinstall.oo_config.OOConfigInvalidHostError: You must specify each host as either a master or a node.


Actual results:


Expected results:
Should give friendly prompt just as when missing "ip, hostname..."
[root@openshift-v3 ~]# atomic-openshift-installer -u -c installer.cfg.yml install
For unattended installs, facts must be provided for all masters/nodes:
Host "xxx" missing facts: ip, hostname


Additional info:

Comment 1 Samuel Munilla 2016-03-04 13:46:47 UTC
No longer stack tracing on latest master:

~/Development/openshift-ansible (master)$ atomic-openshift-installer --unattended install
You must specify either an ip or hostname as 'connect_to'

Comment 2 Gaoyun Pei 2016-03-07 03:06:33 UTC
Verify this bug on package atomic-openshift-utils-3.0.51-1.git.0.faacbce.el7.noarch

When some facts missing from the install file:
*no master or node specified on a host
[root@host-192-168-1-57 ~]# atomic-openshift-installer -c installer.cfg.yml -u install 
You must specify each host as either a master or a node.

*no ip specified on a host
[root@host-192-168-1-57 ~]# atomic-openshift-installer -c installer.cfg.yml -u install 
For unattended installs, facts must be provided for all masters/nodes:
Host "10.66.79.117" missing facts: ip

*no connect_to specified on a host
[root@host-192-168-1-57 ~]# atomic-openshift-installer -c installer.cfg.yml -u install 
You must specify either an ip or hostname as 'connect_to'

*no hostname and public_hostname specified on a host
[root@host-192-168-1-57 ~]# atomic-openshift-installer -c installer.cfg.yml -u install 
For unattended installs, facts must be provided for all masters/nodes:
Host "10.66.79.152" missing facts: hostname, public_hostname

Thanks!

Comment 4 errata-xmlrpc 2016-05-12 16:37:11 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-2016:1065


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