Bug 1281728 - atomic-openshift-installer should give friendly prompt when some facts missing in installer.cfg.yml
atomic-openshift-installer should give friendly prompt when some facts missin...
Status: CLOSED ERRATA
Product: OpenShift Container Platform
Classification: Red Hat
Component: Installer (Show other bugs)
3.1.0
Unspecified Unspecified
medium Severity low
: ---
: ---
Assigned To: Samuel Munilla
Ma xiaoqiang
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-11-13 05:14 EST by Gaoyun Pei
Modified: 2016-07-03 20:47 EDT (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-05-12 12:37:11 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Gaoyun Pei 2015-11-13 05:14:49 EST
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 08:46:47 EST
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-06 22:06:33 EST
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 12:37:11 EDT
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.