python-openstackclient 8.3.0__py3-none-any.whl → 9.0.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- openstackclient/common/module.py +1 -1
- openstackclient/common/quota.py +31 -17
- openstackclient/compute/v2/server.py +2 -2
- openstackclient/identity/common.py +31 -0
- openstackclient/identity/v2_0/service.py +3 -1
- openstackclient/identity/v3/federation_protocol.py +39 -40
- openstackclient/identity/v3/limit.py +85 -84
- openstackclient/identity/v3/project.py +181 -112
- openstackclient/identity/v3/registered_limit.py +82 -99
- openstackclient/identity/v3/tag.py +0 -11
- openstackclient/image/v2/image.py +2 -1
- openstackclient/tests/functional/identity/v3/test_limit.py +47 -0
- openstackclient/tests/functional/image/v2/test_metadef_objects.py +69 -0
- openstackclient/tests/functional/volume/v3/test_volume_snapshot.py +46 -132
- openstackclient/tests/unit/common/test_quota.py +59 -0
- openstackclient/tests/unit/compute/v2/test_server.py +6 -8
- openstackclient/tests/unit/identity/v3/test_limit.py +197 -145
- openstackclient/tests/unit/identity/v3/test_project.py +831 -512
- openstackclient/tests/unit/identity/v3/test_protocol.py +97 -88
- openstackclient/tests/unit/identity/v3/test_registered_limit.py +355 -220
- openstackclient/tests/unit/image/v2/test_image.py +5 -5
- openstackclient/tests/unit/volume/v2/test_consistency_group.py +8 -2
- openstackclient/tests/unit/volume/v2/test_volume.py +7 -6
- openstackclient/tests/unit/volume/v3/test_volume.py +34 -12
- openstackclient/volume/v2/consistency_group.py +8 -8
- openstackclient/volume/v2/consistency_group_snapshot.py +2 -2
- openstackclient/volume/v2/qos_specs.py +2 -2
- openstackclient/volume/v2/volume.py +12 -5
- openstackclient/volume/v2/volume_backup.py +2 -2
- openstackclient/volume/v2/volume_snapshot.py +2 -2
- openstackclient/volume/v2/volume_transfer_request.py +2 -2
- openstackclient/volume/v2/volume_type.py +5 -5
- openstackclient/volume/v3/volume.py +14 -7
- openstackclient/volume/v3/volume_backup.py +2 -2
- openstackclient/volume/v3/volume_snapshot.py +2 -2
- openstackclient/volume/v3/volume_transfer_request.py +2 -2
- openstackclient/volume/v3/volume_type.py +5 -5
- {python_openstackclient-8.3.0.dist-info → python_openstackclient-9.0.0.dist-info}/METADATA +1 -1
- {python_openstackclient-8.3.0.dist-info → python_openstackclient-9.0.0.dist-info}/RECORD +45 -44
- {python_openstackclient-8.3.0.dist-info → python_openstackclient-9.0.0.dist-info}/WHEEL +1 -1
- {python_openstackclient-8.3.0.dist-info → python_openstackclient-9.0.0.dist-info}/licenses/AUTHORS +5 -0
- python_openstackclient-9.0.0.dist-info/pbr.json +1 -0
- python_openstackclient-8.3.0.dist-info/pbr.json +0 -1
- {python_openstackclient-8.3.0.dist-info → python_openstackclient-9.0.0.dist-info}/entry_points.txt +0 -0
- {python_openstackclient-8.3.0.dist-info → python_openstackclient-9.0.0.dist-info}/licenses/LICENSE +0 -0
- {python_openstackclient-8.3.0.dist-info → python_openstackclient-9.0.0.dist-info}/top_level.txt +0 -0
|
@@ -2085,7 +2085,7 @@ class TestImageImport(TestImage):
|
|
|
2085
2085
|
remote_image_id=None,
|
|
2086
2086
|
remote_service_interface=None,
|
|
2087
2087
|
stores=None,
|
|
2088
|
-
all_stores=
|
|
2088
|
+
all_stores=False,
|
|
2089
2089
|
all_stores_must_succeed=False,
|
|
2090
2090
|
)
|
|
2091
2091
|
|
|
@@ -2115,7 +2115,7 @@ class TestImageImport(TestImage):
|
|
|
2115
2115
|
remote_image_id=None,
|
|
2116
2116
|
remote_service_interface=None,
|
|
2117
2117
|
stores=None,
|
|
2118
|
-
all_stores=
|
|
2118
|
+
all_stores=False,
|
|
2119
2119
|
all_stores_must_succeed=False,
|
|
2120
2120
|
)
|
|
2121
2121
|
|
|
@@ -2253,7 +2253,7 @@ class TestImageImport(TestImage):
|
|
|
2253
2253
|
remote_image_id=None,
|
|
2254
2254
|
remote_service_interface=None,
|
|
2255
2255
|
stores=['fast'],
|
|
2256
|
-
all_stores=
|
|
2256
|
+
all_stores=False,
|
|
2257
2257
|
all_stores_must_succeed=False,
|
|
2258
2258
|
)
|
|
2259
2259
|
|
|
@@ -2285,7 +2285,7 @@ class TestImageImport(TestImage):
|
|
|
2285
2285
|
remote_image_id=None,
|
|
2286
2286
|
remote_service_interface=None,
|
|
2287
2287
|
stores=['fast'],
|
|
2288
|
-
all_stores=
|
|
2288
|
+
all_stores=False,
|
|
2289
2289
|
all_stores_must_succeed=True,
|
|
2290
2290
|
)
|
|
2291
2291
|
|
|
@@ -2320,7 +2320,7 @@ class TestImageImport(TestImage):
|
|
|
2320
2320
|
remote_image_id='remote-image-id',
|
|
2321
2321
|
remote_service_interface='private',
|
|
2322
2322
|
stores=None,
|
|
2323
|
-
all_stores=
|
|
2323
|
+
all_stores=False,
|
|
2324
2324
|
all_stores_must_succeed=False,
|
|
2325
2325
|
)
|
|
2326
2326
|
|
|
@@ -129,7 +129,10 @@ class TestConsistencyGroupAddVolume(TestConsistencyGroup):
|
|
|
129
129
|
utils, 'find_resource', side_effect=find_mock_result
|
|
130
130
|
) as find_mock:
|
|
131
131
|
result = self.cmd.take_action(parsed_args)
|
|
132
|
-
mock_error.assert_called_with(
|
|
132
|
+
mock_error.assert_called_with(
|
|
133
|
+
'%(result)s of %(total)s volumes failed to add.',
|
|
134
|
+
{'result': 1, 'total': 2},
|
|
135
|
+
)
|
|
133
136
|
self.assertIsNone(result)
|
|
134
137
|
find_mock.assert_any_call(
|
|
135
138
|
self.consistencygroups_mock, self._consistency_group.id
|
|
@@ -602,7 +605,10 @@ class TestConsistencyGroupRemoveVolume(TestConsistencyGroup):
|
|
|
602
605
|
utils, 'find_resource', side_effect=find_mock_result
|
|
603
606
|
) as find_mock:
|
|
604
607
|
result = self.cmd.take_action(parsed_args)
|
|
605
|
-
mock_error.assert_called_with(
|
|
608
|
+
mock_error.assert_called_with(
|
|
609
|
+
'%(result)s of %(total)s volumes failed to remove.',
|
|
610
|
+
{'result': 1, 'total': 2},
|
|
611
|
+
)
|
|
606
612
|
self.assertIsNone(result)
|
|
607
613
|
find_mock.assert_any_call(
|
|
608
614
|
self.consistencygroups_mock, self._consistency_group.id
|
|
@@ -655,7 +655,7 @@ class TestVolumeDelete(volume_fakes.TestVolume):
|
|
|
655
655
|
arglist = [self.volumes[0].id]
|
|
656
656
|
verifylist = [
|
|
657
657
|
("force", False),
|
|
658
|
-
("
|
|
658
|
+
("cascade", False),
|
|
659
659
|
("volumes", [self.volumes[0].id]),
|
|
660
660
|
]
|
|
661
661
|
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
@@ -674,7 +674,7 @@ class TestVolumeDelete(volume_fakes.TestVolume):
|
|
|
674
674
|
arglist = [v.id for v in self.volumes]
|
|
675
675
|
verifylist = [
|
|
676
676
|
('force', False),
|
|
677
|
-
('
|
|
677
|
+
('cascade', False),
|
|
678
678
|
('volumes', arglist),
|
|
679
679
|
]
|
|
680
680
|
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
@@ -701,7 +701,7 @@ class TestVolumeDelete(volume_fakes.TestVolume):
|
|
|
701
701
|
]
|
|
702
702
|
verifylist = [
|
|
703
703
|
('force', False),
|
|
704
|
-
('
|
|
704
|
+
('cascade', False),
|
|
705
705
|
('volumes', [self.volumes[0].id, 'unexist_volume']),
|
|
706
706
|
]
|
|
707
707
|
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
@@ -732,7 +732,7 @@ class TestVolumeDelete(volume_fakes.TestVolume):
|
|
|
732
732
|
]
|
|
733
733
|
verifylist = [
|
|
734
734
|
('force', False),
|
|
735
|
-
('
|
|
735
|
+
('cascade', True),
|
|
736
736
|
('volumes', [self.volumes[0].id]),
|
|
737
737
|
]
|
|
738
738
|
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
@@ -754,7 +754,7 @@ class TestVolumeDelete(volume_fakes.TestVolume):
|
|
|
754
754
|
]
|
|
755
755
|
verifylist = [
|
|
756
756
|
('force', True),
|
|
757
|
-
('
|
|
757
|
+
('cascade', False),
|
|
758
758
|
('volumes', [self.volumes[0].id]),
|
|
759
759
|
]
|
|
760
760
|
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
@@ -1618,7 +1618,8 @@ class TestVolumeSet(TestVolume):
|
|
|
1618
1618
|
result = self.cmd.take_action(parsed_args)
|
|
1619
1619
|
self.volumes_mock.retype.assert_not_called()
|
|
1620
1620
|
mock_warning.assert_called_with(
|
|
1621
|
-
"'
|
|
1621
|
+
"'%s' option will not work without '--type' option",
|
|
1622
|
+
'--retype-policy',
|
|
1622
1623
|
)
|
|
1623
1624
|
self.assertIsNone(result)
|
|
1624
1625
|
|
|
@@ -912,7 +912,7 @@ class TestVolumeDelete(volume_fakes.TestVolume):
|
|
|
912
912
|
arglist = [self.volumes[0].id]
|
|
913
913
|
verifylist = [
|
|
914
914
|
("force", False),
|
|
915
|
-
("
|
|
915
|
+
("cascade", False),
|
|
916
916
|
("volumes", [self.volumes[0].id]),
|
|
917
917
|
]
|
|
918
918
|
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
@@ -931,7 +931,7 @@ class TestVolumeDelete(volume_fakes.TestVolume):
|
|
|
931
931
|
arglist = [v.id for v in self.volumes]
|
|
932
932
|
verifylist = [
|
|
933
933
|
('force', False),
|
|
934
|
-
('
|
|
934
|
+
('cascade', False),
|
|
935
935
|
('volumes', arglist),
|
|
936
936
|
]
|
|
937
937
|
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
@@ -958,7 +958,7 @@ class TestVolumeDelete(volume_fakes.TestVolume):
|
|
|
958
958
|
]
|
|
959
959
|
verifylist = [
|
|
960
960
|
('force', False),
|
|
961
|
-
('
|
|
961
|
+
('cascade', False),
|
|
962
962
|
('volumes', [self.volumes[0].id, 'unexist_volume']),
|
|
963
963
|
]
|
|
964
964
|
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
@@ -989,7 +989,29 @@ class TestVolumeDelete(volume_fakes.TestVolume):
|
|
|
989
989
|
]
|
|
990
990
|
verifylist = [
|
|
991
991
|
('force', False),
|
|
992
|
-
('
|
|
992
|
+
('cascade', True),
|
|
993
|
+
('volumes', [self.volumes[0].id]),
|
|
994
|
+
]
|
|
995
|
+
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
996
|
+
|
|
997
|
+
result = self.cmd.take_action(parsed_args)
|
|
998
|
+
self.assertIsNone(result)
|
|
999
|
+
|
|
1000
|
+
self.volume_sdk_client.find_volume.assert_called_once_with(
|
|
1001
|
+
self.volumes[0].id, ignore_missing=False
|
|
1002
|
+
)
|
|
1003
|
+
self.volume_sdk_client.delete_volume.assert_called_once_with(
|
|
1004
|
+
self.volumes[0].id, cascade=True, force=False
|
|
1005
|
+
)
|
|
1006
|
+
|
|
1007
|
+
def test_volume_delete_with_cascade(self):
|
|
1008
|
+
arglist = [
|
|
1009
|
+
'--cascade',
|
|
1010
|
+
self.volumes[0].id,
|
|
1011
|
+
]
|
|
1012
|
+
verifylist = [
|
|
1013
|
+
('force', False),
|
|
1014
|
+
('cascade', True),
|
|
993
1015
|
('volumes', [self.volumes[0].id]),
|
|
994
1016
|
]
|
|
995
1017
|
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
@@ -1011,7 +1033,7 @@ class TestVolumeDelete(volume_fakes.TestVolume):
|
|
|
1011
1033
|
]
|
|
1012
1034
|
verifylist = [
|
|
1013
1035
|
('force', True),
|
|
1014
|
-
('
|
|
1036
|
+
('cascade', False),
|
|
1015
1037
|
('volumes', [self.volumes[0].id]),
|
|
1016
1038
|
]
|
|
1017
1039
|
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
@@ -1031,7 +1053,7 @@ class TestVolumeDelete(volume_fakes.TestVolume):
|
|
|
1031
1053
|
verifylist = [
|
|
1032
1054
|
("remote", True),
|
|
1033
1055
|
("force", False),
|
|
1034
|
-
("
|
|
1056
|
+
("cascade", False),
|
|
1035
1057
|
("volumes", [self.volumes[0].id]),
|
|
1036
1058
|
]
|
|
1037
1059
|
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
@@ -1052,7 +1074,7 @@ class TestVolumeDelete(volume_fakes.TestVolume):
|
|
|
1052
1074
|
verifylist = [
|
|
1053
1075
|
('remote', True),
|
|
1054
1076
|
('force', False),
|
|
1055
|
-
('
|
|
1077
|
+
('cascade', False),
|
|
1056
1078
|
('volumes', arglist[1:]),
|
|
1057
1079
|
]
|
|
1058
1080
|
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
@@ -1077,7 +1099,6 @@ class TestVolumeDelete(volume_fakes.TestVolume):
|
|
|
1077
1099
|
verifylist = [
|
|
1078
1100
|
('remote', True),
|
|
1079
1101
|
('force', False),
|
|
1080
|
-
('purge', True),
|
|
1081
1102
|
('volumes', [self.volumes[0].id]),
|
|
1082
1103
|
]
|
|
1083
1104
|
|
|
@@ -1086,7 +1107,7 @@ class TestVolumeDelete(volume_fakes.TestVolume):
|
|
|
1086
1107
|
exceptions.CommandError, self.cmd.take_action, parsed_args
|
|
1087
1108
|
)
|
|
1088
1109
|
self.assertIn(
|
|
1089
|
-
"The --force and --
|
|
1110
|
+
"The --force and --cascade options are not supported with the "
|
|
1090
1111
|
"--remote parameter.",
|
|
1091
1112
|
str(exc),
|
|
1092
1113
|
)
|
|
@@ -1104,7 +1125,7 @@ class TestVolumeDelete(volume_fakes.TestVolume):
|
|
|
1104
1125
|
verifylist = [
|
|
1105
1126
|
('remote', True),
|
|
1106
1127
|
('force', True),
|
|
1107
|
-
('
|
|
1128
|
+
('cascade', False),
|
|
1108
1129
|
('volumes', [self.volumes[0].id]),
|
|
1109
1130
|
]
|
|
1110
1131
|
|
|
@@ -1113,7 +1134,7 @@ class TestVolumeDelete(volume_fakes.TestVolume):
|
|
|
1113
1134
|
exceptions.CommandError, self.cmd.take_action, parsed_args
|
|
1114
1135
|
)
|
|
1115
1136
|
self.assertIn(
|
|
1116
|
-
"The --force and --
|
|
1137
|
+
"The --force and --cascade options are not supported with the "
|
|
1117
1138
|
"--remote parameter.",
|
|
1118
1139
|
str(exc),
|
|
1119
1140
|
)
|
|
@@ -1998,7 +2019,8 @@ class TestVolumeSet(volume_fakes.TestVolume):
|
|
|
1998
2019
|
result = self.cmd.take_action(parsed_args)
|
|
1999
2020
|
self.volumes_mock.retype.assert_not_called()
|
|
2000
2021
|
mock_warning.assert_called_with(
|
|
2001
|
-
"'
|
|
2022
|
+
"'%s' option will not work without '--type' option",
|
|
2023
|
+
'--retype-policy',
|
|
2002
2024
|
)
|
|
2003
2025
|
self.assertIsNone(result)
|
|
2004
2026
|
|
|
@@ -38,8 +38,8 @@ def _find_volumes(parsed_args_volumes, volume_client):
|
|
|
38
38
|
except Exception as e:
|
|
39
39
|
result += 1
|
|
40
40
|
LOG.error(
|
|
41
|
-
_("Failed to find volume with name or ID '%(volume)s':%(e)s")
|
|
42
|
-
|
|
41
|
+
_("Failed to find volume with name or ID '%(volume)s':%(e)s"),
|
|
42
|
+
{'volume': volume, 'e': e},
|
|
43
43
|
)
|
|
44
44
|
|
|
45
45
|
return result, uuid
|
|
@@ -73,8 +73,8 @@ class AddVolumeToConsistencyGroup(command.Command):
|
|
|
73
73
|
if result > 0:
|
|
74
74
|
total = len(parsed_args.volumes)
|
|
75
75
|
LOG.error(
|
|
76
|
-
_("%(result)s of %(total)s volumes failed to add.")
|
|
77
|
-
|
|
76
|
+
_("%(result)s of %(total)s volumes failed to add."),
|
|
77
|
+
{'result': result, 'total': total},
|
|
78
78
|
)
|
|
79
79
|
|
|
80
80
|
if add_uuid:
|
|
@@ -226,8 +226,8 @@ class DeleteConsistencyGroup(command.Command):
|
|
|
226
226
|
_(
|
|
227
227
|
"Failed to delete consistency group with "
|
|
228
228
|
"name or ID '%(consistency_group)s':%(e)s"
|
|
229
|
-
)
|
|
230
|
-
|
|
229
|
+
),
|
|
230
|
+
{'consistency_group': i, 'e': e},
|
|
231
231
|
)
|
|
232
232
|
|
|
233
233
|
if result > 0:
|
|
@@ -317,8 +317,8 @@ class RemoveVolumeFromConsistencyGroup(command.Command):
|
|
|
317
317
|
if result > 0:
|
|
318
318
|
total = len(parsed_args.volumes)
|
|
319
319
|
LOG.error(
|
|
320
|
-
_("%(result)s of %(total)s volumes failed to remove.")
|
|
321
|
-
|
|
320
|
+
_("%(result)s of %(total)s volumes failed to remove."),
|
|
321
|
+
{'result': result, 'total': total},
|
|
322
322
|
)
|
|
323
323
|
|
|
324
324
|
if remove_uuid:
|
|
@@ -101,8 +101,8 @@ class DeleteConsistencyGroupSnapshot(command.Command):
|
|
|
101
101
|
_(
|
|
102
102
|
"Failed to delete consistency group snapshot "
|
|
103
103
|
"with name or ID '%(snapshot)s': %(e)s"
|
|
104
|
-
)
|
|
105
|
-
|
|
104
|
+
),
|
|
105
|
+
{'snapshot': snapshot, 'e': e},
|
|
106
106
|
)
|
|
107
107
|
|
|
108
108
|
if result > 0:
|
|
@@ -390,12 +390,19 @@ class DeleteVolume(command.Command):
|
|
|
390
390
|
),
|
|
391
391
|
)
|
|
392
392
|
group.add_argument(
|
|
393
|
-
"--
|
|
393
|
+
"--cascade",
|
|
394
394
|
action="store_true",
|
|
395
395
|
help=_(
|
|
396
396
|
"Remove any snapshots along with volume(s) (defaults to False)"
|
|
397
397
|
),
|
|
398
398
|
)
|
|
399
|
+
group.add_argument(
|
|
400
|
+
# now called "cascade", accept old arg for compatibility
|
|
401
|
+
"--purge",
|
|
402
|
+
action="store_true",
|
|
403
|
+
help=argparse.SUPPRESS,
|
|
404
|
+
dest='cascade',
|
|
405
|
+
)
|
|
399
406
|
return parser
|
|
400
407
|
|
|
401
408
|
def take_action(self, parsed_args):
|
|
@@ -410,7 +417,7 @@ class DeleteVolume(command.Command):
|
|
|
410
417
|
volume_client.delete_volume(
|
|
411
418
|
volume_obj.id,
|
|
412
419
|
force=parsed_args.force,
|
|
413
|
-
cascade=parsed_args.
|
|
420
|
+
cascade=parsed_args.cascade,
|
|
414
421
|
)
|
|
415
422
|
except Exception as e:
|
|
416
423
|
result += 1
|
|
@@ -910,12 +917,12 @@ class SetVolume(command.Command):
|
|
|
910
917
|
elif policy:
|
|
911
918
|
# If the "--migration-policy" is specified without "--type"
|
|
912
919
|
LOG.warning(
|
|
913
|
-
_("'%s' option will not work without '--type' option")
|
|
914
|
-
|
|
920
|
+
_("'%s' option will not work without '--type' option"),
|
|
921
|
+
(
|
|
915
922
|
'--migration-policy'
|
|
916
923
|
if parsed_args.migration_policy
|
|
917
924
|
else '--retype-policy'
|
|
918
|
-
)
|
|
925
|
+
),
|
|
919
926
|
)
|
|
920
927
|
|
|
921
928
|
kwargs = {}
|
|
@@ -277,7 +277,7 @@ class CreateVolumeType(command.ShowOne):
|
|
|
277
277
|
msg = _(
|
|
278
278
|
"Failed to add project %(project)s access to type: %(e)s"
|
|
279
279
|
)
|
|
280
|
-
LOG.error(msg
|
|
280
|
+
LOG.error(msg, {'project': parsed_args.project, 'e': e})
|
|
281
281
|
|
|
282
282
|
properties = {}
|
|
283
283
|
if parsed_args.properties:
|
|
@@ -358,8 +358,8 @@ class DeleteVolumeType(command.Command):
|
|
|
358
358
|
_(
|
|
359
359
|
"Failed to delete volume type with "
|
|
360
360
|
"name or ID '%(volume_type)s': %(e)s"
|
|
361
|
-
)
|
|
362
|
-
|
|
361
|
+
),
|
|
362
|
+
{'volume_type': volume_type, 'e': e},
|
|
363
363
|
)
|
|
364
364
|
|
|
365
365
|
if result > 0:
|
|
@@ -466,7 +466,7 @@ class ListVolumeType(command.Lister):
|
|
|
466
466
|
_EncryptionInfoColumn = functools.partial(
|
|
467
467
|
EncryptionInfoColumn, encryption_data=encryption
|
|
468
468
|
)
|
|
469
|
-
formatters['id'] = _EncryptionInfoColumn
|
|
469
|
+
formatters['id'] = _EncryptionInfoColumn # type: ignore
|
|
470
470
|
|
|
471
471
|
return (
|
|
472
472
|
column_headers,
|
|
@@ -763,7 +763,7 @@ class ShowVolumeType(command.ShowOne):
|
|
|
763
763
|
'Failed to get access project list for volume type '
|
|
764
764
|
'%(type)s: %(e)s'
|
|
765
765
|
)
|
|
766
|
-
LOG.error(msg
|
|
766
|
+
LOG.error(msg, {'type': volume_type.id, 'e': e})
|
|
767
767
|
volume_type._info.update({'access_project_ids': access_project_ids})
|
|
768
768
|
if parsed_args.encryption_type:
|
|
769
769
|
# show encryption type information for this volume type
|
|
@@ -515,12 +515,19 @@ class DeleteVolume(command.Command):
|
|
|
515
515
|
),
|
|
516
516
|
)
|
|
517
517
|
group.add_argument(
|
|
518
|
-
"--
|
|
518
|
+
"--cascade",
|
|
519
519
|
action="store_true",
|
|
520
520
|
help=_(
|
|
521
521
|
"Remove any snapshots along with volume(s) (defaults to False)"
|
|
522
522
|
),
|
|
523
523
|
)
|
|
524
|
+
group.add_argument(
|
|
525
|
+
# now called "cascade", accept old arg for compatibility
|
|
526
|
+
"--purge",
|
|
527
|
+
action="store_true",
|
|
528
|
+
help=argparse.SUPPRESS,
|
|
529
|
+
dest='cascade',
|
|
530
|
+
)
|
|
524
531
|
parser.add_argument(
|
|
525
532
|
'--remote',
|
|
526
533
|
action='store_true',
|
|
@@ -532,9 +539,9 @@ class DeleteVolume(command.Command):
|
|
|
532
539
|
volume_client = self.app.client_manager.sdk_connection.volume
|
|
533
540
|
result = 0
|
|
534
541
|
|
|
535
|
-
if parsed_args.remote and (parsed_args.force or parsed_args.
|
|
542
|
+
if parsed_args.remote and (parsed_args.force or parsed_args.cascade):
|
|
536
543
|
msg = _(
|
|
537
|
-
"The --force and --
|
|
544
|
+
"The --force and --cascade options are not "
|
|
538
545
|
"supported with the --remote parameter."
|
|
539
546
|
)
|
|
540
547
|
raise exceptions.CommandError(msg)
|
|
@@ -550,7 +557,7 @@ class DeleteVolume(command.Command):
|
|
|
550
557
|
volume_client.delete_volume(
|
|
551
558
|
volume_obj.id,
|
|
552
559
|
force=parsed_args.force,
|
|
553
|
-
cascade=parsed_args.
|
|
560
|
+
cascade=parsed_args.cascade,
|
|
554
561
|
)
|
|
555
562
|
except Exception as e:
|
|
556
563
|
result += 1
|
|
@@ -1071,12 +1078,12 @@ class SetVolume(command.Command):
|
|
|
1071
1078
|
elif policy:
|
|
1072
1079
|
# If the "--migration-policy" is specified without "--type"
|
|
1073
1080
|
LOG.warning(
|
|
1074
|
-
_("'%s' option will not work without '--type' option")
|
|
1075
|
-
|
|
1081
|
+
_("'%s' option will not work without '--type' option"),
|
|
1082
|
+
(
|
|
1076
1083
|
'--migration-policy'
|
|
1077
1084
|
if parsed_args.migration_policy
|
|
1078
1085
|
else '--retype-policy'
|
|
1079
|
-
)
|
|
1086
|
+
),
|
|
1080
1087
|
)
|
|
1081
1088
|
|
|
1082
1089
|
kwargs = {}
|
|
@@ -277,7 +277,7 @@ class CreateVolumeType(command.ShowOne):
|
|
|
277
277
|
msg = _(
|
|
278
278
|
"Failed to add project %(project)s access to type: %(e)s"
|
|
279
279
|
)
|
|
280
|
-
LOG.error(msg
|
|
280
|
+
LOG.error(msg, {'project': parsed_args.project, 'e': e})
|
|
281
281
|
|
|
282
282
|
properties = {}
|
|
283
283
|
if parsed_args.properties:
|
|
@@ -358,8 +358,8 @@ class DeleteVolumeType(command.Command):
|
|
|
358
358
|
_(
|
|
359
359
|
"Failed to delete volume type with "
|
|
360
360
|
"name or ID '%(volume_type)s': %(e)s"
|
|
361
|
-
)
|
|
362
|
-
|
|
361
|
+
),
|
|
362
|
+
{'volume_type': volume_type, 'e': e},
|
|
363
363
|
)
|
|
364
364
|
|
|
365
365
|
if result > 0:
|
|
@@ -549,7 +549,7 @@ class ListVolumeType(command.Lister):
|
|
|
549
549
|
_EncryptionInfoColumn = functools.partial(
|
|
550
550
|
EncryptionInfoColumn, encryption_data=encryption
|
|
551
551
|
)
|
|
552
|
-
formatters['id'] = _EncryptionInfoColumn
|
|
552
|
+
formatters['id'] = _EncryptionInfoColumn # type: ignore
|
|
553
553
|
|
|
554
554
|
return (
|
|
555
555
|
column_headers,
|
|
@@ -846,7 +846,7 @@ class ShowVolumeType(command.ShowOne):
|
|
|
846
846
|
'Failed to get access project list for volume type '
|
|
847
847
|
'%(type)s: %(e)s'
|
|
848
848
|
)
|
|
849
|
-
LOG.error(msg
|
|
849
|
+
LOG.error(msg, {'type': volume_type.id, 'e': e})
|
|
850
850
|
volume_type._info.update({'access_project_ids': access_project_ids})
|
|
851
851
|
if parsed_args.encryption_type:
|
|
852
852
|
# show encryption type information for this volume type
|