summaryrefslogtreecommitdiff
path: root/heatclient/common/event_utils.py
diff options
context:
space:
mode:
authorSteve Baker <sbaker@redhat.com>2016-09-02 05:13:29 +0000
committerSteve Baker <sbaker@redhat.com>2016-09-06 13:54:12 +1200
commitb28d8c610147b2830930da532d6b42233d8cd468 (patch)
treefa3a6b961b224b4187d940860244f3779aad6413 /heatclient/common/event_utils.py
parented287fb91364f6bdd8c91c2f60d6523c3cd2af70 (diff)
downloadpython-heatclient-b28d8c610147b2830930da532d6b42233d8cd468.tar.gz
Show resource name path in event log formatter
The resource name path was introduced in the 'openstack stack failures' command and is a user-friendly way of referring to a deeply nested resource. This change modifies the event log formatter to build and display the resource name path for each event based only off data in previous events. For building the full resource path, and omitting ugly stack names from the resource path, the following heat change is needed Ib8feb7752bd5736785d142216312bb35629b3601. However the output is still improved slightly when running against an older heat which does not have this change. Change-Id: I86b687fc516da215a6baeef8b365a520d12a8ab1 Closes-Bug: #1619415
Diffstat (limited to 'heatclient/common/event_utils.py')
-rw-r--r--heatclient/common/event_utils.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/heatclient/common/event_utils.py b/heatclient/common/event_utils.py
index 6acbbd6..c0bc42e 100644
--- a/heatclient/common/event_utils.py
+++ b/heatclient/common/event_utils.py
@@ -179,6 +179,7 @@ def poll_for_events(hc, stack_name, action=None, poll_period=5, marker=None,
msg_template = _("\n Stack %(name)s %(status)s \n")
if not out:
out = sys.stdout
+ event_log_context = utils.EventLogContext()
while True:
events = get_events(hc, stack_id=stack_name, nested_depth=nested_depth,
event_args={'sort_dir': 'asc',
@@ -190,7 +191,7 @@ def poll_for_events(hc, stack_name, action=None, poll_period=5, marker=None,
no_event_polls = 0
# set marker to last event that was received.
marker = getattr(events[-1], 'id', None)
- events_log = utils.event_log_formatter(events)
+ events_log = utils.event_log_formatter(events, event_log_context)
out.write(events_log)
out.write('\n')