python-openstackclient 8.3.0__py3-none-any.whl → 10.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/__init__.py +2 -6
- openstackclient/api/api.py +41 -23
- openstackclient/api/compute_v2.py +44 -25
- openstackclient/api/object_store_v1.py +75 -97
- openstackclient/api/volume_v2.py +2 -1
- openstackclient/api/volume_v3.py +2 -1
- openstackclient/common/availability_zone.py +58 -42
- openstackclient/common/clientmanager.py +56 -29
- openstackclient/common/configuration.py +10 -3
- openstackclient/common/envvars.py +2 -2
- openstackclient/common/extension.py +14 -5
- openstackclient/common/limits.py +10 -5
- openstackclient/common/module.py +14 -6
- openstackclient/common/pagination.py +8 -2
- openstackclient/common/progressbar.py +7 -6
- openstackclient/common/project_cleanup.py +13 -7
- openstackclient/common/quota.py +126 -114
- openstackclient/common/versions.py +8 -2
- openstackclient/compute/client.py +7 -3
- openstackclient/compute/v2/agent.py +17 -10
- openstackclient/compute/v2/aggregate.py +36 -22
- openstackclient/compute/v2/console.py +14 -8
- openstackclient/compute/v2/console_connection.py +11 -3
- openstackclient/compute/v2/flavor.py +39 -21
- openstackclient/compute/v2/host.py +14 -6
- openstackclient/compute/v2/hypervisor.py +14 -5
- openstackclient/compute/v2/hypervisor_stats.py +10 -2
- openstackclient/compute/v2/keypair.py +29 -14
- openstackclient/compute/v2/server.py +251 -171
- openstackclient/compute/v2/server_backup.py +10 -4
- openstackclient/compute/v2/server_event.py +21 -12
- openstackclient/compute/v2/server_group.py +21 -11
- openstackclient/compute/v2/server_image.py +19 -10
- openstackclient/compute/v2/server_migration.py +24 -10
- openstackclient/compute/v2/server_share.py +274 -0
- openstackclient/compute/v2/server_volume.py +10 -4
- openstackclient/compute/v2/service.py +14 -7
- openstackclient/compute/v2/usage.py +26 -21
- openstackclient/identity/client.py +8 -3
- openstackclient/identity/common.py +103 -41
- openstackclient/identity/v2_0/catalog.py +14 -7
- openstackclient/identity/v2_0/ec2creds.py +21 -10
- openstackclient/identity/v2_0/endpoint.py +23 -11
- openstackclient/identity/v2_0/project.py +25 -14
- openstackclient/identity/v2_0/role.py +28 -14
- openstackclient/identity/v2_0/role_assignment.py +9 -3
- openstackclient/identity/v2_0/service.py +26 -12
- openstackclient/identity/v2_0/token.py +12 -5
- openstackclient/identity/v2_0/user.py +26 -15
- openstackclient/identity/v3/access_rule.py +26 -12
- openstackclient/identity/v3/application_credential.py +59 -24
- openstackclient/identity/v3/catalog.py +14 -7
- openstackclient/identity/v3/consumer.py +22 -11
- openstackclient/identity/v3/credential.py +36 -16
- openstackclient/identity/v3/domain.py +37 -18
- openstackclient/identity/v3/ec2creds.py +25 -12
- openstackclient/identity/v3/endpoint.py +42 -20
- openstackclient/identity/v3/endpoint_group.py +28 -17
- openstackclient/identity/v3/federation_protocol.py +71 -50
- openstackclient/identity/v3/group.py +55 -32
- openstackclient/identity/v3/identity_provider.py +92 -57
- openstackclient/identity/v3/implied_role.py +21 -9
- openstackclient/identity/v3/limit.py +115 -92
- openstackclient/identity/v3/mapping.py +26 -13
- openstackclient/identity/v3/policy.py +23 -12
- openstackclient/identity/v3/project.py +211 -122
- openstackclient/identity/v3/region.py +36 -16
- openstackclient/identity/v3/registered_limit.py +116 -109
- openstackclient/identity/v3/role.py +61 -31
- openstackclient/identity/v3/role_assignment.py +23 -6
- openstackclient/identity/v3/service.py +36 -16
- openstackclient/identity/v3/service_provider.py +37 -15
- openstackclient/identity/v3/tag.py +23 -17
- openstackclient/identity/v3/token.py +30 -14
- openstackclient/identity/v3/trust.py +32 -14
- openstackclient/identity/v3/unscoped_saml.py +10 -2
- openstackclient/identity/v3/user.py +49 -26
- openstackclient/image/client.py +7 -3
- openstackclient/image/v1/image.py +33 -26
- openstackclient/image/v2/cache.py +14 -9
- openstackclient/image/v2/image.py +76 -49
- openstackclient/image/v2/info.py +7 -1
- openstackclient/image/v2/metadef_namespaces.py +109 -13
- openstackclient/image/v2/metadef_objects.py +28 -15
- openstackclient/image/v2/metadef_properties.py +24 -13
- openstackclient/image/v2/metadef_resource_type_association.py +14 -7
- openstackclient/image/v2/metadef_resource_types.py +7 -1
- openstackclient/image/v2/task.py +15 -6
- openstackclient/locale/tr_TR/LC_MESSAGES/openstackclient.po +7 -192
- openstackclient/network/client.py +7 -2
- openstackclient/network/common.py +16 -241
- openstackclient/network/utils.py +36 -22
- openstackclient/network/v2/address_group.py +27 -16
- openstackclient/network/v2/address_scope.py +24 -13
- openstackclient/network/v2/bgpvpn/bgpvpn.py +463 -0
- openstackclient/network/v2/bgpvpn/constants.py +30 -0
- openstackclient/network/v2/bgpvpn/network_association.py +214 -0
- openstackclient/network/v2/bgpvpn/port_association.py +490 -0
- openstackclient/network/v2/bgpvpn/router_association.py +288 -0
- openstackclient/network/v2/default_security_group_rule.py +19 -10
- openstackclient/network/v2/floating_ip.py +110 -159
- openstackclient/network/v2/floating_ip_port_forwarding.py +30 -18
- openstackclient/network/v2/fwaas/__init__.py +0 -0
- openstackclient/network/v2/fwaas/group.py +466 -0
- openstackclient/network/v2/fwaas/policy.py +518 -0
- openstackclient/network/v2/fwaas/rule.py +574 -0
- openstackclient/network/v2/ip_availability.py +13 -5
- openstackclient/network/v2/l3_conntrack_helper.py +22 -13
- openstackclient/network/v2/local_ip.py +24 -13
- openstackclient/network/v2/local_ip_association.py +14 -7
- openstackclient/network/v2/ndp_proxy.py +20 -11
- openstackclient/network/v2/network.py +129 -196
- openstackclient/network/v2/network_agent.py +46 -25
- openstackclient/network/v2/network_auto_allocated_topology.py +22 -11
- openstackclient/network/v2/network_flavor.py +27 -16
- openstackclient/network/v2/network_flavor_profile.py +23 -12
- openstackclient/network/v2/network_meter.py +21 -10
- openstackclient/network/v2/network_meter_rule.py +21 -11
- openstackclient/network/v2/network_qos_policy.py +25 -15
- openstackclient/network/v2/network_qos_rule.py +32 -17
- openstackclient/network/v2/network_qos_rule_type.py +13 -5
- openstackclient/network/v2/network_rbac.py +23 -12
- openstackclient/network/v2/network_segment.py +20 -11
- openstackclient/network/v2/network_segment_range.py +56 -29
- openstackclient/network/v2/network_service_provider.py +7 -1
- openstackclient/network/v2/network_trunk.py +38 -22
- openstackclient/network/v2/port.py +54 -29
- openstackclient/network/v2/router.py +75 -52
- openstackclient/network/v2/security_group.py +87 -157
- openstackclient/network/v2/security_group_rule.py +100 -280
- openstackclient/network/v2/subnet.py +49 -28
- openstackclient/network/v2/subnet_pool.py +30 -17
- openstackclient/network/v2/taas/tap_flow.py +22 -11
- openstackclient/network/v2/taas/tap_mirror.py +22 -11
- openstackclient/network/v2/taas/tap_service.py +23 -12
- openstackclient/object/client.py +7 -2
- openstackclient/object/v1/account.py +13 -6
- openstackclient/object/v1/container.py +25 -15
- openstackclient/object/v1/object.py +25 -15
- openstackclient/py.typed +0 -0
- openstackclient/shell.py +46 -10
- openstackclient/tests/functional/base.py +55 -20
- openstackclient/tests/functional/common/test_extension.py +4 -0
- openstackclient/tests/functional/common/test_quota.py +3 -1
- openstackclient/tests/functional/compute/v2/common.py +14 -13
- openstackclient/tests/functional/compute/v2/test_flavor.py +3 -1
- openstackclient/tests/functional/compute/v2/test_server.py +3 -0
- openstackclient/tests/functional/identity/v2/common.py +10 -6
- openstackclient/tests/functional/identity/v2/test_role.py +4 -4
- openstackclient/tests/functional/identity/v3/common.py +25 -19
- openstackclient/tests/functional/identity/v3/test_group.py +20 -20
- openstackclient/tests/functional/identity/v3/test_idp.py +3 -1
- openstackclient/tests/functional/identity/v3/test_limit.py +47 -0
- openstackclient/tests/functional/identity/v3/test_project.py +10 -10
- openstackclient/tests/functional/identity/v3/test_role.py +18 -18
- openstackclient/tests/functional/identity/v3/test_role_assignment.py +12 -12
- openstackclient/tests/functional/identity/v3/test_user.py +8 -8
- openstackclient/tests/functional/image/base.py +1 -6
- openstackclient/tests/functional/image/v2/test_metadef_objects.py +69 -0
- openstackclient/tests/functional/network/v2/common.py +5 -2
- openstackclient/tests/functional/network/v2/test_floating_ip.py +10 -4
- openstackclient/tests/functional/network/v2/test_ip_availability.py +4 -0
- openstackclient/tests/functional/network/v2/test_network_meter_rule.py +3 -2
- openstackclient/tests/functional/network/v2/test_network_segment.py +5 -0
- openstackclient/tests/functional/network/v2/test_subnet.py +13 -9
- openstackclient/tests/functional/object/v1/common.py +4 -0
- openstackclient/tests/functional/volume/v2/common.py +4 -0
- openstackclient/tests/functional/volume/v2/test_volume_snapshot.py +27 -11
- openstackclient/tests/functional/volume/v2/test_volume_type.py +2 -2
- openstackclient/tests/functional/volume/v3/common.py +4 -0
- openstackclient/tests/functional/volume/v3/test_volume_snapshot.py +56 -138
- openstackclient/tests/functional/volume/v3/test_volume_type.py +2 -2
- openstackclient/tests/unit/common/test_availability_zone.py +35 -49
- openstackclient/tests/unit/common/test_extension.py +2 -2
- openstackclient/tests/unit/common/test_module.py +12 -7
- openstackclient/tests/unit/common/test_project_cleanup.py +3 -1
- openstackclient/tests/unit/common/test_quota.py +62 -23
- openstackclient/tests/unit/compute/v2/fakes.py +25 -0
- openstackclient/tests/unit/compute/v2/test_flavor.py +28 -2
- openstackclient/tests/unit/compute/v2/test_keypair.py +6 -6
- openstackclient/tests/unit/compute/v2/test_server.py +17 -104
- openstackclient/tests/unit/compute/v2/test_server_share.py +287 -0
- openstackclient/tests/unit/identity/v3/fakes.py +3 -0
- openstackclient/tests/unit/identity/v3/test_group.py +4 -14
- openstackclient/tests/unit/identity/v3/test_identity_provider.py +303 -299
- 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/identity/v3/test_user.py +4 -4
- openstackclient/tests/unit/image/v2/test_image.py +16 -16
- openstackclient/tests/unit/image/v2/test_metadef_namespaces.py +105 -6
- openstackclient/tests/unit/network/test_common.py +0 -155
- openstackclient/tests/unit/network/v2/bgpvpn/__init__.py +0 -0
- openstackclient/tests/unit/network/v2/bgpvpn/fakes.py +179 -0
- openstackclient/tests/unit/network/v2/bgpvpn/test_bgpvpn.py +584 -0
- openstackclient/tests/unit/network/v2/bgpvpn/test_network_association.py +285 -0
- openstackclient/tests/unit/network/v2/bgpvpn/test_port_association.py +384 -0
- openstackclient/tests/unit/network/v2/bgpvpn/test_router_association.py +297 -0
- openstackclient/tests/unit/network/v2/fwaas/__init__.py +0 -0
- openstackclient/tests/unit/network/v2/fwaas/test_group.py +897 -0
- openstackclient/tests/unit/network/v2/fwaas/test_policy.py +869 -0
- openstackclient/tests/unit/network/v2/fwaas/test_rule.py +980 -0
- openstackclient/tests/unit/network/v2/taas/{test_osc_tap_flow.py → test_tap_flow.py} +18 -25
- openstackclient/tests/unit/network/v2/taas/{test_osc_tap_mirror.py → test_tap_mirror.py} +19 -29
- openstackclient/tests/unit/network/v2/taas/{test_osc_tap_service.py → test_tap_service.py} +19 -29
- openstackclient/tests/unit/network/v2/test_address_group.py +2 -2
- openstackclient/tests/unit/network/v2/{test_floating_ip_network.py → test_floating_ip.py} +3 -2
- openstackclient/tests/unit/network/v2/test_floating_ip_port_forwarding.py +13 -13
- openstackclient/tests/unit/network/v2/test_network_agent.py +8 -4
- openstackclient/tests/unit/network/v2/test_network_auto_allocated_topology.py +3 -3
- openstackclient/tests/unit/network/v2/test_network_flavor.py +2 -2
- openstackclient/tests/unit/network/v2/test_network_qos_policy.py +1 -1
- openstackclient/tests/unit/network/v2/test_network_qos_rule.py +2 -2
- openstackclient/tests/unit/network/v2/test_network_rbac.py +1 -1
- openstackclient/tests/unit/network/v2/test_network_segment.py +1 -1
- openstackclient/tests/unit/network/v2/test_network_segment_range.py +7 -10
- openstackclient/tests/unit/network/v2/test_network_trunk.py +1 -1
- openstackclient/tests/unit/network/v2/test_router.py +8 -9
- openstackclient/tests/unit/network/v2/{test_security_group_network.py → test_security_group.py} +1 -20
- openstackclient/tests/unit/network/v2/{test_security_group_rule_network.py → test_security_group_rule.py} +7 -41
- openstackclient/tests/unit/network/v2/test_subnet.py +2 -1
- openstackclient/tests/unit/network/v2/test_subnet_pool.py +2 -1
- openstackclient/tests/unit/object/v1/fakes.py +8 -7
- openstackclient/tests/unit/object/v1/test_container.py +65 -101
- openstackclient/tests/unit/object/v1/test_container_all.py +8 -1
- openstackclient/tests/unit/object/v1/test_object.py +44 -84
- openstackclient/tests/unit/object/v1/test_object_all.py +8 -1
- openstackclient/tests/unit/test_hacking.py +108 -0
- openstackclient/tests/unit/volume/v2/fakes.py +1 -0
- 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/v2/test_volume_backup.py +1 -5
- openstackclient/tests/unit/volume/v2/test_volume_snapshot.py +2 -1
- openstackclient/tests/unit/volume/v2/test_volume_type.py +2 -4
- openstackclient/tests/unit/volume/v3/fakes.py +1 -0
- openstackclient/tests/unit/volume/v3/test_volume.py +94 -15
- openstackclient/tests/unit/volume/v3/test_volume_attachment.py +1 -1
- openstackclient/tests/unit/volume/v3/test_volume_backup.py +1 -5
- openstackclient/tests/unit/volume/v3/test_volume_snapshot.py +55 -1
- openstackclient/tests/unit/volume/v3/test_volume_type.py +2 -4
- openstackclient/volume/client.py +7 -3
- openstackclient/volume/v2/backup_record.py +15 -6
- openstackclient/volume/v2/consistency_group.py +37 -25
- openstackclient/volume/v2/consistency_group_snapshot.py +27 -12
- openstackclient/volume/v2/qos_specs.py +30 -19
- openstackclient/volume/v2/service.py +17 -6
- openstackclient/volume/v2/volume.py +69 -34
- openstackclient/volume/v2/volume_backend.py +19 -6
- openstackclient/volume/v2/volume_backup.py +48 -22
- openstackclient/volume/v2/volume_host.py +6 -4
- openstackclient/volume/v2/volume_snapshot.py +52 -26
- openstackclient/volume/v2/volume_transfer_request.py +33 -15
- openstackclient/volume/v2/volume_type.py +46 -27
- openstackclient/volume/v3/block_storage_cleanup.py +11 -3
- openstackclient/volume/v3/block_storage_cluster.py +19 -7
- openstackclient/volume/v3/block_storage_log_level.py +15 -6
- openstackclient/volume/v3/block_storage_manage.py +10 -4
- openstackclient/volume/v3/block_storage_resource_filter.py +17 -5
- openstackclient/volume/v3/service.py +16 -6
- openstackclient/volume/v3/volume.py +103 -46
- openstackclient/volume/v3/volume_attachment.py +43 -21
- openstackclient/volume/v3/volume_backup.py +55 -26
- openstackclient/volume/v3/volume_group.py +23 -13
- openstackclient/volume/v3/volume_group_snapshot.py +32 -13
- openstackclient/volume/v3/volume_group_type.py +26 -13
- openstackclient/volume/v3/volume_message.py +15 -7
- openstackclient/volume/v3/volume_snapshot.py +71 -34
- openstackclient/volume/v3/volume_transfer_request.py +33 -15
- openstackclient/volume/v3/volume_type.py +45 -27
- {python_openstackclient-8.3.0.dist-info → python_openstackclient-10.0.0.dist-info}/METADATA +6 -6
- {python_openstackclient-8.3.0.dist-info → python_openstackclient-10.0.0.dist-info}/RECORD +279 -267
- {python_openstackclient-8.3.0.dist-info → python_openstackclient-10.0.0.dist-info}/WHEEL +1 -1
- {python_openstackclient-8.3.0.dist-info → python_openstackclient-10.0.0.dist-info}/entry_points.txt +53 -1
- {python_openstackclient-8.3.0.dist-info → python_openstackclient-10.0.0.dist-info}/licenses/AUTHORS +9 -0
- python_openstackclient-10.0.0.dist-info/pbr.json +1 -0
- openstackclient/api/image_v1.py +0 -69
- openstackclient/api/image_v2.py +0 -79
- openstackclient/network/v2/floating_ip_pool.py +0 -38
- openstackclient/tests/functional/image/v1/test_image.py +0 -97
- openstackclient/tests/unit/api/test_image_v1.py +0 -96
- openstackclient/tests/unit/api/test_image_v2.py +0 -96
- openstackclient/tests/unit/network/v2/test_floating_ip_compute.py +0 -248
- openstackclient/tests/unit/network/v2/test_floating_ip_pool_compute.py +0 -49
- openstackclient/tests/unit/network/v2/test_floating_ip_pool_network.py +0 -39
- openstackclient/tests/unit/network/v2/test_network_compute.py +0 -404
- openstackclient/tests/unit/network/v2/test_security_group_compute.py +0 -392
- openstackclient/tests/unit/network/v2/test_security_group_rule_compute.py +0 -555
- python_openstackclient-8.3.0.dist-info/pbr.json +0 -1
- /openstackclient/{tests/functional/image/v1 → network/v2/bgpvpn}/__init__.py +0 -0
- {python_openstackclient-8.3.0.dist-info → python_openstackclient-10.0.0.dist-info}/licenses/LICENSE +0 -0
- {python_openstackclient-8.3.0.dist-info → python_openstackclient-10.0.0.dist-info}/top_level.txt +0 -0
|
@@ -14,9 +14,12 @@
|
|
|
14
14
|
|
|
15
15
|
"""Volume v2 Type action implementations"""
|
|
16
16
|
|
|
17
|
+
import argparse
|
|
18
|
+
from collections.abc import MutableMapping
|
|
17
19
|
import functools
|
|
18
20
|
import logging
|
|
19
|
-
import
|
|
21
|
+
from collections.abc import Iterable, Sequence
|
|
22
|
+
from typing import Any
|
|
20
23
|
|
|
21
24
|
from cliff import columns as cliff_columns
|
|
22
25
|
from osc_lib.cli import format_columns
|
|
@@ -32,7 +35,7 @@ from openstackclient.identity import common as identity_common
|
|
|
32
35
|
LOG = logging.getLogger(__name__)
|
|
33
36
|
|
|
34
37
|
|
|
35
|
-
class EncryptionInfoColumn(cliff_columns.FormattableColumn[
|
|
38
|
+
class EncryptionInfoColumn(cliff_columns.FormattableColumn[Any]):
|
|
36
39
|
"""Formattable column for encryption info column.
|
|
37
40
|
|
|
38
41
|
Unlike the parent FormattableColumn class, the initializer of the
|
|
@@ -43,26 +46,30 @@ class EncryptionInfoColumn(cliff_columns.FormattableColumn[ty.Any]):
|
|
|
43
46
|
``functools.partial(EncryptionInfoColumn encryption_data)``.
|
|
44
47
|
"""
|
|
45
48
|
|
|
46
|
-
def __init__(
|
|
49
|
+
def __init__(
|
|
50
|
+
self, value: Any, encryption_data: dict[str, Any] | None = None
|
|
51
|
+
) -> None:
|
|
47
52
|
super().__init__(value)
|
|
48
53
|
self._encryption_data = encryption_data or {}
|
|
49
54
|
|
|
50
|
-
def _get_encryption_info(self):
|
|
55
|
+
def _get_encryption_info(self) -> Any:
|
|
51
56
|
type_id = self._value
|
|
52
57
|
return self._encryption_data.get(type_id)
|
|
53
58
|
|
|
54
|
-
def human_readable(self):
|
|
59
|
+
def human_readable(self) -> str:
|
|
55
60
|
encryption_info = self._get_encryption_info()
|
|
56
61
|
if encryption_info:
|
|
57
62
|
return utils.format_dict(encryption_info)
|
|
58
63
|
else:
|
|
59
64
|
return '-'
|
|
60
65
|
|
|
61
|
-
def machine_readable(self):
|
|
66
|
+
def machine_readable(self) -> Any:
|
|
62
67
|
return self._get_encryption_info()
|
|
63
68
|
|
|
64
69
|
|
|
65
|
-
def _create_encryption_type(
|
|
70
|
+
def _create_encryption_type(
|
|
71
|
+
volume_client: Any, volume_type: Any, parsed_args: argparse.Namespace
|
|
72
|
+
) -> Any:
|
|
66
73
|
if not parsed_args.encryption_provider:
|
|
67
74
|
msg = _(
|
|
68
75
|
"'--encryption-provider' should be specified while "
|
|
@@ -85,7 +92,9 @@ def _create_encryption_type(volume_client, volume_type, parsed_args):
|
|
|
85
92
|
return encryption
|
|
86
93
|
|
|
87
94
|
|
|
88
|
-
def _set_encryption_type(
|
|
95
|
+
def _set_encryption_type(
|
|
96
|
+
volume_client: Any, volume_type: Any, parsed_args: argparse.Namespace
|
|
97
|
+
) -> None:
|
|
89
98
|
# update the existing encryption type
|
|
90
99
|
body = {}
|
|
91
100
|
for attr in ['provider', 'cipher', 'key_size', 'control_location']:
|
|
@@ -109,7 +118,7 @@ def _set_encryption_type(volume_client, volume_type, parsed_args):
|
|
|
109
118
|
class CreateVolumeType(command.ShowOne):
|
|
110
119
|
_description = _("Create new volume type")
|
|
111
120
|
|
|
112
|
-
def get_parser(self, prog_name):
|
|
121
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
113
122
|
parser = super().get_parser(prog_name)
|
|
114
123
|
parser.add_argument(
|
|
115
124
|
"name",
|
|
@@ -243,7 +252,9 @@ class CreateVolumeType(command.ShowOne):
|
|
|
243
252
|
)
|
|
244
253
|
return parser
|
|
245
254
|
|
|
246
|
-
def take_action(
|
|
255
|
+
def take_action(
|
|
256
|
+
self, parsed_args: argparse.Namespace
|
|
257
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
247
258
|
identity_client = self.app.client_manager.identity
|
|
248
259
|
volume_client = self.app.client_manager.volume
|
|
249
260
|
|
|
@@ -277,7 +288,7 @@ class CreateVolumeType(command.ShowOne):
|
|
|
277
288
|
msg = _(
|
|
278
289
|
"Failed to add project %(project)s access to type: %(e)s"
|
|
279
290
|
)
|
|
280
|
-
LOG.error(msg
|
|
291
|
+
LOG.error(msg, {'project': parsed_args.project, 'e': e})
|
|
281
292
|
|
|
282
293
|
properties = {}
|
|
283
294
|
if parsed_args.properties:
|
|
@@ -325,13 +336,14 @@ class CreateVolumeType(command.ShowOne):
|
|
|
325
336
|
|
|
326
337
|
volume_type._info.pop("os-volume-type-access:is_public", None)
|
|
327
338
|
|
|
328
|
-
|
|
339
|
+
col_headers, col_data = zip(*sorted(volume_type._info.items()))
|
|
340
|
+
return col_headers, col_data
|
|
329
341
|
|
|
330
342
|
|
|
331
343
|
class DeleteVolumeType(command.Command):
|
|
332
344
|
_description = _("Delete volume type(s)")
|
|
333
345
|
|
|
334
|
-
def get_parser(self, prog_name):
|
|
346
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
335
347
|
parser = super().get_parser(prog_name)
|
|
336
348
|
parser.add_argument(
|
|
337
349
|
"volume_types",
|
|
@@ -341,7 +353,7 @@ class DeleteVolumeType(command.Command):
|
|
|
341
353
|
)
|
|
342
354
|
return parser
|
|
343
355
|
|
|
344
|
-
def take_action(self, parsed_args):
|
|
356
|
+
def take_action(self, parsed_args: argparse.Namespace) -> None:
|
|
345
357
|
volume_client = self.app.client_manager.volume
|
|
346
358
|
result = 0
|
|
347
359
|
|
|
@@ -358,8 +370,8 @@ class DeleteVolumeType(command.Command):
|
|
|
358
370
|
_(
|
|
359
371
|
"Failed to delete volume type with "
|
|
360
372
|
"name or ID '%(volume_type)s': %(e)s"
|
|
361
|
-
)
|
|
362
|
-
|
|
373
|
+
),
|
|
374
|
+
{'volume_type': volume_type, 'e': e},
|
|
363
375
|
)
|
|
364
376
|
|
|
365
377
|
if result > 0:
|
|
@@ -373,7 +385,7 @@ class DeleteVolumeType(command.Command):
|
|
|
373
385
|
class ListVolumeType(command.Lister):
|
|
374
386
|
_description = _("List volume types")
|
|
375
387
|
|
|
376
|
-
def get_parser(self, prog_name):
|
|
388
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
377
389
|
parser = super().get_parser(prog_name)
|
|
378
390
|
parser.add_argument(
|
|
379
391
|
'--long',
|
|
@@ -412,7 +424,9 @@ class ListVolumeType(command.Lister):
|
|
|
412
424
|
)
|
|
413
425
|
return parser
|
|
414
426
|
|
|
415
|
-
def take_action(
|
|
427
|
+
def take_action(
|
|
428
|
+
self, parsed_args: argparse.Namespace
|
|
429
|
+
) -> tuple[Sequence[str], Iterable[tuple[Any, ...]]]:
|
|
416
430
|
volume_client = self.app.client_manager.volume
|
|
417
431
|
|
|
418
432
|
if parsed_args.long:
|
|
@@ -439,7 +453,9 @@ class ListVolumeType(command.Lister):
|
|
|
439
453
|
is_public=parsed_args.is_public,
|
|
440
454
|
)
|
|
441
455
|
|
|
442
|
-
formatters = {
|
|
456
|
+
formatters: MutableMapping[str, Any] = {
|
|
457
|
+
'Extra Specs': format_columns.DictColumn
|
|
458
|
+
}
|
|
443
459
|
|
|
444
460
|
if parsed_args.encryption_type:
|
|
445
461
|
encryption = {}
|
|
@@ -484,7 +500,7 @@ class ListVolumeType(command.Lister):
|
|
|
484
500
|
class SetVolumeType(command.Command):
|
|
485
501
|
_description = _("Set volume type properties")
|
|
486
502
|
|
|
487
|
-
def get_parser(self, prog_name):
|
|
503
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
488
504
|
parser = super().get_parser(prog_name)
|
|
489
505
|
parser.add_argument(
|
|
490
506
|
'volume_type',
|
|
@@ -623,7 +639,7 @@ class SetVolumeType(command.Command):
|
|
|
623
639
|
)
|
|
624
640
|
return parser
|
|
625
641
|
|
|
626
|
-
def take_action(self, parsed_args):
|
|
642
|
+
def take_action(self, parsed_args: argparse.Namespace) -> None:
|
|
627
643
|
volume_client = self.app.client_manager.volume
|
|
628
644
|
identity_client = self.app.client_manager.identity
|
|
629
645
|
|
|
@@ -719,7 +735,7 @@ class SetVolumeType(command.Command):
|
|
|
719
735
|
class ShowVolumeType(command.ShowOne):
|
|
720
736
|
_description = _("Display volume type details")
|
|
721
737
|
|
|
722
|
-
def get_parser(self, prog_name):
|
|
738
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
723
739
|
parser = super().get_parser(prog_name)
|
|
724
740
|
parser.add_argument(
|
|
725
741
|
"volume_type",
|
|
@@ -736,7 +752,9 @@ class ShowVolumeType(command.ShowOne):
|
|
|
736
752
|
)
|
|
737
753
|
return parser
|
|
738
754
|
|
|
739
|
-
def take_action(
|
|
755
|
+
def take_action(
|
|
756
|
+
self, parsed_args: argparse.Namespace
|
|
757
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
740
758
|
volume_client = self.app.client_manager.volume
|
|
741
759
|
volume_type = utils.find_resource(
|
|
742
760
|
volume_client.volume_types, parsed_args.volume_type
|
|
@@ -763,7 +781,7 @@ class ShowVolumeType(command.ShowOne):
|
|
|
763
781
|
'Failed to get access project list for volume type '
|
|
764
782
|
'%(type)s: %(e)s'
|
|
765
783
|
)
|
|
766
|
-
LOG.error(msg
|
|
784
|
+
LOG.error(msg, {'type': volume_type.id, 'e': e})
|
|
767
785
|
volume_type._info.update({'access_project_ids': access_project_ids})
|
|
768
786
|
if parsed_args.encryption_type:
|
|
769
787
|
# show encryption type information for this volume type
|
|
@@ -784,13 +802,14 @@ class ShowVolumeType(command.ShowOne):
|
|
|
784
802
|
e,
|
|
785
803
|
)
|
|
786
804
|
volume_type._info.pop("os-volume-type-access:is_public", None)
|
|
787
|
-
|
|
805
|
+
col_headers, col_data = zip(*sorted(volume_type._info.items()))
|
|
806
|
+
return col_headers, col_data
|
|
788
807
|
|
|
789
808
|
|
|
790
809
|
class UnsetVolumeType(command.Command):
|
|
791
810
|
_description = _("Unset volume type properties")
|
|
792
811
|
|
|
793
|
-
def get_parser(self, prog_name):
|
|
812
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
794
813
|
parser = super().get_parser(prog_name)
|
|
795
814
|
parser.add_argument(
|
|
796
815
|
'volume_type',
|
|
@@ -825,7 +844,7 @@ class UnsetVolumeType(command.Command):
|
|
|
825
844
|
)
|
|
826
845
|
return parser
|
|
827
846
|
|
|
828
|
-
def take_action(self, parsed_args):
|
|
847
|
+
def take_action(self, parsed_args: argparse.Namespace) -> None:
|
|
829
848
|
volume_client = self.app.client_manager.volume
|
|
830
849
|
identity_client = self.app.client_manager.identity
|
|
831
850
|
|
|
@@ -10,6 +10,10 @@
|
|
|
10
10
|
# License for the specific language governing permissions and limitations
|
|
11
11
|
# under the License.
|
|
12
12
|
|
|
13
|
+
import argparse
|
|
14
|
+
from collections.abc import Iterable
|
|
15
|
+
from typing import Any
|
|
16
|
+
|
|
13
17
|
from cinderclient import api_versions
|
|
14
18
|
from osc_lib import exceptions
|
|
15
19
|
|
|
@@ -17,7 +21,9 @@ from openstackclient import command
|
|
|
17
21
|
from openstackclient.i18n import _
|
|
18
22
|
|
|
19
23
|
|
|
20
|
-
def _format_cleanup_response(
|
|
24
|
+
def _format_cleanup_response(
|
|
25
|
+
cleaning: Any, unavailable: Any
|
|
26
|
+
) -> tuple[tuple[str, ...], list[tuple[Any, ...]]]:
|
|
21
27
|
column_headers = (
|
|
22
28
|
'ID',
|
|
23
29
|
'Cluster Name',
|
|
@@ -49,7 +55,7 @@ class BlockStorageCleanup(command.Lister):
|
|
|
49
55
|
This command requires ``--os-volume-api-version`` 3.24 or greater.
|
|
50
56
|
"""
|
|
51
57
|
|
|
52
|
-
def get_parser(self, prog_name):
|
|
58
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
53
59
|
parser = super().get_parser(prog_name)
|
|
54
60
|
parser.add_argument(
|
|
55
61
|
'--cluster',
|
|
@@ -127,7 +133,9 @@ class BlockStorageCleanup(command.Lister):
|
|
|
127
133
|
)
|
|
128
134
|
return parser
|
|
129
135
|
|
|
130
|
-
def take_action(
|
|
136
|
+
def take_action(
|
|
137
|
+
self, parsed_args: argparse.Namespace
|
|
138
|
+
) -> tuple[tuple[str, ...], Iterable[tuple[Any, ...]]]:
|
|
131
139
|
volume_client = self.app.client_manager.volume
|
|
132
140
|
|
|
133
141
|
if volume_client.api_version < api_versions.APIVersion('3.24'):
|
|
@@ -10,6 +10,10 @@
|
|
|
10
10
|
# License for the specific language governing permissions and limitations
|
|
11
11
|
# under the License.
|
|
12
12
|
|
|
13
|
+
import argparse
|
|
14
|
+
from collections.abc import Iterable, Sequence
|
|
15
|
+
from typing import Any
|
|
16
|
+
|
|
13
17
|
from cinderclient import api_versions
|
|
14
18
|
from osc_lib import exceptions
|
|
15
19
|
from osc_lib import utils
|
|
@@ -18,7 +22,9 @@ from openstackclient import command
|
|
|
18
22
|
from openstackclient.i18n import _
|
|
19
23
|
|
|
20
24
|
|
|
21
|
-
def _format_cluster(
|
|
25
|
+
def _format_cluster(
|
|
26
|
+
cluster: Any, detailed: bool = False
|
|
27
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
22
28
|
columns: tuple[str, ...] = (
|
|
23
29
|
'name',
|
|
24
30
|
'binary',
|
|
@@ -73,7 +79,7 @@ class ListBlockStorageCluster(command.Lister):
|
|
|
73
79
|
This command requires ``--os-volume-api-version`` 3.7 or greater.
|
|
74
80
|
"""
|
|
75
81
|
|
|
76
|
-
def get_parser(self, prog_name):
|
|
82
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
77
83
|
parser = super().get_parser(prog_name)
|
|
78
84
|
parser.add_argument(
|
|
79
85
|
'--cluster',
|
|
@@ -137,7 +143,9 @@ class ListBlockStorageCluster(command.Lister):
|
|
|
137
143
|
)
|
|
138
144
|
return parser
|
|
139
145
|
|
|
140
|
-
def take_action(
|
|
146
|
+
def take_action(
|
|
147
|
+
self, parsed_args: argparse.Namespace
|
|
148
|
+
) -> tuple[tuple[str, ...], Iterable[tuple[Any, ...]]]:
|
|
141
149
|
volume_client = self.app.client_manager.volume
|
|
142
150
|
|
|
143
151
|
if volume_client.api_version < api_versions.APIVersion('3.7'):
|
|
@@ -180,7 +188,7 @@ class SetBlockStorageCluster(command.Command):
|
|
|
180
188
|
This command requires ``--os-volume-api-version`` 3.7 or greater.
|
|
181
189
|
"""
|
|
182
190
|
|
|
183
|
-
def get_parser(self, prog_name):
|
|
191
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
184
192
|
parser = super().get_parser(prog_name)
|
|
185
193
|
parser.add_argument(
|
|
186
194
|
'cluster',
|
|
@@ -221,7 +229,9 @@ class SetBlockStorageCluster(command.Command):
|
|
|
221
229
|
)
|
|
222
230
|
return parser
|
|
223
231
|
|
|
224
|
-
def take_action(
|
|
232
|
+
def take_action(
|
|
233
|
+
self, parsed_args: argparse.Namespace
|
|
234
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
225
235
|
volume_client = self.app.client_manager.volume
|
|
226
236
|
|
|
227
237
|
if volume_client.api_version < api_versions.APIVersion('3.7'):
|
|
@@ -251,7 +261,7 @@ class ShowBlockStorageCluster(command.ShowOne):
|
|
|
251
261
|
This command requires ``--os-volume-api-version`` 3.7 or greater.
|
|
252
262
|
"""
|
|
253
263
|
|
|
254
|
-
def get_parser(self, prog_name):
|
|
264
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
255
265
|
parser = super().get_parser(prog_name)
|
|
256
266
|
parser.add_argument(
|
|
257
267
|
'cluster',
|
|
@@ -265,7 +275,9 @@ class ShowBlockStorageCluster(command.ShowOne):
|
|
|
265
275
|
)
|
|
266
276
|
return parser
|
|
267
277
|
|
|
268
|
-
def take_action(
|
|
278
|
+
def take_action(
|
|
279
|
+
self, parsed_args: argparse.Namespace
|
|
280
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
269
281
|
volume_client = self.app.client_manager.volume
|
|
270
282
|
|
|
271
283
|
if volume_client.api_version < api_versions.APIVersion('3.7'):
|
|
@@ -14,6 +14,9 @@
|
|
|
14
14
|
|
|
15
15
|
"""Block Storage Service action implementations"""
|
|
16
16
|
|
|
17
|
+
import argparse
|
|
18
|
+
from typing import Any
|
|
19
|
+
|
|
17
20
|
from openstack import utils as sdk_utils
|
|
18
21
|
from osc_lib import exceptions
|
|
19
22
|
|
|
@@ -27,7 +30,7 @@ class BlockStorageLogLevelList(command.Lister):
|
|
|
27
30
|
Supported by --os-volume-api-version 3.32 or greater.
|
|
28
31
|
"""
|
|
29
32
|
|
|
30
|
-
def get_parser(self, prog_name):
|
|
33
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
31
34
|
parser = super().get_parser(prog_name)
|
|
32
35
|
parser.add_argument(
|
|
33
36
|
"--host",
|
|
@@ -63,8 +66,12 @@ class BlockStorageLogLevelList(command.Lister):
|
|
|
63
66
|
)
|
|
64
67
|
return parser
|
|
65
68
|
|
|
66
|
-
def take_action(
|
|
67
|
-
|
|
69
|
+
def take_action(
|
|
70
|
+
self, parsed_args: argparse.Namespace
|
|
71
|
+
) -> tuple[list[str], list[tuple[Any, ...]]]:
|
|
72
|
+
volume_client = sdk_utils.ensure_service_version(
|
|
73
|
+
self.app.client_manager.sdk_connection.volume, '3'
|
|
74
|
+
)
|
|
68
75
|
columns = [
|
|
69
76
|
"Binary",
|
|
70
77
|
"Host",
|
|
@@ -98,7 +105,7 @@ class BlockStorageLogLevelSet(command.Command):
|
|
|
98
105
|
Supported by --os-volume-api-version 3.32 or greater.
|
|
99
106
|
"""
|
|
100
107
|
|
|
101
|
-
def get_parser(self, prog_name):
|
|
108
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
102
109
|
parser = super().get_parser(prog_name)
|
|
103
110
|
parser.add_argument(
|
|
104
111
|
"level",
|
|
@@ -141,8 +148,10 @@ class BlockStorageLogLevelSet(command.Command):
|
|
|
141
148
|
)
|
|
142
149
|
return parser
|
|
143
150
|
|
|
144
|
-
def take_action(self, parsed_args):
|
|
145
|
-
volume_client =
|
|
151
|
+
def take_action(self, parsed_args: argparse.Namespace) -> None:
|
|
152
|
+
volume_client = sdk_utils.ensure_service_version(
|
|
153
|
+
self.app.client_manager.sdk_connection.volume, '3'
|
|
154
|
+
)
|
|
146
155
|
|
|
147
156
|
if not sdk_utils.supports_microversion(volume_client, '3.32'):
|
|
148
157
|
msg = _(
|
|
@@ -14,6 +14,8 @@
|
|
|
14
14
|
"""Block Storage Volume/Snapshot Management implementations"""
|
|
15
15
|
|
|
16
16
|
import argparse
|
|
17
|
+
from collections.abc import Iterable
|
|
18
|
+
from typing import Any
|
|
17
19
|
|
|
18
20
|
from cinderclient import api_versions
|
|
19
21
|
from osc_lib import exceptions
|
|
@@ -32,7 +34,7 @@ class BlockStorageManageVolumes(command.Lister):
|
|
|
32
34
|
Supported by --os-volume-api-version 3.8 or greater.
|
|
33
35
|
"""
|
|
34
36
|
|
|
35
|
-
def get_parser(self, prog_name):
|
|
37
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
36
38
|
parser = super().get_parser(prog_name)
|
|
37
39
|
host_group = parser.add_mutually_exclusive_group()
|
|
38
40
|
host_group.add_argument(
|
|
@@ -104,7 +106,9 @@ class BlockStorageManageVolumes(command.Lister):
|
|
|
104
106
|
)
|
|
105
107
|
return parser
|
|
106
108
|
|
|
107
|
-
def take_action(
|
|
109
|
+
def take_action(
|
|
110
|
+
self, parsed_args: argparse.Namespace
|
|
111
|
+
) -> tuple[list[str], Iterable[tuple[Any, ...]]]:
|
|
108
112
|
volume_client = self.app.client_manager.volume
|
|
109
113
|
|
|
110
114
|
if parsed_args.host is None and parsed_args.cluster is None:
|
|
@@ -196,7 +200,7 @@ class BlockStorageManageSnapshots(command.Lister):
|
|
|
196
200
|
Supported by --os-volume-api-version 3.8 or greater.
|
|
197
201
|
"""
|
|
198
202
|
|
|
199
|
-
def get_parser(self, prog_name):
|
|
203
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
200
204
|
parser = super().get_parser(prog_name)
|
|
201
205
|
host_group = parser.add_mutually_exclusive_group()
|
|
202
206
|
host_group.add_argument(
|
|
@@ -268,7 +272,9 @@ class BlockStorageManageSnapshots(command.Lister):
|
|
|
268
272
|
)
|
|
269
273
|
return parser
|
|
270
274
|
|
|
271
|
-
def take_action(
|
|
275
|
+
def take_action(
|
|
276
|
+
self, parsed_args: argparse.Namespace
|
|
277
|
+
) -> tuple[list[str], Iterable[tuple[Any, ...]]]:
|
|
272
278
|
volume_client = self.app.client_manager.volume
|
|
273
279
|
|
|
274
280
|
if parsed_args.host is None and parsed_args.cluster is None:
|
|
@@ -12,6 +12,10 @@
|
|
|
12
12
|
|
|
13
13
|
"""Volume V3 Resource Filters implementations"""
|
|
14
14
|
|
|
15
|
+
import argparse
|
|
16
|
+
from collections.abc import Iterable, Sequence
|
|
17
|
+
from typing import Any
|
|
18
|
+
|
|
15
19
|
from openstack import utils as sdk_utils
|
|
16
20
|
from osc_lib.cli import format_columns
|
|
17
21
|
from osc_lib import exceptions
|
|
@@ -24,8 +28,12 @@ from openstackclient.i18n import _
|
|
|
24
28
|
class ListBlockStorageResourceFilter(command.Lister):
|
|
25
29
|
_description = _('List block storage resource filters')
|
|
26
30
|
|
|
27
|
-
def take_action(
|
|
28
|
-
|
|
31
|
+
def take_action(
|
|
32
|
+
self, parsed_args: argparse.Namespace
|
|
33
|
+
) -> tuple[tuple[str, ...], Iterable[tuple[Any, ...]]]:
|
|
34
|
+
volume_client = sdk_utils.ensure_service_version(
|
|
35
|
+
self.app.client_manager.sdk_connection.volume, '3'
|
|
36
|
+
)
|
|
29
37
|
|
|
30
38
|
if not sdk_utils.supports_microversion(volume_client, '3.33'):
|
|
31
39
|
msg = _(
|
|
@@ -58,7 +66,7 @@ class ListBlockStorageResourceFilter(command.Lister):
|
|
|
58
66
|
class ShowBlockStorageResourceFilter(command.ShowOne):
|
|
59
67
|
_description = _('Show filters for a block storage resource type')
|
|
60
68
|
|
|
61
|
-
def get_parser(self, prog_name):
|
|
69
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
62
70
|
parser = super().get_parser(prog_name)
|
|
63
71
|
parser.add_argument(
|
|
64
72
|
'resource',
|
|
@@ -68,8 +76,12 @@ class ShowBlockStorageResourceFilter(command.ShowOne):
|
|
|
68
76
|
|
|
69
77
|
return parser
|
|
70
78
|
|
|
71
|
-
def take_action(
|
|
72
|
-
|
|
79
|
+
def take_action(
|
|
80
|
+
self, parsed_args: argparse.Namespace
|
|
81
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
82
|
+
volume_client = sdk_utils.ensure_service_version(
|
|
83
|
+
self.app.client_manager.sdk_connection.volume, '3'
|
|
84
|
+
)
|
|
73
85
|
|
|
74
86
|
if not sdk_utils.supports_microversion(volume_client, '3.33'):
|
|
75
87
|
msg = _(
|
|
@@ -14,6 +14,10 @@
|
|
|
14
14
|
|
|
15
15
|
"""Service action implementations"""
|
|
16
16
|
|
|
17
|
+
import argparse
|
|
18
|
+
from collections.abc import Iterable
|
|
19
|
+
from typing import Any
|
|
20
|
+
|
|
17
21
|
from openstack import utils as sdk_utils
|
|
18
22
|
from osc_lib import exceptions
|
|
19
23
|
from osc_lib import utils
|
|
@@ -25,7 +29,7 @@ from openstackclient.i18n import _
|
|
|
25
29
|
class ListService(command.Lister):
|
|
26
30
|
_description = _("List service command")
|
|
27
31
|
|
|
28
|
-
def get_parser(self, prog_name):
|
|
32
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
29
33
|
parser = super().get_parser(prog_name)
|
|
30
34
|
parser.add_argument(
|
|
31
35
|
"--host",
|
|
@@ -45,8 +49,12 @@ class ListService(command.Lister):
|
|
|
45
49
|
)
|
|
46
50
|
return parser
|
|
47
51
|
|
|
48
|
-
def take_action(
|
|
49
|
-
|
|
52
|
+
def take_action(
|
|
53
|
+
self, parsed_args: argparse.Namespace
|
|
54
|
+
) -> tuple[tuple[str, ...], Iterable[tuple[Any, ...]]]:
|
|
55
|
+
volume_client = sdk_utils.ensure_service_version(
|
|
56
|
+
self.app.client_manager.sdk_connection.volume, '3'
|
|
57
|
+
)
|
|
50
58
|
|
|
51
59
|
columns: tuple[str, ...] = (
|
|
52
60
|
"binary",
|
|
@@ -93,7 +101,7 @@ class ListService(command.Lister):
|
|
|
93
101
|
class SetService(command.Command):
|
|
94
102
|
_description = _("Set volume service properties")
|
|
95
103
|
|
|
96
|
-
def get_parser(self, prog_name):
|
|
104
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
97
105
|
parser = super().get_parser(prog_name)
|
|
98
106
|
parser.add_argument(
|
|
99
107
|
"host",
|
|
@@ -122,7 +130,7 @@ class SetService(command.Command):
|
|
|
122
130
|
)
|
|
123
131
|
return parser
|
|
124
132
|
|
|
125
|
-
def take_action(self, parsed_args):
|
|
133
|
+
def take_action(self, parsed_args: argparse.Namespace) -> None:
|
|
126
134
|
if parsed_args.disable_reason and not parsed_args.disable:
|
|
127
135
|
msg = _(
|
|
128
136
|
"Cannot specify option --disable-reason without "
|
|
@@ -130,7 +138,9 @@ class SetService(command.Command):
|
|
|
130
138
|
)
|
|
131
139
|
raise exceptions.CommandError(msg)
|
|
132
140
|
|
|
133
|
-
volume_client =
|
|
141
|
+
volume_client = sdk_utils.ensure_service_version(
|
|
142
|
+
self.app.client_manager.sdk_connection.volume, '3'
|
|
143
|
+
)
|
|
134
144
|
|
|
135
145
|
service = volume_client.find_service(
|
|
136
146
|
parsed_args.service, ignore_missing=False, host=parsed_args.host
|