merge-new-params-nic-config-script - StopIteration ERROR - Not userfriendly

Bug #1812530 reported by Harald Jensås on 2019-01-20
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Harald Jensås

Bug Description

The script fails with a StopIteration error here:

    nic_config_name = next((x.get('deprecated_nic_config_name',
                                  OPTS.role_name.lower() + '.yaml') for x in
                            roles_data if x['name'] == OPTS.role_name))

The exception StopIteration indicates that it iterated trough all the roles in roles data without finding a match. The user specified a --role-name that does not exist in roles_data.

The script should handle this error case more gracefully and indicate the role is missing instead of generating StopIteration.

Tags: ux Edit Tag help

Fix proposed to branch: master

Changed in tripleo:
assignee: nobody → Harald Jensås (harald-jensas)
status: Triaged → In Progress

Submitter: Zuul
Branch: master

commit 3fa634908969d3f7b24c6cbd284610075952a6be
Author: Harald Jensås <email address hidden>
Date: Sun Jan 20 03:57:03 2019 +0100

    UX - Useful error msg if role is not in roles data

    If the user specify a role name that does not exist
    in the provided roles data the scipt exits with a
    StopIteration error. Catch it and raise RuntimeError
    with user friendly error message.

    Closes-Bug: #1812530
    Change-Id: I704316f66c197668a7d8e373efe00889776d2a85

Changed in tripleo:
status: In Progress → Fix Released

This issue was fixed in the openstack/tripleo-heat-templates 10.4.0 release.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers