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
|
@@ -10,13 +10,9 @@
|
|
|
10
10
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
11
11
|
# License for the specific language governing permissions and limitations
|
|
12
12
|
# under the License.
|
|
13
|
-
#
|
|
14
13
|
|
|
15
|
-
from unittest import mock
|
|
16
14
|
from unittest.mock import call
|
|
17
15
|
|
|
18
|
-
from cinderclient import api_versions
|
|
19
|
-
from openstack import utils as sdk_utils
|
|
20
16
|
from osc_lib import exceptions
|
|
21
17
|
|
|
22
18
|
from openstackclient.tests.unit.volume.v2 import fakes as volume_fakes
|
|
@@ -37,29 +33,7 @@ class TestBackupLegacy(volume_fakes.TestVolume):
|
|
|
37
33
|
self.restores_mock.reset_mock()
|
|
38
34
|
|
|
39
35
|
|
|
40
|
-
class
|
|
41
|
-
def setUp(self):
|
|
42
|
-
super().setUp()
|
|
43
|
-
|
|
44
|
-
patcher = mock.patch.object(
|
|
45
|
-
sdk_utils, 'supports_microversion', return_value=True
|
|
46
|
-
)
|
|
47
|
-
self.addCleanup(patcher.stop)
|
|
48
|
-
self.supports_microversion_mock = patcher.start()
|
|
49
|
-
self._set_mock_microversion(
|
|
50
|
-
self.app.client_manager.volume.api_version.get_string()
|
|
51
|
-
)
|
|
52
|
-
|
|
53
|
-
def _set_mock_microversion(self, mock_v):
|
|
54
|
-
"""Set a specific microversion for the mock supports_microversion()."""
|
|
55
|
-
self.supports_microversion_mock.reset_mock(return_value=True)
|
|
56
|
-
self.supports_microversion_mock.side_effect = (
|
|
57
|
-
lambda _, v: api_versions.APIVersion(v)
|
|
58
|
-
<= api_versions.APIVersion(mock_v)
|
|
59
|
-
)
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
class TestBackupCreate(TestBackup):
|
|
36
|
+
class TestBackupCreate(volume_fakes.TestVolume):
|
|
63
37
|
volume = volume_fakes.create_one_volume()
|
|
64
38
|
snapshot = volume_fakes.create_one_snapshot()
|
|
65
39
|
new_backup = volume_fakes.create_one_backup(
|
|
@@ -120,110 +94,12 @@ class TestBackupCreate(TestBackup):
|
|
|
120
94
|
name=self.new_backup.name,
|
|
121
95
|
description=self.new_backup.description,
|
|
122
96
|
force=True,
|
|
123
|
-
|
|
97
|
+
is_incremental=True,
|
|
124
98
|
snapshot_id=self.new_backup.snapshot_id,
|
|
125
99
|
)
|
|
126
100
|
self.assertEqual(self.columns, columns)
|
|
127
101
|
self.assertEqual(self.data, data)
|
|
128
102
|
|
|
129
|
-
def test_backup_create_with_properties(self):
|
|
130
|
-
self._set_mock_microversion('3.43')
|
|
131
|
-
|
|
132
|
-
arglist = [
|
|
133
|
-
"--property",
|
|
134
|
-
"foo=bar",
|
|
135
|
-
"--property",
|
|
136
|
-
"wow=much-cool",
|
|
137
|
-
self.new_backup.volume_id,
|
|
138
|
-
]
|
|
139
|
-
verifylist = [
|
|
140
|
-
("properties", {"foo": "bar", "wow": "much-cool"}),
|
|
141
|
-
("volume", self.new_backup.volume_id),
|
|
142
|
-
]
|
|
143
|
-
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
144
|
-
|
|
145
|
-
columns, data = self.cmd.take_action(parsed_args)
|
|
146
|
-
|
|
147
|
-
self.volume_sdk_client.create_backup.assert_called_with(
|
|
148
|
-
volume_id=self.new_backup.volume_id,
|
|
149
|
-
container=None,
|
|
150
|
-
name=None,
|
|
151
|
-
description=None,
|
|
152
|
-
force=False,
|
|
153
|
-
incremental=False,
|
|
154
|
-
metadata={"foo": "bar", "wow": "much-cool"},
|
|
155
|
-
)
|
|
156
|
-
self.assertEqual(self.columns, columns)
|
|
157
|
-
self.assertEqual(self.data, data)
|
|
158
|
-
|
|
159
|
-
def test_backup_create_with_properties_pre_v343(self):
|
|
160
|
-
self._set_mock_microversion('3.42')
|
|
161
|
-
|
|
162
|
-
arglist = [
|
|
163
|
-
"--property",
|
|
164
|
-
"foo=bar",
|
|
165
|
-
"--property",
|
|
166
|
-
"wow=much-cool",
|
|
167
|
-
self.new_backup.volume_id,
|
|
168
|
-
]
|
|
169
|
-
verifylist = [
|
|
170
|
-
("properties", {"foo": "bar", "wow": "much-cool"}),
|
|
171
|
-
("volume", self.new_backup.volume_id),
|
|
172
|
-
]
|
|
173
|
-
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
174
|
-
|
|
175
|
-
exc = self.assertRaises(
|
|
176
|
-
exceptions.CommandError, self.cmd.take_action, parsed_args
|
|
177
|
-
)
|
|
178
|
-
self.assertIn("--os-volume-api-version 3.43 or greater", str(exc))
|
|
179
|
-
|
|
180
|
-
def test_backup_create_with_availability_zone(self):
|
|
181
|
-
self._set_mock_microversion('3.51')
|
|
182
|
-
|
|
183
|
-
arglist = [
|
|
184
|
-
"--availability-zone",
|
|
185
|
-
"my-az",
|
|
186
|
-
self.new_backup.volume_id,
|
|
187
|
-
]
|
|
188
|
-
verifylist = [
|
|
189
|
-
("availability_zone", "my-az"),
|
|
190
|
-
("volume", self.new_backup.volume_id),
|
|
191
|
-
]
|
|
192
|
-
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
193
|
-
|
|
194
|
-
columns, data = self.cmd.take_action(parsed_args)
|
|
195
|
-
|
|
196
|
-
self.volume_sdk_client.create_backup.assert_called_with(
|
|
197
|
-
volume_id=self.new_backup.volume_id,
|
|
198
|
-
container=None,
|
|
199
|
-
name=None,
|
|
200
|
-
description=None,
|
|
201
|
-
force=False,
|
|
202
|
-
incremental=False,
|
|
203
|
-
availability_zone="my-az",
|
|
204
|
-
)
|
|
205
|
-
self.assertEqual(self.columns, columns)
|
|
206
|
-
self.assertEqual(self.data, data)
|
|
207
|
-
|
|
208
|
-
def test_backup_create_with_availability_zone_pre_v351(self):
|
|
209
|
-
self._set_mock_microversion('3.50')
|
|
210
|
-
|
|
211
|
-
arglist = [
|
|
212
|
-
"--availability-zone",
|
|
213
|
-
"my-az",
|
|
214
|
-
self.new_backup.volume_id,
|
|
215
|
-
]
|
|
216
|
-
verifylist = [
|
|
217
|
-
("availability_zone", "my-az"),
|
|
218
|
-
("volume", self.new_backup.volume_id),
|
|
219
|
-
]
|
|
220
|
-
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
221
|
-
|
|
222
|
-
exc = self.assertRaises(
|
|
223
|
-
exceptions.CommandError, self.cmd.take_action, parsed_args
|
|
224
|
-
)
|
|
225
|
-
self.assertIn("--os-volume-api-version 3.51 or greater", str(exc))
|
|
226
|
-
|
|
227
103
|
def test_backup_create_without_name(self):
|
|
228
104
|
arglist = [
|
|
229
105
|
"--description",
|
|
@@ -247,13 +123,13 @@ class TestBackupCreate(TestBackup):
|
|
|
247
123
|
name=None,
|
|
248
124
|
description=self.new_backup.description,
|
|
249
125
|
force=False,
|
|
250
|
-
|
|
126
|
+
is_incremental=False,
|
|
251
127
|
)
|
|
252
128
|
self.assertEqual(self.columns, columns)
|
|
253
129
|
self.assertEqual(self.data, data)
|
|
254
130
|
|
|
255
131
|
|
|
256
|
-
class TestBackupDelete(
|
|
132
|
+
class TestBackupDelete(volume_fakes.TestVolume):
|
|
257
133
|
backups = volume_fakes.create_backups(count=2)
|
|
258
134
|
|
|
259
135
|
def setUp(self):
|
|
@@ -346,7 +222,7 @@ class TestBackupDelete(TestBackup):
|
|
|
346
222
|
)
|
|
347
223
|
|
|
348
224
|
|
|
349
|
-
class TestBackupList(
|
|
225
|
+
class TestBackupList(volume_fakes.TestVolume):
|
|
350
226
|
volume = volume_fakes.create_one_volume()
|
|
351
227
|
backups = volume_fakes.create_backups(
|
|
352
228
|
attrs={'volume_id': volume.name}, count=3
|
|
@@ -479,7 +355,7 @@ class TestBackupList(TestBackup):
|
|
|
479
355
|
self.assertCountEqual(self.data_long, list(data))
|
|
480
356
|
|
|
481
357
|
|
|
482
|
-
class TestBackupRestore(
|
|
358
|
+
class TestBackupRestore(volume_fakes.TestVolume):
|
|
483
359
|
volume = volume_fakes.create_one_volume()
|
|
484
360
|
backup = volume_fakes.create_one_backup(
|
|
485
361
|
attrs={'volume_id': volume.id},
|
|
@@ -592,91 +468,6 @@ class TestBackupSet(TestBackupLegacy):
|
|
|
592
468
|
# Get the command object to test
|
|
593
469
|
self.cmd = volume_backup.SetVolumeBackup(self.app, None)
|
|
594
470
|
|
|
595
|
-
def test_backup_set_name(self):
|
|
596
|
-
self.volume_client.api_version = api_versions.APIVersion('3.9')
|
|
597
|
-
|
|
598
|
-
arglist = [
|
|
599
|
-
'--name',
|
|
600
|
-
'new_name',
|
|
601
|
-
self.backup.id,
|
|
602
|
-
]
|
|
603
|
-
verifylist = [
|
|
604
|
-
('name', 'new_name'),
|
|
605
|
-
('backup', self.backup.id),
|
|
606
|
-
]
|
|
607
|
-
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
608
|
-
|
|
609
|
-
# In base command class ShowOne in cliff, abstract method take_action()
|
|
610
|
-
# returns nothing
|
|
611
|
-
result = self.cmd.take_action(parsed_args)
|
|
612
|
-
self.backups_mock.update.assert_called_once_with(
|
|
613
|
-
self.backup.id, **{'name': 'new_name'}
|
|
614
|
-
)
|
|
615
|
-
self.assertIsNone(result)
|
|
616
|
-
|
|
617
|
-
def test_backup_set_name_pre_v39(self):
|
|
618
|
-
self.volume_client.api_version = api_versions.APIVersion('3.8')
|
|
619
|
-
|
|
620
|
-
arglist = [
|
|
621
|
-
'--name',
|
|
622
|
-
'new_name',
|
|
623
|
-
self.backup.id,
|
|
624
|
-
]
|
|
625
|
-
verifylist = [
|
|
626
|
-
('name', 'new_name'),
|
|
627
|
-
('backup', self.backup.id),
|
|
628
|
-
]
|
|
629
|
-
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
630
|
-
|
|
631
|
-
exc = self.assertRaises(
|
|
632
|
-
exceptions.CommandError, self.cmd.take_action, parsed_args
|
|
633
|
-
)
|
|
634
|
-
self.assertIn("--os-volume-api-version 3.9 or greater", str(exc))
|
|
635
|
-
|
|
636
|
-
def test_backup_set_description(self):
|
|
637
|
-
self.volume_client.api_version = api_versions.APIVersion('3.9')
|
|
638
|
-
|
|
639
|
-
arglist = [
|
|
640
|
-
'--description',
|
|
641
|
-
'new_description',
|
|
642
|
-
self.backup.id,
|
|
643
|
-
]
|
|
644
|
-
verifylist = [
|
|
645
|
-
('name', None),
|
|
646
|
-
('description', 'new_description'),
|
|
647
|
-
('backup', self.backup.id),
|
|
648
|
-
]
|
|
649
|
-
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
650
|
-
|
|
651
|
-
result = self.cmd.take_action(parsed_args)
|
|
652
|
-
|
|
653
|
-
# Set expected values
|
|
654
|
-
kwargs = {'description': 'new_description'}
|
|
655
|
-
self.backups_mock.update.assert_called_once_with(
|
|
656
|
-
self.backup.id, **kwargs
|
|
657
|
-
)
|
|
658
|
-
self.assertIsNone(result)
|
|
659
|
-
|
|
660
|
-
def test_backup_set_description_pre_v39(self):
|
|
661
|
-
self.volume_client.api_version = api_versions.APIVersion('3.8')
|
|
662
|
-
|
|
663
|
-
arglist = [
|
|
664
|
-
'--description',
|
|
665
|
-
'new_description',
|
|
666
|
-
self.backup.id,
|
|
667
|
-
]
|
|
668
|
-
verifylist = [
|
|
669
|
-
('name', None),
|
|
670
|
-
('description', 'new_description'),
|
|
671
|
-
('backup', self.backup.id),
|
|
672
|
-
]
|
|
673
|
-
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
674
|
-
|
|
675
|
-
exc = self.assertRaises(
|
|
676
|
-
exceptions.CommandError, self.cmd.take_action, parsed_args
|
|
677
|
-
)
|
|
678
|
-
self.assertIn("--os-volume-api-version 3.9 or greater", str(exc))
|
|
679
|
-
|
|
680
471
|
def test_backup_set_state(self):
|
|
681
472
|
arglist = ['--state', 'error', self.backup.id]
|
|
682
473
|
verifylist = [('state', 'error'), ('backup', self.backup.id)]
|
|
@@ -706,152 +497,8 @@ class TestBackupSet(TestBackupLegacy):
|
|
|
706
497
|
self.backup.id, 'error'
|
|
707
498
|
)
|
|
708
499
|
|
|
709
|
-
def test_backup_set_no_property(self):
|
|
710
|
-
self.volume_client.api_version = api_versions.APIVersion('3.43')
|
|
711
|
-
|
|
712
|
-
arglist = [
|
|
713
|
-
'--no-property',
|
|
714
|
-
self.backup.id,
|
|
715
|
-
]
|
|
716
|
-
verifylist = [
|
|
717
|
-
('no_property', True),
|
|
718
|
-
('backup', self.backup.id),
|
|
719
|
-
]
|
|
720
|
-
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
721
|
-
|
|
722
|
-
result = self.cmd.take_action(parsed_args)
|
|
723
|
-
|
|
724
|
-
# Set expected values
|
|
725
|
-
kwargs = {
|
|
726
|
-
'metadata': {},
|
|
727
|
-
}
|
|
728
|
-
self.backups_mock.update.assert_called_once_with(
|
|
729
|
-
self.backup.id, **kwargs
|
|
730
|
-
)
|
|
731
|
-
self.assertIsNone(result)
|
|
732
|
-
|
|
733
|
-
def test_backup_set_no_property_pre_v343(self):
|
|
734
|
-
self.volume_client.api_version = api_versions.APIVersion('3.42')
|
|
735
|
-
|
|
736
|
-
arglist = [
|
|
737
|
-
'--no-property',
|
|
738
|
-
self.backup.id,
|
|
739
|
-
]
|
|
740
|
-
verifylist = [
|
|
741
|
-
('no_property', True),
|
|
742
|
-
('backup', self.backup.id),
|
|
743
|
-
]
|
|
744
|
-
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
745
|
-
|
|
746
|
-
exc = self.assertRaises(
|
|
747
|
-
exceptions.CommandError, self.cmd.take_action, parsed_args
|
|
748
|
-
)
|
|
749
|
-
self.assertIn("--os-volume-api-version 3.43 or greater", str(exc))
|
|
750
|
-
|
|
751
|
-
def test_backup_set_property(self):
|
|
752
|
-
self.volume_client.api_version = api_versions.APIVersion('3.43')
|
|
753
|
-
|
|
754
|
-
arglist = [
|
|
755
|
-
'--property',
|
|
756
|
-
'foo=bar',
|
|
757
|
-
self.backup.id,
|
|
758
|
-
]
|
|
759
|
-
verifylist = [
|
|
760
|
-
('properties', {'foo': 'bar'}),
|
|
761
|
-
('backup', self.backup.id),
|
|
762
|
-
]
|
|
763
|
-
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
764
|
-
|
|
765
|
-
result = self.cmd.take_action(parsed_args)
|
|
766
|
-
|
|
767
|
-
# Set expected values
|
|
768
|
-
kwargs = {
|
|
769
|
-
'metadata': {'wow': 'cool', 'foo': 'bar'},
|
|
770
|
-
}
|
|
771
|
-
self.backups_mock.update.assert_called_once_with(
|
|
772
|
-
self.backup.id, **kwargs
|
|
773
|
-
)
|
|
774
|
-
self.assertIsNone(result)
|
|
775
|
-
|
|
776
|
-
def test_backup_set_property_pre_v343(self):
|
|
777
|
-
self.volume_client.api_version = api_versions.APIVersion('3.42')
|
|
778
|
-
|
|
779
|
-
arglist = [
|
|
780
|
-
'--property',
|
|
781
|
-
'foo=bar',
|
|
782
|
-
self.backup.id,
|
|
783
|
-
]
|
|
784
|
-
verifylist = [
|
|
785
|
-
('properties', {'foo': 'bar'}),
|
|
786
|
-
('backup', self.backup.id),
|
|
787
|
-
]
|
|
788
|
-
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
789
|
-
|
|
790
|
-
exc = self.assertRaises(
|
|
791
|
-
exceptions.CommandError, self.cmd.take_action, parsed_args
|
|
792
|
-
)
|
|
793
|
-
self.assertIn("--os-volume-api-version 3.43 or greater", str(exc))
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
class TestBackupUnset(TestBackupLegacy):
|
|
797
|
-
backup = volume_fakes.create_one_backup(
|
|
798
|
-
attrs={'metadata': {'foo': 'bar'}},
|
|
799
|
-
)
|
|
800
|
-
|
|
801
|
-
def setUp(self):
|
|
802
|
-
super().setUp()
|
|
803
|
-
|
|
804
|
-
self.backups_mock.get.return_value = self.backup
|
|
805
|
-
|
|
806
|
-
# Get the command object to test
|
|
807
|
-
self.cmd = volume_backup.UnsetVolumeBackup(self.app, None)
|
|
808
|
-
|
|
809
|
-
def test_backup_unset_property(self):
|
|
810
|
-
self.volume_client.api_version = api_versions.APIVersion('3.43')
|
|
811
|
-
|
|
812
|
-
arglist = [
|
|
813
|
-
'--property',
|
|
814
|
-
'foo',
|
|
815
|
-
self.backup.id,
|
|
816
|
-
]
|
|
817
|
-
verifylist = [
|
|
818
|
-
('properties', ['foo']),
|
|
819
|
-
('backup', self.backup.id),
|
|
820
|
-
]
|
|
821
|
-
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
822
|
-
|
|
823
|
-
result = self.cmd.take_action(parsed_args)
|
|
824
|
-
|
|
825
|
-
# Set expected values
|
|
826
|
-
kwargs = {
|
|
827
|
-
'metadata': {},
|
|
828
|
-
}
|
|
829
|
-
self.backups_mock.update.assert_called_once_with(
|
|
830
|
-
self.backup.id, **kwargs
|
|
831
|
-
)
|
|
832
|
-
self.assertIsNone(result)
|
|
833
|
-
|
|
834
|
-
def test_backup_unset_property_pre_v343(self):
|
|
835
|
-
self.volume_client.api_version = api_versions.APIVersion('3.42')
|
|
836
|
-
|
|
837
|
-
arglist = [
|
|
838
|
-
'--property',
|
|
839
|
-
'foo',
|
|
840
|
-
self.backup.id,
|
|
841
|
-
]
|
|
842
|
-
verifylist = [
|
|
843
|
-
('properties', ['foo']),
|
|
844
|
-
('backup', self.backup.id),
|
|
845
|
-
]
|
|
846
|
-
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
847
|
-
|
|
848
|
-
exc = self.assertRaises(
|
|
849
|
-
exceptions.CommandError, self.cmd.take_action, parsed_args
|
|
850
|
-
)
|
|
851
|
-
self.assertIn("--os-volume-api-version 3.43 or greater", str(exc))
|
|
852
|
-
|
|
853
500
|
|
|
854
|
-
class TestBackupShow(
|
|
501
|
+
class TestBackupShow(volume_fakes.TestVolume):
|
|
855
502
|
backup = volume_fakes.create_one_backup()
|
|
856
503
|
|
|
857
504
|
columns = (
|
|
@@ -860,20 +507,16 @@ class TestBackupShow(TestBackup):
|
|
|
860
507
|
"created_at",
|
|
861
508
|
"data_timestamp",
|
|
862
509
|
"description",
|
|
863
|
-
"encryption_key_id",
|
|
864
510
|
"fail_reason",
|
|
865
511
|
"has_dependent_backups",
|
|
866
512
|
"id",
|
|
867
513
|
"is_incremental",
|
|
868
|
-
"metadata",
|
|
869
514
|
"name",
|
|
870
515
|
"object_count",
|
|
871
|
-
"project_id",
|
|
872
516
|
"size",
|
|
873
517
|
"snapshot_id",
|
|
874
518
|
"status",
|
|
875
519
|
"updated_at",
|
|
876
|
-
"user_id",
|
|
877
520
|
"volume_id",
|
|
878
521
|
)
|
|
879
522
|
data = (
|
|
@@ -882,20 +525,16 @@ class TestBackupShow(TestBackup):
|
|
|
882
525
|
backup.created_at,
|
|
883
526
|
backup.data_timestamp,
|
|
884
527
|
backup.description,
|
|
885
|
-
backup.encryption_key_id,
|
|
886
528
|
backup.fail_reason,
|
|
887
529
|
backup.has_dependent_backups,
|
|
888
530
|
backup.id,
|
|
889
531
|
backup.is_incremental,
|
|
890
|
-
backup.metadata,
|
|
891
532
|
backup.name,
|
|
892
533
|
backup.object_count,
|
|
893
|
-
backup.project_id,
|
|
894
534
|
backup.size,
|
|
895
535
|
backup.snapshot_id,
|
|
896
536
|
backup.status,
|
|
897
537
|
backup.updated_at,
|
|
898
|
-
backup.user_id,
|
|
899
538
|
backup.volume_id,
|
|
900
539
|
)
|
|
901
540
|
|
|
@@ -31,7 +31,7 @@ class TestVolumeSnapshot(volume_fakes.TestVolume):
|
|
|
31
31
|
self.snapshots_mock.reset_mock()
|
|
32
32
|
self.volumes_mock = self.volume_client.volumes
|
|
33
33
|
self.volumes_mock.reset_mock()
|
|
34
|
-
self.project_mock = self.
|
|
34
|
+
self.project_mock = self.identity_client.projects
|
|
35
35
|
self.project_mock.reset_mock()
|
|
36
36
|
|
|
37
37
|
|
|
@@ -15,7 +15,6 @@
|
|
|
15
15
|
from unittest import mock
|
|
16
16
|
from unittest.mock import call
|
|
17
17
|
|
|
18
|
-
from cinderclient import api_versions
|
|
19
18
|
from osc_lib import exceptions
|
|
20
19
|
from osc_lib import utils
|
|
21
20
|
|
|
@@ -176,49 +175,6 @@ class TestTransferCreate(TestTransfer):
|
|
|
176
175
|
self.assertEqual(self.columns, columns)
|
|
177
176
|
self.assertEqual(self.data, data)
|
|
178
177
|
|
|
179
|
-
def test_transfer_create_with_no_snapshots(self):
|
|
180
|
-
self.volume_client.api_version = api_versions.APIVersion('3.55')
|
|
181
|
-
|
|
182
|
-
arglist = [
|
|
183
|
-
'--no-snapshots',
|
|
184
|
-
self.volume.id,
|
|
185
|
-
]
|
|
186
|
-
verifylist = [
|
|
187
|
-
('name', None),
|
|
188
|
-
('snapshots', False),
|
|
189
|
-
('volume', self.volume.id),
|
|
190
|
-
]
|
|
191
|
-
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
192
|
-
|
|
193
|
-
columns, data = self.cmd.take_action(parsed_args)
|
|
194
|
-
|
|
195
|
-
self.transfer_mock.create.assert_called_once_with(
|
|
196
|
-
self.volume.id, None, no_snapshots=True
|
|
197
|
-
)
|
|
198
|
-
self.assertEqual(self.columns, columns)
|
|
199
|
-
self.assertEqual(self.data, data)
|
|
200
|
-
|
|
201
|
-
def test_transfer_create_pre_v355(self):
|
|
202
|
-
self.volume_client.api_version = api_versions.APIVersion('3.54')
|
|
203
|
-
|
|
204
|
-
arglist = [
|
|
205
|
-
'--no-snapshots',
|
|
206
|
-
self.volume.id,
|
|
207
|
-
]
|
|
208
|
-
verifylist = [
|
|
209
|
-
('name', None),
|
|
210
|
-
('snapshots', False),
|
|
211
|
-
('volume', self.volume.id),
|
|
212
|
-
]
|
|
213
|
-
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
214
|
-
|
|
215
|
-
exc = self.assertRaises(
|
|
216
|
-
exceptions.CommandError, self.cmd.take_action, parsed_args
|
|
217
|
-
)
|
|
218
|
-
self.assertIn(
|
|
219
|
-
'--os-volume-api-version 3.55 or greater is required', str(exc)
|
|
220
|
-
)
|
|
221
|
-
|
|
222
178
|
|
|
223
179
|
class TestTransferDelete(TestTransfer):
|
|
224
180
|
volume_transfers = volume_fakes.create_transfers(count=2)
|
|
@@ -15,7 +15,6 @@
|
|
|
15
15
|
from unittest import mock
|
|
16
16
|
from unittest.mock import call
|
|
17
17
|
|
|
18
|
-
from cinderclient import api_versions
|
|
19
18
|
from osc_lib.cli import format_columns
|
|
20
19
|
from osc_lib import exceptions
|
|
21
20
|
from osc_lib import utils
|
|
@@ -41,7 +40,7 @@ class TestType(volume_fakes.TestVolume):
|
|
|
41
40
|
)
|
|
42
41
|
self.volume_encryption_types_mock.reset_mock()
|
|
43
42
|
|
|
44
|
-
self.projects_mock = self.
|
|
43
|
+
self.projects_mock = self.identity_client.projects
|
|
45
44
|
self.projects_mock.reset_mock()
|
|
46
45
|
|
|
47
46
|
|
|
@@ -333,7 +332,7 @@ class TestTypeList(TestType):
|
|
|
333
332
|
"Name",
|
|
334
333
|
"Is Public",
|
|
335
334
|
]
|
|
336
|
-
columns_long = columns + ["Description"
|
|
335
|
+
columns_long = columns + ["Description"]
|
|
337
336
|
data_with_default_type = [(volume_types[0].id, volume_types[0].name, True)]
|
|
338
337
|
data = []
|
|
339
338
|
for t in volume_types:
|
|
@@ -352,7 +351,6 @@ class TestTypeList(TestType):
|
|
|
352
351
|
t.name,
|
|
353
352
|
t.is_public,
|
|
354
353
|
t.description,
|
|
355
|
-
format_columns.DictColumn(t.extra_specs),
|
|
356
354
|
)
|
|
357
355
|
)
|
|
358
356
|
|
|
@@ -374,9 +372,7 @@ class TestTypeList(TestType):
|
|
|
374
372
|
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
375
373
|
|
|
376
374
|
columns, data = self.cmd.take_action(parsed_args)
|
|
377
|
-
self.volume_types_mock.list.assert_called_once_with(
|
|
378
|
-
search_opts={}, is_public=None
|
|
379
|
-
)
|
|
375
|
+
self.volume_types_mock.list.assert_called_once_with(is_public=None)
|
|
380
376
|
self.assertEqual(self.columns, columns)
|
|
381
377
|
self.assertCountEqual(self.data, list(data))
|
|
382
378
|
|
|
@@ -393,9 +389,7 @@ class TestTypeList(TestType):
|
|
|
393
389
|
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
394
390
|
|
|
395
391
|
columns, data = self.cmd.take_action(parsed_args)
|
|
396
|
-
self.volume_types_mock.list.assert_called_once_with(
|
|
397
|
-
search_opts={}, is_public=True
|
|
398
|
-
)
|
|
392
|
+
self.volume_types_mock.list.assert_called_once_with(is_public=True)
|
|
399
393
|
self.assertEqual(self.columns_long, columns)
|
|
400
394
|
self.assertCountEqual(self.data_long, list(data))
|
|
401
395
|
|
|
@@ -411,9 +405,7 @@ class TestTypeList(TestType):
|
|
|
411
405
|
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
412
406
|
|
|
413
407
|
columns, data = self.cmd.take_action(parsed_args)
|
|
414
|
-
self.volume_types_mock.list.assert_called_once_with(
|
|
415
|
-
search_opts={}, is_public=False
|
|
416
|
-
)
|
|
408
|
+
self.volume_types_mock.list.assert_called_once_with(is_public=False)
|
|
417
409
|
self.assertEqual(self.columns, columns)
|
|
418
410
|
self.assertCountEqual(self.data, list(data))
|
|
419
411
|
|
|
@@ -434,77 +426,6 @@ class TestTypeList(TestType):
|
|
|
434
426
|
self.assertEqual(self.columns, columns)
|
|
435
427
|
self.assertCountEqual(self.data_with_default_type, list(data))
|
|
436
428
|
|
|
437
|
-
def test_type_list_with_properties(self):
|
|
438
|
-
self.app.client_manager.volume.api_version = api_versions.APIVersion(
|
|
439
|
-
'3.52'
|
|
440
|
-
)
|
|
441
|
-
|
|
442
|
-
arglist = [
|
|
443
|
-
"--property",
|
|
444
|
-
"foo=bar",
|
|
445
|
-
"--multiattach",
|
|
446
|
-
"--cacheable",
|
|
447
|
-
"--replicated",
|
|
448
|
-
"--availability-zone",
|
|
449
|
-
"az1",
|
|
450
|
-
]
|
|
451
|
-
verifylist = [
|
|
452
|
-
("encryption_type", False),
|
|
453
|
-
("long", False),
|
|
454
|
-
("is_public", None),
|
|
455
|
-
("default", False),
|
|
456
|
-
("properties", {"foo": "bar"}),
|
|
457
|
-
("multiattach", True),
|
|
458
|
-
("cacheable", True),
|
|
459
|
-
("replicated", True),
|
|
460
|
-
("availability_zones", ["az1"]),
|
|
461
|
-
]
|
|
462
|
-
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
463
|
-
|
|
464
|
-
columns, data = self.cmd.take_action(parsed_args)
|
|
465
|
-
self.volume_types_mock.list.assert_called_once_with(
|
|
466
|
-
search_opts={
|
|
467
|
-
"extra_specs": {
|
|
468
|
-
"foo": "bar",
|
|
469
|
-
"multiattach": "<is> True",
|
|
470
|
-
"cacheable": "<is> True",
|
|
471
|
-
"replication_enabled": "<is> True",
|
|
472
|
-
"RESKEY:availability_zones": "az1",
|
|
473
|
-
}
|
|
474
|
-
},
|
|
475
|
-
is_public=None,
|
|
476
|
-
)
|
|
477
|
-
self.assertEqual(self.columns, columns)
|
|
478
|
-
self.assertCountEqual(self.data, list(data))
|
|
479
|
-
|
|
480
|
-
def test_type_list_with_properties_pre_v352(self):
|
|
481
|
-
self.app.client_manager.volume.api_version = api_versions.APIVersion(
|
|
482
|
-
'3.51'
|
|
483
|
-
)
|
|
484
|
-
|
|
485
|
-
arglist = [
|
|
486
|
-
"--property",
|
|
487
|
-
"foo=bar",
|
|
488
|
-
]
|
|
489
|
-
verifylist = [
|
|
490
|
-
("encryption_type", False),
|
|
491
|
-
("long", False),
|
|
492
|
-
("is_public", None),
|
|
493
|
-
("default", False),
|
|
494
|
-
("properties", {"foo": "bar"}),
|
|
495
|
-
]
|
|
496
|
-
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
497
|
-
|
|
498
|
-
exc = self.assertRaises(
|
|
499
|
-
exceptions.CommandError,
|
|
500
|
-
self.cmd.take_action,
|
|
501
|
-
parsed_args,
|
|
502
|
-
)
|
|
503
|
-
self.assertIn(
|
|
504
|
-
'--os-volume-api-version 3.52 or greater is required',
|
|
505
|
-
str(exc),
|
|
506
|
-
)
|
|
507
|
-
|
|
508
429
|
def test_type_list_with_encryption(self):
|
|
509
430
|
encryption_type = volume_fakes.create_one_encryption_volume_type(
|
|
510
431
|
attrs={'volume_type_id': self.volume_types[0].id},
|
|
@@ -550,9 +471,7 @@ class TestTypeList(TestType):
|
|
|
550
471
|
|
|
551
472
|
columns, data = self.cmd.take_action(parsed_args)
|
|
552
473
|
self.volume_encryption_types_mock.list.assert_called_once_with()
|
|
553
|
-
self.volume_types_mock.list.assert_called_once_with(
|
|
554
|
-
search_opts={}, is_public=None
|
|
555
|
-
)
|
|
474
|
+
self.volume_types_mock.list.assert_called_once_with(is_public=None)
|
|
556
475
|
self.assertEqual(encryption_columns, columns)
|
|
557
476
|
self.assertCountEqual(encryption_data, list(data))
|
|
558
477
|
|