Bug 903187 - Better error handling for missing parameters in answer file
Summary: Better error handling for missing parameters in answer file
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: openstack-packstack
Version: unspecified
Hardware: Unspecified
OS: Unspecified
high
low
Target Milestone: snapshot3
: 2.1
Assignee: Martin Magr
QA Contact: Nir Magnezi
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-01-23 12:34 UTC by Flavio Percoco
Modified: 2022-07-09 06:04 UTC (History)
3 users (show)

Fixed In Version: openstack-packstack-2012.2.2-0.9.dev406
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-03-05 21:02:52 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
OpenStack gerrit 20816 0 None None None Never
Red Hat Issue Tracker OSP-16334 0 None None None 2022-07-09 06:04:29 UTC
Red Hat Product Errata RHSA-2013:0595 0 normal SHIPPED_LIVE Moderate: openstack-packstack security and bug fix update 2013-03-06 02:00:00 UTC

Description Flavio Percoco 2013-01-23 12:34:32 UTC
Description of problem:

Packstack crashes when there are missing parameters in the answer file. A better error handling with a useful message would be better.


Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1. packstack --answer-file=empty_answer_file.txt
2.
3.
  
Actual results:

ERROR:root:Traceback (most recent call last):
  File "/home/flaper87/workspace/rhos/packstack/packstack/installer/run_setup.py", line 387, in _handleAnswerFileParams
    _loadParamFromFile(fconf, "general", param.getKey("CONF_NAME"))
  File "/home/flaper87/workspace/rhos/packstack/packstack/installer/run_setup.py", line 349, in _loadParamFromFile
    value = config.get(section, paramName)
  File "/usr/lib/python2.7/ConfigParser.py", line 618, in get
    raise NoOptionError(option, section)
NoOptionError: No option 'config_keystone_db_pw' in section: 'general'


Expected results:

A message saying there're missing parameters in the answer file.

Additional info:

Comment 2 Derek Higgins 2013-01-30 22:04:01 UTC
If this change merges 
https://review.openstack.org/#/c/20816/

the message will look like this
Additional information:
 * ERROR : Failed handling answer file: No option 'config_repo' in section: 'general'
 * Please check log file /var/tmp/packstack/20130130-1700/openstack-setup.log for more information


the config option is lower_case (options in the answer file are not case sensitive), this is how the exception comes from ConfigParser

Comment 4 Nir Magnezi 2013-02-25 14:48:58 UTC
Verified NVR: openstack-packstack-2012.2.2-1.0.dev408.el6ost.noarch

# packstack --answer-file=empty_ans.txt -d
Welcome to Installer setup utility

Additional information:
 * ERROR : Failed handling answer file: No section: 'general'
 * Please check log file /var/tmp/packstack/20130225-164658-fdOSZN/openstack-setup.log for more information
[root@puma06 ~]# vim /var/tmp/packstack/20130225-164658-fdOSZN/openstack-setup.log

Comment 6 errata-xmlrpc 2013-03-05 21:02:52 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.

http://rhn.redhat.com/errata/RHSA-2013-0595.html


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