diff --git a/heatclient/osc/v1/snapshot.py b/heatclient/osc/v1/snapshot.py index 1ff1384a..79eea08d 100644 --- a/heatclient/osc/v1/snapshot.py +++ b/heatclient/osc/v1/snapshot.py @@ -52,7 +52,14 @@ class ListSnapshot(command.Lister): raise exc.CommandError(_('Stack not found: %s') % parsed_args.stack) - columns = ['id', 'name', 'status', 'status_reason', 'creation_time'] + columns = [ + 'id', + 'name', + 'action', + 'status', + 'status_reason', + 'creation_time' + ] return ( columns, (utils.get_dict_properties(s, columns) @@ -168,6 +175,7 @@ class CreateSnapshot(command.ShowOne): columns = [ 'ID', 'name', + 'action', 'status', 'status_reason', 'data', diff --git a/heatclient/tests/unit/osc/v1/test_snapshot.py b/heatclient/tests/unit/osc/v1/test_snapshot.py index d22dee89..e65449c4 100644 --- a/heatclient/tests/unit/osc/v1/test_snapshot.py +++ b/heatclient/tests/unit/osc/v1/test_snapshot.py @@ -101,6 +101,7 @@ class TestRestoreSnapshot(TestStack): class TestSnapshotCreate(TestStack): get_response = { + "action": "CREATE", "status": "IN_PROGRESS", "name": "test_snapshot", "status_reason": None, diff --git a/heatclient/tests/unit/test_shell.py b/heatclient/tests/unit/test_shell.py index fffef6cc..322b6f76 100644 --- a/heatclient/tests/unit/test_shell.py +++ b/heatclient/tests/unit/test_shell.py @@ -2124,6 +2124,7 @@ class ShellTestUserPass(ShellBase): resp_dict = {"snapshots": [{ "id": "2", "name": "snap1", + "action": "CREATE", "status": "COMPLETE", "status_reason": "", "creation_time": "2014-12-05T01:25:52Z" @@ -2136,6 +2137,7 @@ class ShellTestUserPass(ShellBase): required = [ 'id', 'name', + 'action', 'status', 'status_reason', 'creation_time', diff --git a/heatclient/v1/shell.py b/heatclient/v1/shell.py index f3cb69fa..12ee3f70 100644 --- a/heatclient/v1/shell.py +++ b/heatclient/v1/shell.py @@ -1684,10 +1684,13 @@ def do_snapshot_list(hc, args): except exc.HTTPNotFound: raise exc.CommandError(_('Stack not found: %s') % args.id) else: - fields = ['id', 'name', 'status', 'status_reason', 'creation_time'] + fields = [ + 'id', 'name', 'action', 'status', 'status_reason', 'creation_time' + ] formatters = { 'id': lambda x: x['id'], 'name': lambda x: x['name'], + 'action': lambda x: x['action'], 'status': lambda x: x['status'], 'status_reason': lambda x: x['status_reason'], 'creation_time': lambda x: x['creation_time'], diff --git a/releasenotes/notes/snapshot-action-a8ead3d9d0285a54.yaml b/releasenotes/notes/snapshot-action-a8ead3d9d0285a54.yaml new file mode 100644 index 00000000..70bd8372 --- /dev/null +++ b/releasenotes/notes/snapshot-action-a8ead3d9d0285a54.yaml @@ -0,0 +1,7 @@ +--- +features: + - | + The follwoing commands now shows the new `action` field. + + - ``openstack stack snapshot list `` + - ``openstack stack snapshot show ``