python-openstackclient 7.4.0__py3-none-any.whl → 8.1.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/availability_zone.py +3 -6
- openstackclient/common/clientmanager.py +2 -1
- openstackclient/common/envvars.py +57 -0
- openstackclient/common/extension.py +3 -11
- openstackclient/common/limits.py +1 -1
- openstackclient/common/project_cleanup.py +3 -2
- openstackclient/common/quota.py +54 -28
- openstackclient/compute/client.py +7 -5
- openstackclient/compute/v2/agent.py +5 -5
- openstackclient/compute/v2/aggregate.py +17 -15
- openstackclient/compute/v2/console.py +10 -4
- openstackclient/compute/v2/console_connection.py +48 -0
- openstackclient/compute/v2/flavor.py +14 -18
- openstackclient/compute/v2/host.py +3 -3
- openstackclient/compute/v2/hypervisor.py +10 -4
- openstackclient/compute/v2/hypervisor_stats.py +1 -1
- openstackclient/compute/v2/keypair.py +18 -13
- openstackclient/compute/v2/server.py +144 -121
- openstackclient/compute/v2/server_backup.py +1 -1
- openstackclient/compute/v2/server_event.py +8 -17
- openstackclient/compute/v2/server_group.py +6 -6
- openstackclient/compute/v2/server_image.py +1 -1
- openstackclient/compute/v2/server_migration.py +6 -6
- openstackclient/compute/v2/server_volume.py +4 -4
- openstackclient/compute/v2/service.py +9 -13
- openstackclient/compute/v2/usage.py +4 -6
- openstackclient/identity/client.py +2 -4
- openstackclient/identity/common.py +95 -17
- openstackclient/identity/v2_0/ec2creds.py +4 -3
- openstackclient/identity/v2_0/endpoint.py +12 -10
- openstackclient/identity/v2_0/project.py +6 -6
- openstackclient/identity/v2_0/role.py +1 -1
- openstackclient/identity/v2_0/service.py +7 -7
- openstackclient/identity/v2_0/user.py +6 -21
- openstackclient/identity/v3/access_rule.py +2 -5
- openstackclient/identity/v3/application_credential.py +2 -2
- openstackclient/identity/v3/consumer.py +4 -3
- openstackclient/identity/v3/credential.py +6 -7
- openstackclient/identity/v3/domain.py +63 -44
- openstackclient/identity/v3/ec2creds.py +4 -3
- openstackclient/identity/v3/endpoint.py +104 -88
- openstackclient/identity/v3/endpoint_group.py +1 -1
- openstackclient/identity/v3/group.py +116 -72
- openstackclient/identity/v3/identity_provider.py +1 -2
- openstackclient/identity/v3/limit.py +4 -9
- openstackclient/identity/v3/mapping.py +4 -3
- openstackclient/identity/v3/policy.py +5 -8
- openstackclient/identity/v3/project.py +23 -6
- openstackclient/identity/v3/region.py +2 -5
- openstackclient/identity/v3/registered_limit.py +4 -8
- openstackclient/identity/v3/role.py +15 -16
- openstackclient/identity/v3/service.py +8 -8
- openstackclient/identity/v3/service_provider.py +3 -6
- openstackclient/identity/v3/tag.py +2 -2
- openstackclient/identity/v3/token.py +1 -2
- openstackclient/identity/v3/trust.py +74 -25
- openstackclient/identity/v3/user.py +47 -11
- openstackclient/image/client.py +7 -5
- openstackclient/image/v1/image.py +11 -15
- openstackclient/image/v2/cache.py +2 -4
- openstackclient/image/v2/image.py +41 -48
- openstackclient/image/v2/metadef_namespaces.py +4 -3
- openstackclient/image/v2/metadef_resource_type_association.py +1 -2
- openstackclient/image/v2/metadef_resource_types.py +1 -2
- openstackclient/locale/tr_TR/LC_MESSAGES/openstackclient.po +9 -1370
- openstackclient/network/client.py +4 -16
- openstackclient/network/common.py +16 -12
- openstackclient/network/utils.py +3 -3
- openstackclient/network/v2/address_group.py +5 -9
- openstackclient/network/v2/address_scope.py +2 -3
- openstackclient/network/v2/default_security_group_rule.py +1 -2
- openstackclient/network/v2/floating_ip.py +69 -47
- openstackclient/network/v2/floating_ip_port_forwarding.py +7 -7
- openstackclient/network/v2/ip_availability.py +1 -2
- openstackclient/network/v2/l3_conntrack_helper.py +8 -12
- openstackclient/network/v2/local_ip.py +24 -26
- openstackclient/network/v2/local_ip_association.py +4 -5
- openstackclient/network/v2/ndp_proxy.py +9 -10
- openstackclient/network/v2/network.py +12 -16
- openstackclient/network/v2/network_agent.py +29 -37
- openstackclient/network/v2/network_auto_allocated_topology.py +4 -5
- openstackclient/network/v2/network_flavor.py +1 -1
- openstackclient/network/v2/network_flavor_profile.py +5 -5
- openstackclient/network/v2/network_meter.py +3 -3
- openstackclient/network/v2/network_meter_rule.py +5 -8
- openstackclient/network/v2/network_qos_policy.py +4 -4
- openstackclient/network/v2/network_qos_rule.py +7 -16
- openstackclient/network/v2/network_rbac.py +4 -4
- openstackclient/network/v2/network_segment.py +6 -7
- openstackclient/network/v2/network_segment_range.py +16 -20
- openstackclient/network/v2/network_trunk.py +24 -16
- openstackclient/network/v2/port.py +28 -29
- openstackclient/network/v2/router.py +53 -42
- openstackclient/network/v2/security_group.py +13 -19
- openstackclient/network/v2/security_group_rule.py +10 -11
- openstackclient/network/v2/subnet.py +31 -30
- openstackclient/network/v2/subnet_pool.py +4 -4
- openstackclient/object/client.py +2 -3
- openstackclient/object/v1/container.py +2 -3
- openstackclient/object/v1/object.py +2 -9
- openstackclient/shell.py +22 -5
- openstackclient/tests/functional/base.py +7 -3
- openstackclient/tests/functional/common/test_quota.py +3 -1
- openstackclient/tests/functional/compute/v2/common.py +12 -6
- openstackclient/tests/functional/compute/v2/test_keypair.py +41 -5
- openstackclient/tests/functional/compute/v2/test_server.py +2 -3
- openstackclient/tests/functional/compute/v2/test_server_event.py +1 -1
- openstackclient/tests/functional/identity/v2/test_user.py +1 -1
- openstackclient/tests/functional/identity/v3/common.py +3 -8
- openstackclient/tests/functional/identity/v3/test_application_credential.py +10 -10
- openstackclient/tests/functional/identity/v3/test_endpoint.py +3 -3
- openstackclient/tests/functional/identity/v3/test_group.py +3 -3
- openstackclient/tests/functional/identity/v3/test_idp.py +3 -7
- openstackclient/tests/functional/identity/v3/test_limit.py +4 -4
- openstackclient/tests/functional/identity/v3/test_project.py +5 -14
- openstackclient/tests/functional/identity/v3/test_region.py +1 -3
- openstackclient/tests/functional/identity/v3/test_registered_limit.py +3 -3
- openstackclient/tests/functional/identity/v3/test_role.py +1 -1
- openstackclient/tests/functional/identity/v3/test_role_assignment.py +13 -31
- openstackclient/tests/functional/identity/v3/test_service_provider.py +3 -7
- openstackclient/tests/functional/identity/v3/test_user.py +8 -8
- openstackclient/tests/functional/network/v2/common.py +7 -3
- openstackclient/tests/functional/network/v2/test_address_group.py +4 -0
- openstackclient/tests/functional/network/v2/test_l3_conntrack_helper.py +15 -11
- openstackclient/tests/functional/network/v2/test_local_ip.py +4 -0
- openstackclient/tests/functional/network/v2/test_network_meter_rule.py +2 -2
- openstackclient/tests/functional/network/v2/test_network_ndp_proxy.py +2 -3
- openstackclient/tests/functional/network/v2/test_network_rbac.py +2 -2
- openstackclient/tests/functional/network/v2/test_network_trunk.py +1 -1
- openstackclient/tests/functional/network/v2/test_port.py +17 -7
- openstackclient/tests/functional/network/v2/test_router.py +42 -0
- openstackclient/tests/functional/network/v2/test_subnet_pool.py +4 -0
- openstackclient/tests/unit/api/test_compute_v2.py +67 -87
- openstackclient/tests/unit/common/test_availability_zone.py +6 -14
- openstackclient/tests/unit/common/test_command.py +1 -1
- openstackclient/tests/unit/common/test_extension.py +5 -7
- openstackclient/tests/unit/common/test_limits.py +1 -1
- openstackclient/tests/unit/common/test_project_cleanup.py +5 -6
- openstackclient/tests/unit/common/test_quota.py +51 -28
- openstackclient/tests/unit/compute/v2/fakes.py +85 -315
- openstackclient/tests/unit/compute/v2/test_agent.py +16 -16
- openstackclient/tests/unit/compute/v2/test_aggregate.py +56 -60
- openstackclient/tests/unit/compute/v2/test_console.py +34 -17
- openstackclient/tests/unit/compute/v2/test_console_connection.py +72 -0
- openstackclient/tests/unit/compute/v2/test_flavor.py +72 -72
- openstackclient/tests/unit/compute/v2/test_host.py +8 -8
- openstackclient/tests/unit/compute/v2/test_hypervisor.py +22 -30
- openstackclient/tests/unit/compute/v2/test_hypervisor_stats.py +2 -2
- openstackclient/tests/unit/compute/v2/test_keypair.py +36 -29
- openstackclient/tests/unit/compute/v2/test_server.py +693 -606
- openstackclient/tests/unit/compute/v2/test_server_backup.py +36 -77
- openstackclient/tests/unit/compute/v2/test_server_event.py +18 -20
- openstackclient/tests/unit/compute/v2/test_server_group.py +25 -31
- openstackclient/tests/unit/compute/v2/test_server_image.py +37 -78
- openstackclient/tests/unit/compute/v2/test_server_migration.py +41 -41
- openstackclient/tests/unit/compute/v2/test_server_volume.py +12 -12
- openstackclient/tests/unit/compute/v2/test_service.py +39 -45
- openstackclient/tests/unit/compute/v2/test_usage.py +5 -5
- openstackclient/tests/unit/identity/v2_0/fakes.py +1 -1
- openstackclient/tests/unit/identity/v3/test_access_rule.py +1 -3
- openstackclient/tests/unit/identity/v3/test_application_credential.py +48 -26
- openstackclient/tests/unit/identity/v3/test_domain.py +115 -105
- openstackclient/tests/unit/identity/v3/test_endpoint.py +167 -172
- openstackclient/tests/unit/identity/v3/test_group.py +353 -202
- openstackclient/tests/unit/identity/v3/test_mappings.py +2 -2
- openstackclient/tests/unit/identity/v3/test_project.py +16 -0
- openstackclient/tests/unit/identity/v3/test_trust.py +5 -2
- openstackclient/tests/unit/identity/v3/test_user.py +102 -6
- openstackclient/tests/unit/image/v1/fakes.py +2 -2
- openstackclient/tests/unit/image/v1/test_image.py +8 -9
- openstackclient/tests/unit/image/v2/test_image.py +84 -46
- openstackclient/tests/unit/integ/cli/test_shell.py +1 -2
- openstackclient/tests/unit/network/test_common.py +2 -2
- openstackclient/tests/unit/network/v2/fakes.py +405 -485
- openstackclient/tests/unit/network/v2/test_floating_ip_compute.py +8 -14
- openstackclient/tests/unit/network/v2/test_floating_ip_network.py +62 -54
- openstackclient/tests/unit/network/v2/test_floating_ip_pool_compute.py +1 -1
- openstackclient/tests/unit/network/v2/test_l3_conntrack_helper.py +2 -2
- openstackclient/tests/unit/network/v2/test_ndp_proxy.py +1 -3
- openstackclient/tests/unit/network/v2/test_network.py +4 -4
- openstackclient/tests/unit/network/v2/test_network_agent.py +15 -29
- openstackclient/tests/unit/network/v2/test_network_compute.py +11 -11
- openstackclient/tests/unit/network/v2/test_network_qos_policy.py +16 -19
- openstackclient/tests/unit/network/v2/test_network_qos_rule.py +79 -152
- openstackclient/tests/unit/network/v2/test_network_qos_rule_type.py +4 -6
- openstackclient/tests/unit/network/v2/test_network_rbac.py +2 -2
- openstackclient/tests/unit/network/v2/test_network_trunk.py +2 -2
- openstackclient/tests/unit/network/v2/test_port.py +21 -22
- openstackclient/tests/unit/network/v2/test_router.py +130 -51
- openstackclient/tests/unit/network/v2/test_security_group_compute.py +11 -19
- openstackclient/tests/unit/network/v2/test_security_group_network.py +25 -27
- openstackclient/tests/unit/network/v2/test_security_group_rule_compute.py +15 -17
- openstackclient/tests/unit/network/v2/test_security_group_rule_network.py +33 -39
- openstackclient/tests/unit/object/v1/test_object_all.py +4 -3
- openstackclient/tests/unit/test_shell.py +16 -13
- openstackclient/tests/unit/volume/v2/fakes.py +1 -2
- openstackclient/tests/unit/volume/v2/test_service.py +57 -91
- openstackclient/tests/unit/volume/v2/test_volume.py +109 -106
- openstackclient/tests/unit/volume/v2/test_volume_backup.py +141 -148
- openstackclient/tests/unit/volume/v2/test_volume_snapshot.py +293 -283
- openstackclient/tests/unit/volume/v2/test_volume_transfer_request.py +1 -1
- openstackclient/tests/unit/volume/v3/fakes.py +2 -8
- openstackclient/tests/unit/volume/v3/test_block_storage_log_level.py +61 -71
- openstackclient/tests/unit/volume/v3/test_service.py +221 -141
- openstackclient/tests/unit/volume/v3/test_volume.py +131 -120
- openstackclient/tests/unit/volume/v3/test_volume_attachment.py +4 -4
- openstackclient/tests/unit/volume/v3/test_volume_backup.py +198 -203
- openstackclient/tests/unit/volume/v3/test_volume_snapshot.py +683 -49
- openstackclient/tests/unit/volume/v3/test_volume_transfer_request.py +1 -1
- openstackclient/volume/client.py +1 -3
- openstackclient/volume/v2/consistency_group.py +4 -8
- openstackclient/volume/v2/consistency_group_snapshot.py +1 -2
- openstackclient/volume/v2/qos_specs.py +1 -2
- openstackclient/volume/v2/service.py +41 -38
- openstackclient/volume/v2/volume.py +71 -53
- openstackclient/volume/v2/volume_backup.py +15 -10
- openstackclient/volume/v2/volume_snapshot.py +129 -93
- openstackclient/volume/v2/volume_transfer_request.py +0 -3
- openstackclient/volume/v2/volume_type.py +10 -21
- openstackclient/volume/v3/block_storage_cluster.py +3 -3
- openstackclient/volume/v3/block_storage_log_level.py +22 -28
- openstackclient/volume/v3/block_storage_manage.py +1 -3
- openstackclient/volume/v3/service.py +105 -14
- openstackclient/volume/v3/volume.py +218 -58
- openstackclient/volume/v3/volume_attachment.py +3 -2
- openstackclient/volume/v3/volume_backup.py +31 -27
- openstackclient/volume/v3/volume_group.py +2 -1
- openstackclient/volume/v3/volume_group_snapshot.py +2 -1
- openstackclient/volume/v3/volume_snapshot.py +489 -13
- openstackclient/volume/v3/volume_type.py +10 -21
- {python_openstackclient-7.4.0.dist-info → python_openstackclient-8.1.0.dist-info}/AUTHORS +11 -0
- python_openstackclient-8.1.0.dist-info/METADATA +264 -0
- {python_openstackclient-7.4.0.dist-info → python_openstackclient-8.1.0.dist-info}/RECORD +238 -259
- {python_openstackclient-7.4.0.dist-info → python_openstackclient-8.1.0.dist-info}/WHEEL +1 -1
- {python_openstackclient-7.4.0.dist-info → python_openstackclient-8.1.0.dist-info}/entry_points.txt +7 -47
- python_openstackclient-8.1.0.dist-info/pbr.json +1 -0
- openstackclient/tests/functional/volume/v1/__init__.py +0 -0
- openstackclient/tests/functional/volume/v1/common.py +0 -35
- openstackclient/tests/functional/volume/v1/test_qos.py +0 -100
- openstackclient/tests/functional/volume/v1/test_service.py +0 -76
- openstackclient/tests/functional/volume/v1/test_snapshot.py +0 -232
- openstackclient/tests/functional/volume/v1/test_transfer_request.py +0 -111
- openstackclient/tests/functional/volume/v1/test_volume.py +0 -228
- openstackclient/tests/functional/volume/v1/test_volume_type.py +0 -213
- openstackclient/tests/unit/volume/v1/__init__.py +0 -0
- openstackclient/tests/unit/volume/v1/fakes.py +0 -615
- openstackclient/tests/unit/volume/v1/test_qos_specs.py +0 -471
- openstackclient/tests/unit/volume/v1/test_service.py +0 -295
- openstackclient/tests/unit/volume/v1/test_transfer_request.py +0 -380
- openstackclient/tests/unit/volume/v1/test_type.py +0 -633
- openstackclient/tests/unit/volume/v1/test_volume.py +0 -1447
- openstackclient/tests/unit/volume/v1/test_volume_backup.py +0 -435
- openstackclient/volume/v1/__init__.py +0 -0
- openstackclient/volume/v1/qos_specs.py +0 -377
- openstackclient/volume/v1/service.py +0 -136
- openstackclient/volume/v1/volume.py +0 -734
- openstackclient/volume/v1/volume_backup.py +0 -302
- openstackclient/volume/v1/volume_snapshot.py +0 -433
- openstackclient/volume/v1/volume_transfer_request.py +0 -200
- openstackclient/volume/v1/volume_type.py +0 -520
- python_openstackclient-7.4.0.dist-info/METADATA +0 -172
- python_openstackclient-7.4.0.dist-info/pbr.json +0 -1
- {python_openstackclient-7.4.0.dist-info → python_openstackclient-8.1.0.dist-info}/LICENSE +0 -0
- {python_openstackclient-7.4.0.dist-info → python_openstackclient-8.1.0.dist-info}/top_level.txt +0 -0
|
@@ -284,7 +284,7 @@ class TestTransferDelete(TestTransfer):
|
|
|
284
284
|
self.fail('CommandError should be raised.')
|
|
285
285
|
except exceptions.CommandError as e:
|
|
286
286
|
self.assertEqual(
|
|
287
|
-
'1 of 2 volume transfer requests failed
|
|
287
|
+
'1 of 2 volume transfer requests failed to delete',
|
|
288
288
|
str(e),
|
|
289
289
|
)
|
|
290
290
|
|
openstackclient/volume/client.py
CHANGED
|
@@ -105,9 +105,7 @@ def build_option_parser(parser):
|
|
|
105
105
|
'--os-volume-api-version',
|
|
106
106
|
metavar='<volume-api-version>',
|
|
107
107
|
default=utils.env('OS_VOLUME_API_VERSION'),
|
|
108
|
-
help=_(
|
|
109
|
-
'Volume API version, default=%s ' '(Env: OS_VOLUME_API_VERSION)'
|
|
110
|
-
)
|
|
108
|
+
help=_('Volume API version, default=%s (Env: OS_VOLUME_API_VERSION)')
|
|
111
109
|
% DEFAULT_API_VERSION,
|
|
112
110
|
)
|
|
113
111
|
return parser
|
|
@@ -38,10 +38,7 @@ def _find_volumes(parsed_args_volumes, volume_client):
|
|
|
38
38
|
except Exception as e:
|
|
39
39
|
result += 1
|
|
40
40
|
LOG.error(
|
|
41
|
-
_(
|
|
42
|
-
"Failed to find volume with "
|
|
43
|
-
"name or ID '%(volume)s':%(e)s"
|
|
44
|
-
)
|
|
41
|
+
_("Failed to find volume with name or ID '%(volume)s':%(e)s")
|
|
45
42
|
% {'volume': volume, 'e': e}
|
|
46
43
|
)
|
|
47
44
|
|
|
@@ -76,7 +73,7 @@ class AddVolumeToConsistencyGroup(command.Command):
|
|
|
76
73
|
if result > 0:
|
|
77
74
|
total = len(parsed_args.volumes)
|
|
78
75
|
LOG.error(
|
|
79
|
-
_("%(result)s of %(total)s volumes failed
|
|
76
|
+
_("%(result)s of %(total)s volumes failed to add.")
|
|
80
77
|
% {'result': result, 'total': total}
|
|
81
78
|
)
|
|
82
79
|
|
|
@@ -236,8 +233,7 @@ class DeleteConsistencyGroup(command.Command):
|
|
|
236
233
|
if result > 0:
|
|
237
234
|
total = len(parsed_args.consistency_groups)
|
|
238
235
|
msg = _(
|
|
239
|
-
"%(result)s of %(total)s consistency groups failed "
|
|
240
|
-
"to delete."
|
|
236
|
+
"%(result)s of %(total)s consistency groups failed to delete."
|
|
241
237
|
) % {'result': result, 'total': total}
|
|
242
238
|
raise exceptions.CommandError(msg)
|
|
243
239
|
|
|
@@ -321,7 +317,7 @@ class RemoveVolumeFromConsistencyGroup(command.Command):
|
|
|
321
317
|
if result > 0:
|
|
322
318
|
total = len(parsed_args.volumes)
|
|
323
319
|
LOG.error(
|
|
324
|
-
_("%(result)s of %(total)s volumes failed
|
|
320
|
+
_("%(result)s of %(total)s volumes failed to remove.")
|
|
325
321
|
% {'result': result, 'total': total}
|
|
326
322
|
)
|
|
327
323
|
|
|
@@ -123,8 +123,7 @@ class ListConsistencyGroupSnapshot(command.Lister):
|
|
|
123
123
|
'--all-projects',
|
|
124
124
|
action="store_true",
|
|
125
125
|
help=_(
|
|
126
|
-
'Show detail for all projects (admin only) '
|
|
127
|
-
'(defaults to False)'
|
|
126
|
+
'Show detail for all projects (admin only) (defaults to False)'
|
|
128
127
|
),
|
|
129
128
|
)
|
|
130
129
|
parser.add_argument(
|
|
@@ -153,8 +153,7 @@ class DeleteQos(command.Command):
|
|
|
153
153
|
if result > 0:
|
|
154
154
|
total = len(parsed_args.qos_specs)
|
|
155
155
|
msg = _(
|
|
156
|
-
"%(result)s of %(total)s QoS specifications failed"
|
|
157
|
-
" to delete."
|
|
156
|
+
"%(result)s of %(total)s QoS specifications failed to delete."
|
|
158
157
|
) % {'result': result, 'total': total}
|
|
159
158
|
raise exceptions.CommandError(msg)
|
|
160
159
|
|
|
@@ -45,33 +45,34 @@ class ListService(command.Lister):
|
|
|
45
45
|
return parser
|
|
46
46
|
|
|
47
47
|
def take_action(self, parsed_args):
|
|
48
|
-
|
|
48
|
+
volume_client = self.app.client_manager.sdk_connection.volume
|
|
49
|
+
|
|
50
|
+
columns: tuple[str, ...] = (
|
|
51
|
+
"binary",
|
|
52
|
+
"host",
|
|
53
|
+
"availability_zone",
|
|
54
|
+
"status",
|
|
55
|
+
"state",
|
|
56
|
+
"updated_at",
|
|
57
|
+
)
|
|
58
|
+
column_names: tuple[str, ...] = (
|
|
59
|
+
"Binary",
|
|
60
|
+
"Host",
|
|
61
|
+
"Zone",
|
|
62
|
+
"Status",
|
|
63
|
+
"State",
|
|
64
|
+
"Updated At",
|
|
65
|
+
)
|
|
49
66
|
|
|
50
67
|
if parsed_args.long:
|
|
51
|
-
columns
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
"State",
|
|
57
|
-
"Updated At",
|
|
58
|
-
"Disabled Reason",
|
|
59
|
-
]
|
|
60
|
-
else:
|
|
61
|
-
columns = [
|
|
62
|
-
"Binary",
|
|
63
|
-
"Host",
|
|
64
|
-
"Zone",
|
|
65
|
-
"Status",
|
|
66
|
-
"State",
|
|
67
|
-
"Updated At",
|
|
68
|
-
]
|
|
69
|
-
|
|
70
|
-
data = service_client.services.list(
|
|
71
|
-
parsed_args.host, parsed_args.service
|
|
68
|
+
columns += ("disabled_reason",)
|
|
69
|
+
column_names += ("Disabled Reason",)
|
|
70
|
+
|
|
71
|
+
data = volume_client.services(
|
|
72
|
+
host=parsed_args.host, binary=parsed_args.service
|
|
72
73
|
)
|
|
73
74
|
return (
|
|
74
|
-
|
|
75
|
+
column_names,
|
|
75
76
|
(
|
|
76
77
|
utils.get_item_properties(
|
|
77
78
|
s,
|
|
@@ -87,7 +88,11 @@ class SetService(command.Command):
|
|
|
87
88
|
|
|
88
89
|
def get_parser(self, prog_name):
|
|
89
90
|
parser = super().get_parser(prog_name)
|
|
90
|
-
parser.add_argument(
|
|
91
|
+
parser.add_argument(
|
|
92
|
+
"host",
|
|
93
|
+
metavar="<host>",
|
|
94
|
+
help=_("Name of host"),
|
|
95
|
+
)
|
|
91
96
|
parser.add_argument(
|
|
92
97
|
"service",
|
|
93
98
|
metavar="<service>",
|
|
@@ -118,19 +123,17 @@ class SetService(command.Command):
|
|
|
118
123
|
)
|
|
119
124
|
raise exceptions.CommandError(msg)
|
|
120
125
|
|
|
121
|
-
|
|
126
|
+
volume_client = self.app.client_manager.sdk_connection.volume
|
|
127
|
+
|
|
128
|
+
service = volume_client.find_service(
|
|
129
|
+
host=parsed_args.host, service=parsed_args.service
|
|
130
|
+
)
|
|
131
|
+
|
|
122
132
|
if parsed_args.enable:
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
)
|
|
133
|
+
service.enable(volume_client)
|
|
134
|
+
|
|
126
135
|
if parsed_args.disable:
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
parsed_args.disable_reason,
|
|
132
|
-
)
|
|
133
|
-
else:
|
|
134
|
-
service_client.services.disable(
|
|
135
|
-
parsed_args.host, parsed_args.service
|
|
136
|
-
)
|
|
136
|
+
service.disable(
|
|
137
|
+
volume_client,
|
|
138
|
+
reason=parsed_args.disable_reason,
|
|
139
|
+
)
|
|
@@ -107,7 +107,7 @@ class CreateVolume(command.ShowOne):
|
|
|
107
107
|
)
|
|
108
108
|
raise exceptions.CommandError(msg)
|
|
109
109
|
|
|
110
|
-
def
|
|
110
|
+
def get_parser(self, prog_name):
|
|
111
111
|
parser = super().get_parser(prog_name)
|
|
112
112
|
parser.add_argument(
|
|
113
113
|
"name",
|
|
@@ -169,6 +169,7 @@ class CreateVolume(command.ShowOne):
|
|
|
169
169
|
"--property",
|
|
170
170
|
metavar="<key=value>",
|
|
171
171
|
action=parseractions.KeyValueAction,
|
|
172
|
+
dest="properties",
|
|
172
173
|
help=_(
|
|
173
174
|
"Set a property to this volume "
|
|
174
175
|
"(repeat option to set multiple properties)"
|
|
@@ -189,32 +190,36 @@ class CreateVolume(command.ShowOne):
|
|
|
189
190
|
bootable_group.add_argument(
|
|
190
191
|
"--bootable",
|
|
191
192
|
action="store_true",
|
|
193
|
+
dest="bootable",
|
|
194
|
+
default=None,
|
|
192
195
|
help=_("Mark volume as bootable"),
|
|
193
196
|
)
|
|
194
197
|
bootable_group.add_argument(
|
|
195
198
|
"--non-bootable",
|
|
196
|
-
action="
|
|
199
|
+
action="store_false",
|
|
200
|
+
dest="bootable",
|
|
201
|
+
default=None,
|
|
197
202
|
help=_("Mark volume as non-bootable (default)"),
|
|
198
203
|
)
|
|
199
204
|
readonly_group = parser.add_mutually_exclusive_group()
|
|
200
205
|
readonly_group.add_argument(
|
|
201
206
|
"--read-only",
|
|
202
207
|
action="store_true",
|
|
208
|
+
dest="read_only",
|
|
209
|
+
default=None,
|
|
203
210
|
help=_("Set volume to read-only access mode"),
|
|
204
211
|
)
|
|
205
212
|
readonly_group.add_argument(
|
|
206
213
|
"--read-write",
|
|
207
|
-
action="
|
|
214
|
+
action="store_false",
|
|
215
|
+
dest="read_only",
|
|
216
|
+
default=None,
|
|
208
217
|
help=_("Set volume to read-write access mode (default)"),
|
|
209
218
|
)
|
|
210
|
-
return parser, source_group
|
|
211
|
-
|
|
212
|
-
def get_parser(self, prog_name):
|
|
213
|
-
parser, _ = self._get_parser(prog_name)
|
|
214
219
|
return parser
|
|
215
220
|
|
|
216
221
|
def take_action(self, parsed_args):
|
|
217
|
-
|
|
222
|
+
self._check_size_arg(parsed_args)
|
|
218
223
|
# size is validated in the above call to
|
|
219
224
|
# _check_size_arg where we check that size
|
|
220
225
|
# should be passed if we are not creating a
|
|
@@ -265,14 +270,14 @@ class CreateVolume(command.ShowOne):
|
|
|
265
270
|
description=parsed_args.description,
|
|
266
271
|
volume_type=parsed_args.type,
|
|
267
272
|
availability_zone=parsed_args.availability_zone,
|
|
268
|
-
metadata=parsed_args.
|
|
273
|
+
metadata=parsed_args.properties,
|
|
269
274
|
imageRef=image,
|
|
270
275
|
source_volid=source_volume,
|
|
271
276
|
consistencygroup_id=consistency_group,
|
|
272
277
|
scheduler_hints=parsed_args.hint,
|
|
273
278
|
)
|
|
274
279
|
|
|
275
|
-
if parsed_args.bootable
|
|
280
|
+
if parsed_args.bootable is not None:
|
|
276
281
|
try:
|
|
277
282
|
if utils.wait_for_status(
|
|
278
283
|
volume_client.volumes.get,
|
|
@@ -286,13 +291,13 @@ class CreateVolume(command.ShowOne):
|
|
|
286
291
|
)
|
|
287
292
|
else:
|
|
288
293
|
msg = _(
|
|
289
|
-
"Volume status is not available for setting boot "
|
|
290
|
-
"state"
|
|
294
|
+
"Volume status is not available for setting boot state"
|
|
291
295
|
)
|
|
292
296
|
raise exceptions.CommandError(msg)
|
|
293
297
|
except Exception as e:
|
|
294
298
|
LOG.error(_("Failed to set volume bootable property: %s"), e)
|
|
295
|
-
|
|
299
|
+
|
|
300
|
+
if parsed_args.read_only is not None:
|
|
296
301
|
try:
|
|
297
302
|
if utils.wait_for_status(
|
|
298
303
|
volume_client.volumes.get,
|
|
@@ -312,10 +317,7 @@ class CreateVolume(command.ShowOne):
|
|
|
312
317
|
raise exceptions.CommandError(msg)
|
|
313
318
|
except Exception as e:
|
|
314
319
|
LOG.error(
|
|
315
|
-
_(
|
|
316
|
-
"Failed to set volume read-only access "
|
|
317
|
-
"mode flag: %s"
|
|
318
|
-
),
|
|
320
|
+
_("Failed to set volume read-only access mode flag: %s"),
|
|
319
321
|
e,
|
|
320
322
|
)
|
|
321
323
|
|
|
@@ -356,25 +358,25 @@ class DeleteVolume(command.Command):
|
|
|
356
358
|
"--purge",
|
|
357
359
|
action="store_true",
|
|
358
360
|
help=_(
|
|
359
|
-
"Remove any snapshots along with volume(s) "
|
|
360
|
-
"(defaults to False)"
|
|
361
|
+
"Remove any snapshots along with volume(s) (defaults to False)"
|
|
361
362
|
),
|
|
362
363
|
)
|
|
363
364
|
return parser
|
|
364
365
|
|
|
365
366
|
def take_action(self, parsed_args):
|
|
366
|
-
volume_client = self.app.client_manager.volume
|
|
367
|
+
volume_client = self.app.client_manager.sdk_connection.volume
|
|
367
368
|
result = 0
|
|
368
369
|
|
|
369
|
-
for
|
|
370
|
+
for volume in parsed_args.volumes:
|
|
370
371
|
try:
|
|
371
|
-
volume_obj =
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
372
|
+
volume_obj = volume_client.find_volume(
|
|
373
|
+
volume, ignore_missing=False
|
|
374
|
+
)
|
|
375
|
+
volume_client.delete_volume(
|
|
376
|
+
volume_obj.id,
|
|
377
|
+
force=parsed_args.force,
|
|
378
|
+
cascade=parsed_args.purge,
|
|
379
|
+
)
|
|
378
380
|
except Exception as e:
|
|
379
381
|
result += 1
|
|
380
382
|
LOG.error(
|
|
@@ -382,12 +384,12 @@ class DeleteVolume(command.Command):
|
|
|
382
384
|
"Failed to delete volume with "
|
|
383
385
|
"name or ID '%(volume)s': %(e)s"
|
|
384
386
|
),
|
|
385
|
-
{'volume':
|
|
387
|
+
{'volume': volume, 'e': e},
|
|
386
388
|
)
|
|
387
389
|
|
|
388
390
|
if result > 0:
|
|
389
391
|
total = len(parsed_args.volumes)
|
|
390
|
-
msg = _("%(result)s of %(total)s volumes failed
|
|
392
|
+
msg = _("%(result)s of %(total)s volumes failed to delete.") % {
|
|
391
393
|
'result': result,
|
|
392
394
|
'total': total,
|
|
393
395
|
}
|
|
@@ -508,7 +510,7 @@ class ListVolume(command.Lister):
|
|
|
508
510
|
server_cache = {}
|
|
509
511
|
if do_server_list:
|
|
510
512
|
try:
|
|
511
|
-
compute_client = self.app.client_manager.
|
|
513
|
+
compute_client = self.app.client_manager.compute
|
|
512
514
|
for s in compute_client.servers():
|
|
513
515
|
server_cache[s.id] = s
|
|
514
516
|
except sdk_exceptions.SDKException: # noqa: S110
|
|
@@ -627,6 +629,7 @@ class SetVolume(command.Command):
|
|
|
627
629
|
'--property',
|
|
628
630
|
metavar='<key=value>',
|
|
629
631
|
action=parseractions.KeyValueAction,
|
|
632
|
+
dest="properties",
|
|
630
633
|
help=_(
|
|
631
634
|
'Set a property on this volume '
|
|
632
635
|
'(repeat option to set multiple properties)'
|
|
@@ -636,6 +639,7 @@ class SetVolume(command.Command):
|
|
|
636
639
|
'--image-property',
|
|
637
640
|
metavar='<key=value>',
|
|
638
641
|
action=parseractions.KeyValueAction,
|
|
642
|
+
dest="image_properties",
|
|
639
643
|
help=_(
|
|
640
644
|
'Set an image property on this volume '
|
|
641
645
|
'(repeat option to set multiple image properties)'
|
|
@@ -712,22 +716,30 @@ class SetVolume(command.Command):
|
|
|
712
716
|
bootable_group.add_argument(
|
|
713
717
|
"--bootable",
|
|
714
718
|
action="store_true",
|
|
719
|
+
dest="bootable",
|
|
720
|
+
default=None,
|
|
715
721
|
help=_("Mark volume as bootable"),
|
|
716
722
|
)
|
|
717
723
|
bootable_group.add_argument(
|
|
718
724
|
"--non-bootable",
|
|
719
|
-
action="
|
|
725
|
+
action="store_false",
|
|
726
|
+
dest="bootable",
|
|
727
|
+
default=None,
|
|
720
728
|
help=_("Mark volume as non-bootable"),
|
|
721
729
|
)
|
|
722
730
|
readonly_group = parser.add_mutually_exclusive_group()
|
|
723
731
|
readonly_group.add_argument(
|
|
724
732
|
"--read-only",
|
|
725
733
|
action="store_true",
|
|
734
|
+
dest="read_only",
|
|
735
|
+
default=None,
|
|
726
736
|
help=_("Set volume to read-only access mode"),
|
|
727
737
|
)
|
|
728
738
|
readonly_group.add_argument(
|
|
729
739
|
"--read-write",
|
|
730
|
-
action="
|
|
740
|
+
action="store_false",
|
|
741
|
+
dest="read_only",
|
|
742
|
+
default=None,
|
|
731
743
|
help=_("Set volume to read-write access mode"),
|
|
732
744
|
)
|
|
733
745
|
return parser
|
|
@@ -776,28 +788,31 @@ class SetVolume(command.Command):
|
|
|
776
788
|
LOG.error(_("Failed to clean volume properties: %s"), e)
|
|
777
789
|
result += 1
|
|
778
790
|
|
|
779
|
-
if parsed_args.
|
|
791
|
+
if parsed_args.properties:
|
|
780
792
|
try:
|
|
781
793
|
volume_client.volumes.set_metadata(
|
|
782
|
-
volume.id, parsed_args.
|
|
794
|
+
volume.id, parsed_args.properties
|
|
783
795
|
)
|
|
784
796
|
except Exception as e:
|
|
785
|
-
LOG.error(_("Failed to set volume
|
|
797
|
+
LOG.error(_("Failed to set volume properties: %s"), e)
|
|
786
798
|
result += 1
|
|
787
|
-
|
|
799
|
+
|
|
800
|
+
if parsed_args.image_properties:
|
|
788
801
|
try:
|
|
789
802
|
volume_client.volumes.set_image_metadata(
|
|
790
|
-
volume.id, parsed_args.
|
|
803
|
+
volume.id, parsed_args.image_properties
|
|
791
804
|
)
|
|
792
805
|
except Exception as e:
|
|
793
|
-
LOG.error(_("Failed to set image
|
|
806
|
+
LOG.error(_("Failed to set image properties: %s"), e)
|
|
794
807
|
result += 1
|
|
808
|
+
|
|
795
809
|
if parsed_args.state:
|
|
796
810
|
try:
|
|
797
811
|
volume_client.volumes.reset_state(volume.id, parsed_args.state)
|
|
798
812
|
except Exception as e:
|
|
799
813
|
LOG.error(_("Failed to set volume state: %s"), e)
|
|
800
814
|
result += 1
|
|
815
|
+
|
|
801
816
|
if parsed_args.attached:
|
|
802
817
|
try:
|
|
803
818
|
volume_client.volumes.reset_state(
|
|
@@ -806,6 +821,7 @@ class SetVolume(command.Command):
|
|
|
806
821
|
except Exception as e:
|
|
807
822
|
LOG.error(_("Failed to set volume attach-status: %s"), e)
|
|
808
823
|
result += 1
|
|
824
|
+
|
|
809
825
|
if parsed_args.detached:
|
|
810
826
|
try:
|
|
811
827
|
volume_client.volumes.reset_state(
|
|
@@ -814,7 +830,8 @@ class SetVolume(command.Command):
|
|
|
814
830
|
except Exception as e:
|
|
815
831
|
LOG.error(_("Failed to set volume attach-status: %s"), e)
|
|
816
832
|
result += 1
|
|
817
|
-
|
|
833
|
+
|
|
834
|
+
if parsed_args.bootable is not None:
|
|
818
835
|
try:
|
|
819
836
|
volume_client.volumes.set_bootable(
|
|
820
837
|
volume.id, parsed_args.bootable
|
|
@@ -822,20 +839,19 @@ class SetVolume(command.Command):
|
|
|
822
839
|
except Exception as e:
|
|
823
840
|
LOG.error(_("Failed to set volume bootable property: %s"), e)
|
|
824
841
|
result += 1
|
|
825
|
-
|
|
842
|
+
|
|
843
|
+
if parsed_args.read_only is not None:
|
|
826
844
|
try:
|
|
827
845
|
volume_client.volumes.update_readonly_flag(
|
|
828
846
|
volume.id, parsed_args.read_only
|
|
829
847
|
)
|
|
830
848
|
except Exception as e:
|
|
831
849
|
LOG.error(
|
|
832
|
-
_(
|
|
833
|
-
"Failed to set volume read-only access "
|
|
834
|
-
"mode flag: %s"
|
|
835
|
-
),
|
|
850
|
+
_("Failed to set volume read-only access mode flag: %s"),
|
|
836
851
|
e,
|
|
837
852
|
)
|
|
838
853
|
result += 1
|
|
854
|
+
|
|
839
855
|
policy = parsed_args.migration_policy or parsed_args.retype_policy
|
|
840
856
|
if parsed_args.type:
|
|
841
857
|
# get the migration policy
|
|
@@ -885,7 +901,7 @@ class SetVolume(command.Command):
|
|
|
885
901
|
|
|
886
902
|
if result > 0:
|
|
887
903
|
raise exceptions.CommandError(
|
|
888
|
-
_("One or more of the
|
|
904
|
+
_("One or more of the set operations failed")
|
|
889
905
|
)
|
|
890
906
|
|
|
891
907
|
|
|
@@ -936,6 +952,7 @@ class UnsetVolume(command.Command):
|
|
|
936
952
|
'--property',
|
|
937
953
|
metavar='<key>',
|
|
938
954
|
action='append',
|
|
955
|
+
dest='properties',
|
|
939
956
|
help=_(
|
|
940
957
|
'Remove a property from volume '
|
|
941
958
|
'(repeat option to remove multiple properties)'
|
|
@@ -945,6 +962,7 @@ class UnsetVolume(command.Command):
|
|
|
945
962
|
'--image-property',
|
|
946
963
|
metavar='<key>',
|
|
947
964
|
action='append',
|
|
965
|
+
dest='image_properties',
|
|
948
966
|
help=_(
|
|
949
967
|
'Remove an image property from volume '
|
|
950
968
|
'(repeat option to remove multiple image properties)'
|
|
@@ -957,25 +975,25 @@ class UnsetVolume(command.Command):
|
|
|
957
975
|
volume = utils.find_resource(volume_client.volumes, parsed_args.volume)
|
|
958
976
|
|
|
959
977
|
result = 0
|
|
960
|
-
if parsed_args.
|
|
978
|
+
if parsed_args.properties:
|
|
961
979
|
try:
|
|
962
980
|
volume_client.volumes.delete_metadata(
|
|
963
|
-
volume.id, parsed_args.
|
|
981
|
+
volume.id, parsed_args.properties
|
|
964
982
|
)
|
|
965
983
|
except Exception as e:
|
|
966
|
-
LOG.error(_("Failed to unset volume
|
|
984
|
+
LOG.error(_("Failed to unset volume properties: %s"), e)
|
|
967
985
|
result += 1
|
|
968
986
|
|
|
969
|
-
if parsed_args.
|
|
987
|
+
if parsed_args.image_properties:
|
|
970
988
|
try:
|
|
971
989
|
volume_client.volumes.delete_image_metadata(
|
|
972
|
-
volume.id, parsed_args.
|
|
990
|
+
volume.id, parsed_args.image_properties
|
|
973
991
|
)
|
|
974
992
|
except Exception as e:
|
|
975
|
-
LOG.error(_("Failed to unset image
|
|
993
|
+
LOG.error(_("Failed to unset image properties: %s"), e)
|
|
976
994
|
result += 1
|
|
977
995
|
|
|
978
996
|
if result > 0:
|
|
979
997
|
raise exceptions.CommandError(
|
|
980
|
-
_("One or more of the
|
|
998
|
+
_("One or more of the unset operations failed")
|
|
981
999
|
)
|
|
@@ -118,7 +118,7 @@ class CreateVolumeBackup(command.ShowOne):
|
|
|
118
118
|
ignore_missing=False,
|
|
119
119
|
).id
|
|
120
120
|
|
|
121
|
-
columns = (
|
|
121
|
+
columns: tuple[str, ...] = (
|
|
122
122
|
"id",
|
|
123
123
|
"name",
|
|
124
124
|
"volume_id",
|
|
@@ -240,7 +240,7 @@ class ListVolumeBackup(command.Lister):
|
|
|
240
240
|
def take_action(self, parsed_args):
|
|
241
241
|
volume_client = self.app.client_manager.sdk_connection.volume
|
|
242
242
|
|
|
243
|
-
columns = (
|
|
243
|
+
columns: tuple[str, ...] = (
|
|
244
244
|
'id',
|
|
245
245
|
'name',
|
|
246
246
|
'description',
|
|
@@ -249,7 +249,7 @@ class ListVolumeBackup(command.Lister):
|
|
|
249
249
|
'is_incremental',
|
|
250
250
|
'created_at',
|
|
251
251
|
)
|
|
252
|
-
column_headers = (
|
|
252
|
+
column_headers: tuple[str, ...] = (
|
|
253
253
|
'ID',
|
|
254
254
|
'Name',
|
|
255
255
|
'Description',
|
|
@@ -345,8 +345,7 @@ class RestoreVolumeBackup(command.ShowOne):
|
|
|
345
345
|
"--force",
|
|
346
346
|
action="store_true",
|
|
347
347
|
help=_(
|
|
348
|
-
"Restore the backup to an existing volume "
|
|
349
|
-
"(default to False)"
|
|
348
|
+
"Restore the backup to an existing volume (default to False)"
|
|
350
349
|
),
|
|
351
350
|
)
|
|
352
351
|
return parser
|
|
@@ -359,7 +358,7 @@ class RestoreVolumeBackup(command.ShowOne):
|
|
|
359
358
|
ignore_missing=False,
|
|
360
359
|
)
|
|
361
360
|
|
|
362
|
-
columns = (
|
|
361
|
+
columns: tuple[str, ...] = (
|
|
363
362
|
'id',
|
|
364
363
|
'volume_id',
|
|
365
364
|
'volume_name',
|
|
@@ -418,13 +417,19 @@ class SetVolumeBackup(command.Command):
|
|
|
418
417
|
return parser
|
|
419
418
|
|
|
420
419
|
def take_action(self, parsed_args):
|
|
421
|
-
volume_client = self.app.client_manager.volume
|
|
422
|
-
|
|
420
|
+
volume_client = self.app.client_manager.sdk_connection.volume
|
|
421
|
+
|
|
422
|
+
backup = volume_client.find_backup(
|
|
423
|
+
parsed_args.backup,
|
|
424
|
+
ignore_missing=False,
|
|
425
|
+
)
|
|
423
426
|
|
|
424
427
|
result = 0
|
|
425
428
|
if parsed_args.state:
|
|
426
429
|
try:
|
|
427
|
-
volume_client.
|
|
430
|
+
volume_client.reset_backup_status(
|
|
431
|
+
backup, status=parsed_args.state
|
|
432
|
+
)
|
|
428
433
|
except Exception as e:
|
|
429
434
|
LOG.error(_("Failed to set backup state: %s"), e)
|
|
430
435
|
result += 1
|
|
@@ -449,7 +454,7 @@ class ShowVolumeBackup(command.ShowOne):
|
|
|
449
454
|
def take_action(self, parsed_args):
|
|
450
455
|
volume_client = self.app.client_manager.sdk_connection.volume
|
|
451
456
|
backup = volume_client.find_backup(parsed_args.backup)
|
|
452
|
-
columns = (
|
|
457
|
+
columns: tuple[str, ...] = (
|
|
453
458
|
"availability_zone",
|
|
454
459
|
"container",
|
|
455
460
|
"created_at",
|