python-openstackclient 6.6.1__py3-none-any.whl → 7.0.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- openstackclient/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 +16 -4
- openstackclient/common/configuration.py +1 -1
- openstackclient/common/extension.py +1 -1
- openstackclient/common/limits.py +66 -32
- openstackclient/common/module.py +3 -3
- openstackclient/common/progressbar.py +2 -2
- openstackclient/common/project_cleanup.py +5 -2
- openstackclient/common/quota.py +281 -410
- openstackclient/common/versions.py +1 -1
- openstackclient/compute/client.py +7 -116
- openstackclient/compute/v2/agent.py +75 -49
- openstackclient/compute/v2/aggregate.py +9 -9
- 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 +4 -3
- openstackclient/compute/v2/keypair.py +7 -8
- openstackclient/compute/v2/server.py +478 -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 +127 -45
- 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/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 +14 -6
- openstackclient/tests/functional/identity/v3/test_application_credential.py +13 -19
- 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_limit.py +2 -2
- openstackclient/tests/functional/identity/v3/test_region.py +1 -3
- openstackclient/tests/functional/identity/v3/test_registered_limit.py +1 -1
- 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 +4 -6
- 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 +18 -16
- 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 +28 -31
- 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 +2895 -2459
- 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 +11 -11
- 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 +212 -235
- 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 +93 -97
- 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 +7 -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 +7 -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.0.0.dist-info}/AUTHORS +4 -0
- {python_openstackclient-6.6.1.dist-info → python_openstackclient-7.0.0.dist-info}/METADATA +2 -3
- python_openstackclient-7.0.0.dist-info/RECORD +502 -0
- {python_openstackclient-6.6.1.dist-info → python_openstackclient-7.0.0.dist-info}/entry_points.txt +33 -27
- python_openstackclient-7.0.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.0.0.dist-info}/LICENSE +0 -0
- {python_openstackclient-6.6.1.dist-info → python_openstackclient-7.0.0.dist-info}/WHEEL +0 -0
- {python_openstackclient-6.6.1.dist-info → python_openstackclient-7.0.0.dist-info}/top_level.txt +0 -0
|
@@ -17,7 +17,6 @@ from unittest import mock
|
|
|
17
17
|
from unittest.mock import call
|
|
18
18
|
import uuid
|
|
19
19
|
|
|
20
|
-
from openstack import utils as sdk_utils
|
|
21
20
|
from osc_lib import exceptions
|
|
22
21
|
|
|
23
22
|
from openstackclient.compute.v2 import keypair
|
|
@@ -29,10 +28,10 @@ from openstackclient.tests.unit import utils as tests_utils
|
|
|
29
28
|
|
|
30
29
|
class TestKeypair(compute_fakes.TestComputev2):
|
|
31
30
|
def setUp(self):
|
|
32
|
-
super(
|
|
31
|
+
super().setUp()
|
|
33
32
|
|
|
34
33
|
# Initialize the user mock
|
|
35
|
-
self.users_mock = self.
|
|
34
|
+
self.users_mock = self.identity_client.users
|
|
36
35
|
self.users_mock.reset_mock()
|
|
37
36
|
self.users_mock.get.return_value = fakes.FakeResource(
|
|
38
37
|
None,
|
|
@@ -118,7 +117,9 @@ class TestKeypairCreate(TestKeypair):
|
|
|
118
117
|
|
|
119
118
|
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
120
119
|
|
|
121
|
-
with mock.patch(
|
|
120
|
+
with mock.patch(
|
|
121
|
+
'openstackclient.compute.v2.keypair.open'
|
|
122
|
+
) as mock_open:
|
|
122
123
|
mock_open.return_value = mock.MagicMock()
|
|
123
124
|
m_file = mock_open.return_value.__enter__.return_value
|
|
124
125
|
m_file.read.return_value = 'dummy'
|
|
@@ -152,7 +153,9 @@ class TestKeypairCreate(TestKeypair):
|
|
|
152
153
|
|
|
153
154
|
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
154
155
|
|
|
155
|
-
with mock.patch(
|
|
156
|
+
with mock.patch(
|
|
157
|
+
'openstackclient.compute.v2.keypair.open'
|
|
158
|
+
) as mock_open:
|
|
156
159
|
mock_open.return_value = mock.MagicMock()
|
|
157
160
|
m_file = mock_open.return_value.__enter__.return_value
|
|
158
161
|
|
|
@@ -171,8 +174,9 @@ class TestKeypairCreate(TestKeypair):
|
|
|
171
174
|
self.assertEqual(self.columns, columns)
|
|
172
175
|
self.assertEqual(self.data, data)
|
|
173
176
|
|
|
174
|
-
|
|
175
|
-
|
|
177
|
+
def test_keypair_create_with_key_type(self):
|
|
178
|
+
self.set_compute_api_version('2.2')
|
|
179
|
+
|
|
176
180
|
for key_type in ['x509', 'ssh']:
|
|
177
181
|
self.compute_sdk_client.create_keypair.return_value = self.keypair
|
|
178
182
|
|
|
@@ -199,7 +203,9 @@ class TestKeypairCreate(TestKeypair):
|
|
|
199
203
|
]
|
|
200
204
|
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
201
205
|
|
|
202
|
-
with mock.patch(
|
|
206
|
+
with mock.patch(
|
|
207
|
+
'openstackclient.compute.v2.keypair.open'
|
|
208
|
+
) as mock_open:
|
|
203
209
|
mock_open.return_value = mock.MagicMock()
|
|
204
210
|
m_file = mock_open.return_value.__enter__.return_value
|
|
205
211
|
m_file.read.return_value = 'dummy'
|
|
@@ -214,8 +220,9 @@ class TestKeypairCreate(TestKeypair):
|
|
|
214
220
|
self.assertEqual(self.columns, columns)
|
|
215
221
|
self.assertEqual(self.data, data)
|
|
216
222
|
|
|
217
|
-
|
|
218
|
-
|
|
223
|
+
def test_keypair_create_with_key_type_pre_v22(self):
|
|
224
|
+
self.set_compute_api_version('2.1')
|
|
225
|
+
|
|
219
226
|
for key_type in ['x509', 'ssh']:
|
|
220
227
|
arglist = [
|
|
221
228
|
'--public-key',
|
|
@@ -231,7 +238,9 @@ class TestKeypairCreate(TestKeypair):
|
|
|
231
238
|
]
|
|
232
239
|
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
233
240
|
|
|
234
|
-
with mock.patch(
|
|
241
|
+
with mock.patch(
|
|
242
|
+
'openstackclient.compute.v2.keypair.open'
|
|
243
|
+
) as mock_open:
|
|
235
244
|
mock_open.return_value = mock.MagicMock()
|
|
236
245
|
m_file = mock_open.return_value.__enter__.return_value
|
|
237
246
|
m_file.read.return_value = 'dummy'
|
|
@@ -249,8 +258,9 @@ class TestKeypairCreate(TestKeypair):
|
|
|
249
258
|
'_generate_keypair',
|
|
250
259
|
return_value=keypair.Keypair('private', 'public'),
|
|
251
260
|
)
|
|
252
|
-
|
|
253
|
-
|
|
261
|
+
def test_key_pair_create_with_user(self, mock_generate):
|
|
262
|
+
self.set_compute_api_version('2.10')
|
|
263
|
+
|
|
254
264
|
arglist = [
|
|
255
265
|
'--user',
|
|
256
266
|
identity_fakes.user_name,
|
|
@@ -273,8 +283,9 @@ class TestKeypairCreate(TestKeypair):
|
|
|
273
283
|
self.assertEqual({}, columns)
|
|
274
284
|
self.assertEqual({}, data)
|
|
275
285
|
|
|
276
|
-
|
|
277
|
-
|
|
286
|
+
def test_key_pair_create_with_user_pre_v210(self):
|
|
287
|
+
self.set_compute_api_version('2.9')
|
|
288
|
+
|
|
278
289
|
arglist = [
|
|
279
290
|
'--user',
|
|
280
291
|
identity_fakes.user_name,
|
|
@@ -360,8 +371,9 @@ class TestKeypairDelete(TestKeypair):
|
|
|
360
371
|
calls.append(call(k, ignore_missing=False))
|
|
361
372
|
self.compute_sdk_client.delete_keypair.assert_has_calls(calls)
|
|
362
373
|
|
|
363
|
-
|
|
364
|
-
|
|
374
|
+
def test_keypair_delete_with_user(self):
|
|
375
|
+
self.set_compute_api_version('2.10')
|
|
376
|
+
|
|
365
377
|
arglist = ['--user', identity_fakes.user_name, self.keypairs[0].name]
|
|
366
378
|
verifylist = [
|
|
367
379
|
('user', identity_fakes.user_name),
|
|
@@ -378,8 +390,9 @@ class TestKeypairDelete(TestKeypair):
|
|
|
378
390
|
ignore_missing=False,
|
|
379
391
|
)
|
|
380
392
|
|
|
381
|
-
|
|
382
|
-
|
|
393
|
+
def test_keypair_delete_with_user_pre_v210(self):
|
|
394
|
+
self.set_compute_api_version('2.9')
|
|
395
|
+
|
|
383
396
|
arglist = ['--user', identity_fakes.user_name, self.keypairs[0].name]
|
|
384
397
|
verifylist = [
|
|
385
398
|
('user', identity_fakes.user_name),
|
|
@@ -407,8 +420,7 @@ class TestKeypairList(TestKeypair):
|
|
|
407
420
|
# Get the command object to test
|
|
408
421
|
self.cmd = keypair.ListKeypair(self.app, None)
|
|
409
422
|
|
|
410
|
-
|
|
411
|
-
def test_keypair_list_no_options(self, sm_mock):
|
|
423
|
+
def test_keypair_list_no_options(self):
|
|
412
424
|
arglist = []
|
|
413
425
|
verifylist = []
|
|
414
426
|
|
|
@@ -429,8 +441,9 @@ class TestKeypairList(TestKeypair):
|
|
|
429
441
|
tuple(data),
|
|
430
442
|
)
|
|
431
443
|
|
|
432
|
-
|
|
433
|
-
|
|
444
|
+
def test_keypair_list_v22(self):
|
|
445
|
+
self.set_compute_api_version('2.22')
|
|
446
|
+
|
|
434
447
|
arglist = []
|
|
435
448
|
verifylist = []
|
|
436
449
|
|
|
@@ -457,9 +470,10 @@ class TestKeypairList(TestKeypair):
|
|
|
457
470
|
tuple(data),
|
|
458
471
|
)
|
|
459
472
|
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
473
|
+
def test_keypair_list_with_user(self):
|
|
474
|
+
self.set_compute_api_version('2.35')
|
|
475
|
+
|
|
476
|
+
users_mock = self.identity_client.users
|
|
463
477
|
users_mock.reset_mock()
|
|
464
478
|
users_mock.get.return_value = fakes.FakeResource(
|
|
465
479
|
None,
|
|
@@ -495,8 +509,9 @@ class TestKeypairList(TestKeypair):
|
|
|
495
509
|
tuple(data),
|
|
496
510
|
)
|
|
497
511
|
|
|
498
|
-
|
|
499
|
-
|
|
512
|
+
def test_keypair_list_with_user_pre_v210(self):
|
|
513
|
+
self.set_compute_api_version('2.9')
|
|
514
|
+
|
|
500
515
|
arglist = [
|
|
501
516
|
'--user',
|
|
502
517
|
identity_fakes.user_name,
|
|
@@ -513,9 +528,10 @@ class TestKeypairList(TestKeypair):
|
|
|
513
528
|
'--os-compute-api-version 2.10 or greater is required', str(ex)
|
|
514
529
|
)
|
|
515
530
|
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
531
|
+
def test_keypair_list_with_project(self):
|
|
532
|
+
self.set_compute_api_version('2.35')
|
|
533
|
+
|
|
534
|
+
projects_mock = self.identity_client.tenants
|
|
519
535
|
projects_mock.reset_mock()
|
|
520
536
|
projects_mock.get.return_value = fakes.FakeResource(
|
|
521
537
|
None,
|
|
@@ -523,7 +539,7 @@ class TestKeypairList(TestKeypair):
|
|
|
523
539
|
loaded=True,
|
|
524
540
|
)
|
|
525
541
|
|
|
526
|
-
users_mock = self.
|
|
542
|
+
users_mock = self.identity_client.users
|
|
527
543
|
users_mock.reset_mock()
|
|
528
544
|
users_mock.list.return_value = [
|
|
529
545
|
fakes.FakeResource(
|
|
@@ -557,8 +573,9 @@ class TestKeypairList(TestKeypair):
|
|
|
557
573
|
tuple(data),
|
|
558
574
|
)
|
|
559
575
|
|
|
560
|
-
|
|
561
|
-
|
|
576
|
+
def test_keypair_list_with_project_pre_v210(self):
|
|
577
|
+
self.set_compute_api_version('2.9')
|
|
578
|
+
|
|
562
579
|
arglist = ['--project', identity_fakes.project_name]
|
|
563
580
|
verifylist = [('project', identity_fakes.project_name)]
|
|
564
581
|
|
|
@@ -586,10 +603,9 @@ class TestKeypairList(TestKeypair):
|
|
|
586
603
|
None,
|
|
587
604
|
)
|
|
588
605
|
|
|
589
|
-
@mock.patch.object(
|
|
590
|
-
sdk_utils, 'supports_microversion', new=mock.Mock(return_value=True)
|
|
591
|
-
)
|
|
592
606
|
def test_keypair_list_with_limit(self):
|
|
607
|
+
self.set_compute_api_version('2.35')
|
|
608
|
+
|
|
593
609
|
arglist = [
|
|
594
610
|
'--limit',
|
|
595
611
|
'1',
|
|
@@ -603,10 +619,9 @@ class TestKeypairList(TestKeypair):
|
|
|
603
619
|
|
|
604
620
|
self.compute_sdk_client.keypairs.assert_called_with(limit=1)
|
|
605
621
|
|
|
606
|
-
@mock.patch.object(
|
|
607
|
-
sdk_utils, 'supports_microversion', new=mock.Mock(return_value=False)
|
|
608
|
-
)
|
|
609
622
|
def test_keypair_list_with_limit_pre_v235(self):
|
|
623
|
+
self.set_compute_api_version('2.34')
|
|
624
|
+
|
|
610
625
|
arglist = [
|
|
611
626
|
'--limit',
|
|
612
627
|
'1',
|
|
@@ -624,10 +639,9 @@ class TestKeypairList(TestKeypair):
|
|
|
624
639
|
'--os-compute-api-version 2.35 or greater is required', str(ex)
|
|
625
640
|
)
|
|
626
641
|
|
|
627
|
-
@mock.patch.object(
|
|
628
|
-
sdk_utils, 'supports_microversion', new=mock.Mock(return_value=True)
|
|
629
|
-
)
|
|
630
642
|
def test_keypair_list_with_marker(self):
|
|
643
|
+
self.set_compute_api_version('2.35')
|
|
644
|
+
|
|
631
645
|
arglist = [
|
|
632
646
|
'--marker',
|
|
633
647
|
'test_kp',
|
|
@@ -641,10 +655,9 @@ class TestKeypairList(TestKeypair):
|
|
|
641
655
|
|
|
642
656
|
self.compute_sdk_client.keypairs.assert_called_with(marker='test_kp')
|
|
643
657
|
|
|
644
|
-
@mock.patch.object(
|
|
645
|
-
sdk_utils, 'supports_microversion', new=mock.Mock(return_value=False)
|
|
646
|
-
)
|
|
647
658
|
def test_keypair_list_with_marker_pre_v235(self):
|
|
659
|
+
self.set_compute_api_version('2.34')
|
|
660
|
+
|
|
648
661
|
arglist = [
|
|
649
662
|
'--marker',
|
|
650
663
|
'test_kp',
|
|
@@ -735,8 +748,9 @@ class TestKeypairShow(TestKeypair):
|
|
|
735
748
|
self.assertEqual({}, columns)
|
|
736
749
|
self.assertEqual({}, data)
|
|
737
750
|
|
|
738
|
-
|
|
739
|
-
|
|
751
|
+
def test_keypair_show_with_user(self):
|
|
752
|
+
self.set_compute_api_version('2.10')
|
|
753
|
+
|
|
740
754
|
self.keypair = compute_fakes.create_one_keypair()
|
|
741
755
|
self.compute_sdk_client.find_keypair.return_value = self.keypair
|
|
742
756
|
|
|
@@ -774,8 +788,9 @@ class TestKeypairShow(TestKeypair):
|
|
|
774
788
|
self.assertEqual(self.columns, columns)
|
|
775
789
|
self.assertEqual(self.data, data)
|
|
776
790
|
|
|
777
|
-
|
|
778
|
-
|
|
791
|
+
def test_keypair_show_with_user_pre_v210(self):
|
|
792
|
+
self.set_compute_api_version('2.9')
|
|
793
|
+
|
|
779
794
|
self.keypair = compute_fakes.create_one_keypair()
|
|
780
795
|
arglist = [
|
|
781
796
|
'--user',
|