Skip to content

Commit 7fe7663

Browse files
Zuulopenstack-gerrit
authored andcommitted
Merge "Add action field for snapshot"
2 parents 8fad505 + 0c8fdde commit 7fe7663

5 files changed

Lines changed: 23 additions & 2 deletions

File tree

heatclient/osc/v1/snapshot.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,14 @@ def _list_snapshot(self, heat_client, parsed_args):
5252
raise exc.CommandError(_('Stack not found: %s') %
5353
parsed_args.stack)
5454

55-
columns = ['id', 'name', 'status', 'status_reason', 'creation_time']
55+
columns = [
56+
'id',
57+
'name',
58+
'action',
59+
'status',
60+
'status_reason',
61+
'creation_time'
62+
]
5663
return (
5764
columns,
5865
(utils.get_dict_properties(s, columns)
@@ -168,6 +175,7 @@ def take_action(self, parsed_args):
168175
columns = [
169176
'ID',
170177
'name',
178+
'action',
171179
'status',
172180
'status_reason',
173181
'data',

heatclient/tests/unit/osc/v1/test_snapshot.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ def test_snapshot_restore_error(self):
101101

102102
class TestSnapshotCreate(TestStack):
103103
get_response = {
104+
"action": "CREATE",
104105
"status": "IN_PROGRESS",
105106
"name": "test_snapshot",
106107
"status_reason": None,

heatclient/tests/unit/test_shell.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2124,6 +2124,7 @@ def test_snapshot_list(self):
21242124
resp_dict = {"snapshots": [{
21252125
"id": "2",
21262126
"name": "snap1",
2127+
"action": "CREATE",
21272128
"status": "COMPLETE",
21282129
"status_reason": "",
21292130
"creation_time": "2014-12-05T01:25:52Z"
@@ -2136,6 +2137,7 @@ def test_snapshot_list(self):
21362137
required = [
21372138
'id',
21382139
'name',
2140+
'action',
21392141
'status',
21402142
'status_reason',
21412143
'creation_time',

heatclient/v1/shell.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1684,10 +1684,13 @@ def do_snapshot_list(hc, args):
16841684
except exc.HTTPNotFound:
16851685
raise exc.CommandError(_('Stack not found: %s') % args.id)
16861686
else:
1687-
fields = ['id', 'name', 'status', 'status_reason', 'creation_time']
1687+
fields = [
1688+
'id', 'name', 'action', 'status', 'status_reason', 'creation_time'
1689+
]
16881690
formatters = {
16891691
'id': lambda x: x['id'],
16901692
'name': lambda x: x['name'],
1693+
'action': lambda x: x['action'],
16911694
'status': lambda x: x['status'],
16921695
'status_reason': lambda x: x['status_reason'],
16931696
'creation_time': lambda x: x['creation_time'],
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
features:
3+
- |
4+
The follwoing commands now shows the new `action` field.
5+
6+
- ``openstack stack snapshot list <stack>``
7+
- ``openstack stack snapshot show <stack> <snapshot>``

0 commit comments

Comments
 (0)