Revert patch 772755 to not return error when groups is empty in validation playbook
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
tripleo |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
Root Cause Analysis (RCA) on why we needed to revert patch 772755
- PROBLEM: On master - patch 772755 is causing an error when a playbook
contains an empty group list []
- 772755: Add an error message when groups is not found in the playbook
- https:/
- TESTED: 16.1: patch 772755 WORKED, as validation.py did not have the
change to return empty group list [] when a group is not found.
- TESTED: Master: patch 772755 FAILED
- SOLUTION: Revert patch 772755
https:/
Root Cause Analysis (RCA) on why we needed to revert patch 772755
Summary:
- 16.1 - getting error "IndexError: list index out of range" when
playbook does not contain group property.
- 16.1 - to reproduce on 16.1, using node-health.yaml as playbook
- Modify node-health.yaml and comment out groups:
- /usr/share/
- Run command to show problem
- FIX - file utils.py was modified to report more info about the problem
- 16.1: ORIGINAL version iterates and returns with above python fault.
- 16.1: FIXED - see box below - changed things to return with
informative error if/when groups are NOT FOUND.
- Merge to master - turns out, above patch was NOT necessary - since
master was changed to return an empty list if the key was not found.
- master: changed to return an empty list if the key w|s not found.
- For example - ceph-pg.yaml - contains an empty [] group list -
which is valid.
- master: empty [] group list is VALID - need to remove initial patch
Detail:
- 16.1 - getting error "IndexError: list index out of range" when
playbook does not contain group property.
- 16.1 - to reproduce on 16.1, using node-health.yaml as playbook
- Modify node-health.yaml and comment out groups:
- /usr/share/
---
- hosts: undercloud
vars:
metadata:
name: Node health check
Check if all overcloud nodes can be connected to before ...
scale-up or an upgrade.
# groups:
# - pre-upgrade
roles:
- node_health
- Run command to show problem
openstack tripleo validator run --group pre-update
$ openstack tripleo validator |un --group pre-update
Exception occured while running the command
Traceback (most recent call last):
File "/usr/lib/
line 32, in run
super(
File "/usr/lib/
line 41, in run
return super(Command, self).run(
File "/usr/lib/
in run
return_code = self.take_
File "/usr/lib/
self.
File "/usr/lib/
t.field_names = results[0].keys()
IndexError: list index out of range
list index out of range
- FIX - file utils.py was modified to report more info about the problem
- 16.1: ORIGINAL version iterates through and returns with above fault.
// version: 16.1
// file: /usr/lib/
def parse_all_
"""
Return a list of validations metadata
Can be sorted by Groups
"""
results = []
validations
if isinstance(groups, six.string_types):
groups = [groups]
for pl in validations_
val = Validation(pl)
|if not groups or set(groups)
| results.
return results
- 16.1: FIXED - see box below - we changed things to return with
informative error if/when groups are NOT FOUND.
// version: master
// file: validations-
// gerrit patch:
// https:/
def parse_all_
results = []
if not groups:
groups = []
else:
groups = convert_
validations
for pl in validations_
val = Validation(pl)
|if not val.groups:
| msg = 'Group not found in playbook - please .......
| raise RuntimeError(msg)
if not groups or set(groups)
return results
- We tested above fix manually on 16.1
- Merge to master - turns out, above patch was NOT necessary -
code in master changed to return an empty list if key was not found.
- master: code in master was changed to return an empty list if the key
was not found.
// version: master
// file: validations-
// diff/patch: https:/
commit/
@property
def groups(self):
- return self.dict[
+ if self.has_
+ groups = self.dict[
+ if groups:
+ return groups
+ else:
+ return []
+ else:
+ raise NameError(
+ "No metadata found in validation {}".format(self.id)
+ )
- For example - ceph-pg.yaml - contains an empty [] group list,
which is|valid.
// version: master
// file: tripleo-
// gerrit patch:
// https:/
---
- hosts: undercloud
vars:
metadata:
name: Validate requested Ceph Placement Groups
In Ceph Lumionus and newer the Placement Group overdose...
(https:/
executed by Ceph before a pool is created. If the check...
then the pool is not created. When TripleO deploys Ceph...
determine if the user should update their CephPools, PG...
of OSD. Without this check a deployer may have to wait ...
is running but before the pools are created to realize ...
will fail.
+----------+
|groups: []|
+----------+
tasks:
- include_role:
name: ceph
- master: the empty [] group list is VALID - need to remove initial patch
// version: master
// file: validations-
// gerrit patch:
// https:/
+----
|if not val.groups:
| msg = 'Group not found in playbook - please add ...
| raise RuntimeError(msg)
+----
Changed in tripleo: | |
status: | New → In Progress |
description: | updated |
description: | updated |
description: | updated |
description: | updated |
description: | updated |
Changed in tripleo: | |
status: | In Progress → Fix Released |
This issue was fixed in the openstack/ validations- libs 1.1.0 release.