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
|
@@ -12,7 +12,6 @@
|
|
|
12
12
|
|
|
13
13
|
from unittest import mock
|
|
14
14
|
|
|
15
|
-
from cinderclient import api_versions
|
|
16
15
|
from osc_lib import exceptions
|
|
17
16
|
|
|
18
17
|
from openstackclient.tests.unit import utils as tests_utils
|
|
@@ -96,7 +95,7 @@ class TestVolumeGroupCreate(TestVolumeGroup):
|
|
|
96
95
|
self.cmd = volume_group.CreateVolumeGroup(self.app, None)
|
|
97
96
|
|
|
98
97
|
def test_volume_group_create(self):
|
|
99
|
-
self.
|
|
98
|
+
self.set_volume_api_version('3.13')
|
|
100
99
|
|
|
101
100
|
arglist = [
|
|
102
101
|
'--volume-group-type',
|
|
@@ -132,7 +131,7 @@ class TestVolumeGroupCreate(TestVolumeGroup):
|
|
|
132
131
|
self.assertCountEqual(self.data, data)
|
|
133
132
|
|
|
134
133
|
def test_volume_group_create__legacy(self):
|
|
135
|
-
self.
|
|
134
|
+
self.set_volume_api_version('3.13')
|
|
136
135
|
|
|
137
136
|
arglist = [
|
|
138
137
|
self.fake_volume_group_type.id,
|
|
@@ -172,7 +171,7 @@ class TestVolumeGroupCreate(TestVolumeGroup):
|
|
|
172
171
|
)
|
|
173
172
|
|
|
174
173
|
def test_volume_group_create_no_volume_type(self):
|
|
175
|
-
self.
|
|
174
|
+
self.set_volume_api_version('3.13')
|
|
176
175
|
|
|
177
176
|
arglist = [
|
|
178
177
|
'--volume-group-type',
|
|
@@ -194,7 +193,7 @@ class TestVolumeGroupCreate(TestVolumeGroup):
|
|
|
194
193
|
)
|
|
195
194
|
|
|
196
195
|
def test_volume_group_create_with_options(self):
|
|
197
|
-
self.
|
|
196
|
+
self.set_volume_api_version('3.13')
|
|
198
197
|
|
|
199
198
|
arglist = [
|
|
200
199
|
'--volume-group-type',
|
|
@@ -236,7 +235,7 @@ class TestVolumeGroupCreate(TestVolumeGroup):
|
|
|
236
235
|
self.assertCountEqual(self.data, data)
|
|
237
236
|
|
|
238
237
|
def test_volume_group_create_pre_v313(self):
|
|
239
|
-
self.
|
|
238
|
+
self.set_volume_api_version('3.12')
|
|
240
239
|
|
|
241
240
|
arglist = [
|
|
242
241
|
'--volume-group-type',
|
|
@@ -261,7 +260,7 @@ class TestVolumeGroupCreate(TestVolumeGroup):
|
|
|
261
260
|
)
|
|
262
261
|
|
|
263
262
|
def test_volume_group_create_from_source_group(self):
|
|
264
|
-
self.
|
|
263
|
+
self.set_volume_api_version('3.14')
|
|
265
264
|
|
|
266
265
|
arglist = [
|
|
267
266
|
'--source-group',
|
|
@@ -290,7 +289,7 @@ class TestVolumeGroupCreate(TestVolumeGroup):
|
|
|
290
289
|
self.assertCountEqual(self.data, data)
|
|
291
290
|
|
|
292
291
|
def test_volume_group_create_from_group_snapshot(self):
|
|
293
|
-
self.
|
|
292
|
+
self.set_volume_api_version('3.14')
|
|
294
293
|
|
|
295
294
|
arglist = [
|
|
296
295
|
'--group-snapshot',
|
|
@@ -319,7 +318,7 @@ class TestVolumeGroupCreate(TestVolumeGroup):
|
|
|
319
318
|
self.assertCountEqual(self.data, data)
|
|
320
319
|
|
|
321
320
|
def test_volume_group_create_from_src_pre_v314(self):
|
|
322
|
-
self.
|
|
321
|
+
self.set_volume_api_version('3.13')
|
|
323
322
|
|
|
324
323
|
arglist = [
|
|
325
324
|
'--source-group',
|
|
@@ -338,7 +337,7 @@ class TestVolumeGroupCreate(TestVolumeGroup):
|
|
|
338
337
|
)
|
|
339
338
|
|
|
340
339
|
def test_volume_group_create_from_src_source_group_group_snapshot(self):
|
|
341
|
-
self.
|
|
340
|
+
self.set_volume_api_version('3.14')
|
|
342
341
|
|
|
343
342
|
arglist = [
|
|
344
343
|
'--source-group',
|
|
@@ -376,7 +375,7 @@ class TestVolumeGroupDelete(TestVolumeGroup):
|
|
|
376
375
|
self.cmd = volume_group.DeleteVolumeGroup(self.app, None)
|
|
377
376
|
|
|
378
377
|
def test_volume_group_delete(self):
|
|
379
|
-
self.
|
|
378
|
+
self.set_volume_api_version('3.13')
|
|
380
379
|
|
|
381
380
|
arglist = [
|
|
382
381
|
self.fake_volume_group.id,
|
|
@@ -397,7 +396,7 @@ class TestVolumeGroupDelete(TestVolumeGroup):
|
|
|
397
396
|
self.assertIsNone(result)
|
|
398
397
|
|
|
399
398
|
def test_volume_group_delete_pre_v313(self):
|
|
400
|
-
self.
|
|
399
|
+
self.set_volume_api_version('3.12')
|
|
401
400
|
|
|
402
401
|
arglist = [
|
|
403
402
|
self.fake_volume_group.id,
|
|
@@ -455,7 +454,7 @@ class TestVolumeGroupSet(TestVolumeGroup):
|
|
|
455
454
|
self.cmd = volume_group.SetVolumeGroup(self.app, None)
|
|
456
455
|
|
|
457
456
|
def test_volume_group_set(self):
|
|
458
|
-
self.
|
|
457
|
+
self.set_volume_api_version('3.13')
|
|
459
458
|
|
|
460
459
|
arglist = [
|
|
461
460
|
self.fake_volume_group.id,
|
|
@@ -482,7 +481,7 @@ class TestVolumeGroupSet(TestVolumeGroup):
|
|
|
482
481
|
self.assertCountEqual(self.data, data)
|
|
483
482
|
|
|
484
483
|
def test_volume_group_with_enable_replication_option(self):
|
|
485
|
-
self.
|
|
484
|
+
self.set_volume_api_version('3.38')
|
|
486
485
|
|
|
487
486
|
arglist = [
|
|
488
487
|
self.fake_volume_group.id,
|
|
@@ -503,7 +502,7 @@ class TestVolumeGroupSet(TestVolumeGroup):
|
|
|
503
502
|
self.assertCountEqual(self.data, data)
|
|
504
503
|
|
|
505
504
|
def test_volume_group_set_pre_v313(self):
|
|
506
|
-
self.
|
|
505
|
+
self.set_volume_api_version('3.12')
|
|
507
506
|
|
|
508
507
|
arglist = [
|
|
509
508
|
self.fake_volume_group.id,
|
|
@@ -527,7 +526,7 @@ class TestVolumeGroupSet(TestVolumeGroup):
|
|
|
527
526
|
)
|
|
528
527
|
|
|
529
528
|
def test_volume_group_with_enable_replication_option_pre_v338(self):
|
|
530
|
-
self.
|
|
529
|
+
self.set_volume_api_version('3.37')
|
|
531
530
|
|
|
532
531
|
arglist = [
|
|
533
532
|
self.fake_volume_group.id,
|
|
@@ -572,7 +571,7 @@ class TestVolumeGroupList(TestVolumeGroup):
|
|
|
572
571
|
self.cmd = volume_group.ListVolumeGroup(self.app, None)
|
|
573
572
|
|
|
574
573
|
def test_volume_group_list(self):
|
|
575
|
-
self.
|
|
574
|
+
self.set_volume_api_version('3.13')
|
|
576
575
|
|
|
577
576
|
arglist = [
|
|
578
577
|
'--all-projects',
|
|
@@ -593,7 +592,7 @@ class TestVolumeGroupList(TestVolumeGroup):
|
|
|
593
592
|
self.assertCountEqual(tuple(self.data), data)
|
|
594
593
|
|
|
595
594
|
def test_volume_group_list_pre_v313(self):
|
|
596
|
-
self.
|
|
595
|
+
self.set_volume_api_version('3.12')
|
|
597
596
|
|
|
598
597
|
arglist = [
|
|
599
598
|
'--all-projects',
|
|
@@ -623,7 +622,7 @@ class TestVolumeGroupFailover(TestVolumeGroup):
|
|
|
623
622
|
self.cmd = volume_group.FailoverVolumeGroup(self.app, None)
|
|
624
623
|
|
|
625
624
|
def test_volume_group_failover(self):
|
|
626
|
-
self.
|
|
625
|
+
self.set_volume_api_version('3.38')
|
|
627
626
|
|
|
628
627
|
arglist = [
|
|
629
628
|
self.fake_volume_group.id,
|
|
@@ -648,7 +647,7 @@ class TestVolumeGroupFailover(TestVolumeGroup):
|
|
|
648
647
|
self.assertIsNone(result)
|
|
649
648
|
|
|
650
649
|
def test_volume_group_failover_pre_v338(self):
|
|
651
|
-
self.
|
|
650
|
+
self.set_volume_api_version('3.37')
|
|
652
651
|
|
|
653
652
|
arglist = [
|
|
654
653
|
self.fake_volume_group.id,
|
|
@@ -10,28 +10,15 @@
|
|
|
10
10
|
# License for the specific language governing permissions and limitations
|
|
11
11
|
# under the License.
|
|
12
12
|
|
|
13
|
-
from unittest import mock
|
|
14
|
-
|
|
15
|
-
from keystoneauth1 import discover
|
|
16
13
|
from openstack.block_storage.v3 import group as _group
|
|
17
14
|
from openstack.block_storage.v3 import group_snapshot as _group_snapshot
|
|
18
15
|
from openstack.test import fakes as sdk_fakes
|
|
19
|
-
from openstack import utils as sdk_utils
|
|
20
16
|
from osc_lib import exceptions
|
|
21
17
|
|
|
22
18
|
from openstackclient.tests.unit.volume.v3 import fakes as volume_fakes
|
|
23
19
|
from openstackclient.volume.v3 import volume_group_snapshot
|
|
24
20
|
|
|
25
21
|
|
|
26
|
-
def fake_supports_microversion(mocked_version):
|
|
27
|
-
def supports_microversion(adapter, microversion, raise_exception=False):
|
|
28
|
-
required = discover.normalize_version_number(microversion)
|
|
29
|
-
candidate = discover.normalize_version_number(mocked_version)
|
|
30
|
-
return discover.version_match(required, candidate)
|
|
31
|
-
|
|
32
|
-
return supports_microversion
|
|
33
|
-
|
|
34
|
-
|
|
35
22
|
class TestVolumeGroupSnapshotCreate(volume_fakes.TestVolume):
|
|
36
23
|
fake_volume_group = sdk_fakes.generate_fake_resource(_group.Group)
|
|
37
24
|
fake_volume_group_snapshot = sdk_fakes.generate_fake_resource(
|
|
@@ -70,9 +57,8 @@ class TestVolumeGroupSnapshotCreate(volume_fakes.TestVolume):
|
|
|
70
57
|
self.app, None
|
|
71
58
|
)
|
|
72
59
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
mock_mv.side_effect = fake_supports_microversion('3.14')
|
|
60
|
+
def test_volume_group_snapshot_create(self):
|
|
61
|
+
self.set_volume_api_version('3.14')
|
|
76
62
|
|
|
77
63
|
arglist = [
|
|
78
64
|
self.fake_volume_group.id,
|
|
@@ -99,9 +85,8 @@ class TestVolumeGroupSnapshotCreate(volume_fakes.TestVolume):
|
|
|
99
85
|
self.assertEqual(self.columns, columns)
|
|
100
86
|
self.assertCountEqual(self.data, data)
|
|
101
87
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
mock_mv.side_effect = fake_supports_microversion('3.14')
|
|
88
|
+
def test_volume_group_snapshot_create_with_options(self):
|
|
89
|
+
self.set_volume_api_version('3.14')
|
|
105
90
|
|
|
106
91
|
arglist = [
|
|
107
92
|
self.fake_volume_group.id,
|
|
@@ -132,9 +117,8 @@ class TestVolumeGroupSnapshotCreate(volume_fakes.TestVolume):
|
|
|
132
117
|
self.assertEqual(self.columns, columns)
|
|
133
118
|
self.assertCountEqual(self.data, data)
|
|
134
119
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
mock_mv.side_effect = fake_supports_microversion('3.13')
|
|
120
|
+
def test_volume_group_snapshot_create_pre_v314(self):
|
|
121
|
+
self.set_volume_api_version('3.13')
|
|
138
122
|
|
|
139
123
|
arglist = [
|
|
140
124
|
self.fake_volume_group.id,
|
|
@@ -174,9 +158,8 @@ class TestVolumeGroupSnapshotDelete(volume_fakes.TestVolume):
|
|
|
174
158
|
self.app, None
|
|
175
159
|
)
|
|
176
160
|
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
mock_mv.side_effect = fake_supports_microversion('3.14')
|
|
161
|
+
def test_volume_group_snapshot_delete(self):
|
|
162
|
+
self.set_volume_api_version('3.14')
|
|
180
163
|
|
|
181
164
|
arglist = [
|
|
182
165
|
self.fake_volume_group_snapshot.id,
|
|
@@ -193,9 +176,8 @@ class TestVolumeGroupSnapshotDelete(volume_fakes.TestVolume):
|
|
|
193
176
|
)
|
|
194
177
|
self.assertIsNone(result)
|
|
195
178
|
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
mock_mv.side_effect = fake_supports_microversion('3.13')
|
|
179
|
+
def test_volume_group_snapshot_delete_pre_v314(self):
|
|
180
|
+
self.set_volume_api_version('3.13')
|
|
199
181
|
|
|
200
182
|
arglist = [
|
|
201
183
|
self.fake_volume_group_snapshot.id,
|
|
@@ -249,9 +231,8 @@ class TestVolumeGroupSnapshotList(volume_fakes.TestVolume):
|
|
|
249
231
|
self.app, None
|
|
250
232
|
)
|
|
251
233
|
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
mock_mv.side_effect = fake_supports_microversion('3.14')
|
|
234
|
+
def test_volume_group_snapshot_list(self):
|
|
235
|
+
self.set_volume_api_version('3.14')
|
|
255
236
|
|
|
256
237
|
arglist = [
|
|
257
238
|
'--all-projects',
|
|
@@ -269,9 +250,8 @@ class TestVolumeGroupSnapshotList(volume_fakes.TestVolume):
|
|
|
269
250
|
self.assertEqual(self.columns, columns)
|
|
270
251
|
self.assertCountEqual(tuple(self.data), data)
|
|
271
252
|
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
mock_mv.side_effect = fake_supports_microversion('3.13')
|
|
253
|
+
def test_volume_group_snapshot_list_pre_v314(self):
|
|
254
|
+
self.set_volume_api_version('3.13')
|
|
275
255
|
|
|
276
256
|
arglist = []
|
|
277
257
|
verifylist = [
|
|
@@ -12,7 +12,6 @@
|
|
|
12
12
|
|
|
13
13
|
from unittest import mock
|
|
14
14
|
|
|
15
|
-
from cinderclient import api_versions
|
|
16
15
|
from osc_lib.cli import format_columns
|
|
17
16
|
from osc_lib import exceptions
|
|
18
17
|
|
|
@@ -29,8 +28,6 @@ class TestVolumeGroupType(volume_fakes.TestVolume):
|
|
|
29
28
|
|
|
30
29
|
|
|
31
30
|
class TestVolumeGroupTypeCreate(TestVolumeGroupType):
|
|
32
|
-
maxDiff = 2000
|
|
33
|
-
|
|
34
31
|
fake_volume_group_type = volume_fakes.create_one_volume_group_type()
|
|
35
32
|
|
|
36
33
|
columns = (
|
|
@@ -58,7 +55,7 @@ class TestVolumeGroupTypeCreate(TestVolumeGroupType):
|
|
|
58
55
|
self.cmd = volume_group_type.CreateVolumeGroupType(self.app, None)
|
|
59
56
|
|
|
60
57
|
def test_volume_group_type_create(self):
|
|
61
|
-
self.
|
|
58
|
+
self.set_volume_api_version('3.11')
|
|
62
59
|
|
|
63
60
|
arglist = [
|
|
64
61
|
self.fake_volume_group_type.name,
|
|
@@ -79,7 +76,7 @@ class TestVolumeGroupTypeCreate(TestVolumeGroupType):
|
|
|
79
76
|
self.assertCountEqual(self.data, data)
|
|
80
77
|
|
|
81
78
|
def test_volume_group_type_create_with_options(self):
|
|
82
|
-
self.
|
|
79
|
+
self.set_volume_api_version('3.11')
|
|
83
80
|
|
|
84
81
|
arglist = [
|
|
85
82
|
self.fake_volume_group_type.name,
|
|
@@ -103,7 +100,7 @@ class TestVolumeGroupTypeCreate(TestVolumeGroupType):
|
|
|
103
100
|
self.assertCountEqual(self.data, data)
|
|
104
101
|
|
|
105
102
|
def test_volume_group_type_create_pre_v311(self):
|
|
106
|
-
self.
|
|
103
|
+
self.set_volume_api_version('3.10')
|
|
107
104
|
|
|
108
105
|
arglist = [
|
|
109
106
|
self.fake_volume_group_type.name,
|
|
@@ -137,7 +134,7 @@ class TestVolumeGroupTypeDelete(TestVolumeGroupType):
|
|
|
137
134
|
self.cmd = volume_group_type.DeleteVolumeGroupType(self.app, None)
|
|
138
135
|
|
|
139
136
|
def test_volume_group_type_delete(self):
|
|
140
|
-
self.
|
|
137
|
+
self.set_volume_api_version('3.11')
|
|
141
138
|
|
|
142
139
|
arglist = [
|
|
143
140
|
self.fake_volume_group_type.id,
|
|
@@ -155,7 +152,7 @@ class TestVolumeGroupTypeDelete(TestVolumeGroupType):
|
|
|
155
152
|
self.assertIsNone(result)
|
|
156
153
|
|
|
157
154
|
def test_volume_group_type_delete_pre_v311(self):
|
|
158
|
-
self.
|
|
155
|
+
self.set_volume_api_version('3.10')
|
|
159
156
|
|
|
160
157
|
arglist = [
|
|
161
158
|
self.fake_volume_group_type.id,
|
|
@@ -210,7 +207,7 @@ class TestVolumeGroupTypeSet(TestVolumeGroupType):
|
|
|
210
207
|
self.cmd = volume_group_type.SetVolumeGroupType(self.app, None)
|
|
211
208
|
|
|
212
209
|
def test_volume_group_type_set(self):
|
|
213
|
-
self.
|
|
210
|
+
self.set_volume_api_version('3.11')
|
|
214
211
|
|
|
215
212
|
self.fake_volume_group_type.set_keys.return_value = None
|
|
216
213
|
|
|
@@ -249,7 +246,7 @@ class TestVolumeGroupTypeSet(TestVolumeGroupType):
|
|
|
249
246
|
self.assertCountEqual(self.data, data)
|
|
250
247
|
|
|
251
248
|
def test_volume_group_type_with_no_property_option(self):
|
|
252
|
-
self.
|
|
249
|
+
self.set_volume_api_version('3.11')
|
|
253
250
|
|
|
254
251
|
arglist = [
|
|
255
252
|
self.fake_volume_group_type.id,
|
|
@@ -280,7 +277,7 @@ class TestVolumeGroupTypeSet(TestVolumeGroupType):
|
|
|
280
277
|
self.assertCountEqual(self.data, data)
|
|
281
278
|
|
|
282
279
|
def test_volume_group_type_set_pre_v311(self):
|
|
283
|
-
self.
|
|
280
|
+
self.set_volume_api_version('3.10')
|
|
284
281
|
|
|
285
282
|
arglist = [
|
|
286
283
|
self.fake_volume_group_type.id,
|
|
@@ -337,7 +334,7 @@ class TestVolumeGroupTypeUnset(TestVolumeGroupType):
|
|
|
337
334
|
self.cmd = volume_group_type.UnsetVolumeGroupType(self.app, None)
|
|
338
335
|
|
|
339
336
|
def test_volume_group_type_unset(self):
|
|
340
|
-
self.
|
|
337
|
+
self.set_volume_api_version('3.11')
|
|
341
338
|
|
|
342
339
|
arglist = [
|
|
343
340
|
self.fake_volume_group_type.id,
|
|
@@ -365,7 +362,7 @@ class TestVolumeGroupTypeUnset(TestVolumeGroupType):
|
|
|
365
362
|
self.assertCountEqual(self.data, data)
|
|
366
363
|
|
|
367
364
|
def test_volume_group_type_unset_pre_v311(self):
|
|
368
|
-
self.
|
|
365
|
+
self.set_volume_api_version('3.10')
|
|
369
366
|
|
|
370
367
|
arglist = [
|
|
371
368
|
self.fake_volume_group_type.id,
|
|
@@ -418,7 +415,7 @@ class TestVolumeGroupTypeList(TestVolumeGroupType):
|
|
|
418
415
|
self.cmd = volume_group_type.ListVolumeGroupType(self.app, None)
|
|
419
416
|
|
|
420
417
|
def test_volume_group_type_list(self):
|
|
421
|
-
self.
|
|
418
|
+
self.set_volume_api_version('3.11')
|
|
422
419
|
|
|
423
420
|
arglist = []
|
|
424
421
|
verifylist = [
|
|
@@ -433,7 +430,7 @@ class TestVolumeGroupTypeList(TestVolumeGroupType):
|
|
|
433
430
|
self.assertCountEqual(tuple(self.data), data)
|
|
434
431
|
|
|
435
432
|
def test_volume_group_type_list_with_default_option(self):
|
|
436
|
-
self.
|
|
433
|
+
self.set_volume_api_version('3.11')
|
|
437
434
|
|
|
438
435
|
arglist = [
|
|
439
436
|
'--default',
|
|
@@ -450,7 +447,7 @@ class TestVolumeGroupTypeList(TestVolumeGroupType):
|
|
|
450
447
|
self.assertCountEqual(tuple([self.data[0]]), data)
|
|
451
448
|
|
|
452
449
|
def test_volume_group_type_list_pre_v311(self):
|
|
453
|
-
self.
|
|
450
|
+
self.set_volume_api_version('3.10')
|
|
454
451
|
|
|
455
452
|
arglist = []
|
|
456
453
|
verifylist = []
|
|
@@ -12,7 +12,6 @@
|
|
|
12
12
|
|
|
13
13
|
from unittest.mock import call
|
|
14
14
|
|
|
15
|
-
from cinderclient import api_versions
|
|
16
15
|
from osc_lib import exceptions
|
|
17
16
|
|
|
18
17
|
from openstackclient.tests.unit.identity.v3 import fakes as identity_fakes
|
|
@@ -24,7 +23,7 @@ class TestVolumeMessage(volume_fakes.TestVolume):
|
|
|
24
23
|
def setUp(self):
|
|
25
24
|
super().setUp()
|
|
26
25
|
|
|
27
|
-
self.projects_mock = self.
|
|
26
|
+
self.projects_mock = self.identity_client.projects
|
|
28
27
|
self.projects_mock.reset_mock()
|
|
29
28
|
|
|
30
29
|
self.volume_messages_mock = self.volume_client.messages
|
|
@@ -46,7 +45,7 @@ class TestVolumeMessageDelete(TestVolumeMessage):
|
|
|
46
45
|
self.cmd = volume_message.DeleteMessage(self.app, None)
|
|
47
46
|
|
|
48
47
|
def test_message_delete(self):
|
|
49
|
-
self.
|
|
48
|
+
self.set_volume_api_version('3.3')
|
|
50
49
|
|
|
51
50
|
arglist = [
|
|
52
51
|
self.fake_messages[0].id,
|
|
@@ -64,7 +63,7 @@ class TestVolumeMessageDelete(TestVolumeMessage):
|
|
|
64
63
|
self.assertIsNone(result)
|
|
65
64
|
|
|
66
65
|
def test_message_delete_multiple_messages(self):
|
|
67
|
-
self.
|
|
66
|
+
self.set_volume_api_version('3.3')
|
|
68
67
|
|
|
69
68
|
arglist = [
|
|
70
69
|
self.fake_messages[0].id,
|
|
@@ -84,7 +83,7 @@ class TestVolumeMessageDelete(TestVolumeMessage):
|
|
|
84
83
|
self.assertIsNone(result)
|
|
85
84
|
|
|
86
85
|
def test_message_delete_multiple_messages_with_exception(self):
|
|
87
|
-
self.
|
|
86
|
+
self.set_volume_api_version('3.3')
|
|
88
87
|
|
|
89
88
|
arglist = [
|
|
90
89
|
self.fake_messages[0].id,
|
|
@@ -114,7 +113,7 @@ class TestVolumeMessageDelete(TestVolumeMessage):
|
|
|
114
113
|
self.assertEqual(2, self.volume_messages_mock.delete.call_count)
|
|
115
114
|
|
|
116
115
|
def test_message_delete_pre_v33(self):
|
|
117
|
-
self.
|
|
116
|
+
self.set_volume_api_version('3.2')
|
|
118
117
|
|
|
119
118
|
arglist = [
|
|
120
119
|
self.fake_messages[0].id,
|
|
@@ -172,7 +171,7 @@ class TestVolumeMessageList(TestVolumeMessage):
|
|
|
172
171
|
self.cmd = volume_message.ListMessages(self.app, None)
|
|
173
172
|
|
|
174
173
|
def test_message_list(self):
|
|
175
|
-
self.
|
|
174
|
+
self.set_volume_api_version('3.3')
|
|
176
175
|
|
|
177
176
|
arglist = []
|
|
178
177
|
verifylist = [
|
|
@@ -196,7 +195,7 @@ class TestVolumeMessageList(TestVolumeMessage):
|
|
|
196
195
|
self.assertCountEqual(self.data, list(data))
|
|
197
196
|
|
|
198
197
|
def test_message_list_with_options(self):
|
|
199
|
-
self.
|
|
198
|
+
self.set_volume_api_version('3.3')
|
|
200
199
|
|
|
201
200
|
arglist = [
|
|
202
201
|
'--project',
|
|
@@ -227,7 +226,7 @@ class TestVolumeMessageList(TestVolumeMessage):
|
|
|
227
226
|
self.assertCountEqual(self.data, list(data))
|
|
228
227
|
|
|
229
228
|
def test_message_list_pre_v33(self):
|
|
230
|
-
self.
|
|
229
|
+
self.set_volume_api_version('3.2')
|
|
231
230
|
|
|
232
231
|
arglist = []
|
|
233
232
|
verifylist = [
|
|
@@ -280,7 +279,7 @@ class TestVolumeMessageShow(TestVolumeMessage):
|
|
|
280
279
|
self.cmd = volume_message.ShowMessage(self.app, None)
|
|
281
280
|
|
|
282
281
|
def test_message_show(self):
|
|
283
|
-
self.
|
|
282
|
+
self.set_volume_api_version('3.3')
|
|
284
283
|
|
|
285
284
|
arglist = [self.fake_message.id]
|
|
286
285
|
verifylist = [('message_id', self.fake_message.id)]
|
|
@@ -293,7 +292,7 @@ class TestVolumeMessageShow(TestVolumeMessage):
|
|
|
293
292
|
self.assertEqual(self.data, data)
|
|
294
293
|
|
|
295
294
|
def test_message_show_pre_v33(self):
|
|
296
|
-
self.
|
|
295
|
+
self.set_volume_api_version('3.2')
|
|
297
296
|
|
|
298
297
|
arglist = [self.fake_message.id]
|
|
299
298
|
verifylist = [('message_id', self.fake_message.id)]
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
#
|
|
2
|
+
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
|
3
|
+
# not use this file except in compliance with the License. You may obtain
|
|
4
|
+
# a copy of the License at
|
|
5
|
+
#
|
|
6
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
#
|
|
8
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
9
|
+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
10
|
+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
11
|
+
# License for the specific language governing permissions and limitations
|
|
12
|
+
# under the License.
|
|
13
|
+
|
|
14
|
+
from unittest import mock
|
|
15
|
+
|
|
16
|
+
from osc_lib import exceptions
|
|
17
|
+
from osc_lib import utils
|
|
18
|
+
|
|
19
|
+
from openstackclient.tests.unit.volume.v2 import fakes as volume_fakes
|
|
20
|
+
from openstackclient.tests.unit.volume.v3 import fakes as volume_fakes_v3
|
|
21
|
+
from openstackclient.volume.v3 import volume_snapshot
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
class TestVolumeSnapshot(volume_fakes_v3.TestVolume):
|
|
25
|
+
def setUp(self):
|
|
26
|
+
super().setUp()
|
|
27
|
+
|
|
28
|
+
self.snapshots_mock = self.volume_client.volume_snapshots
|
|
29
|
+
self.snapshots_mock.reset_mock()
|
|
30
|
+
|
|
31
|
+
self.volume_sdk_client.unmanage_snapshot.return_value = None
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
class TestVolumeSnapshotDelete(TestVolumeSnapshot):
|
|
35
|
+
snapshots = volume_fakes.create_snapshots(count=2)
|
|
36
|
+
|
|
37
|
+
def setUp(self):
|
|
38
|
+
super().setUp()
|
|
39
|
+
|
|
40
|
+
self.snapshots_mock.get = volume_fakes.get_snapshots(self.snapshots)
|
|
41
|
+
self.snapshots_mock.delete.return_value = None
|
|
42
|
+
|
|
43
|
+
# Get the command object to mock
|
|
44
|
+
self.cmd = volume_snapshot.DeleteVolumeSnapshot(self.app, None)
|
|
45
|
+
|
|
46
|
+
def test_snapshot_delete(self):
|
|
47
|
+
arglist = [self.snapshots[0].id]
|
|
48
|
+
verifylist = [("snapshots", [self.snapshots[0].id])]
|
|
49
|
+
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
50
|
+
|
|
51
|
+
result = self.cmd.take_action(parsed_args)
|
|
52
|
+
|
|
53
|
+
self.snapshots_mock.delete.assert_called_with(
|
|
54
|
+
self.snapshots[0].id, False
|
|
55
|
+
)
|
|
56
|
+
self.assertIsNone(result)
|
|
57
|
+
|
|
58
|
+
def test_snapshot_delete_with_force(self):
|
|
59
|
+
arglist = ['--force', self.snapshots[0].id]
|
|
60
|
+
verifylist = [('force', True), ("snapshots", [self.snapshots[0].id])]
|
|
61
|
+
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
62
|
+
|
|
63
|
+
result = self.cmd.take_action(parsed_args)
|
|
64
|
+
|
|
65
|
+
self.snapshots_mock.delete.assert_called_with(
|
|
66
|
+
self.snapshots[0].id, True
|
|
67
|
+
)
|
|
68
|
+
self.assertIsNone(result)
|
|
69
|
+
|
|
70
|
+
def test_delete_multiple_snapshots(self):
|
|
71
|
+
arglist = []
|
|
72
|
+
for s in self.snapshots:
|
|
73
|
+
arglist.append(s.id)
|
|
74
|
+
verifylist = [
|
|
75
|
+
('snapshots', arglist),
|
|
76
|
+
]
|
|
77
|
+
|
|
78
|
+
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
79
|
+
result = self.cmd.take_action(parsed_args)
|
|
80
|
+
|
|
81
|
+
calls = []
|
|
82
|
+
for s in self.snapshots:
|
|
83
|
+
calls.append(mock.call(s.id, False))
|
|
84
|
+
self.snapshots_mock.delete.assert_has_calls(calls)
|
|
85
|
+
self.assertIsNone(result)
|
|
86
|
+
|
|
87
|
+
def test_delete_multiple_snapshots_with_exception(self):
|
|
88
|
+
arglist = [
|
|
89
|
+
self.snapshots[0].id,
|
|
90
|
+
'unexist_snapshot',
|
|
91
|
+
]
|
|
92
|
+
verifylist = [
|
|
93
|
+
('snapshots', arglist),
|
|
94
|
+
]
|
|
95
|
+
|
|
96
|
+
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
97
|
+
|
|
98
|
+
find_mock_result = [self.snapshots[0], exceptions.CommandError]
|
|
99
|
+
with mock.patch.object(
|
|
100
|
+
utils, 'find_resource', side_effect=find_mock_result
|
|
101
|
+
) as find_mock:
|
|
102
|
+
try:
|
|
103
|
+
self.cmd.take_action(parsed_args)
|
|
104
|
+
self.fail('CommandError should be raised.')
|
|
105
|
+
except exceptions.CommandError as e:
|
|
106
|
+
self.assertEqual('1 of 2 snapshots failed to delete.', str(e))
|
|
107
|
+
|
|
108
|
+
find_mock.assert_any_call(
|
|
109
|
+
self.snapshots_mock, self.snapshots[0].id
|
|
110
|
+
)
|
|
111
|
+
find_mock.assert_any_call(self.snapshots_mock, 'unexist_snapshot')
|
|
112
|
+
|
|
113
|
+
self.assertEqual(2, find_mock.call_count)
|
|
114
|
+
self.snapshots_mock.delete.assert_called_once_with(
|
|
115
|
+
self.snapshots[0].id, False
|
|
116
|
+
)
|
|
117
|
+
|
|
118
|
+
def test_snapshot_delete_remote(self):
|
|
119
|
+
arglist = ['--remote', self.snapshots[0].id]
|
|
120
|
+
verifylist = [('remote', True), ("snapshots", [self.snapshots[0].id])]
|
|
121
|
+
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
122
|
+
|
|
123
|
+
result = self.cmd.take_action(parsed_args)
|
|
124
|
+
|
|
125
|
+
self.volume_sdk_client.unmanage_snapshot.assert_called_with(
|
|
126
|
+
self.snapshots[0].id
|
|
127
|
+
)
|
|
128
|
+
self.assertIsNone(result)
|
|
129
|
+
|
|
130
|
+
def test_snapshot_delete_with_remote_force(self):
|
|
131
|
+
arglist = ['--remote', '--force', self.snapshots[0].id]
|
|
132
|
+
verifylist = [
|
|
133
|
+
('remote', True),
|
|
134
|
+
('force', True),
|
|
135
|
+
("snapshots", [self.snapshots[0].id]),
|
|
136
|
+
]
|
|
137
|
+
|
|
138
|
+
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
139
|
+
exc = self.assertRaises(
|
|
140
|
+
exceptions.CommandError, self.cmd.take_action, parsed_args
|
|
141
|
+
)
|
|
142
|
+
self.assertIn(
|
|
143
|
+
"The --force option is not supported with the --remote "
|
|
144
|
+
"parameter.",
|
|
145
|
+
str(exc),
|
|
146
|
+
)
|
|
147
|
+
|
|
148
|
+
def test_delete_multiple_snapshots_remote(self):
|
|
149
|
+
arglist = ['--remote']
|
|
150
|
+
for s in self.snapshots:
|
|
151
|
+
arglist.append(s.id)
|
|
152
|
+
verifylist = [('remote', True), ('snapshots', arglist[1:])]
|
|
153
|
+
|
|
154
|
+
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
155
|
+
result = self.cmd.take_action(parsed_args)
|
|
156
|
+
|
|
157
|
+
calls = []
|
|
158
|
+
for s in self.snapshots:
|
|
159
|
+
calls.append(mock.call(s.id))
|
|
160
|
+
self.volume_sdk_client.unmanage_snapshot.assert_has_calls(calls)
|
|
161
|
+
self.assertIsNone(result)
|