Bug 1887437 - IndexError: list index out of range when using an empty validation group in "run" subcommand
Summary: IndexError: list index out of range when using an empty validation group in "...
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: python-tripleoclient
Version: 16.1 (Train)
Hardware: Unspecified
OS: Unspecified
Target Milestone: z4
: 16.1 (Train on RHEL 8.2)
Assignee: mathieu bultel
QA Contact: David Rosenfeld
Depends On: 1912879
TreeView+ depends on / blocked
Reported: 2020-10-12 13:27 UTC by Cédric Jeanneret
Modified: 2021-03-17 15:34 UTC (History)
8 users (show)

Fixed In Version: python-tripleoclient-12.3.2-1.20200914164931.el8ost
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Last Closed: 2021-03-17 15:32:20 UTC
Target Upstream Version:

Attachments (Terms of Use)

System ID Private Priority Status Summary Last Updated
OpenStack gerrit 757649 0 None MERGED Raise if no validation has been executed 2021-02-10 10:20:25 UTC
OpenStack gerrit 759695 0 None MERGED Raise if no validation has been executed 2021-02-10 10:20:25 UTC
Red Hat Product Errata RHBA-2021:0817 0 None None None 2021-03-17 15:34:06 UTC

Description Cédric Jeanneret 2020-10-12 13:27:36 UTC
Description of problem:

Running `openstack tripleo validator run --group some-group' returns a stack trace if no validation is present in "some-group". For instance:

openstack tripleo validator run --group post-overcloud-prepare
Exception occured while running the command
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/tripleoclient/command.py", line 32, in run
    super(Command, self).run(parsed_args)
  File "/usr/lib/python3.6/site-packages/osc_lib/command/command.py", line 41, in run
    return super(Command, self).run(parsed_args)
  File "/usr/lib/python3.6/site-packages/cliff/command.py", line 185, in run
    return_code = self.take_action(parsed_args) or 0
  File "/usr/lib/python3.6/site-packages/tripleoclient/v1/tripleo_validator.py", line 388, in take_action
  File "/usr/lib/python3.6/site-packages/tripleoclient/v1/tripleo_validator.py", line 364, in _run_validator_run
    t.field_names = results[0].keys()
IndexError: list index out of range
list index out of range

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

How reproducible:

Steps to Reproduce:
1. deploy an undercloud
2. try running a group without any validation in it

Actual results:
A stacktrace is shown

Expected results:
A message saying "no validation in that group" or something should be shown

Additional info:
Detected during downstream CI checks - thanks David R and Jad!

Comment 6 David Rosenfeld 2021-01-25 13:29:23 UTC
Verification of this BZ is blocked by https://bugzilla.redhat.com/show_bug.cgi?id=1912879

Comment 9 David Rosenfeld 2021-02-04 19:18:25 UTC
index error is no longer seen. A message is now printed:

openstack tripleo validator run --group post-overcloud-prepare
Running Validations without Overcloud settings.
WARNING:tripleo_common.inventory:Stack not found: overcloud. Only the undercloud will be added to the inventory.
No Validation has been run, please check your parameters.

Comment 15 errata-xmlrpc 2021-03-17 15:32:20 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 (Red Hat OpenStack Platform 16.1.4 director bug fix 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.


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