Skip to content

Commit

Permalink
Merge "Be backward compatible after a renaming in API"
Browse files Browse the repository at this point in the history
  • Loading branch information
Jenkins authored and openstack-gerrit committed Sep 4, 2013
2 parents a7ffcd7 + b95657f commit e2cbb45
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions heatclient/v1/shell.py
Original file line number Diff line number Diff line change
Expand Up @@ -333,8 +333,13 @@ def do_resource_list(hc, args):
except exc.HTTPNotFound:
raise exc.CommandError('Stack not found: %s' % args.id)
else:
fields = ['resource_name', 'resource_type',
'resource_status', 'updated_time']
fields = ['resource_type', 'resource_status', 'updated_time']
if len(resources) >= 1:
if hasattr(resources[0], 'resource_name'):
fields.insert(0, 'resource_name')
else:
fields.insert(0, 'logical_resource_id')

utils.print_list(resources, fields, sortby=3)


Expand Down Expand Up @@ -416,8 +421,13 @@ def do_event_list(hc, args):
except exc.HTTPNotFound:
raise exc.CommandError('Stack not found: %s' % args.id)
else:
fields = ['resource_name', 'id', 'resource_status_reason',
fields = ['id', 'resource_status_reason',
'resource_status', 'event_time']
if len(events) >= 1:
if hasattr(events[0], 'resource_name'):
fields.insert(0, 'resource_name')
else:
fields.insert(0, 'logical_resource_id')
utils.print_list(events, fields)


Expand Down

0 comments on commit e2cbb45

Please sign in to comment.