Created attachment 1409416 [details] tempest.conf created with discover-tempest-config +++ This bug was initially created as a clone (related to) Bug #1554306 +++ Description of problem: Running "discover-tempest-config" had failure in discovering "api_extensions", and as consequence, "tempest verify-config" (from python-tempestconf) raised IndexError. Version-Release number of selected component (if applicable): OSP: 13 Puddle: 2018-03-02.2 How reproducible - Always Steps to Reproduce: 1) Install OSP-13 (master branch). 2) Due to Bug #1554306 - Please also install python-tempestconf: [stack@undercloud-0 ~]$ sudo yum -y install python-tempestconf 3) Run discover-tempest-config: [stack@undercloud-0 ~]$ source overcloudrc (overcloud) [stack@undercloud-0 ~]$ tempest init my_workspace (overcloud) [stack@undercloud-0 ~]$ cd my_workspace (overcloud) [stack@undercloud-0 my_workspace]$ discover-tempest-config --deployer-input 4) Run verify-config: (overcloud) [stack@undercloud-0 my_workspace]$ tempest verify-config -o ./etc/tempest.conf Running config verification... Traceback (most recent call last): File "/home/stack/tempest/tempest/cmd/verify_tempest_config.py", line 486, in take_action main(parsed_args) File "/home/stack/tempest/tempest/cmd/verify_tempest_config.py", line 458, in main results = verify_extensions(os, service, results) File "/home/stack/tempest/tempest/cmd/verify_tempest_config.py", line 286, in verify_extensions if extensions_opt[0] == 'all': IndexError: list index out of range -------- Suggestion - Please fix 2 issues: 1) In "verify_tempest_config.py" (line 286): Method "verify_extensions" does not check if "get_enabled_extensions(service)" has return an empty list. Please handle empty list error - if extensions_opt is empty: Print proper message like "Service {service} has no extensions defined in tempest.conf". 2) In "/usr/lib/python2.7/site-packages/config_tempest/config_tempest.py": There's a failure in discovering "api_extensions" of "volume-feature-enabled" (cinder ?), which creates an empty value in tempest.conf (attached): [volume-feature-enabled] api_extensions =
Using latest verify-config from tempest 18.0.0, I see a fix of: if not getattr(CONF.service_available, codename_match[cfgname]): print('Endpoint type %s is available, service %s should be' ' set as available in the config file.' % ( catalog_type, codename_match[cfgname])) However, if dictionary "codename_match" does not have for example "loadbalancer", it will fail on KeyError, and will not print message: (overcloud) (.venv) [stack@undercloud-0 ~]$ tempest verify-config Running config verification... cfgname = compute cfgname = image cfgname = loadbalancer Traceback (most recent call last): File "/home/stack/.venv/lib/python2.7/site-packages/tempest/cmd/verify_tempest_config.py", line 488, in take_action main(parsed_args) File "/home/stack/.venv/lib/python2.7/site-packages/tempest/cmd/verify_tempest_config.py", line 454, in main services = check_service_availability(os, update) File "/home/stack/.venv/lib/python2.7/site-packages/tempest/cmd/verify_tempest_config.py", line 384, in check_service_availability codename_match[cfgname]): KeyError: 'loadbalancer'
Please handle key error for non-existing dict key (in my case "loadbalancer"), to use dict.get() that returns None if no key found. So: < if not getattr(CONF.service_available, codename_match[cfgname])' > should rather be: < 'cfg_value = codename_match.get(cfgname)' if not cfg_value or not getattr(CONF.service_available, cfg_value) >
In addition to fixing key error for non-existing dict, please also fix in "verify_tempest_config.py" - "check_service_availability": codename_match dict should include 'loadbalancer': 'loadbalancer'. (see related bug https://bugzilla.redhat.com/show_bug.cgi?id=1562085#c2:)
we suspect this is already fixed
verify-config issue should be resolved by 591595 (see external trackers). It's waiting for review. The issue in python-tempestconf regarding volume extensions was resolved and merged to master branch, see 568876 in external trackers.
python-tempestconf issue will be resolved as soon as python-tempestconf-2.0.0 for RHOS-13 is available, see depends on bug (1621205).
python-tempestconf-2.0.0, which includes the fix for python-tempestconf's issue, has been released for RHOS-14, see https://bugzilla.redhat.com/show_bug.cgi?id=1622011 As soon as the patch (https://review.openstack.org/#/c/591595/) will be part of openstack-tempest for RHOS-14, the bug can be verified. To make sure that the patch will be backported to RHOS-13 too, I have created a bug - https://bugzilla.redhat.com/show_bug.cgi?id=1624906
The required patch has been included in openstack-tempest-19.0.0-2.el7ost package, which is available in RHOS-14 repositories also via latest symlink - moving this bug to VERIFIED.
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-2019:0591