diff options
author | Steve Baker <sbaker@redhat.com> | 2016-02-16 17:12:42 +1300 |
---|---|---|
committer | Steve Baker <sbaker@redhat.com> | 2016-02-29 16:04:48 +1300 |
commit | ebdf0ebc941eb1d99452347cf69e73ab901e1301 (patch) | |
tree | 3969c59e7d6e24ce2faec067b7041b1ac9aaa6b6 /heatclient/common/event_utils.py | |
parent | 6c184587648defb015c7dda7416b53721d71a9c7 (diff) | |
download | python-heatclient-ebdf0ebc941eb1d99452347cf69e73ab901e1301.tar.gz |
Implement stack event list --follow
This adds a --follow option which is similar to the --wait logging
behaviour in changes like I72421c1adf9220e3440179fec672f49803a6cde2
except that --follow doesn't exit until the user does ctrl-c.
This change also includes:
- always sort events ascending for all formatters - the newest events
should always be at the bottom of the screen as they are generally the
most interesting
- get_event marker handling tolerates the marker not being in the event
list. --follow was triggering this, but ignoring the marker in this
case has not lead to events being printed more than once
Change-Id: Ie0964918fc1d05e7e18aa39ceea6d4777deeb87e
Blueprint: heat-support-python-openstackclient
Diffstat (limited to 'heatclient/common/event_utils.py')
-rw-r--r-- | heatclient/common/event_utils.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/heatclient/common/event_utils.py b/heatclient/common/event_utils.py index 3e6b197..1b8b179 100644 --- a/heatclient/common/event_utils.py +++ b/heatclient/common/event_utils.py @@ -75,8 +75,11 @@ def get_events(hc, stack_id, event_args, nested_depth=0, # Slice the list if marker is specified if marker: - marker_index = [e.id for e in events].index(marker) - events = events[marker_index:] + try: + marker_index = [e.id for e in events].index(marker) + events = events[marker_index:] + except ValueError: + pass # Slice the list if limit is specified if limit: |