Show stack failures on error

On stack create or update error, go ahead and run "openstack stack
failures list overcloud". It's the best way to show the immediate error
from a stack failure and it's more user friendly to go ahead and show
the error.

Note that this module is not currently tested with any unit tests, but
if there is general agreement on this patch, I'll work on adding some in
a followup.

Change-Id: Ibe9a97f3a3088954b1e88fa7c741845f70bd6edf
This commit is contained in:
James Slagle 2017-02-17 10:31:03 -05:00
parent caa966c9e3
commit 067590b9f0

View File

@ -16,6 +16,7 @@ import time
import uuid
from heatclient.common import event_utils
from openstackclient import shell
from tripleoclient import exceptions
from tripleoclient import utils
@ -80,6 +81,7 @@ def deploy_and_wait(log, clients, stack, plan_name, verbose_level,
create_result = utils.wait_for_stack_ready(
orchestration_client, plan_name, marker, action, verbose_events)
if not create_result:
shell.OpenStackShell().run(["stack", "failures", "list", plan_name])
if stack is None:
raise exceptions.DeploymentError("Heat Stack create failed.")
else: