tripleoclient does not handle failed actions

Bug #1686811 reported by James Slagle on 2017-04-27
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tripleo
Medium
James Slagle

Bug Description

tripleoclient in workflows/base.py in the call_action method does not check if the action passed or failed. It just assumes it succeeded and returns the output. In particular, the overcloudrc create action can fall and the error is not handled, resulting in utils.write_overcloudrc treading the error message as a dict of overclodurc values.

which then fails with a cryptic error:
"string indices must be intergers"

full traceback:
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/osc_lib/shell.py", line 135, in run
    ret_val = super(OpenStackShell, self).run(argv)
  File "/usr/lib/python2.7/site-packages/cliff/app.py", line 279, in run
    result = self.run_subcommand(remainder)
  File "/usr/lib/python2.7/site-packages/osc_lib/shell.py", line 180, in run_subcommand
    ret_value = super(OpenStackShell, self).run_subcommand(argv)
  File "/usr/lib/python2.7/site-packages/cliff/app.py", line 400, in run_subcommand
    result = cmd.run(parsed_args)
  File "/usr/lib/python2.7/site-packages/osc_lib/command/command.py", line 41, in run
    return super(Command, self).run(parsed_args)
  File "/usr/lib/python2.7/site-packages/cliff/command.py", line 90, in run
    return self.take_action(parsed_args) or 0
  File "/usr/lib/python2.7/site-packages/tripleoclient/v1/overcloud_deploy.py", line 898, in take_action
    utils.write_overcloudrc(stack.stack_name, overcloudrcs)
  File "/usr/lib/python2.7/site-packages/tripleoclient/utils.py", line 73, in write_overcloudrc
    rcfile.write(overcloudrcs['overcloudrc'])
TypeError: string indices must be integers

Changed in tripleo:
status: New → In Progress
importance: Undecided → Medium
assignee: nobody → James Slagle (james-slagle)
milestone: none → pike-2
description: updated

Reviewed: https://review.openstack.org/460720
Committed: https://git.openstack.org/cgit/openstack/python-tripleoclient/commit/?id=026cb4a76e3c90b3a58d8f4fcec0fb205b04ce61
Submitter: Jenkins
Branch: master

commit 026cb4a76e3c90b3a58d8f4fcec0fb205b04ce61
Author: James Slagle <email address hidden>
Date: Thu Apr 27 15:16:07 2017 -0400

    Handle failed actions

    The result of syncrhonously called Mistral actions wasn't being checked
    to see if the action passed or failed. The result is now checked and if
    the action has failed, an exception will be raised.

    Change-Id: I95ae8c98fec94cf91f3f209b593f6c1815729fd4
    Closes-Bug: #1686811

Changed in tripleo:
status: In Progress → Fix Released

This issue was fixed in the openstack/python-tripleoclient 7.1.0 release.

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

Other bug subscribers