summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.opendev.org>2020-03-24 21:34:44 +0000
committerGerrit Code Review <review@openstack.org>2020-03-24 21:34:44 +0000
commit81dcc91214c7b449e74ed5d0fe6854590431e6ef (patch)
tree4be05ec57ff40517cb3febb21012e0943238a6b8
parent2c8d705a24ac5a741c5fc00ce278450896e5f2db (diff)
parent69870ae439f18863979949f5728543a0fb1cbe83 (diff)
downloadpython-openstackclient-81dcc91214c7b449e74ed5d0fe6854590431e6ef.tar.gz
Merge "Fix faulthy state argument choice"5.1.0
-rw-r--r--doc/source/cli/command-objects/volume-snapshot.rst2
-rw-r--r--openstackclient/tests/functional/volume/v2/test_volume_snapshot.py18
-rw-r--r--openstackclient/volume/v1/volume_snapshot.py4
-rw-r--r--openstackclient/volume/v2/consistency_group_snapshot.py2
-rw-r--r--openstackclient/volume/v2/volume_snapshot.py6
5 files changed, 25 insertions, 7 deletions
diff --git a/doc/source/cli/command-objects/volume-snapshot.rst b/doc/source/cli/command-objects/volume-snapshot.rst
index 30cc77cc..21a89370 100644
--- a/doc/source/cli/command-objects/volume-snapshot.rst
+++ b/doc/source/cli/command-objects/volume-snapshot.rst
@@ -115,7 +115,7 @@ List volume snapshots
.. option:: --status <status>
Filters results by a status.
- ('available', 'error', 'creating', 'deleting' or 'error-deleting')
+ ('available', 'error', 'creating', 'deleting' or 'error_deleting')
.. option:: --name <name>
diff --git a/openstackclient/tests/functional/volume/v2/test_volume_snapshot.py b/openstackclient/tests/functional/volume/v2/test_volume_snapshot.py
index 8d32d997..4977a73e 100644
--- a/openstackclient/tests/functional/volume/v2/test_volume_snapshot.py
+++ b/openstackclient/tests/functional/volume/v2/test_volume_snapshot.py
@@ -121,6 +121,24 @@ class VolumeSnapshotTests(common.BaseVolumeTests):
cmd_output["size"],
)
self.wait_for_status('volume snapshot', name2, 'available')
+
+ raw_output = self.openstack(
+ 'volume snapshot set ' +
+ '--state error_deleting ' +
+ name2
+ )
+ self.assertOutput('', raw_output)
+
+ # Test list --long, --status
+ cmd_output = json.loads(self.openstack(
+ 'volume snapshot list -f json ' +
+ '--long ' +
+ '--status error_deleting'
+ ))
+ names = [x["Name"] for x in cmd_output]
+ self.assertNotIn(name1, names)
+ self.assertIn(name2, names)
+
raw_output = self.openstack(
'volume snapshot set ' +
'--state error ' +
diff --git a/openstackclient/volume/v1/volume_snapshot.py b/openstackclient/volume/v1/volume_snapshot.py
index 966db48f..2d1f0359 100644
--- a/openstackclient/volume/v1/volume_snapshot.py
+++ b/openstackclient/volume/v1/volume_snapshot.py
@@ -174,10 +174,10 @@ class ListVolumeSnapshot(command.Lister):
'--status',
metavar='<status>',
choices=['available', 'error', 'creating', 'deleting',
- 'error-deleting'],
+ 'error_deleting'],
help=_("Filters results by a status. "
"('available', 'error', 'creating', 'deleting'"
- " or 'error-deleting')")
+ " or 'error_deleting')")
)
parser.add_argument(
'--volume',
diff --git a/openstackclient/volume/v2/consistency_group_snapshot.py b/openstackclient/volume/v2/consistency_group_snapshot.py
index 3df66e69..7d5ba82f 100644
--- a/openstackclient/volume/v2/consistency_group_snapshot.py
+++ b/openstackclient/volume/v2/consistency_group_snapshot.py
@@ -128,7 +128,7 @@ class ListConsistencyGroupSnapshot(command.Lister):
'--status',
metavar="<status>",
choices=['available', 'error', 'creating', 'deleting',
- 'error-deleting'],
+ 'error_deleting'],
help=_('Filters results by a status ("available", "error", '
'"creating", "deleting" or "error_deleting")')
)
diff --git a/openstackclient/volume/v2/volume_snapshot.py b/openstackclient/volume/v2/volume_snapshot.py
index edacf683..656f59d4 100644
--- a/openstackclient/volume/v2/volume_snapshot.py
+++ b/openstackclient/volume/v2/volume_snapshot.py
@@ -229,10 +229,10 @@ class ListVolumeSnapshot(command.Lister):
'--status',
metavar='<status>',
choices=['available', 'error', 'creating', 'deleting',
- 'error-deleting'],
+ 'error_deleting'],
help=_("Filters results by a status. "
"('available', 'error', 'creating', 'deleting'"
- " or 'error-deleting')")
+ " or 'error_deleting')")
)
parser.add_argument(
'--volume',
@@ -344,7 +344,7 @@ class SetVolumeSnapshot(command.Command):
'--state',
metavar='<state>',
choices=['available', 'error', 'creating', 'deleting',
- 'error-deleting'],
+ 'error_deleting'],
help=_('New snapshot state. ("available", "error", "creating", '
'"deleting", or "error_deleting") (admin only) '
'(This option simply changes the state of the snapshot '