python-openstackclient 9.0.0__py3-none-any.whl → 10.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/__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 +59 -43
- 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 +36 -34
- openstackclient/common/pagination.py +50 -6
- openstackclient/common/progressbar.py +7 -6
- openstackclient/common/project_cleanup.py +11 -6
- openstackclient/common/quota.py +105 -103
- 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 +42 -22
- openstackclient/compute/v2/host.py +14 -6
- openstackclient/compute/v2/hypervisor.py +16 -5
- openstackclient/compute/v2/hypervisor_stats.py +10 -2
- openstackclient/compute/v2/keypair.py +35 -16
- openstackclient/compute/v2/server.py +268 -179
- openstackclient/compute/v2/server_backup.py +10 -4
- openstackclient/compute/v2/server_event.py +28 -12
- openstackclient/compute/v2/server_group.py +23 -11
- openstackclient/compute/v2/server_image.py +19 -10
- openstackclient/compute/v2/server_migration.py +27 -10
- openstackclient/compute/v2/server_share.py +274 -0
- openstackclient/compute/v2/server_volume.py +13 -5
- openstackclient/compute/v2/service.py +17 -8
- openstackclient/compute/v2/usage.py +28 -23
- openstackclient/identity/client.py +8 -3
- openstackclient/identity/common.py +82 -47
- 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 +23 -11
- openstackclient/identity/v2_0/token.py +12 -5
- openstackclient/identity/v2_0/user.py +26 -15
- openstackclient/identity/v3/access_rule.py +32 -12
- openstackclient/identity/v3/application_credential.py +66 -24
- openstackclient/identity/v3/catalog.py +14 -7
- openstackclient/identity/v3/consumer.py +22 -11
- openstackclient/identity/v3/credential.py +39 -17
- openstackclient/identity/v3/domain.py +40 -19
- openstackclient/identity/v3/ec2creds.py +25 -12
- openstackclient/identity/v3/endpoint.py +98 -64
- openstackclient/identity/v3/endpoint_group.py +28 -17
- openstackclient/identity/v3/federation_protocol.py +44 -20
- openstackclient/identity/v3/group.py +64 -40
- openstackclient/identity/v3/identity_provider.py +95 -57
- openstackclient/identity/v3/implied_role.py +21 -9
- openstackclient/identity/v3/limit.py +42 -17
- openstackclient/identity/v3/mapping.py +58 -28
- openstackclient/identity/v3/policy.py +23 -12
- openstackclient/identity/v3/project.py +59 -26
- openstackclient/identity/v3/region.py +39 -17
- openstackclient/identity/v3/registered_limit.py +41 -16
- openstackclient/identity/v3/role.py +62 -31
- openstackclient/identity/v3/role_assignment.py +25 -7
- openstackclient/identity/v3/service.py +39 -17
- openstackclient/identity/v3/service_provider.py +40 -16
- openstackclient/identity/v3/tag.py +23 -6
- openstackclient/identity/v3/token.py +30 -14
- openstackclient/identity/v3/trust.py +39 -18
- openstackclient/identity/v3/unscoped_saml.py +10 -2
- openstackclient/identity/v3/user.py +86 -36
- openstackclient/image/client.py +7 -3
- openstackclient/image/v1/image.py +33 -26
- openstackclient/image/v2/cache.py +16 -11
- openstackclient/image/v2/image.py +88 -56
- openstackclient/image/v2/info.py +7 -1
- openstackclient/image/v2/metadef_namespaces.py +117 -20
- openstackclient/image/v2/metadef_objects.py +32 -19
- openstackclient/image/v2/metadef_properties.py +30 -16
- openstackclient/image/v2/metadef_resource_type_association.py +14 -7
- openstackclient/image/v2/metadef_resource_types.py +7 -1
- openstackclient/image/v2/task.py +25 -27
- 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 +27 -54
- openstackclient/network/v2/address_group.py +39 -16
- openstackclient/network/v2/address_scope.py +36 -20
- openstackclient/network/v2/bgpvpn/bgpvpn.py +477 -0
- openstackclient/network/v2/bgpvpn/constants.py +30 -0
- openstackclient/network/v2/bgpvpn/network_association.py +226 -0
- openstackclient/network/v2/bgpvpn/port_association.py +504 -0
- openstackclient/network/v2/bgpvpn/router_association.py +301 -0
- openstackclient/network/v2/default_security_group_rule.py +31 -14
- openstackclient/network/v2/floating_ip.py +121 -162
- openstackclient/network/v2/floating_ip_port_forwarding.py +41 -19
- openstackclient/network/v2/fwaas/__init__.py +0 -0
- openstackclient/network/v2/fwaas/group.py +499 -0
- openstackclient/network/v2/fwaas/policy.py +518 -0
- openstackclient/network/v2/fwaas/rule.py +610 -0
- openstackclient/network/v2/ip_availability.py +25 -8
- openstackclient/network/v2/l3_conntrack_helper.py +35 -13
- openstackclient/network/v2/local_ip.py +27 -13
- openstackclient/network/v2/local_ip_association.py +17 -7
- openstackclient/network/v2/ndp_proxy.py +23 -11
- openstackclient/network/v2/network.py +213 -213
- openstackclient/network/v2/network_agent.py +77 -34
- openstackclient/network/v2/network_auto_allocated_topology.py +27 -15
- openstackclient/network/v2/network_flavor.py +45 -21
- openstackclient/network/v2/network_flavor_profile.py +42 -17
- openstackclient/network/v2/network_meter.py +39 -15
- openstackclient/network/v2/network_meter_rule.py +40 -12
- openstackclient/network/v2/network_qos_policy.py +39 -21
- openstackclient/network/v2/network_qos_rule.py +48 -18
- openstackclient/network/v2/network_qos_rule_type.py +28 -9
- openstackclient/network/v2/network_rbac.py +34 -16
- openstackclient/network/v2/network_segment.py +32 -11
- openstackclient/network/v2/network_segment_range.py +70 -31
- openstackclient/network/v2/network_service_provider.py +7 -1
- openstackclient/network/v2/network_trunk.py +41 -22
- openstackclient/network/v2/port.py +141 -40
- openstackclient/network/v2/router.py +101 -67
- openstackclient/network/v2/security_group.py +97 -198
- openstackclient/network/v2/security_group_rule.py +115 -282
- openstackclient/network/v2/subnet.py +63 -34
- openstackclient/network/v2/subnet_pool.py +42 -24
- openstackclient/network/v2/taas/tap_flow.py +35 -14
- openstackclient/network/v2/taas/tap_mirror.py +28 -14
- openstackclient/network/v2/taas/tap_service.py +26 -12
- openstackclient/object/client.py +7 -2
- openstackclient/object/v1/account.py +13 -6
- openstackclient/object/v1/container.py +28 -16
- openstackclient/object/v1/object.py +28 -16
- 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 +59 -19
- openstackclient/tests/functional/identity/v3/test_application_credential.py +1 -1
- 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_mapping.py +81 -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/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_group.py +163 -0
- openstackclient/tests/functional/volume/v3/test_volume_snapshot.py +11 -7
- 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_limits.py +1 -1
- openstackclient/tests/unit/common/test_module.py +82 -44
- openstackclient/tests/unit/common/test_project_cleanup.py +3 -1
- openstackclient/tests/unit/common/test_quota.py +15 -26
- openstackclient/tests/unit/compute/v2/fakes.py +26 -57
- openstackclient/tests/unit/compute/v2/test_agent.py +4 -4
- openstackclient/tests/unit/compute/v2/test_aggregate.py +1 -1
- openstackclient/tests/unit/compute/v2/test_console.py +2 -2
- openstackclient/tests/unit/compute/v2/test_console_connection.py +1 -1
- openstackclient/tests/unit/compute/v2/test_flavor.py +29 -3
- openstackclient/tests/unit/compute/v2/test_host.py +3 -3
- openstackclient/tests/unit/compute/v2/test_hypervisor.py +2 -2
- openstackclient/tests/unit/compute/v2/test_hypervisor_stats.py +1 -1
- openstackclient/tests/unit/compute/v2/test_keypair.py +7 -7
- openstackclient/tests/unit/compute/v2/test_server.py +26 -111
- openstackclient/tests/unit/compute/v2/test_server_backup.py +1 -1
- openstackclient/tests/unit/compute/v2/test_server_event.py +2 -2
- openstackclient/tests/unit/compute/v2/test_server_group.py +1 -1
- openstackclient/tests/unit/compute/v2/test_server_image.py +1 -1
- openstackclient/tests/unit/compute/v2/test_server_migration.py +4 -4
- openstackclient/tests/unit/compute/v2/test_server_share.py +287 -0
- openstackclient/tests/unit/compute/v2/test_server_volume.py +2 -2
- openstackclient/tests/unit/compute/v2/test_service.py +3 -3
- openstackclient/tests/unit/compute/v2/test_usage.py +1 -1
- openstackclient/tests/unit/identity/v2_0/fakes.py +3 -7
- openstackclient/tests/unit/identity/v2_0/test_endpoint.py +1 -1
- openstackclient/tests/unit/identity/v2_0/test_project.py +1 -1
- openstackclient/tests/unit/identity/v2_0/test_role.py +1 -1
- openstackclient/tests/unit/identity/v2_0/test_role_assignment.py +1 -1
- openstackclient/tests/unit/identity/v2_0/test_service.py +1 -1
- openstackclient/tests/unit/identity/v2_0/test_token.py +2 -2
- openstackclient/tests/unit/identity/v2_0/test_user.py +1 -1
- openstackclient/tests/unit/identity/v3/fakes.py +8 -38
- openstackclient/tests/unit/identity/v3/test_access_rule.py +3 -3
- openstackclient/tests/unit/identity/v3/test_application_credential.py +4 -4
- openstackclient/tests/unit/identity/v3/test_credential.py +5 -5
- openstackclient/tests/unit/identity/v3/test_domain.py +5 -5
- openstackclient/tests/unit/identity/v3/test_endpoint.py +6 -6
- openstackclient/tests/unit/identity/v3/test_endpoint_group.py +1 -1
- openstackclient/tests/unit/identity/v3/test_group.py +12 -22
- openstackclient/tests/unit/identity/v3/test_identity_provider.py +303 -299
- openstackclient/tests/unit/identity/v3/test_implied_role.py +1 -1
- openstackclient/tests/unit/identity/v3/test_limit.py +5 -5
- openstackclient/tests/unit/identity/v3/test_mappings.py +163 -79
- openstackclient/tests/unit/identity/v3/test_project.py +28 -5
- openstackclient/tests/unit/identity/v3/test_protocol.py +3 -3
- openstackclient/tests/unit/identity/v3/test_region.py +5 -5
- openstackclient/tests/unit/identity/v3/test_registered_limit.py +5 -5
- openstackclient/tests/unit/identity/v3/test_role.py +8 -8
- openstackclient/tests/unit/identity/v3/test_role_assignment.py +1 -1
- openstackclient/tests/unit/identity/v3/test_service.py +5 -5
- openstackclient/tests/unit/identity/v3/test_token.py +2 -2
- openstackclient/tests/unit/identity/v3/test_trust.py +4 -4
- openstackclient/tests/unit/identity/v3/test_user.py +77 -10
- openstackclient/tests/unit/image/v2/test_image.py +11 -11
- 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/fakes.py +5 -77
- openstackclient/tests/unit/network/v2/fwaas/__init__.py +0 -0
- openstackclient/tests/unit/network/v2/fwaas/test_group.py +923 -0
- openstackclient/tests/unit/network/v2/fwaas/test_policy.py +869 -0
- openstackclient/tests/unit/network/v2/fwaas/test_rule.py +1005 -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 +26 -2
- openstackclient/tests/unit/network/v2/test_address_scope.py +24 -0
- openstackclient/tests/unit/network/v2/{test_floating_ip_network.py → test_floating_ip.py} +27 -2
- openstackclient/tests/unit/network/v2/test_floating_ip_port_forwarding.py +37 -13
- openstackclient/tests/unit/network/v2/test_ip_availability.py +25 -0
- openstackclient/tests/unit/network/v2/test_l3_conntrack_helper.py +29 -3
- openstackclient/tests/unit/network/v2/test_network.py +74 -12
- openstackclient/tests/unit/network/v2/test_network_agent.py +58 -5
- openstackclient/tests/unit/network/v2/test_network_auto_allocated_topology.py +3 -3
- openstackclient/tests/unit/network/v2/test_network_flavor.py +26 -2
- openstackclient/tests/unit/network/v2/test_network_flavor_profile.py +24 -0
- openstackclient/tests/unit/network/v2/test_network_meter.py +24 -0
- openstackclient/tests/unit/network/v2/test_network_qos_policy.py +25 -1
- openstackclient/tests/unit/network/v2/test_network_qos_rule.py +2 -2
- openstackclient/tests/unit/network/v2/test_network_qos_rule_type.py +24 -0
- openstackclient/tests/unit/network/v2/test_network_rbac.py +25 -1
- openstackclient/tests/unit/network/v2/test_network_segment.py +25 -1
- openstackclient/tests/unit/network/v2/test_network_segment_range.py +31 -10
- openstackclient/tests/unit/network/v2/test_network_trunk.py +1 -1
- openstackclient/tests/unit/network/v2/test_port.py +166 -0
- openstackclient/tests/unit/network/v2/test_router.py +36 -16
- openstackclient/tests/unit/network/v2/{test_security_group_network.py → test_security_group.py} +11 -8
- openstackclient/tests/unit/network/v2/{test_security_group_rule_network.py → test_security_group_rule.py} +28 -37
- openstackclient/tests/unit/network/v2/test_subnet.py +30 -5
- openstackclient/tests/unit/network/v2/test_subnet_pool.py +26 -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 +21 -140
- openstackclient/tests/unit/volume/v2/test_volume_backup.py +6 -14
- openstackclient/tests/unit/volume/v2/test_volume_snapshot.py +8 -1
- openstackclient/tests/unit/volume/v2/test_volume_type.py +2 -4
- openstackclient/tests/unit/volume/v3/fakes.py +205 -100
- openstackclient/tests/unit/volume/v3/test_backup_record.py +114 -0
- openstackclient/tests/unit/volume/v3/test_consistency_group.py +720 -0
- openstackclient/tests/unit/volume/v3/test_consistency_group_snapshot.py +354 -0
- openstackclient/tests/unit/volume/v3/test_qos_specs.py +455 -0
- openstackclient/tests/unit/volume/v3/test_volume.py +60 -3
- openstackclient/tests/unit/volume/v3/test_volume_attachment.py +3 -1
- openstackclient/tests/unit/volume/v3/test_volume_backend.py +158 -0
- openstackclient/tests/unit/volume/v3/test_volume_backup.py +6 -14
- openstackclient/tests/unit/volume/v3/test_volume_group_type.py +65 -0
- openstackclient/tests/unit/volume/v3/test_volume_host.py +115 -0
- openstackclient/tests/unit/volume/v3/test_volume_snapshot.py +61 -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 +29 -17
- openstackclient/volume/v2/consistency_group_snapshot.py +25 -10
- openstackclient/volume/v2/qos_specs.py +28 -17
- openstackclient/volume/v2/service.py +17 -6
- openstackclient/volume/v2/volume.py +60 -30
- openstackclient/volume/v2/volume_backend.py +19 -6
- openstackclient/volume/v2/volume_backup.py +48 -23
- openstackclient/volume/v2/volume_host.py +6 -4
- openstackclient/volume/v2/volume_snapshot.py +49 -24
- openstackclient/volume/v2/volume_transfer_request.py +31 -13
- openstackclient/volume/v2/volume_type.py +43 -24
- openstackclient/volume/v3/backup_record.py +94 -0
- 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/consistency_group.py +400 -0
- openstackclient/volume/v3/consistency_group_snapshot.py +225 -0
- openstackclient/volume/v3/qos_specs.py +389 -0
- openstackclient/volume/v3/service.py +16 -6
- openstackclient/volume/v3/volume.py +92 -40
- openstackclient/volume/v3/volume_attachment.py +47 -21
- openstackclient/volume/v3/volume_backend.py +130 -0
- openstackclient/volume/v3/volume_backup.py +55 -27
- openstackclient/volume/v3/volume_group.py +23 -13
- openstackclient/volume/v3/volume_group_snapshot.py +34 -17
- openstackclient/volume/v3/volume_group_type.py +27 -14
- openstackclient/volume/v3/volume_host.py +74 -0
- openstackclient/volume/v3/volume_message.py +18 -8
- openstackclient/volume/v3/volume_snapshot.py +70 -32
- openstackclient/volume/v3/volume_transfer_request.py +31 -13
- openstackclient/volume/v3/volume_type.py +42 -24
- {python_openstackclient-9.0.0.dist-info → python_openstackclient-10.1.0.dist-info}/METADATA +7 -8
- python_openstackclient-10.1.0.dist-info/RECORD +524 -0
- {python_openstackclient-9.0.0.dist-info → python_openstackclient-10.1.0.dist-info}/WHEEL +1 -1
- {python_openstackclient-9.0.0.dist-info → python_openstackclient-10.1.0.dist-info}/entry_points.txt +77 -25
- {python_openstackclient-9.0.0.dist-info → python_openstackclient-10.1.0.dist-info}/licenses/AUTHORS +9 -0
- python_openstackclient-10.1.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-9.0.0.dist-info/RECORD +0 -499
- python_openstackclient-9.0.0.dist-info/pbr.json +0 -1
- /openstackclient/{tests/functional/image/v1 → network/v2/bgpvpn}/__init__.py +0 -0
- {python_openstackclient-9.0.0.dist-info → python_openstackclient-10.1.0.dist-info}/licenses/LICENSE +0 -0
- {python_openstackclient-9.0.0.dist-info → python_openstackclient-10.1.0.dist-info}/top_level.txt +0 -0
|
@@ -15,7 +15,10 @@
|
|
|
15
15
|
|
|
16
16
|
"""Identity v2 Project action implementations"""
|
|
17
17
|
|
|
18
|
+
import argparse
|
|
19
|
+
from collections.abc import Iterable, Sequence
|
|
18
20
|
import logging
|
|
21
|
+
from typing import Any
|
|
19
22
|
|
|
20
23
|
from keystoneauth1 import exceptions as ks_exc
|
|
21
24
|
from osc_lib.cli import format_columns
|
|
@@ -33,7 +36,7 @@ LOG = logging.getLogger(__name__)
|
|
|
33
36
|
class CreateProject(command.ShowOne):
|
|
34
37
|
_description = _("Create new project")
|
|
35
38
|
|
|
36
|
-
def get_parser(self, prog_name):
|
|
39
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
37
40
|
parser = super().get_parser(prog_name)
|
|
38
41
|
parser.add_argument(
|
|
39
42
|
'name',
|
|
@@ -73,7 +76,9 @@ class CreateProject(command.ShowOne):
|
|
|
73
76
|
)
|
|
74
77
|
return parser
|
|
75
78
|
|
|
76
|
-
def take_action(
|
|
79
|
+
def take_action(
|
|
80
|
+
self, parsed_args: argparse.Namespace
|
|
81
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
77
82
|
identity_client = self.app.client_manager.identity
|
|
78
83
|
|
|
79
84
|
enabled = True
|
|
@@ -102,7 +107,8 @@ class CreateProject(command.ShowOne):
|
|
|
102
107
|
|
|
103
108
|
# TODO(stevemar): Remove the line below when we support multitenancy
|
|
104
109
|
project._info.pop('parent_id', None)
|
|
105
|
-
|
|
110
|
+
col_headers, col_data = zip(*sorted(project._info.items()))
|
|
111
|
+
return col_headers, col_data
|
|
106
112
|
|
|
107
113
|
|
|
108
114
|
class DeleteProject(command.Command):
|
|
@@ -115,7 +121,7 @@ class DeleteProject(command.Command):
|
|
|
115
121
|
"regardless."
|
|
116
122
|
)
|
|
117
123
|
|
|
118
|
-
def get_parser(self, prog_name):
|
|
124
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
119
125
|
parser = super().get_parser(prog_name)
|
|
120
126
|
parser.add_argument(
|
|
121
127
|
'projects',
|
|
@@ -125,7 +131,7 @@ class DeleteProject(command.Command):
|
|
|
125
131
|
)
|
|
126
132
|
return parser
|
|
127
133
|
|
|
128
|
-
def take_action(self, parsed_args):
|
|
134
|
+
def take_action(self, parsed_args: argparse.Namespace) -> None:
|
|
129
135
|
identity_client = self.app.client_manager.identity
|
|
130
136
|
|
|
131
137
|
errors = 0
|
|
@@ -158,7 +164,7 @@ class DeleteProject(command.Command):
|
|
|
158
164
|
class ListProject(command.Lister):
|
|
159
165
|
_description = _("List projects")
|
|
160
166
|
|
|
161
|
-
def get_parser(self, prog_name):
|
|
167
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
162
168
|
parser = super().get_parser(prog_name)
|
|
163
169
|
parser.add_argument(
|
|
164
170
|
'--long',
|
|
@@ -177,7 +183,9 @@ class ListProject(command.Lister):
|
|
|
177
183
|
)
|
|
178
184
|
return parser
|
|
179
185
|
|
|
180
|
-
def take_action(
|
|
186
|
+
def take_action(
|
|
187
|
+
self, parsed_args: argparse.Namespace
|
|
188
|
+
) -> tuple[tuple[str, ...], Iterable[tuple[Any, ...]]]:
|
|
181
189
|
columns: tuple[str, ...] = ('ID', 'Name')
|
|
182
190
|
if parsed_args.long:
|
|
183
191
|
columns += ('Description', 'Enabled')
|
|
@@ -200,7 +208,7 @@ class ListProject(command.Lister):
|
|
|
200
208
|
class SetProject(command.Command):
|
|
201
209
|
_description = _("Set project properties")
|
|
202
210
|
|
|
203
|
-
def get_parser(self, prog_name):
|
|
211
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
204
212
|
parser = super().get_parser(prog_name)
|
|
205
213
|
parser.add_argument(
|
|
206
214
|
'project',
|
|
@@ -240,7 +248,7 @@ class SetProject(command.Command):
|
|
|
240
248
|
)
|
|
241
249
|
return parser
|
|
242
250
|
|
|
243
|
-
def take_action(self, parsed_args):
|
|
251
|
+
def take_action(self, parsed_args: argparse.Namespace) -> None:
|
|
244
252
|
identity_client = self.app.client_manager.identity
|
|
245
253
|
|
|
246
254
|
project = utils.find_resource(
|
|
@@ -272,7 +280,7 @@ class SetProject(command.Command):
|
|
|
272
280
|
class ShowProject(command.ShowOne):
|
|
273
281
|
_description = _("Display project details")
|
|
274
282
|
|
|
275
|
-
def get_parser(self, prog_name):
|
|
283
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
276
284
|
parser = super().get_parser(prog_name)
|
|
277
285
|
parser.add_argument(
|
|
278
286
|
'project',
|
|
@@ -281,7 +289,9 @@ class ShowProject(command.ShowOne):
|
|
|
281
289
|
)
|
|
282
290
|
return parser
|
|
283
291
|
|
|
284
|
-
def take_action(
|
|
292
|
+
def take_action(
|
|
293
|
+
self, parsed_args: argparse.Namespace
|
|
294
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
285
295
|
identity_client = self.app.client_manager.identity
|
|
286
296
|
|
|
287
297
|
info = {}
|
|
@@ -324,13 +334,14 @@ class ShowProject(command.ShowOne):
|
|
|
324
334
|
properties[k] = v
|
|
325
335
|
|
|
326
336
|
info['properties'] = format_columns.DictColumn(properties)
|
|
327
|
-
|
|
337
|
+
col_headers, col_data = zip(*sorted(info.items()))
|
|
338
|
+
return col_headers, col_data
|
|
328
339
|
|
|
329
340
|
|
|
330
341
|
class UnsetProject(command.Command):
|
|
331
342
|
_description = _("Unset project properties")
|
|
332
343
|
|
|
333
|
-
def get_parser(self, prog_name):
|
|
344
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
334
345
|
parser = super().get_parser(prog_name)
|
|
335
346
|
parser.add_argument(
|
|
336
347
|
'project',
|
|
@@ -350,7 +361,7 @@ class UnsetProject(command.Command):
|
|
|
350
361
|
)
|
|
351
362
|
return parser
|
|
352
363
|
|
|
353
|
-
def take_action(self, parsed_args):
|
|
364
|
+
def take_action(self, parsed_args: argparse.Namespace) -> None:
|
|
354
365
|
identity_client = self.app.client_manager.identity
|
|
355
366
|
project = utils.find_resource(
|
|
356
367
|
identity_client.tenants,
|
|
@@ -15,7 +15,10 @@
|
|
|
15
15
|
|
|
16
16
|
"""Identity v2 Role action implementations"""
|
|
17
17
|
|
|
18
|
+
import argparse
|
|
19
|
+
from collections.abc import Iterable, Sequence
|
|
18
20
|
import logging
|
|
21
|
+
from typing import Any
|
|
19
22
|
|
|
20
23
|
from keystoneauth1 import exceptions as ks_exc
|
|
21
24
|
from osc_lib import exceptions
|
|
@@ -31,7 +34,7 @@ LOG = logging.getLogger(__name__)
|
|
|
31
34
|
class AddRole(command.ShowOne):
|
|
32
35
|
_description = _("Add role to project:user")
|
|
33
36
|
|
|
34
|
-
def get_parser(self, prog_name):
|
|
37
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
35
38
|
parser = super().get_parser(prog_name)
|
|
36
39
|
parser.add_argument(
|
|
37
40
|
'role',
|
|
@@ -52,7 +55,9 @@ class AddRole(command.ShowOne):
|
|
|
52
55
|
)
|
|
53
56
|
return parser
|
|
54
57
|
|
|
55
|
-
def take_action(
|
|
58
|
+
def take_action(
|
|
59
|
+
self, parsed_args: argparse.Namespace
|
|
60
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
56
61
|
identity_client = self.app.client_manager.identity
|
|
57
62
|
role = utils.find_resource(identity_client.roles, parsed_args.role)
|
|
58
63
|
project = utils.find_resource(
|
|
@@ -68,13 +73,14 @@ class AddRole(command.ShowOne):
|
|
|
68
73
|
|
|
69
74
|
info = {}
|
|
70
75
|
info.update(role._info)
|
|
71
|
-
|
|
76
|
+
col_headers, col_data = zip(*sorted(info.items()))
|
|
77
|
+
return col_headers, col_data
|
|
72
78
|
|
|
73
79
|
|
|
74
80
|
class CreateRole(command.ShowOne):
|
|
75
81
|
_description = _("Create new role")
|
|
76
82
|
|
|
77
|
-
def get_parser(self, prog_name):
|
|
83
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
78
84
|
parser = super().get_parser(prog_name)
|
|
79
85
|
parser.add_argument(
|
|
80
86
|
'role_name',
|
|
@@ -88,7 +94,9 @@ class CreateRole(command.ShowOne):
|
|
|
88
94
|
)
|
|
89
95
|
return parser
|
|
90
96
|
|
|
91
|
-
def take_action(
|
|
97
|
+
def take_action(
|
|
98
|
+
self, parsed_args: argparse.Namespace
|
|
99
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
92
100
|
identity_client = self.app.client_manager.identity
|
|
93
101
|
try:
|
|
94
102
|
role = identity_client.roles.create(parsed_args.role_name)
|
|
@@ -104,13 +112,14 @@ class CreateRole(command.ShowOne):
|
|
|
104
112
|
|
|
105
113
|
info = {}
|
|
106
114
|
info.update(role._info)
|
|
107
|
-
|
|
115
|
+
col_headers, col_data = zip(*sorted(info.items()))
|
|
116
|
+
return col_headers, col_data
|
|
108
117
|
|
|
109
118
|
|
|
110
119
|
class DeleteRole(command.Command):
|
|
111
120
|
_description = _("Delete role(s)")
|
|
112
121
|
|
|
113
|
-
def get_parser(self, prog_name):
|
|
122
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
114
123
|
parser = super().get_parser(prog_name)
|
|
115
124
|
parser.add_argument(
|
|
116
125
|
'roles',
|
|
@@ -120,7 +129,7 @@ class DeleteRole(command.Command):
|
|
|
120
129
|
)
|
|
121
130
|
return parser
|
|
122
131
|
|
|
123
|
-
def take_action(self, parsed_args):
|
|
132
|
+
def take_action(self, parsed_args: argparse.Namespace) -> None:
|
|
124
133
|
identity_client = self.app.client_manager.identity
|
|
125
134
|
|
|
126
135
|
errors = 0
|
|
@@ -153,7 +162,9 @@ class DeleteRole(command.Command):
|
|
|
153
162
|
class ListRole(command.Lister):
|
|
154
163
|
_description = _("List roles")
|
|
155
164
|
|
|
156
|
-
def take_action(
|
|
165
|
+
def take_action(
|
|
166
|
+
self, parsed_args: argparse.Namespace
|
|
167
|
+
) -> tuple[tuple[str, ...], Iterable[tuple[Any, ...]]]:
|
|
157
168
|
identity_client = self.app.client_manager.identity
|
|
158
169
|
|
|
159
170
|
columns = ('ID', 'Name')
|
|
@@ -175,7 +186,7 @@ class ListRole(command.Lister):
|
|
|
175
186
|
class RemoveRole(command.Command):
|
|
176
187
|
_description = _("Remove role from project : user")
|
|
177
188
|
|
|
178
|
-
def get_parser(self, prog_name):
|
|
189
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
179
190
|
parser = super().get_parser(prog_name)
|
|
180
191
|
parser.add_argument(
|
|
181
192
|
'role',
|
|
@@ -196,7 +207,7 @@ class RemoveRole(command.Command):
|
|
|
196
207
|
)
|
|
197
208
|
return parser
|
|
198
209
|
|
|
199
|
-
def take_action(self, parsed_args):
|
|
210
|
+
def take_action(self, parsed_args: argparse.Namespace) -> None:
|
|
200
211
|
identity_client = self.app.client_manager.identity
|
|
201
212
|
role = utils.find_resource(identity_client.roles, parsed_args.role)
|
|
202
213
|
project = utils.find_resource(
|
|
@@ -210,7 +221,7 @@ class RemoveRole(command.Command):
|
|
|
210
221
|
class ShowRole(command.ShowOne):
|
|
211
222
|
_description = _("Display role details")
|
|
212
223
|
|
|
213
|
-
def get_parser(self, prog_name):
|
|
224
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
214
225
|
parser = super().get_parser(prog_name)
|
|
215
226
|
parser.add_argument(
|
|
216
227
|
'role',
|
|
@@ -219,10 +230,13 @@ class ShowRole(command.ShowOne):
|
|
|
219
230
|
)
|
|
220
231
|
return parser
|
|
221
232
|
|
|
222
|
-
def take_action(
|
|
233
|
+
def take_action(
|
|
234
|
+
self, parsed_args: argparse.Namespace
|
|
235
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
223
236
|
identity_client = self.app.client_manager.identity
|
|
224
237
|
role = utils.find_resource(identity_client.roles, parsed_args.role)
|
|
225
238
|
|
|
226
239
|
info = {}
|
|
227
240
|
info.update(role._info)
|
|
228
|
-
|
|
241
|
+
col_headers, col_data = zip(*sorted(info.items()))
|
|
242
|
+
return col_headers, col_data
|
|
@@ -13,17 +13,21 @@
|
|
|
13
13
|
|
|
14
14
|
"""Identity v2 Assignment action implementations"""
|
|
15
15
|
|
|
16
|
+
import argparse
|
|
17
|
+
from collections.abc import Iterable
|
|
18
|
+
from typing import Any
|
|
19
|
+
|
|
16
20
|
from osc_lib import exceptions
|
|
17
21
|
from osc_lib import utils
|
|
18
22
|
|
|
19
23
|
from openstackclient import command
|
|
20
|
-
from openstackclient.i18n import _
|
|
24
|
+
from openstackclient.i18n import _
|
|
21
25
|
|
|
22
26
|
|
|
23
27
|
class ListRoleAssignment(command.Lister):
|
|
24
28
|
_description = _("List role assignments")
|
|
25
29
|
|
|
26
|
-
def get_parser(self, prog_name):
|
|
30
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
27
31
|
parser = super().get_parser(prog_name)
|
|
28
32
|
parser.add_argument(
|
|
29
33
|
'--user',
|
|
@@ -55,7 +59,9 @@ class ListRoleAssignment(command.Lister):
|
|
|
55
59
|
)
|
|
56
60
|
return parser
|
|
57
61
|
|
|
58
|
-
def take_action(
|
|
62
|
+
def take_action(
|
|
63
|
+
self, parsed_args: argparse.Namespace
|
|
64
|
+
) -> tuple[tuple[str, ...], Iterable[tuple[Any, ...]]]:
|
|
59
65
|
identity_client = self.app.client_manager.identity
|
|
60
66
|
auth_ref = self.app.client_manager.auth_ref
|
|
61
67
|
|
|
@@ -15,7 +15,10 @@
|
|
|
15
15
|
|
|
16
16
|
"""Service action implementations"""
|
|
17
17
|
|
|
18
|
+
import argparse
|
|
19
|
+
from collections.abc import Iterable, Sequence
|
|
18
20
|
import logging
|
|
21
|
+
from typing import Any
|
|
19
22
|
|
|
20
23
|
from osc_lib import exceptions
|
|
21
24
|
from osc_lib import utils
|
|
@@ -31,7 +34,7 @@ LOG = logging.getLogger(__name__)
|
|
|
31
34
|
class CreateService(command.ShowOne):
|
|
32
35
|
_description = _("Create new service")
|
|
33
36
|
|
|
34
|
-
def get_parser(self, prog_name):
|
|
37
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
35
38
|
parser = super().get_parser(prog_name)
|
|
36
39
|
parser.add_argument(
|
|
37
40
|
'type',
|
|
@@ -50,7 +53,9 @@ class CreateService(command.ShowOne):
|
|
|
50
53
|
)
|
|
51
54
|
return parser
|
|
52
55
|
|
|
53
|
-
def take_action(
|
|
56
|
+
def take_action(
|
|
57
|
+
self, parsed_args: argparse.Namespace
|
|
58
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
54
59
|
identity_client = self.app.client_manager.identity
|
|
55
60
|
|
|
56
61
|
name = parsed_args.name
|
|
@@ -64,13 +69,14 @@ class CreateService(command.ShowOne):
|
|
|
64
69
|
|
|
65
70
|
info = {}
|
|
66
71
|
info.update(service._info)
|
|
67
|
-
|
|
72
|
+
col_headers, col_data = zip(*sorted(info.items()))
|
|
73
|
+
return col_headers, col_data
|
|
68
74
|
|
|
69
75
|
|
|
70
76
|
class DeleteService(command.Command):
|
|
71
77
|
_description = _("Delete service(s)")
|
|
72
78
|
|
|
73
|
-
def get_parser(self, prog_name):
|
|
79
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
74
80
|
parser = super().get_parser(prog_name)
|
|
75
81
|
parser.add_argument(
|
|
76
82
|
'services',
|
|
@@ -80,7 +86,7 @@ class DeleteService(command.Command):
|
|
|
80
86
|
)
|
|
81
87
|
return parser
|
|
82
88
|
|
|
83
|
-
def take_action(self, parsed_args):
|
|
89
|
+
def take_action(self, parsed_args: argparse.Namespace) -> None:
|
|
84
90
|
identity_client = self.app.client_manager.identity
|
|
85
91
|
|
|
86
92
|
result = 0
|
|
@@ -110,7 +116,7 @@ class DeleteService(command.Command):
|
|
|
110
116
|
class ListService(command.Lister):
|
|
111
117
|
_description = _("List services")
|
|
112
118
|
|
|
113
|
-
def get_parser(self, prog_name):
|
|
119
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
114
120
|
parser = super().get_parser(prog_name)
|
|
115
121
|
parser.add_argument(
|
|
116
122
|
'--long',
|
|
@@ -120,7 +126,9 @@ class ListService(command.Lister):
|
|
|
120
126
|
)
|
|
121
127
|
return parser
|
|
122
128
|
|
|
123
|
-
def take_action(
|
|
129
|
+
def take_action(
|
|
130
|
+
self, parsed_args: argparse.Namespace
|
|
131
|
+
) -> tuple[tuple[str, ...], Iterable[tuple[Any, ...]]]:
|
|
124
132
|
columns: tuple[str, ...] = ('ID', 'Name', 'Type')
|
|
125
133
|
if parsed_args.long:
|
|
126
134
|
columns += ('Description',)
|
|
@@ -134,7 +142,7 @@ class ListService(command.Lister):
|
|
|
134
142
|
class ShowService(command.ShowOne):
|
|
135
143
|
_description = _("Display service details")
|
|
136
144
|
|
|
137
|
-
def get_parser(self, prog_name):
|
|
145
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
138
146
|
parser = super().get_parser(prog_name)
|
|
139
147
|
parser.add_argument(
|
|
140
148
|
'service',
|
|
@@ -149,7 +157,9 @@ class ShowService(command.ShowOne):
|
|
|
149
157
|
)
|
|
150
158
|
return parser
|
|
151
159
|
|
|
152
|
-
def take_action(
|
|
160
|
+
def take_action(
|
|
161
|
+
self, parsed_args: argparse.Namespace
|
|
162
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
153
163
|
identity_client = self.app.client_manager.identity
|
|
154
164
|
auth_ref = self.app.client_manager.auth_ref
|
|
155
165
|
|
|
@@ -163,7 +173,8 @@ class ShowService(command.ShowOne):
|
|
|
163
173
|
# FIXME(stephenfin): The return type for this in ksa is
|
|
164
174
|
# wrong
|
|
165
175
|
info.update(service_endpoints[0]) # type: ignore
|
|
166
|
-
|
|
176
|
+
col_headers, col_data = zip(*sorted(info.items()))
|
|
177
|
+
return col_headers, col_data
|
|
167
178
|
|
|
168
179
|
msg = _(
|
|
169
180
|
"No service catalog with a type, name or ID of '%s' exists."
|
|
@@ -173,4 +184,5 @@ class ShowService(command.ShowOne):
|
|
|
173
184
|
service = common.find_service(identity_client, parsed_args.service)
|
|
174
185
|
info = {}
|
|
175
186
|
info.update(service._info)
|
|
176
|
-
|
|
187
|
+
col_headers, col_data = zip(*sorted(info.items()))
|
|
188
|
+
return col_headers, col_data
|
|
@@ -15,6 +15,10 @@
|
|
|
15
15
|
|
|
16
16
|
"""Identity v2 Token action implementations"""
|
|
17
17
|
|
|
18
|
+
import argparse
|
|
19
|
+
from collections.abc import Iterable, Sequence
|
|
20
|
+
from typing import Any
|
|
21
|
+
|
|
18
22
|
from osc_lib import exceptions
|
|
19
23
|
|
|
20
24
|
from openstackclient import command
|
|
@@ -27,11 +31,13 @@ class IssueToken(command.ShowOne):
|
|
|
27
31
|
# scoped token is optional
|
|
28
32
|
required_scope = False
|
|
29
33
|
|
|
30
|
-
def get_parser(self, prog_name):
|
|
34
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
31
35
|
parser = super().get_parser(prog_name)
|
|
32
36
|
return parser
|
|
33
37
|
|
|
34
|
-
def take_action(
|
|
38
|
+
def take_action(
|
|
39
|
+
self, parsed_args: argparse.Namespace
|
|
40
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
35
41
|
auth_ref = self.app.client_manager.auth_ref
|
|
36
42
|
if not auth_ref:
|
|
37
43
|
raise exceptions.AuthorizationFailure(
|
|
@@ -49,13 +55,14 @@ class IssueToken(command.ShowOne):
|
|
|
49
55
|
data['project_id'] = auth_ref.project_id
|
|
50
56
|
if auth_ref.user_id:
|
|
51
57
|
data['user_id'] = auth_ref.user_id
|
|
52
|
-
|
|
58
|
+
col_headers, col_data = zip(*sorted(data.items()))
|
|
59
|
+
return col_headers, col_data
|
|
53
60
|
|
|
54
61
|
|
|
55
62
|
class RevokeToken(command.Command):
|
|
56
63
|
_description = _("Revoke existing token")
|
|
57
64
|
|
|
58
|
-
def get_parser(self, prog_name):
|
|
65
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
59
66
|
parser = super().get_parser(prog_name)
|
|
60
67
|
parser.add_argument(
|
|
61
68
|
'token',
|
|
@@ -64,7 +71,7 @@ class RevokeToken(command.Command):
|
|
|
64
71
|
)
|
|
65
72
|
return parser
|
|
66
73
|
|
|
67
|
-
def take_action(self, parsed_args):
|
|
74
|
+
def take_action(self, parsed_args: argparse.Namespace) -> None:
|
|
68
75
|
identity_client = self.app.client_manager.identity
|
|
69
76
|
|
|
70
77
|
identity_client.tokens.delete(parsed_args.token)
|
|
@@ -15,8 +15,11 @@
|
|
|
15
15
|
|
|
16
16
|
"""Identity v2.0 User action implementations"""
|
|
17
17
|
|
|
18
|
+
import argparse
|
|
19
|
+
from collections.abc import Iterable, Sequence
|
|
18
20
|
import functools
|
|
19
21
|
import logging
|
|
22
|
+
from typing import Any, cast
|
|
20
23
|
|
|
21
24
|
from cliff import columns as cliff_columns
|
|
22
25
|
from keystoneauth1 import exceptions as ks_exc
|
|
@@ -41,16 +44,16 @@ class ProjectColumn(cliff_columns.FormattableColumn[str]):
|
|
|
41
44
|
``functools.partial(ProjectColumn, project_cache)``.
|
|
42
45
|
"""
|
|
43
46
|
|
|
44
|
-
def __init__(self, value, project_cache=None):
|
|
47
|
+
def __init__(self, value: str, project_cache: Any = None) -> None:
|
|
45
48
|
super().__init__(value)
|
|
46
49
|
self.project_cache = project_cache or {}
|
|
47
50
|
|
|
48
|
-
def human_readable(self):
|
|
51
|
+
def human_readable(self) -> str:
|
|
49
52
|
project = self._value
|
|
50
53
|
if not project:
|
|
51
54
|
return ""
|
|
52
55
|
if project in self.project_cache.keys():
|
|
53
|
-
return self.project_cache[project].name
|
|
56
|
+
return cast(str, self.project_cache[project].name)
|
|
54
57
|
else:
|
|
55
58
|
return project
|
|
56
59
|
|
|
@@ -58,7 +61,7 @@ class ProjectColumn(cliff_columns.FormattableColumn[str]):
|
|
|
58
61
|
class CreateUser(command.ShowOne):
|
|
59
62
|
_description = _("Create new user")
|
|
60
63
|
|
|
61
|
-
def get_parser(self, prog_name):
|
|
64
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
62
65
|
parser = super().get_parser(prog_name)
|
|
63
66
|
parser.add_argument(
|
|
64
67
|
'name',
|
|
@@ -104,7 +107,9 @@ class CreateUser(command.ShowOne):
|
|
|
104
107
|
)
|
|
105
108
|
return parser
|
|
106
109
|
|
|
107
|
-
def take_action(
|
|
110
|
+
def take_action(
|
|
111
|
+
self, parsed_args: argparse.Namespace
|
|
112
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
108
113
|
identity_client = self.app.client_manager.identity
|
|
109
114
|
|
|
110
115
|
if parsed_args.project:
|
|
@@ -155,13 +160,14 @@ class CreateUser(command.ShowOne):
|
|
|
155
160
|
|
|
156
161
|
info = {}
|
|
157
162
|
info.update(user._info)
|
|
158
|
-
|
|
163
|
+
col_headers, col_data = zip(*sorted(info.items()))
|
|
164
|
+
return col_headers, col_data
|
|
159
165
|
|
|
160
166
|
|
|
161
167
|
class DeleteUser(command.Command):
|
|
162
168
|
_description = _("Delete user(s)")
|
|
163
169
|
|
|
164
|
-
def get_parser(self, prog_name):
|
|
170
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
165
171
|
parser = super().get_parser(prog_name)
|
|
166
172
|
parser.add_argument(
|
|
167
173
|
'users',
|
|
@@ -171,7 +177,7 @@ class DeleteUser(command.Command):
|
|
|
171
177
|
)
|
|
172
178
|
return parser
|
|
173
179
|
|
|
174
|
-
def take_action(self, parsed_args):
|
|
180
|
+
def take_action(self, parsed_args: argparse.Namespace) -> None:
|
|
175
181
|
identity_client = self.app.client_manager.identity
|
|
176
182
|
|
|
177
183
|
errors = 0
|
|
@@ -204,7 +210,7 @@ class DeleteUser(command.Command):
|
|
|
204
210
|
class ListUser(command.Lister):
|
|
205
211
|
_description = _("List users")
|
|
206
212
|
|
|
207
|
-
def get_parser(self, prog_name):
|
|
213
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
208
214
|
parser = super().get_parser(prog_name)
|
|
209
215
|
parser.add_argument(
|
|
210
216
|
'--project',
|
|
@@ -219,7 +225,9 @@ class ListUser(command.Lister):
|
|
|
219
225
|
)
|
|
220
226
|
return parser
|
|
221
227
|
|
|
222
|
-
def take_action(
|
|
228
|
+
def take_action(
|
|
229
|
+
self, parsed_args: argparse.Namespace
|
|
230
|
+
) -> tuple[tuple[str, ...], Iterable[tuple[Any, ...]]]:
|
|
223
231
|
identity_client = self.app.client_manager.identity
|
|
224
232
|
formatters = {}
|
|
225
233
|
project = None
|
|
@@ -278,7 +286,7 @@ class ListUser(command.Lister):
|
|
|
278
286
|
class SetUser(command.Command):
|
|
279
287
|
_description = _("Set user properties")
|
|
280
288
|
|
|
281
|
-
def get_parser(self, prog_name):
|
|
289
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
282
290
|
parser = super().get_parser(prog_name)
|
|
283
291
|
parser.add_argument(
|
|
284
292
|
'user',
|
|
@@ -324,7 +332,7 @@ class SetUser(command.Command):
|
|
|
324
332
|
)
|
|
325
333
|
return parser
|
|
326
334
|
|
|
327
|
-
def take_action(self, parsed_args):
|
|
335
|
+
def take_action(self, parsed_args: argparse.Namespace) -> None:
|
|
328
336
|
identity_client = self.app.client_manager.identity
|
|
329
337
|
|
|
330
338
|
if parsed_args.password_prompt:
|
|
@@ -376,7 +384,7 @@ class SetUser(command.Command):
|
|
|
376
384
|
class ShowUser(command.ShowOne):
|
|
377
385
|
_description = _("Display user details")
|
|
378
386
|
|
|
379
|
-
def get_parser(self, prog_name):
|
|
387
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
380
388
|
parser = super().get_parser(prog_name)
|
|
381
389
|
parser.add_argument(
|
|
382
390
|
'user',
|
|
@@ -385,7 +393,9 @@ class ShowUser(command.ShowOne):
|
|
|
385
393
|
)
|
|
386
394
|
return parser
|
|
387
395
|
|
|
388
|
-
def take_action(
|
|
396
|
+
def take_action(
|
|
397
|
+
self, parsed_args: argparse.Namespace
|
|
398
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
389
399
|
identity_client = self.app.client_manager.identity
|
|
390
400
|
|
|
391
401
|
info = {}
|
|
@@ -417,4 +427,5 @@ class ShowUser(command.ShowOne):
|
|
|
417
427
|
if 'tenant_id' in info:
|
|
418
428
|
info.update({'project_id': info.pop('tenant_id')})
|
|
419
429
|
|
|
420
|
-
|
|
430
|
+
col_headers, col_data = zip(*sorted(info.items()))
|
|
431
|
+
return col_headers, col_data
|