Skip to content

Commit 81dcc91

Browse files
Zuulopenstack-gerrit
authored andcommitted
Merge "Fix faulthy state argument choice"
2 parents 2c8d705 + 69870ae commit 81dcc91

5 files changed

Lines changed: 25 additions & 7 deletions

File tree

doc/source/cli/command-objects/volume-snapshot.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ List volume snapshots
115115
.. option:: --status <status>
116116
117117
Filters results by a status.
118-
('available', 'error', 'creating', 'deleting' or 'error-deleting')
118+
('available', 'error', 'creating', 'deleting' or 'error_deleting')
119119
120120
.. option:: --name <name>
121121

openstackclient/tests/functional/volume/v2/test_volume_snapshot.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,24 @@ def test_volume_snapshot_list(self):
121121
cmd_output["size"],
122122
)
123123
self.wait_for_status('volume snapshot', name2, 'available')
124+
125+
raw_output = self.openstack(
126+
'volume snapshot set ' +
127+
'--state error_deleting ' +
128+
name2
129+
)
130+
self.assertOutput('', raw_output)
131+
132+
# Test list --long, --status
133+
cmd_output = json.loads(self.openstack(
134+
'volume snapshot list -f json ' +
135+
'--long ' +
136+
'--status error_deleting'
137+
))
138+
names = [x["Name"] for x in cmd_output]
139+
self.assertNotIn(name1, names)
140+
self.assertIn(name2, names)
141+
124142
raw_output = self.openstack(
125143
'volume snapshot set ' +
126144
'--state error ' +

openstackclient/volume/v1/volume_snapshot.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,10 +174,10 @@ def get_parser(self, prog_name):
174174
'--status',
175175
metavar='<status>',
176176
choices=['available', 'error', 'creating', 'deleting',
177-
'error-deleting'],
177+
'error_deleting'],
178178
help=_("Filters results by a status. "
179179
"('available', 'error', 'creating', 'deleting'"
180-
" or 'error-deleting')")
180+
" or 'error_deleting')")
181181
)
182182
parser.add_argument(
183183
'--volume',

openstackclient/volume/v2/consistency_group_snapshot.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ def get_parser(self, prog_name):
128128
'--status',
129129
metavar="<status>",
130130
choices=['available', 'error', 'creating', 'deleting',
131-
'error-deleting'],
131+
'error_deleting'],
132132
help=_('Filters results by a status ("available", "error", '
133133
'"creating", "deleting" or "error_deleting")')
134134
)

openstackclient/volume/v2/volume_snapshot.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -229,10 +229,10 @@ def get_parser(self, prog_name):
229229
'--status',
230230
metavar='<status>',
231231
choices=['available', 'error', 'creating', 'deleting',
232-
'error-deleting'],
232+
'error_deleting'],
233233
help=_("Filters results by a status. "
234234
"('available', 'error', 'creating', 'deleting'"
235-
" or 'error-deleting')")
235+
" or 'error_deleting')")
236236
)
237237
parser.add_argument(
238238
'--volume',
@@ -344,7 +344,7 @@ def get_parser(self, prog_name):
344344
'--state',
345345
metavar='<state>',
346346
choices=['available', 'error', 'creating', 'deleting',
347-
'error-deleting'],
347+
'error_deleting'],
348348
help=_('New snapshot state. ("available", "error", "creating", '
349349
'"deleting", or "error_deleting") (admin only) '
350350
'(This option simply changes the state of the snapshot '

0 commit comments

Comments
 (0)