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
|
@@ -17,15 +17,17 @@
|
|
|
17
17
|
|
|
18
18
|
import argparse
|
|
19
19
|
from base64 import b64encode
|
|
20
|
+
from collections.abc import Iterable, Sequence
|
|
20
21
|
import copy
|
|
21
22
|
import logging
|
|
22
23
|
import os
|
|
23
24
|
import sys
|
|
24
|
-
|
|
25
|
+
from typing import Any
|
|
25
26
|
import urllib.parse
|
|
26
27
|
|
|
27
28
|
from openstack import exceptions as sdk_exceptions
|
|
28
29
|
from openstack.image import image_signer
|
|
30
|
+
from openstack.image.v2 import image as _image
|
|
29
31
|
from openstack import utils as sdk_utils
|
|
30
32
|
from osc_lib.api import utils as api_utils
|
|
31
33
|
from osc_lib.cli import format_columns
|
|
@@ -73,11 +75,13 @@ MEMBER_STATUS_CHOICES = ["accepted", "pending", "rejected", "all"]
|
|
|
73
75
|
LOG = logging.getLogger(__name__)
|
|
74
76
|
|
|
75
77
|
|
|
76
|
-
def _format_image(
|
|
78
|
+
def _format_image(
|
|
79
|
+
image: _image.Image, human_readable: bool = False
|
|
80
|
+
) -> dict[str, object]:
|
|
77
81
|
"""Format an image to make it more consistent with OSC operations."""
|
|
78
82
|
|
|
79
83
|
info = {}
|
|
80
|
-
properties = {}
|
|
84
|
+
properties: dict[str, object] = {}
|
|
81
85
|
|
|
82
86
|
# the only fields we're not including is "links", "tags" and the properties
|
|
83
87
|
fields_to_show = [
|
|
@@ -105,25 +109,25 @@ def _format_image(image, human_readable=False):
|
|
|
105
109
|
|
|
106
110
|
# TODO(gtema/anybody): actually it should be possible to drop this method,
|
|
107
111
|
# since SDK already delivers a proper object
|
|
108
|
-
|
|
112
|
+
data = image.to_dict(ignore_none=True, original_names=True)
|
|
109
113
|
|
|
110
114
|
# split out the usual key and the properties which are top-level
|
|
111
|
-
for key in
|
|
115
|
+
for key in data:
|
|
112
116
|
if key in fields_to_show:
|
|
113
|
-
info[key] =
|
|
117
|
+
info[key] = data[key]
|
|
114
118
|
elif key == 'tags':
|
|
115
119
|
continue # handle this later
|
|
116
120
|
elif key == 'properties':
|
|
117
121
|
# NOTE(gtema): flatten content of properties
|
|
118
|
-
properties.update(
|
|
122
|
+
properties.update(data[key])
|
|
119
123
|
elif key != 'location':
|
|
120
|
-
properties[key] =
|
|
124
|
+
properties[key] = data[key]
|
|
121
125
|
|
|
122
126
|
if human_readable:
|
|
123
|
-
info['size'] = utils.format_size(
|
|
127
|
+
info['size'] = utils.format_size(data['size'])
|
|
124
128
|
|
|
125
129
|
# format the tags if they are there
|
|
126
|
-
info['tags'] = format_columns.ListColumn(
|
|
130
|
+
info['tags'] = format_columns.ListColumn(data.get('tags') or [])
|
|
127
131
|
|
|
128
132
|
# add properties back into the dictionary as a top-level key
|
|
129
133
|
if properties:
|
|
@@ -137,7 +141,7 @@ _formatters = {
|
|
|
137
141
|
}
|
|
138
142
|
|
|
139
143
|
|
|
140
|
-
def _get_member_columns(item):
|
|
144
|
+
def _get_member_columns(item: Any) -> tuple[tuple[str, ...], tuple[str, ...]]:
|
|
141
145
|
column_map = {'image_id': 'image_id'}
|
|
142
146
|
hidden_columns = ['id', 'location', 'name']
|
|
143
147
|
return utils.get_osc_show_columns_for_sdk_resource(
|
|
@@ -147,7 +151,7 @@ def _get_member_columns(item):
|
|
|
147
151
|
)
|
|
148
152
|
|
|
149
153
|
|
|
150
|
-
def get_data_from_stdin():
|
|
154
|
+
def get_data_from_stdin() -> Any:
|
|
151
155
|
# distinguish cases where:
|
|
152
156
|
# (1) stdin is not valid (as in cron jobs):
|
|
153
157
|
# openstack ... <&-
|
|
@@ -166,10 +170,10 @@ def get_data_from_stdin():
|
|
|
166
170
|
image = sys.stdin
|
|
167
171
|
if hasattr(sys.stdin, 'buffer'):
|
|
168
172
|
image = sys.stdin.buffer
|
|
169
|
-
if
|
|
173
|
+
if sys.platform == "win32":
|
|
170
174
|
import msvcrt
|
|
171
175
|
|
|
172
|
-
msvcrt.setmode(sys.stdin.fileno(), os.O_BINARY)
|
|
176
|
+
msvcrt.setmode(sys.stdin.fileno(), os.O_BINARY)
|
|
173
177
|
|
|
174
178
|
return image
|
|
175
179
|
else:
|
|
@@ -177,7 +181,7 @@ def get_data_from_stdin():
|
|
|
177
181
|
return None
|
|
178
182
|
|
|
179
183
|
|
|
180
|
-
def _add_is_protected_args(parser):
|
|
184
|
+
def _add_is_protected_args(parser: argparse.ArgumentParser) -> None:
|
|
181
185
|
protected_group = parser.add_mutually_exclusive_group()
|
|
182
186
|
protected_group.add_argument(
|
|
183
187
|
"--protected",
|
|
@@ -195,7 +199,7 @@ def _add_is_protected_args(parser):
|
|
|
195
199
|
)
|
|
196
200
|
|
|
197
201
|
|
|
198
|
-
def _add_visibility_args(parser):
|
|
202
|
+
def _add_visibility_args(parser: argparse.ArgumentParser) -> None:
|
|
199
203
|
public_group = parser.add_mutually_exclusive_group()
|
|
200
204
|
public_group.add_argument(
|
|
201
205
|
"--public",
|
|
@@ -241,7 +245,7 @@ def _add_visibility_args(parser):
|
|
|
241
245
|
class AddProjectToImage(command.ShowOne):
|
|
242
246
|
_description = _("Associate project with image")
|
|
243
247
|
|
|
244
|
-
def get_parser(self, prog_name):
|
|
248
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
245
249
|
parser = super().get_parser(prog_name)
|
|
246
250
|
parser.add_argument(
|
|
247
251
|
"image",
|
|
@@ -256,7 +260,9 @@ class AddProjectToImage(command.ShowOne):
|
|
|
256
260
|
identity_common.add_project_domain_option_to_parser(parser)
|
|
257
261
|
return parser
|
|
258
262
|
|
|
259
|
-
def take_action(
|
|
263
|
+
def take_action(
|
|
264
|
+
self, parsed_args: argparse.Namespace
|
|
265
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
260
266
|
image_client = self.app.client_manager.image
|
|
261
267
|
identity_client = self.app.client_manager.identity
|
|
262
268
|
|
|
@@ -287,7 +293,7 @@ class CreateImage(command.ShowOne):
|
|
|
287
293
|
|
|
288
294
|
deadopts = ('size', 'location', 'copy-from', 'checksum', 'store')
|
|
289
295
|
|
|
290
|
-
def get_parser(self, prog_name):
|
|
296
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
291
297
|
parser = super().get_parser(prog_name)
|
|
292
298
|
# TODO(bunting): There are additional arguments that v1 supported
|
|
293
299
|
# that v2 either doesn't support or supports weirdly.
|
|
@@ -440,13 +446,15 @@ class CreateImage(command.ShowOne):
|
|
|
440
446
|
)
|
|
441
447
|
return parser
|
|
442
448
|
|
|
443
|
-
def _take_action_image(
|
|
449
|
+
def _take_action_image(
|
|
450
|
+
self, parsed_args: argparse.Namespace
|
|
451
|
+
) -> dict[str, Any]:
|
|
444
452
|
identity_client = self.app.client_manager.identity
|
|
445
453
|
image_client = self.app.client_manager.image
|
|
446
454
|
|
|
447
455
|
# Build an attribute dict from the parsed args, only include
|
|
448
456
|
# attributes that were actually set on the command line
|
|
449
|
-
kwargs: dict[str,
|
|
457
|
+
kwargs: dict[str, Any] = {'allow_duplicates': True}
|
|
450
458
|
copy_attrs = (
|
|
451
459
|
'name',
|
|
452
460
|
'id',
|
|
@@ -592,8 +600,12 @@ class CreateImage(command.ShowOne):
|
|
|
592
600
|
image = image_client.get_image(image)
|
|
593
601
|
return _format_image(image)
|
|
594
602
|
|
|
595
|
-
def _take_action_volume(
|
|
596
|
-
|
|
603
|
+
def _take_action_volume(
|
|
604
|
+
self, parsed_args: argparse.Namespace
|
|
605
|
+
) -> dict[str, Any]:
|
|
606
|
+
volume_client = sdk_utils.ensure_service_version(
|
|
607
|
+
self.app.client_manager.sdk_connection.volume, '3'
|
|
608
|
+
)
|
|
597
609
|
|
|
598
610
|
unsupported_opts = {
|
|
599
611
|
# 'name', # 'name' is a positional argument and will always exist
|
|
@@ -627,7 +639,7 @@ class CreateImage(command.ShowOne):
|
|
|
627
639
|
source_volume = volume_client.find_volume(
|
|
628
640
|
parsed_args.volume, ignore_missing=False
|
|
629
641
|
)
|
|
630
|
-
kwargs: dict[str,
|
|
642
|
+
kwargs: dict[str, Any] = {
|
|
631
643
|
'visibility': None,
|
|
632
644
|
'protected': None,
|
|
633
645
|
}
|
|
@@ -643,7 +655,7 @@ class CreateImage(command.ShowOne):
|
|
|
643
655
|
kwargs['visibility'] = parsed_args.visibility or 'private'
|
|
644
656
|
kwargs['protected'] = parsed_args.is_protected or False
|
|
645
657
|
|
|
646
|
-
response = volume_client.upload_volume_to_image(
|
|
658
|
+
response: dict[str, Any] = volume_client.upload_volume_to_image(
|
|
647
659
|
source_volume.id,
|
|
648
660
|
parsed_args.name,
|
|
649
661
|
force=parsed_args.force,
|
|
@@ -659,7 +671,9 @@ class CreateImage(command.ShowOne):
|
|
|
659
671
|
|
|
660
672
|
return info
|
|
661
673
|
|
|
662
|
-
def take_action(
|
|
674
|
+
def take_action(
|
|
675
|
+
self, parsed_args: argparse.Namespace
|
|
676
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
663
677
|
for deadopt in self.deadopts:
|
|
664
678
|
if getattr(parsed_args, deadopt.replace('-', '_'), None):
|
|
665
679
|
msg = _(
|
|
@@ -673,13 +687,14 @@ class CreateImage(command.ShowOne):
|
|
|
673
687
|
else:
|
|
674
688
|
info = self._take_action_image(parsed_args)
|
|
675
689
|
|
|
676
|
-
|
|
690
|
+
col_headers, col_data = zip(*sorted(info.items()))
|
|
691
|
+
return col_headers, col_data
|
|
677
692
|
|
|
678
693
|
|
|
679
694
|
class DeleteImage(command.Command):
|
|
680
695
|
_description = _("Delete image(s)")
|
|
681
696
|
|
|
682
|
-
def get_parser(self, prog_name):
|
|
697
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
683
698
|
parser = super().get_parser(prog_name)
|
|
684
699
|
parser.add_argument(
|
|
685
700
|
"images",
|
|
@@ -696,7 +711,7 @@ class DeleteImage(command.Command):
|
|
|
696
711
|
)
|
|
697
712
|
return parser
|
|
698
713
|
|
|
699
|
-
def take_action(self, parsed_args):
|
|
714
|
+
def take_action(self, parsed_args: argparse.Namespace) -> None:
|
|
700
715
|
result = 0
|
|
701
716
|
image_client = self.app.client_manager.image
|
|
702
717
|
for image in parsed_args.images:
|
|
@@ -732,7 +747,7 @@ class DeleteImage(command.Command):
|
|
|
732
747
|
class ListImage(command.Lister):
|
|
733
748
|
_description = _("List available images")
|
|
734
749
|
|
|
735
|
-
def get_parser(self, prog_name):
|
|
750
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
736
751
|
parser = super().get_parser(prog_name)
|
|
737
752
|
public_group = parser.add_mutually_exclusive_group()
|
|
738
753
|
public_group.add_argument(
|
|
@@ -861,7 +876,9 @@ class ListImage(command.Lister):
|
|
|
861
876
|
pagination.add_marker_pagination_option_to_parser(parser)
|
|
862
877
|
return parser
|
|
863
878
|
|
|
864
|
-
def take_action(
|
|
879
|
+
def take_action(
|
|
880
|
+
self, parsed_args: argparse.Namespace
|
|
881
|
+
) -> tuple[tuple[str, ...], Iterable[tuple[Any, ...]]]:
|
|
865
882
|
identity_client = self.app.client_manager.identity
|
|
866
883
|
image_client = self.app.client_manager.image
|
|
867
884
|
|
|
@@ -870,6 +887,8 @@ class ListImage(command.Lister):
|
|
|
870
887
|
kwargs['visibility'] = parsed_args.visibility
|
|
871
888
|
if parsed_args.limit:
|
|
872
889
|
kwargs['limit'] = parsed_args.limit
|
|
890
|
+
if parsed_args.max_items is not None:
|
|
891
|
+
kwargs['max_items'] = parsed_args.max_items
|
|
873
892
|
if parsed_args.marker:
|
|
874
893
|
kwargs['marker'] = image_client.find_image(
|
|
875
894
|
parsed_args.marker,
|
|
@@ -962,7 +981,7 @@ class ListImage(command.Lister):
|
|
|
962
981
|
class ListImageProjects(command.Lister):
|
|
963
982
|
_description = _("List projects associated with image")
|
|
964
983
|
|
|
965
|
-
def get_parser(self, prog_name):
|
|
984
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
966
985
|
parser = super().get_parser(prog_name)
|
|
967
986
|
parser.add_argument(
|
|
968
987
|
"image",
|
|
@@ -972,7 +991,9 @@ class ListImageProjects(command.Lister):
|
|
|
972
991
|
identity_common.add_project_domain_option_to_parser(parser)
|
|
973
992
|
return parser
|
|
974
993
|
|
|
975
|
-
def take_action(
|
|
994
|
+
def take_action(
|
|
995
|
+
self, parsed_args: argparse.Namespace
|
|
996
|
+
) -> tuple[tuple[str, ...], Iterable[tuple[Any, ...]]]:
|
|
976
997
|
image_client = self.app.client_manager.image
|
|
977
998
|
columns: tuple[str, ...] = ("Image ID", "Member ID", "Status")
|
|
978
999
|
|
|
@@ -998,7 +1019,7 @@ class ListImageProjects(command.Lister):
|
|
|
998
1019
|
class RemoveProjectImage(command.Command):
|
|
999
1020
|
_description = _("Disassociate project with image")
|
|
1000
1021
|
|
|
1001
|
-
def get_parser(self, prog_name):
|
|
1022
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
1002
1023
|
parser = super().get_parser(prog_name)
|
|
1003
1024
|
parser.add_argument(
|
|
1004
1025
|
"image",
|
|
@@ -1013,7 +1034,7 @@ class RemoveProjectImage(command.Command):
|
|
|
1013
1034
|
identity_common.add_project_domain_option_to_parser(parser)
|
|
1014
1035
|
return parser
|
|
1015
1036
|
|
|
1016
|
-
def take_action(self, parsed_args):
|
|
1037
|
+
def take_action(self, parsed_args: argparse.Namespace) -> None:
|
|
1017
1038
|
image_client = self.app.client_manager.image
|
|
1018
1039
|
identity_client = self.app.client_manager.identity
|
|
1019
1040
|
|
|
@@ -1034,7 +1055,7 @@ class RemoveProjectImage(command.Command):
|
|
|
1034
1055
|
class ShowProjectImage(command.ShowOne):
|
|
1035
1056
|
_description = _("Show a particular project associated with image")
|
|
1036
1057
|
|
|
1037
|
-
def get_parser(self, prog_name):
|
|
1058
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
1038
1059
|
parser = super().get_parser(prog_name)
|
|
1039
1060
|
parser.add_argument(
|
|
1040
1061
|
"image",
|
|
@@ -1049,7 +1070,9 @@ class ShowProjectImage(command.ShowOne):
|
|
|
1049
1070
|
identity_common.add_project_domain_option_to_parser(parser)
|
|
1050
1071
|
return parser
|
|
1051
1072
|
|
|
1052
|
-
def take_action(
|
|
1073
|
+
def take_action(
|
|
1074
|
+
self, parsed_args: argparse.Namespace
|
|
1075
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
1053
1076
|
image_client = self.app.client_manager.image
|
|
1054
1077
|
|
|
1055
1078
|
image = image_client.find_image(
|
|
@@ -1071,7 +1094,7 @@ class ShowProjectImage(command.ShowOne):
|
|
|
1071
1094
|
class SaveImage(command.Command):
|
|
1072
1095
|
_description = _("Save an image locally")
|
|
1073
1096
|
|
|
1074
|
-
def get_parser(self, prog_name):
|
|
1097
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
1075
1098
|
parser = super().get_parser(prog_name)
|
|
1076
1099
|
parser.add_argument(
|
|
1077
1100
|
"--chunk-size",
|
|
@@ -1096,7 +1119,7 @@ class SaveImage(command.Command):
|
|
|
1096
1119
|
)
|
|
1097
1120
|
return parser
|
|
1098
1121
|
|
|
1099
|
-
def take_action(self, parsed_args):
|
|
1122
|
+
def take_action(self, parsed_args: argparse.Namespace) -> None:
|
|
1100
1123
|
image_client = self.app.client_manager.image
|
|
1101
1124
|
image = image_client.find_image(
|
|
1102
1125
|
parsed_args.image,
|
|
@@ -1120,7 +1143,7 @@ class SetImage(command.Command):
|
|
|
1120
1143
|
|
|
1121
1144
|
deadopts = ('visibility',)
|
|
1122
1145
|
|
|
1123
|
-
def get_parser(self, prog_name):
|
|
1146
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
1124
1147
|
parser = super().get_parser(prog_name)
|
|
1125
1148
|
# TODO(bunting): There are additional arguments that v1 supported
|
|
1126
1149
|
# --size - does not exist in v2
|
|
@@ -1296,7 +1319,7 @@ class SetImage(command.Command):
|
|
|
1296
1319
|
)
|
|
1297
1320
|
return parser
|
|
1298
1321
|
|
|
1299
|
-
def take_action(self, parsed_args):
|
|
1322
|
+
def take_action(self, parsed_args: argparse.Namespace) -> None:
|
|
1300
1323
|
identity_client = self.app.client_manager.identity
|
|
1301
1324
|
image_client = self.app.client_manager.image
|
|
1302
1325
|
|
|
@@ -1340,6 +1363,7 @@ class SetImage(command.Command):
|
|
|
1340
1363
|
# our own membership
|
|
1341
1364
|
if not project_id:
|
|
1342
1365
|
project_id = self.app.client_manager.auth_ref.project_id
|
|
1366
|
+
assert project_id is not None, 'this should not happen'
|
|
1343
1367
|
image_client.update_member(
|
|
1344
1368
|
image=image.id,
|
|
1345
1369
|
member=project_id,
|
|
@@ -1421,7 +1445,7 @@ class SetImage(command.Command):
|
|
|
1421
1445
|
class ShowImage(command.ShowOne):
|
|
1422
1446
|
_description = _("Display image details")
|
|
1423
1447
|
|
|
1424
|
-
def get_parser(self, prog_name):
|
|
1448
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
1425
1449
|
parser = super().get_parser(prog_name)
|
|
1426
1450
|
parser.add_argument(
|
|
1427
1451
|
"--human-readable",
|
|
@@ -1436,7 +1460,9 @@ class ShowImage(command.ShowOne):
|
|
|
1436
1460
|
)
|
|
1437
1461
|
return parser
|
|
1438
1462
|
|
|
1439
|
-
def take_action(
|
|
1463
|
+
def take_action(
|
|
1464
|
+
self, parsed_args: argparse.Namespace
|
|
1465
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
1440
1466
|
image_client = self.app.client_manager.image
|
|
1441
1467
|
|
|
1442
1468
|
image = image_client.find_image(
|
|
@@ -1445,13 +1471,14 @@ class ShowImage(command.ShowOne):
|
|
|
1445
1471
|
)
|
|
1446
1472
|
|
|
1447
1473
|
info = _format_image(image, parsed_args.human_readable)
|
|
1448
|
-
|
|
1474
|
+
col_headers, col_data = zip(*sorted(info.items()))
|
|
1475
|
+
return col_headers, col_data
|
|
1449
1476
|
|
|
1450
1477
|
|
|
1451
1478
|
class UnsetImage(command.Command):
|
|
1452
1479
|
_description = _("Unset image tags and properties")
|
|
1453
1480
|
|
|
1454
|
-
def get_parser(self, prog_name):
|
|
1481
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
1455
1482
|
parser = super().get_parser(prog_name)
|
|
1456
1483
|
parser.add_argument(
|
|
1457
1484
|
"image",
|
|
@@ -1482,7 +1509,7 @@ class UnsetImage(command.Command):
|
|
|
1482
1509
|
)
|
|
1483
1510
|
return parser
|
|
1484
1511
|
|
|
1485
|
-
def take_action(self, parsed_args):
|
|
1512
|
+
def take_action(self, parsed_args: argparse.Namespace) -> None:
|
|
1486
1513
|
image_client = self.app.client_manager.image
|
|
1487
1514
|
image = image_client.find_image(
|
|
1488
1515
|
parsed_args.image,
|
|
@@ -1501,7 +1528,7 @@ class UnsetImage(command.Command):
|
|
|
1501
1528
|
)
|
|
1502
1529
|
tagret += 1
|
|
1503
1530
|
|
|
1504
|
-
kwargs: dict[str,
|
|
1531
|
+
kwargs: dict[str, Any] = {}
|
|
1505
1532
|
if parsed_args.properties:
|
|
1506
1533
|
for k in parsed_args.properties:
|
|
1507
1534
|
if k in image:
|
|
@@ -1512,7 +1539,7 @@ class UnsetImage(command.Command):
|
|
|
1512
1539
|
# out, what was changed inside
|
|
1513
1540
|
# NOTE: ping gtema to improve that in SDK
|
|
1514
1541
|
new_props = kwargs.get(
|
|
1515
|
-
'properties', image
|
|
1542
|
+
'properties', image['properties'].copy()
|
|
1516
1543
|
)
|
|
1517
1544
|
new_props.pop(k, None)
|
|
1518
1545
|
kwargs['properties'] = new_props
|
|
@@ -1569,7 +1596,7 @@ class StageImage(command.Command):
|
|
|
1569
1596
|
"(Glance 16.0.0 (Queens))"
|
|
1570
1597
|
)
|
|
1571
1598
|
|
|
1572
|
-
def get_parser(self, prog_name):
|
|
1599
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
1573
1600
|
parser = super().get_parser(prog_name)
|
|
1574
1601
|
|
|
1575
1602
|
parser.add_argument(
|
|
@@ -1599,7 +1626,7 @@ class StageImage(command.Command):
|
|
|
1599
1626
|
|
|
1600
1627
|
return parser
|
|
1601
1628
|
|
|
1602
|
-
def take_action(self, parsed_args):
|
|
1629
|
+
def take_action(self, parsed_args: argparse.Namespace) -> None:
|
|
1603
1630
|
image_client = self.app.client_manager.image
|
|
1604
1631
|
|
|
1605
1632
|
image = image_client.find_image(
|
|
@@ -1619,7 +1646,7 @@ class StageImage(command.Command):
|
|
|
1619
1646
|
else:
|
|
1620
1647
|
fp = get_data_from_stdin()
|
|
1621
1648
|
|
|
1622
|
-
kwargs: dict[str,
|
|
1649
|
+
kwargs: dict[str, Any] = {}
|
|
1623
1650
|
|
|
1624
1651
|
if parsed_args.progress and parsed_args.filename:
|
|
1625
1652
|
# NOTE(stephenfin): we only show a progress bar if the user
|
|
@@ -1645,7 +1672,7 @@ class ImportImage(command.ShowOne):
|
|
|
1645
1672
|
"(Glance 16.0.0 (Queens))"
|
|
1646
1673
|
)
|
|
1647
1674
|
|
|
1648
|
-
def get_parser(self, prog_name):
|
|
1675
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
1649
1676
|
parser = super().get_parser(prog_name)
|
|
1650
1677
|
|
|
1651
1678
|
parser.add_argument(
|
|
@@ -1756,7 +1783,9 @@ class ImportImage(command.ShowOne):
|
|
|
1756
1783
|
)
|
|
1757
1784
|
return parser
|
|
1758
1785
|
|
|
1759
|
-
def take_action(
|
|
1786
|
+
def take_action(
|
|
1787
|
+
self, parsed_args: argparse.Namespace
|
|
1788
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
1760
1789
|
image_client = self.app.client_manager.image
|
|
1761
1790
|
|
|
1762
1791
|
try:
|
|
@@ -1886,7 +1915,8 @@ class ImportImage(command.ShowOne):
|
|
|
1886
1915
|
)
|
|
1887
1916
|
|
|
1888
1917
|
info = _format_image(image)
|
|
1889
|
-
|
|
1918
|
+
col_headers, col_data = zip(*sorted(info.items()))
|
|
1919
|
+
return col_headers, col_data
|
|
1890
1920
|
|
|
1891
1921
|
|
|
1892
1922
|
class StoresInfo(command.Lister):
|
|
@@ -1894,7 +1924,7 @@ class StoresInfo(command.Lister):
|
|
|
1894
1924
|
"Get available backends (only valid with Multi-Backend support)"
|
|
1895
1925
|
)
|
|
1896
1926
|
|
|
1897
|
-
def get_parser(self, prog_name):
|
|
1927
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
1898
1928
|
parser = super().get_parser(prog_name)
|
|
1899
1929
|
parser.add_argument(
|
|
1900
1930
|
"--detail",
|
|
@@ -1907,7 +1937,9 @@ class StoresInfo(command.Lister):
|
|
|
1907
1937
|
)
|
|
1908
1938
|
return parser
|
|
1909
1939
|
|
|
1910
|
-
def take_action(
|
|
1940
|
+
def take_action(
|
|
1941
|
+
self, parsed_args: argparse.Namespace
|
|
1942
|
+
) -> tuple[tuple[str, ...], Iterable[tuple[Any, ...]]]:
|
|
1911
1943
|
image_client = self.app.client_manager.image
|
|
1912
1944
|
try:
|
|
1913
1945
|
columns: tuple[str, ...] = ("id", "description", "is_default")
|
openstackclient/image/v2/info.py
CHANGED
|
@@ -11,6 +11,10 @@
|
|
|
11
11
|
# under the License.
|
|
12
12
|
|
|
13
13
|
|
|
14
|
+
import argparse
|
|
15
|
+
from collections.abc import Iterable, Sequence
|
|
16
|
+
from typing import Any
|
|
17
|
+
|
|
14
18
|
from osc_lib.cli import format_columns
|
|
15
19
|
|
|
16
20
|
from openstackclient import command
|
|
@@ -20,7 +24,9 @@ from openstackclient.i18n import _
|
|
|
20
24
|
class ImportInfo(command.ShowOne):
|
|
21
25
|
_description = _("Show available import methods")
|
|
22
26
|
|
|
23
|
-
def take_action(
|
|
27
|
+
def take_action(
|
|
28
|
+
self, parsed_args: argparse.Namespace
|
|
29
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
24
30
|
image_client = self.app.client_manager.image
|
|
25
31
|
|
|
26
32
|
import_info = image_client.get_import_info()
|