python-openstackclient 6.6.1__py3-none-any.whl → 7.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/api/api.py +4 -4
- openstackclient/api/compute_v2.py +352 -638
- openstackclient/api/image_v1.py +1 -1
- openstackclient/api/object_store_v1.py +3 -4
- openstackclient/common/availability_zone.py +1 -1
- openstackclient/common/clientmanager.py +24 -20
- openstackclient/common/configuration.py +1 -1
- openstackclient/common/extension.py +1 -1
- openstackclient/common/limits.py +67 -34
- openstackclient/common/module.py +3 -3
- openstackclient/common/progressbar.py +2 -2
- openstackclient/common/project_cleanup.py +5 -2
- openstackclient/common/quota.py +299 -423
- openstackclient/common/versions.py +1 -1
- openstackclient/compute/client.py +7 -116
- openstackclient/compute/v2/agent.py +75 -49
- openstackclient/compute/v2/aggregate.py +38 -32
- openstackclient/compute/v2/console.py +2 -2
- openstackclient/compute/v2/flavor.py +6 -6
- openstackclient/compute/v2/host.py +38 -33
- openstackclient/compute/v2/hypervisor.py +9 -6
- openstackclient/compute/v2/keypair.py +7 -8
- openstackclient/compute/v2/server.py +479 -396
- openstackclient/compute/v2/server_backup.py +1 -1
- openstackclient/compute/v2/server_group.py +4 -4
- openstackclient/compute/v2/server_image.py +1 -1
- openstackclient/compute/v2/server_migration.py +3 -4
- openstackclient/compute/v2/service.py +4 -4
- openstackclient/compute/v2/usage.py +3 -3
- openstackclient/identity/common.py +34 -0
- openstackclient/identity/v2_0/catalog.py +2 -2
- openstackclient/identity/v2_0/ec2creds.py +4 -4
- openstackclient/identity/v2_0/endpoint.py +4 -4
- openstackclient/identity/v2_0/project.py +6 -6
- openstackclient/identity/v2_0/role.py +5 -5
- openstackclient/identity/v2_0/role_assignment.py +1 -1
- openstackclient/identity/v2_0/service.py +4 -4
- openstackclient/identity/v2_0/token.py +2 -2
- openstackclient/identity/v2_0/user.py +7 -7
- openstackclient/identity/v3/access_rule.py +3 -3
- openstackclient/identity/v3/application_credential.py +125 -43
- openstackclient/identity/v3/catalog.py +2 -2
- openstackclient/identity/v3/consumer.py +4 -4
- openstackclient/identity/v3/credential.py +5 -5
- openstackclient/identity/v3/domain.py +5 -5
- openstackclient/identity/v3/ec2creds.py +4 -4
- openstackclient/identity/v3/endpoint.py +7 -7
- openstackclient/identity/v3/endpoint_group.py +8 -10
- openstackclient/identity/v3/federation_protocol.py +5 -5
- openstackclient/identity/v3/group.py +8 -8
- openstackclient/identity/v3/identity_provider.py +5 -5
- openstackclient/identity/v3/implied_role.py +3 -3
- openstackclient/identity/v3/limit.py +5 -5
- openstackclient/identity/v3/mapping.py +5 -5
- openstackclient/identity/v3/policy.py +5 -5
- openstackclient/identity/v3/project.py +5 -5
- openstackclient/identity/v3/region.py +5 -5
- openstackclient/identity/v3/registered_limit.py +5 -5
- openstackclient/identity/v3/role.py +7 -7
- openstackclient/identity/v3/role_assignment.py +92 -140
- openstackclient/identity/v3/service.py +64 -34
- openstackclient/identity/v3/service_provider.py +4 -4
- openstackclient/identity/v3/tag.py +2 -2
- openstackclient/identity/v3/token.py +5 -5
- openstackclient/identity/v3/trust.py +3 -3
- openstackclient/identity/v3/user.py +144 -80
- openstackclient/image/client.py +4 -4
- openstackclient/image/v1/image.py +8 -9
- openstackclient/image/v2/cache.py +12 -10
- openstackclient/image/v2/metadef_objects.py +44 -0
- openstackclient/image/v2/metadef_resource_type_association.py +189 -0
- openstackclient/image/v2/task.py +1 -1
- openstackclient/network/common.py +6 -5
- openstackclient/network/utils.py +2 -2
- openstackclient/network/v2/address_group.py +6 -6
- openstackclient/network/v2/address_scope.py +5 -5
- openstackclient/network/v2/default_security_group_rule.py +1 -1
- openstackclient/network/v2/floating_ip.py +8 -10
- openstackclient/network/v2/floating_ip_pool.py +6 -15
- openstackclient/network/v2/floating_ip_port_forwarding.py +5 -13
- openstackclient/network/v2/ip_availability.py +2 -2
- openstackclient/network/v2/l3_conntrack_helper.py +5 -5
- openstackclient/network/v2/network.py +8 -8
- openstackclient/network/v2/network_agent.py +8 -8
- openstackclient/network/v2/network_auto_allocated_topology.py +2 -2
- openstackclient/network/v2/network_flavor.py +6 -8
- openstackclient/network/v2/network_flavor_profile.py +4 -4
- openstackclient/network/v2/network_meter.py +3 -3
- openstackclient/network/v2/network_meter_rule.py +3 -3
- openstackclient/network/v2/network_qos_policy.py +5 -5
- openstackclient/network/v2/network_qos_rule.py +9 -9
- openstackclient/network/v2/network_qos_rule_type.py +1 -1
- openstackclient/network/v2/network_rbac.py +5 -5
- openstackclient/network/v2/network_segment.py +5 -5
- openstackclient/network/v2/network_segment_range.py +7 -7
- openstackclient/network/v2/network_trunk.py +7 -7
- openstackclient/network/v2/port.py +26 -12
- openstackclient/network/v2/router.py +403 -54
- openstackclient/network/v2/security_group.py +18 -14
- openstackclient/network/v2/security_group_rule.py +18 -15
- openstackclient/network/v2/subnet.py +15 -8
- openstackclient/network/v2/subnet_pool.py +6 -6
- openstackclient/object/v1/account.py +2 -2
- openstackclient/object/v1/container.py +7 -7
- openstackclient/object/v1/object.py +7 -7
- openstackclient/releasenotes/notes/volume-backup-created-at-list-b49ec893ae1f6b0d.yaml +4 -0
- openstackclient/shell.py +4 -6
- openstackclient/tests/functional/base.py +1 -1
- openstackclient/tests/functional/common/test_extension.py +1 -1
- openstackclient/tests/functional/common/test_help.py +2 -2
- openstackclient/tests/functional/common/test_module.py +1 -1
- openstackclient/tests/functional/common/test_quota.py +43 -61
- openstackclient/tests/functional/compute/v2/common.py +2 -2
- openstackclient/tests/functional/compute/v2/test_flavor.py +2 -2
- openstackclient/tests/functional/compute/v2/test_keypair.py +1 -1
- openstackclient/tests/functional/compute/v2/test_server.py +5 -5
- openstackclient/tests/functional/compute/v2/test_server_event.py +1 -1
- openstackclient/tests/functional/identity/v2/common.py +3 -3
- openstackclient/tests/functional/identity/v3/common.py +12 -4
- openstackclient/tests/functional/identity/v3/test_application_credential.py +6 -12
- openstackclient/tests/functional/identity/v3/test_domain.py +1 -3
- openstackclient/tests/functional/identity/v3/test_endpoint.py +1 -1
- openstackclient/tests/functional/identity/v3/test_idp.py +1 -1
- openstackclient/tests/functional/identity/v3/test_region.py +1 -3
- openstackclient/tests/functional/identity/v3/test_role.py +2 -2
- openstackclient/tests/functional/identity/v3/test_role_assignment.py +210 -0
- openstackclient/tests/functional/identity/v3/test_service.py +1 -3
- openstackclient/tests/functional/identity/v3/test_service_provider.py +1 -3
- openstackclient/tests/functional/image/base.py +1 -1
- openstackclient/tests/functional/image/v2/test_image.py +1 -1
- openstackclient/tests/functional/image/v2/test_info.py +1 -1
- openstackclient/tests/functional/network/v2/common.py +4 -6
- openstackclient/tests/functional/network/v2/test_network.py +5 -3
- openstackclient/tests/functional/network/v2/test_network_agent.py +7 -5
- openstackclient/tests/functional/network/v2/test_network_qos_rule.py +4 -4
- openstackclient/tests/functional/network/v2/test_port.py +11 -7
- openstackclient/tests/functional/network/v2/test_router.py +2 -2
- openstackclient/tests/functional/object/v1/common.py +1 -1
- openstackclient/tests/functional/object/v1/test_container.py +3 -3
- openstackclient/tests/functional/object/v1/test_object.py +9 -13
- openstackclient/tests/functional/volume/base.py +1 -1
- openstackclient/tests/functional/volume/v1/test_service.py +1 -1
- openstackclient/tests/functional/volume/v1/test_snapshot.py +2 -2
- openstackclient/tests/functional/volume/v1/test_transfer_request.py +2 -2
- openstackclient/tests/functional/volume/v1/test_volume_type.py +1 -1
- openstackclient/tests/functional/volume/v2/test_service.py +2 -2
- openstackclient/tests/functional/volume/v2/test_volume_backup.py +2 -2
- openstackclient/tests/functional/volume/v2/test_volume_snapshot.py +2 -2
- openstackclient/tests/functional/volume/v2/test_volume_type.py +1 -1
- openstackclient/tests/functional/volume/v3/test_volume_snapshot.py +2 -2
- openstackclient/tests/functional/volume/v3/test_volume_type.py +1 -1
- openstackclient/tests/unit/api/fakes.py +1 -1
- openstackclient/tests/unit/api/test_api.py +2 -2
- openstackclient/tests/unit/api/test_compute_v2.py +522 -707
- openstackclient/tests/unit/api/test_image_v1.py +1 -1
- openstackclient/tests/unit/api/test_image_v2.py +1 -1
- openstackclient/tests/unit/api/test_object_store_v1.py +4 -4
- openstackclient/tests/unit/common/test_limits.py +73 -35
- openstackclient/tests/unit/common/test_logs.py +2 -2
- openstackclient/tests/unit/common/test_module.py +4 -2
- openstackclient/tests/unit/common/test_project_cleanup.py +31 -6
- openstackclient/tests/unit/common/test_quota.py +490 -630
- openstackclient/tests/unit/compute/v2/fakes.py +37 -286
- openstackclient/tests/unit/compute/v2/test_agent.py +189 -147
- openstackclient/tests/unit/compute/v2/test_aggregate.py +87 -57
- openstackclient/tests/unit/compute/v2/test_console.py +4 -5
- openstackclient/tests/unit/compute/v2/test_flavor.py +59 -68
- openstackclient/tests/unit/compute/v2/test_host.py +83 -54
- openstackclient/tests/unit/compute/v2/test_hypervisor.py +57 -34
- openstackclient/tests/unit/compute/v2/test_hypervisor_stats.py +2 -2
- openstackclient/tests/unit/compute/v2/test_keypair.py +65 -50
- openstackclient/tests/unit/compute/v2/test_server.py +2850 -2453
- openstackclient/tests/unit/compute/v2/test_server_backup.py +1 -1
- openstackclient/tests/unit/compute/v2/test_server_event.py +14 -39
- openstackclient/tests/unit/compute/v2/test_server_group.py +28 -29
- openstackclient/tests/unit/compute/v2/test_server_migration.py +43 -68
- openstackclient/tests/unit/compute/v2/test_server_volume.py +17 -34
- openstackclient/tests/unit/compute/v2/test_service.py +34 -52
- openstackclient/tests/unit/compute/v2/test_usage.py +4 -4
- openstackclient/tests/unit/fakes.py +12 -12
- openstackclient/tests/unit/identity/v2_0/fakes.py +27 -10
- openstackclient/tests/unit/identity/v2_0/test_catalog.py +3 -3
- openstackclient/tests/unit/identity/v2_0/test_endpoint.py +7 -7
- openstackclient/tests/unit/identity/v2_0/test_project.py +8 -8
- openstackclient/tests/unit/identity/v2_0/test_role.py +10 -10
- openstackclient/tests/unit/identity/v2_0/test_role_assignment.py +4 -4
- openstackclient/tests/unit/identity/v2_0/test_service.py +6 -6
- openstackclient/tests/unit/identity/v2_0/test_token.py +4 -4
- openstackclient/tests/unit/identity/v2_0/test_user.py +8 -8
- openstackclient/tests/unit/identity/v3/fakes.py +59 -20
- openstackclient/tests/unit/identity/v3/test_access_rule.py +5 -5
- openstackclient/tests/unit/identity/v3/test_application_credential.py +207 -230
- openstackclient/tests/unit/identity/v3/test_catalog.py +3 -3
- openstackclient/tests/unit/identity/v3/test_consumer.py +7 -8
- openstackclient/tests/unit/identity/v3/test_credential.py +9 -9
- openstackclient/tests/unit/identity/v3/test_domain.py +8 -8
- openstackclient/tests/unit/identity/v3/test_endpoint.py +13 -13
- openstackclient/tests/unit/identity/v3/test_endpoint_group.py +12 -14
- openstackclient/tests/unit/identity/v3/test_group.py +12 -12
- openstackclient/tests/unit/identity/v3/test_identity_provider.py +8 -8
- openstackclient/tests/unit/identity/v3/test_implied_role.py +5 -5
- openstackclient/tests/unit/identity/v3/test_limit.py +7 -7
- openstackclient/tests/unit/identity/v3/test_mappings.py +7 -7
- openstackclient/tests/unit/identity/v3/test_oauth.py +5 -5
- openstackclient/tests/unit/identity/v3/test_project.py +16 -16
- openstackclient/tests/unit/identity/v3/test_protocol.py +7 -7
- openstackclient/tests/unit/identity/v3/test_region.py +7 -7
- openstackclient/tests/unit/identity/v3/test_registered_limit.py +12 -13
- openstackclient/tests/unit/identity/v3/test_role.py +13 -13
- openstackclient/tests/unit/identity/v3/test_role_assignment.py +410 -331
- openstackclient/tests/unit/identity/v3/test_service.py +90 -94
- openstackclient/tests/unit/identity/v3/test_service_provider.py +7 -7
- openstackclient/tests/unit/identity/v3/test_token.py +4 -4
- openstackclient/tests/unit/identity/v3/test_trust.py +9 -9
- openstackclient/tests/unit/identity/v3/test_unscoped_saml.py +4 -4
- openstackclient/tests/unit/identity/v3/test_user.py +299 -327
- openstackclient/tests/unit/image/v1/test_image.py +6 -6
- openstackclient/tests/unit/image/v2/fakes.py +46 -9
- openstackclient/tests/unit/image/v2/test_cache.py +2 -2
- openstackclient/tests/unit/image/v2/test_image.py +3 -3
- openstackclient/tests/unit/image/v2/test_metadef_objects.py +62 -0
- openstackclient/tests/unit/image/v2/test_metadef_resource_type_association.py +131 -0
- openstackclient/tests/unit/integ/base.py +1 -1
- openstackclient/tests/unit/integ/cli/test_project.py +4 -4
- openstackclient/tests/unit/integ/cli/test_shell.py +7 -7
- openstackclient/tests/unit/network/test_common.py +12 -21
- openstackclient/tests/unit/network/v2/fakes.py +64 -130
- openstackclient/tests/unit/network/v2/test_address_group.py +15 -15
- openstackclient/tests/unit/network/v2/test_address_scope.py +13 -13
- openstackclient/tests/unit/network/v2/test_default_security_group_rule.py +49 -27
- openstackclient/tests/unit/network/v2/test_floating_ip_compute.py +40 -38
- openstackclient/tests/unit/network/v2/test_floating_ip_network.py +15 -15
- openstackclient/tests/unit/network/v2/test_floating_ip_pool_compute.py +4 -7
- openstackclient/tests/unit/network/v2/test_floating_ip_pool_network.py +3 -5
- openstackclient/tests/unit/network/v2/test_floating_ip_port_forwarding.py +11 -11
- openstackclient/tests/unit/network/v2/test_ip_availability.py +6 -6
- openstackclient/tests/unit/network/v2/test_l3_conntrack_helper.py +11 -21
- openstackclient/tests/unit/network/v2/test_local_ip.py +7 -7
- openstackclient/tests/unit/network/v2/test_local_ip_association.py +3 -5
- openstackclient/tests/unit/network/v2/test_ndp_proxy.py +13 -13
- openstackclient/tests/unit/network/v2/test_network.py +23 -28
- openstackclient/tests/unit/network/v2/test_network_agent.py +17 -21
- openstackclient/tests/unit/network/v2/test_network_auto_allocated_topology.py +8 -8
- openstackclient/tests/unit/network/v2/test_network_compute.py +66 -65
- openstackclient/tests/unit/network/v2/test_network_flavor.py +17 -19
- openstackclient/tests/unit/network/v2/test_network_flavor_profile.py +13 -13
- openstackclient/tests/unit/network/v2/test_network_meter.py +11 -11
- openstackclient/tests/unit/network/v2/test_network_meter_rule.py +11 -11
- openstackclient/tests/unit/network/v2/test_network_qos_policy.py +11 -21
- openstackclient/tests/unit/network/v2/test_network_qos_rule.py +51 -77
- openstackclient/tests/unit/network/v2/test_network_qos_rule_type.py +5 -9
- openstackclient/tests/unit/network/v2/test_network_rbac.py +12 -12
- openstackclient/tests/unit/network/v2/test_network_segment.py +11 -15
- openstackclient/tests/unit/network/v2/test_network_segment_range.py +11 -13
- openstackclient/tests/unit/network/v2/test_network_service_provider.py +3 -5
- openstackclient/tests/unit/network/v2/test_network_trunk.py +11 -11
- openstackclient/tests/unit/network/v2/test_port.py +22 -25
- openstackclient/tests/unit/network/v2/test_router.py +721 -51
- openstackclient/tests/unit/network/v2/test_security_group_compute.py +65 -49
- openstackclient/tests/unit/network/v2/test_security_group_network.py +15 -15
- openstackclient/tests/unit/network/v2/test_security_group_rule_compute.py +57 -45
- openstackclient/tests/unit/network/v2/test_security_group_rule_network.py +11 -19
- openstackclient/tests/unit/network/v2/test_subnet.py +29 -25
- openstackclient/tests/unit/network/v2/test_subnet_pool.py +15 -15
- openstackclient/tests/unit/object/v1/fakes.py +1 -1
- openstackclient/tests/unit/object/v1/test_container.py +5 -5
- openstackclient/tests/unit/object/v1/test_container_all.py +6 -6
- openstackclient/tests/unit/object/v1/test_object.py +3 -3
- openstackclient/tests/unit/object/v1/test_object_all.py +5 -5
- openstackclient/tests/unit/test_shell.py +5 -5
- openstackclient/tests/unit/utils.py +4 -1
- openstackclient/tests/unit/volume/test_find_resource.py +2 -2
- openstackclient/tests/unit/volume/v1/fakes.py +5 -6
- openstackclient/tests/unit/volume/v1/test_volume.py +5 -4
- openstackclient/tests/unit/volume/v2/fakes.py +39 -259
- openstackclient/tests/unit/volume/v2/test_consistency_group_snapshot.py +5 -5
- openstackclient/tests/unit/volume/v2/test_qos_specs.py +9 -9
- openstackclient/tests/unit/volume/v2/test_volume.py +21 -87
- openstackclient/tests/unit/volume/v2/test_volume_backup.py +10 -368
- openstackclient/tests/unit/volume/v2/test_volume_snapshot.py +1 -1
- openstackclient/tests/unit/volume/v2/test_volume_transfer_request.py +0 -44
- openstackclient/tests/unit/volume/v2/test_volume_type.py +6 -87
- openstackclient/tests/unit/volume/v3/fakes.py +505 -22
- openstackclient/tests/unit/volume/v3/test_block_storage_cleanup.py +2 -3
- openstackclient/tests/unit/volume/v3/test_block_storage_cluster.py +10 -11
- openstackclient/tests/unit/volume/v3/test_block_storage_log_level.py +10 -6
- openstackclient/tests/unit/volume/v3/test_block_storage_manage.py +25 -17
- openstackclient/tests/unit/volume/v3/test_block_storage_resource_filter.py +6 -32
- openstackclient/tests/unit/volume/v3/test_service.py +271 -0
- openstackclient/tests/unit/volume/v3/test_volume.py +2177 -33
- openstackclient/tests/unit/volume/v3/test_volume_attachment.py +48 -52
- openstackclient/tests/unit/volume/v3/test_volume_backup.py +892 -0
- openstackclient/tests/unit/volume/v3/test_volume_group.py +19 -20
- openstackclient/tests/unit/volume/v3/test_volume_group_snapshot.py +14 -34
- openstackclient/tests/unit/volume/v3/test_volume_group_type.py +13 -16
- openstackclient/tests/unit/volume/v3/test_volume_message.py +10 -11
- openstackclient/tests/unit/volume/v3/test_volume_snapshot.py +161 -0
- openstackclient/tests/unit/volume/v3/test_volume_transfer_request.py +425 -0
- openstackclient/tests/unit/volume/v3/test_volume_type.py +1109 -0
- openstackclient/volume/v1/qos_specs.py +7 -7
- openstackclient/volume/v1/service.py +2 -2
- openstackclient/volume/v1/volume.py +12 -12
- openstackclient/volume/v1/volume_backup.py +7 -7
- openstackclient/volume/v1/volume_snapshot.py +8 -8
- openstackclient/volume/v1/volume_transfer_request.py +5 -5
- openstackclient/volume/v1/volume_type.py +7 -7
- openstackclient/volume/v2/backup_record.py +2 -2
- openstackclient/volume/v2/consistency_group.py +7 -9
- openstackclient/volume/v2/consistency_group_snapshot.py +4 -12
- openstackclient/volume/v2/qos_specs.py +7 -7
- openstackclient/volume/v2/service.py +2 -2
- openstackclient/volume/v2/volume.py +80 -80
- openstackclient/volume/v2/volume_backend.py +2 -2
- openstackclient/volume/v2/volume_backup.py +9 -217
- openstackclient/volume/v2/volume_host.py +2 -2
- openstackclient/volume/v2/volume_snapshot.py +8 -8
- openstackclient/volume/v2/volume_transfer_request.py +5 -37
- openstackclient/volume/v2/volume_type.py +7 -89
- openstackclient/volume/v3/service.py +56 -0
- openstackclient/volume/v3/volume.py +971 -0
- openstackclient/volume/v3/volume_attachment.py +31 -29
- openstackclient/volume/v3/volume_backup.py +670 -0
- openstackclient/volume/v3/volume_message.py +1 -1
- openstackclient/volume/v3/volume_snapshot.py +97 -0
- openstackclient/volume/v3/volume_transfer_request.py +233 -0
- openstackclient/volume/v3/volume_type.py +967 -0
- {python_openstackclient-6.6.1.dist-info → python_openstackclient-7.1.0.dist-info}/AUTHORS +6 -0
- {python_openstackclient-6.6.1.dist-info → python_openstackclient-7.1.0.dist-info}/METADATA +4 -4
- python_openstackclient-7.1.0.dist-info/RECORD +503 -0
- {python_openstackclient-6.6.1.dist-info → python_openstackclient-7.1.0.dist-info}/entry_points.txt +33 -27
- python_openstackclient-7.1.0.dist-info/pbr.json +1 -0
- python_openstackclient-6.6.1.dist-info/RECORD +0 -489
- python_openstackclient-6.6.1.dist-info/pbr.json +0 -1
- {python_openstackclient-6.6.1.dist-info → python_openstackclient-7.1.0.dist-info}/LICENSE +0 -0
- {python_openstackclient-6.6.1.dist-info → python_openstackclient-7.1.0.dist-info}/WHEEL +0 -0
- {python_openstackclient-6.6.1.dist-info → python_openstackclient-7.1.0.dist-info}/top_level.txt +0 -0
openstackclient/api/image_v1.py
CHANGED
|
@@ -22,7 +22,7 @@ class APIv1(api.BaseAPI):
|
|
|
22
22
|
_endpoint_suffix = '/v1'
|
|
23
23
|
|
|
24
24
|
def __init__(self, endpoint=None, **kwargs):
|
|
25
|
-
super(
|
|
25
|
+
super().__init__(endpoint=endpoint, **kwargs)
|
|
26
26
|
|
|
27
27
|
self.endpoint = self.endpoint.rstrip('/')
|
|
28
28
|
self._munge_url()
|
|
@@ -13,7 +13,6 @@
|
|
|
13
13
|
|
|
14
14
|
"""Object Store v1 API Library"""
|
|
15
15
|
|
|
16
|
-
import io
|
|
17
16
|
import logging
|
|
18
17
|
import os
|
|
19
18
|
import sys
|
|
@@ -33,7 +32,7 @@ class APIv1(api.BaseAPI):
|
|
|
33
32
|
"""Object Store v1 API"""
|
|
34
33
|
|
|
35
34
|
def __init__(self, **kwargs):
|
|
36
|
-
super(
|
|
35
|
+
super().__init__(**kwargs)
|
|
37
36
|
|
|
38
37
|
def container_create(
|
|
39
38
|
self, container=None, public=False, storage_policy=None
|
|
@@ -257,11 +256,11 @@ class APIv1(api.BaseAPI):
|
|
|
257
256
|
# object's name in the container.
|
|
258
257
|
object_name_str = name if name else object
|
|
259
258
|
|
|
260
|
-
full_url = "
|
|
259
|
+
full_url = "{}/{}".format(
|
|
261
260
|
urllib.parse.quote(container),
|
|
262
261
|
urllib.parse.quote(object_name_str),
|
|
263
262
|
)
|
|
264
|
-
with
|
|
263
|
+
with open(object, 'rb') as f:
|
|
265
264
|
response = self.create(
|
|
266
265
|
full_url,
|
|
267
266
|
method='PUT',
|
|
@@ -47,7 +47,7 @@ def _xform_compute_availability_zone(az, include_extra):
|
|
|
47
47
|
for svc, state in services.items():
|
|
48
48
|
info = copy.deepcopy(host_info)
|
|
49
49
|
info['service_name'] = svc
|
|
50
|
-
info['service_status'] = '
|
|
50
|
+
info['service_status'] = '{} {} {}'.format(
|
|
51
51
|
'enabled' if state['active'] else 'disabled',
|
|
52
52
|
':-)' if state['available'] else 'XXX',
|
|
53
53
|
state['updated_at'],
|
|
@@ -51,7 +51,7 @@ class ClientManager(clientmanager.ClientManager):
|
|
|
51
51
|
api_version=None,
|
|
52
52
|
pw_func=None,
|
|
53
53
|
):
|
|
54
|
-
super(
|
|
54
|
+
super().__init__(
|
|
55
55
|
cli_options=cli_options,
|
|
56
56
|
api_version=api_version,
|
|
57
57
|
pw_func=pw_func,
|
|
@@ -94,7 +94,7 @@ class ClientManager(clientmanager.ClientManager):
|
|
|
94
94
|
except TypeError as e:
|
|
95
95
|
self._fallback_load_auth_plugin(e)
|
|
96
96
|
|
|
97
|
-
return super(
|
|
97
|
+
return super().setup_auth()
|
|
98
98
|
|
|
99
99
|
def _fallback_load_auth_plugin(self, e):
|
|
100
100
|
# NOTES(RuiChen): Hack to avoid auth plugins choking on data they don't
|
|
@@ -116,7 +116,6 @@ class ClientManager(clientmanager.ClientManager):
|
|
|
116
116
|
|
|
117
117
|
def is_network_endpoint_enabled(self):
|
|
118
118
|
"""Check if the network endpoint is enabled"""
|
|
119
|
-
|
|
120
119
|
# NOTE(dtroyer): is_service_available() can also return None if
|
|
121
120
|
# there is no Service Catalog, callers here are
|
|
122
121
|
# not expecting that so fold None into True to
|
|
@@ -125,33 +124,37 @@ class ClientManager(clientmanager.ClientManager):
|
|
|
125
124
|
|
|
126
125
|
def is_compute_endpoint_enabled(self):
|
|
127
126
|
"""Check if Compute endpoint is enabled"""
|
|
128
|
-
|
|
129
127
|
return self.is_service_available('compute') is not False
|
|
130
128
|
|
|
131
|
-
|
|
129
|
+
# TODO(stephenfin): Drop volume_client argument in OSC 8.0 or later.
|
|
130
|
+
def is_volume_endpoint_enabled(self, volume_client=None):
|
|
132
131
|
"""Check if volume endpoint is enabled"""
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
self.is_service_available("volumev%s" % volume_version)
|
|
139
|
-
is not False
|
|
140
|
-
):
|
|
141
|
-
return True
|
|
142
|
-
elif self.is_service_available('volume') is not False:
|
|
143
|
-
return True
|
|
144
|
-
else:
|
|
145
|
-
return False
|
|
132
|
+
return (
|
|
133
|
+
self.is_service_available('volume') is not False
|
|
134
|
+
or self.is_service_available('volumev3') is not False
|
|
135
|
+
or self.is_service_available('volumev2') is not False
|
|
136
|
+
)
|
|
146
137
|
|
|
147
138
|
|
|
148
139
|
# Plugin Support
|
|
149
140
|
|
|
150
141
|
|
|
142
|
+
def _on_load_failure_callback(
|
|
143
|
+
manager: stevedore.ExtensionManager,
|
|
144
|
+
ep: importlib.metadata.EntryPoint,
|
|
145
|
+
err: Exception,
|
|
146
|
+
) -> None:
|
|
147
|
+
sys.stderr.write(
|
|
148
|
+
f"WARNING: Failed to import plugin {ep.group}:{ep.name}: {err}.\n"
|
|
149
|
+
)
|
|
150
|
+
|
|
151
|
+
|
|
151
152
|
def get_plugin_modules(group):
|
|
152
153
|
"""Find plugin entry points"""
|
|
153
154
|
mod_list = []
|
|
154
|
-
mgr = stevedore.ExtensionManager(
|
|
155
|
+
mgr = stevedore.ExtensionManager(
|
|
156
|
+
group, on_load_failure_callback=_on_load_failure_callback
|
|
157
|
+
)
|
|
155
158
|
for ep in mgr:
|
|
156
159
|
LOG.debug('Found plugin %s', ep.name)
|
|
157
160
|
|
|
@@ -170,7 +173,8 @@ def get_plugin_modules(group):
|
|
|
170
173
|
module = importlib.import_module(module_name)
|
|
171
174
|
except Exception as err:
|
|
172
175
|
sys.stderr.write(
|
|
173
|
-
"WARNING: Failed to import plugin
|
|
176
|
+
f"WARNING: Failed to import plugin {ep.group}:{ep.name}: "
|
|
177
|
+
f"{err}.\n"
|
|
174
178
|
)
|
|
175
179
|
continue
|
|
176
180
|
|
|
@@ -27,7 +27,7 @@ class ShowConfiguration(command.ShowOne):
|
|
|
27
27
|
auth_required = False
|
|
28
28
|
|
|
29
29
|
def get_parser(self, prog_name):
|
|
30
|
-
parser = super(
|
|
30
|
+
parser = super().get_parser(prog_name)
|
|
31
31
|
mask_group = parser.add_mutually_exclusive_group()
|
|
32
32
|
mask_group.add_argument(
|
|
33
33
|
"--mask",
|
|
@@ -148,7 +148,7 @@ class ShowExtension(command.ShowOne):
|
|
|
148
148
|
_description = _("Show API extension")
|
|
149
149
|
|
|
150
150
|
def get_parser(self, prog_name):
|
|
151
|
-
parser = super(
|
|
151
|
+
parser = super().get_parser(prog_name)
|
|
152
152
|
parser.add_argument(
|
|
153
153
|
'extension',
|
|
154
154
|
metavar='<extension>',
|
openstackclient/common/limits.py
CHANGED
|
@@ -24,11 +24,36 @@ from openstackclient.i18n import _
|
|
|
24
24
|
from openstackclient.identity import common as identity_common
|
|
25
25
|
|
|
26
26
|
|
|
27
|
+
def _format_absolute_limit(absolute_limits):
|
|
28
|
+
info = {}
|
|
29
|
+
|
|
30
|
+
for key in set(absolute_limits):
|
|
31
|
+
if key in ('id', 'name', 'location'):
|
|
32
|
+
continue
|
|
33
|
+
|
|
34
|
+
info[key] = absolute_limits[key]
|
|
35
|
+
|
|
36
|
+
return info
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
def _format_rate_limit(rate_limits):
|
|
40
|
+
# flatten this:
|
|
41
|
+
#
|
|
42
|
+
# {'uri': '<uri>', 'limit': [{'value': '<value>', ...], ...}
|
|
43
|
+
#
|
|
44
|
+
# to this:
|
|
45
|
+
#
|
|
46
|
+
# {'uri': '<uri>', 'value': '<value>', ...}, ...}
|
|
47
|
+
return itertools.chain(
|
|
48
|
+
*[[{'uri': x['uri'], **y} for y in x['limit']] for x in rate_limits]
|
|
49
|
+
)
|
|
50
|
+
|
|
51
|
+
|
|
27
52
|
class ShowLimits(command.Lister):
|
|
28
53
|
_description = _("Show compute and block storage limits")
|
|
29
54
|
|
|
30
55
|
def get_parser(self, prog_name):
|
|
31
|
-
parser = super(
|
|
56
|
+
parser = super().get_parser(prog_name)
|
|
32
57
|
type_group = parser.add_mutually_exclusive_group(required=True)
|
|
33
58
|
type_group.add_argument(
|
|
34
59
|
"--absolute",
|
|
@@ -42,37 +67,40 @@ class ShowLimits(command.Lister):
|
|
|
42
67
|
dest="is_rate",
|
|
43
68
|
action="store_true",
|
|
44
69
|
default=False,
|
|
45
|
-
help=_(
|
|
70
|
+
help=_(
|
|
71
|
+
'Show rate limits. This is not supported by the compute '
|
|
72
|
+
'service since the 12.0.0 (Liberty) release and is only '
|
|
73
|
+
'supported by the block storage service when the '
|
|
74
|
+
'rate-limiting middleware is enabled. It is therefore a no-op '
|
|
75
|
+
'in most deployments.'
|
|
76
|
+
),
|
|
46
77
|
)
|
|
47
78
|
parser.add_argument(
|
|
48
79
|
"--reserved",
|
|
49
80
|
dest="is_reserved",
|
|
50
81
|
action="store_true",
|
|
51
82
|
default=False,
|
|
52
|
-
help=_("Include reservations count
|
|
83
|
+
help=_("Include reservations count (only valid with --absolute)"),
|
|
53
84
|
)
|
|
54
85
|
parser.add_argument(
|
|
55
86
|
'--project',
|
|
56
87
|
metavar='<project>',
|
|
57
88
|
help=_(
|
|
58
|
-
'Show limits for a specific project (name or ID)'
|
|
59
|
-
'
|
|
89
|
+
'Show limits for a specific project (name or ID) '
|
|
90
|
+
'(only valid with --absolute)'
|
|
60
91
|
),
|
|
61
92
|
)
|
|
62
93
|
parser.add_argument(
|
|
63
94
|
'--domain',
|
|
64
95
|
metavar='<domain>',
|
|
65
96
|
help=_(
|
|
66
|
-
'Domain the project belongs to (name or ID)'
|
|
67
|
-
'
|
|
97
|
+
'Domain the project belongs to (name or ID) '
|
|
98
|
+
'(only valid with --absolute)'
|
|
68
99
|
),
|
|
69
100
|
)
|
|
70
101
|
return parser
|
|
71
102
|
|
|
72
103
|
def take_action(self, parsed_args):
|
|
73
|
-
compute_client = self.app.client_manager.compute
|
|
74
|
-
volume_client = self.app.client_manager.volume
|
|
75
|
-
|
|
76
104
|
project_id = None
|
|
77
105
|
if parsed_args.project is not None:
|
|
78
106
|
identity_client = self.app.client_manager.identity
|
|
@@ -94,33 +122,32 @@ class ShowLimits(command.Lister):
|
|
|
94
122
|
volume_limits = None
|
|
95
123
|
|
|
96
124
|
if self.app.client_manager.is_compute_endpoint_enabled():
|
|
97
|
-
|
|
98
|
-
|
|
125
|
+
compute_client = self.app.client_manager.sdk_connection.compute
|
|
126
|
+
compute_limits = compute_client.get_limits(
|
|
127
|
+
reserved=parsed_args.is_reserved, tenant_id=project_id
|
|
99
128
|
)
|
|
100
129
|
|
|
101
|
-
if self.app.client_manager.is_volume_endpoint_enabled(
|
|
102
|
-
|
|
130
|
+
if self.app.client_manager.is_volume_endpoint_enabled():
|
|
131
|
+
volume_client = self.app.client_manager.sdk_connection.volume
|
|
132
|
+
volume_limits = volume_client.get_limits(
|
|
133
|
+
project_id=project_id,
|
|
134
|
+
)
|
|
103
135
|
|
|
104
|
-
data = []
|
|
105
136
|
if parsed_args.is_absolute:
|
|
137
|
+
columns = ["Name", "Value"]
|
|
138
|
+
info = {}
|
|
106
139
|
if compute_limits:
|
|
107
|
-
|
|
140
|
+
info.update(_format_absolute_limit(compute_limits.absolute))
|
|
108
141
|
if volume_limits:
|
|
109
|
-
|
|
110
|
-
columns = ["Name", "Value"]
|
|
111
|
-
return (
|
|
112
|
-
columns,
|
|
113
|
-
(
|
|
114
|
-
utils.get_item_properties(s, columns)
|
|
115
|
-
for s in itertools.chain(*data)
|
|
116
|
-
),
|
|
117
|
-
)
|
|
142
|
+
info.update(_format_absolute_limit(volume_limits.absolute))
|
|
118
143
|
|
|
119
|
-
|
|
144
|
+
return (columns, sorted(info.items(), key=lambda x: x[0]))
|
|
145
|
+
else: # parsed_args.is_rate
|
|
146
|
+
data = []
|
|
120
147
|
if compute_limits:
|
|
121
|
-
data.
|
|
148
|
+
data.extend(_format_rate_limit(compute_limits.rate))
|
|
122
149
|
if volume_limits:
|
|
123
|
-
data.
|
|
150
|
+
data.extend(_format_rate_limit(volume_limits.rate))
|
|
124
151
|
columns = [
|
|
125
152
|
"Verb",
|
|
126
153
|
"URI",
|
|
@@ -129,12 +156,18 @@ class ShowLimits(command.Lister):
|
|
|
129
156
|
"Unit",
|
|
130
157
|
"Next Available",
|
|
131
158
|
]
|
|
159
|
+
|
|
132
160
|
return (
|
|
133
161
|
columns,
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
162
|
+
[
|
|
163
|
+
(
|
|
164
|
+
s['verb'],
|
|
165
|
+
s['uri'],
|
|
166
|
+
s['value'],
|
|
167
|
+
s['remaining'],
|
|
168
|
+
s['unit'],
|
|
169
|
+
s.get('next-available') or s['next_available'],
|
|
170
|
+
)
|
|
171
|
+
for s in data
|
|
172
|
+
],
|
|
138
173
|
)
|
|
139
|
-
else:
|
|
140
|
-
return {}, {}
|
openstackclient/common/module.py
CHANGED
|
@@ -29,7 +29,7 @@ class ListCommand(command.Lister):
|
|
|
29
29
|
auth_required = False
|
|
30
30
|
|
|
31
31
|
def get_parser(self, prog_name):
|
|
32
|
-
parser = super(
|
|
32
|
+
parser = super().get_parser(prog_name)
|
|
33
33
|
parser.add_argument(
|
|
34
34
|
'--group',
|
|
35
35
|
metavar='<group-keyword>',
|
|
@@ -72,7 +72,7 @@ class ListModule(command.ShowOne):
|
|
|
72
72
|
auth_required = False
|
|
73
73
|
|
|
74
74
|
def get_parser(self, prog_name):
|
|
75
|
-
parser = super(
|
|
75
|
+
parser = super().get_parser(prog_name)
|
|
76
76
|
parser.add_argument(
|
|
77
77
|
'--all',
|
|
78
78
|
action='store_true',
|
|
@@ -113,6 +113,6 @@ class ListModule(command.ShowOne):
|
|
|
113
113
|
data[k] = mods[k].__version__
|
|
114
114
|
except Exception:
|
|
115
115
|
# Catch all exceptions, just skip it
|
|
116
|
-
pass
|
|
116
|
+
pass # nosec: B110
|
|
117
117
|
|
|
118
118
|
return zip(*sorted(data.items()))
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
import sys
|
|
17
17
|
|
|
18
18
|
|
|
19
|
-
class _ProgressBarBase
|
|
19
|
+
class _ProgressBarBase:
|
|
20
20
|
"""A progress bar provider for a wrapped object.
|
|
21
21
|
|
|
22
22
|
Base abstract class used by specific class wrapper to show
|
|
@@ -39,7 +39,7 @@ class _ProgressBarBase(object):
|
|
|
39
39
|
self._percent += size_read / self._totalsize
|
|
40
40
|
# Output something like this: [==========> ] 49%
|
|
41
41
|
sys.stdout.write(
|
|
42
|
-
'\r[{
|
|
42
|
+
'\r[{:<30}] {:.0%}'.format(
|
|
43
43
|
'=' * int(round(self._percent * 29)) + '>', self._percent
|
|
44
44
|
)
|
|
45
45
|
)
|
|
@@ -46,7 +46,7 @@ class ProjectCleanup(command.Command):
|
|
|
46
46
|
_description = _("Clean resources associated with a project")
|
|
47
47
|
|
|
48
48
|
def get_parser(self, prog_name):
|
|
49
|
-
parser = super(
|
|
49
|
+
parser = super().get_parser(prog_name)
|
|
50
50
|
action_group = parser.add_mutually_exclusive_group()
|
|
51
51
|
action_group.add_argument(
|
|
52
52
|
'--dry-run',
|
|
@@ -150,5 +150,8 @@ class ProjectCleanup(command.Command):
|
|
|
150
150
|
self.log.warning(_('Deleting resources'))
|
|
151
151
|
|
|
152
152
|
project_connect.project_cleanup(
|
|
153
|
-
dry_run=False,
|
|
153
|
+
dry_run=False,
|
|
154
|
+
status_queue=status_queue,
|
|
155
|
+
filters=filters,
|
|
156
|
+
skip_resources=parsed_args.skip_resource,
|
|
154
157
|
)
|