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
|
@@ -16,7 +16,6 @@ from unittest import mock
|
|
|
16
16
|
|
|
17
17
|
from openstack.compute.v2 import flavor as _flavor
|
|
18
18
|
from openstack import exceptions as sdk_exceptions
|
|
19
|
-
from openstack import utils as sdk_utils
|
|
20
19
|
from osc_lib.cli import format_columns
|
|
21
20
|
from osc_lib import exceptions
|
|
22
21
|
|
|
@@ -28,9 +27,9 @@ from openstackclient.tests.unit import utils as tests_utils
|
|
|
28
27
|
|
|
29
28
|
class TestFlavor(compute_fakes.TestComputev2):
|
|
30
29
|
def setUp(self):
|
|
31
|
-
super(
|
|
30
|
+
super().setUp()
|
|
32
31
|
|
|
33
|
-
self.projects_mock = self.
|
|
32
|
+
self.projects_mock = self.identity_client.projects
|
|
34
33
|
self.projects_mock.reset_mock()
|
|
35
34
|
|
|
36
35
|
|
|
@@ -83,7 +82,7 @@ class TestFlavorCreate(TestFlavor):
|
|
|
83
82
|
)
|
|
84
83
|
|
|
85
84
|
def setUp(self):
|
|
86
|
-
super(
|
|
85
|
+
super().setUp()
|
|
87
86
|
|
|
88
87
|
# Return a project
|
|
89
88
|
self.projects_mock.get.return_value = self.project
|
|
@@ -118,6 +117,8 @@ class TestFlavorCreate(TestFlavor):
|
|
|
118
117
|
self.assertCountEqual(self.data, data)
|
|
119
118
|
|
|
120
119
|
def test_flavor_create_all_options(self):
|
|
120
|
+
self.set_compute_api_version('2.55')
|
|
121
|
+
|
|
121
122
|
arglist = [
|
|
122
123
|
'--id',
|
|
123
124
|
self.flavor.id,
|
|
@@ -184,22 +185,19 @@ class TestFlavorCreate(TestFlavor):
|
|
|
184
185
|
expected_flavor
|
|
185
186
|
)
|
|
186
187
|
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
)
|
|
194
|
-
self.compute_sdk_client.create_flavor_extra_specs.assert_called_once_with(
|
|
195
|
-
create_flavor, props
|
|
196
|
-
)
|
|
197
|
-
self.compute_sdk_client.get_flavor_access.assert_not_called()
|
|
188
|
+
columns, data = self.cmd.take_action(parsed_args)
|
|
189
|
+
self.compute_sdk_client.create_flavor.assert_called_once_with(**args)
|
|
190
|
+
self.compute_sdk_client.create_flavor_extra_specs.assert_called_once_with(
|
|
191
|
+
create_flavor, props
|
|
192
|
+
)
|
|
193
|
+
self.compute_sdk_client.get_flavor_access.assert_not_called()
|
|
198
194
|
|
|
199
195
|
self.assertEqual(self.columns, columns)
|
|
200
196
|
self.assertCountEqual(tuple(cmp_data), data)
|
|
201
197
|
|
|
202
198
|
def test_flavor_create_other_options(self):
|
|
199
|
+
self.set_compute_api_version('2.55')
|
|
200
|
+
|
|
203
201
|
self.flavor.is_public = False
|
|
204
202
|
arglist = [
|
|
205
203
|
'--id',
|
|
@@ -272,10 +270,8 @@ class TestFlavorCreate(TestFlavor):
|
|
|
272
270
|
expected_flavor
|
|
273
271
|
)
|
|
274
272
|
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
):
|
|
278
|
-
columns, data = self.cmd.take_action(parsed_args)
|
|
273
|
+
columns, data = self.cmd.take_action(parsed_args)
|
|
274
|
+
|
|
279
275
|
self.compute_sdk_client.create_flavor.assert_called_once_with(**args)
|
|
280
276
|
self.compute_sdk_client.flavor_add_tenant_access.assert_called_with(
|
|
281
277
|
self.flavor.id,
|
|
@@ -314,7 +310,9 @@ class TestFlavorCreate(TestFlavor):
|
|
|
314
310
|
verifylist,
|
|
315
311
|
)
|
|
316
312
|
|
|
317
|
-
def
|
|
313
|
+
def test_flavor_create_with_description(self):
|
|
314
|
+
self.set_compute_api_version('2.55')
|
|
315
|
+
|
|
318
316
|
arglist = [
|
|
319
317
|
'--id',
|
|
320
318
|
self.flavor.id,
|
|
@@ -348,10 +346,8 @@ class TestFlavorCreate(TestFlavor):
|
|
|
348
346
|
('name', self.flavor.name),
|
|
349
347
|
]
|
|
350
348
|
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
):
|
|
354
|
-
columns, data = self.cmd.take_action(parsed_args)
|
|
349
|
+
|
|
350
|
+
columns, data = self.cmd.take_action(parsed_args)
|
|
355
351
|
|
|
356
352
|
args = {
|
|
357
353
|
'name': self.flavor.name,
|
|
@@ -371,7 +367,9 @@ class TestFlavorCreate(TestFlavor):
|
|
|
371
367
|
self.assertEqual(self.columns, columns)
|
|
372
368
|
self.assertCountEqual(self.data_private, data)
|
|
373
369
|
|
|
374
|
-
def
|
|
370
|
+
def test_flavor_create_with_description_pre_v255(self):
|
|
371
|
+
self.set_compute_api_version('2.54')
|
|
372
|
+
|
|
375
373
|
arglist = [
|
|
376
374
|
'--id',
|
|
377
375
|
self.flavor.id,
|
|
@@ -391,19 +389,16 @@ class TestFlavorCreate(TestFlavor):
|
|
|
391
389
|
]
|
|
392
390
|
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
393
391
|
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
)
|
|
397
|
-
self.assertRaises(
|
|
398
|
-
exceptions.CommandError, self.cmd.take_action, parsed_args
|
|
399
|
-
)
|
|
392
|
+
self.assertRaises(
|
|
393
|
+
exceptions.CommandError, self.cmd.take_action, parsed_args
|
|
394
|
+
)
|
|
400
395
|
|
|
401
396
|
|
|
402
397
|
class TestFlavorDelete(TestFlavor):
|
|
403
398
|
flavors = compute_fakes.create_flavors(count=2)
|
|
404
399
|
|
|
405
400
|
def setUp(self):
|
|
406
|
-
super(
|
|
401
|
+
super().setUp()
|
|
407
402
|
|
|
408
403
|
self.compute_sdk_client.delete_flavor.return_value = None
|
|
409
404
|
|
|
@@ -513,7 +508,7 @@ class TestFlavorList(TestFlavor):
|
|
|
513
508
|
)
|
|
514
509
|
|
|
515
510
|
def setUp(self):
|
|
516
|
-
super(
|
|
511
|
+
super().setUp()
|
|
517
512
|
|
|
518
513
|
self.api_mock = mock.Mock()
|
|
519
514
|
self.api_mock.side_effect = [
|
|
@@ -756,7 +751,7 @@ class TestFlavorSet(TestFlavor):
|
|
|
756
751
|
project = identity_fakes.FakeProject.create_one_project()
|
|
757
752
|
|
|
758
753
|
def setUp(self):
|
|
759
|
-
super(
|
|
754
|
+
super().setUp()
|
|
760
755
|
|
|
761
756
|
self.compute_sdk_client.find_flavor.return_value = self.flavor
|
|
762
757
|
# Return a project
|
|
@@ -887,7 +882,9 @@ class TestFlavorSet(TestFlavor):
|
|
|
887
882
|
self.compute_sdk_client.flavor_add_tenant_access.assert_not_called()
|
|
888
883
|
self.assertIsNone(result)
|
|
889
884
|
|
|
890
|
-
def
|
|
885
|
+
def test_flavor_set_description(self):
|
|
886
|
+
self.set_compute_api_version('2.55')
|
|
887
|
+
|
|
891
888
|
arglist = [
|
|
892
889
|
'--description',
|
|
893
890
|
'description',
|
|
@@ -899,16 +896,15 @@ class TestFlavorSet(TestFlavor):
|
|
|
899
896
|
]
|
|
900
897
|
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
901
898
|
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
899
|
+
result = self.cmd.take_action(parsed_args)
|
|
900
|
+
self.compute_sdk_client.update_flavor.assert_called_with(
|
|
901
|
+
flavor=self.flavor.id, description='description'
|
|
902
|
+
)
|
|
903
|
+
self.assertIsNone(result)
|
|
904
|
+
|
|
905
|
+
def test_flavor_set_description_pre_v254(self):
|
|
906
|
+
self.set_compute_api_version('2.54')
|
|
910
907
|
|
|
911
|
-
def test_flavor_set_description_api_older(self):
|
|
912
908
|
arglist = [
|
|
913
909
|
'--description',
|
|
914
910
|
'description',
|
|
@@ -920,14 +916,13 @@ class TestFlavorSet(TestFlavor):
|
|
|
920
916
|
]
|
|
921
917
|
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
922
918
|
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
)
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
919
|
+
self.assertRaises(
|
|
920
|
+
exceptions.CommandError, self.cmd.take_action, parsed_args
|
|
921
|
+
)
|
|
922
|
+
|
|
923
|
+
def test_flavor_set_description_using_name(self):
|
|
924
|
+
self.set_compute_api_version('2.55')
|
|
929
925
|
|
|
930
|
-
def test_flavor_set_description_using_name_api_newer(self):
|
|
931
926
|
arglist = [
|
|
932
927
|
'--description',
|
|
933
928
|
'description',
|
|
@@ -939,16 +934,15 @@ class TestFlavorSet(TestFlavor):
|
|
|
939
934
|
]
|
|
940
935
|
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
941
936
|
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
937
|
+
result = self.cmd.take_action(parsed_args)
|
|
938
|
+
self.compute_sdk_client.update_flavor.assert_called_with(
|
|
939
|
+
flavor=self.flavor.id, description='description'
|
|
940
|
+
)
|
|
941
|
+
self.assertIsNone(result)
|
|
942
|
+
|
|
943
|
+
def test_flavor_set_description_using_name_pre_v255(self):
|
|
944
|
+
self.set_compute_api_version('2.54')
|
|
950
945
|
|
|
951
|
-
def test_flavor_set_description_using_name_api_older(self):
|
|
952
946
|
arglist = [
|
|
953
947
|
'--description',
|
|
954
948
|
'description',
|
|
@@ -960,12 +954,9 @@ class TestFlavorSet(TestFlavor):
|
|
|
960
954
|
]
|
|
961
955
|
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
962
956
|
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
)
|
|
966
|
-
self.assertRaises(
|
|
967
|
-
exceptions.CommandError, self.cmd.take_action, parsed_args
|
|
968
|
-
)
|
|
957
|
+
self.assertRaises(
|
|
958
|
+
exceptions.CommandError, self.cmd.take_action, parsed_args
|
|
959
|
+
)
|
|
969
960
|
|
|
970
961
|
|
|
971
962
|
class TestFlavorShow(TestFlavor):
|
|
@@ -1006,7 +997,7 @@ class TestFlavorShow(TestFlavor):
|
|
|
1006
997
|
)
|
|
1007
998
|
|
|
1008
999
|
def setUp(self):
|
|
1009
|
-
super(
|
|
1000
|
+
super().setUp()
|
|
1010
1001
|
|
|
1011
1002
|
# Return value of _find_resource()
|
|
1012
1003
|
self.compute_sdk_client.find_flavor.return_value = self.flavor
|
|
@@ -1093,7 +1084,7 @@ class TestFlavorUnset(TestFlavor):
|
|
|
1093
1084
|
project = identity_fakes.FakeProject.create_one_project()
|
|
1094
1085
|
|
|
1095
1086
|
def setUp(self):
|
|
1096
|
-
super(
|
|
1087
|
+
super().setUp()
|
|
1097
1088
|
|
|
1098
1089
|
self.compute_sdk_client.find_flavor.return_value = self.flavor
|
|
1099
1090
|
# Return a project
|
|
@@ -11,9 +11,8 @@
|
|
|
11
11
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
12
12
|
# License for the specific language governing permissions and limitations
|
|
13
13
|
# under the License.
|
|
14
|
-
#
|
|
15
14
|
|
|
16
|
-
|
|
15
|
+
import uuid
|
|
17
16
|
|
|
18
17
|
from openstackclient.compute.v2 import host
|
|
19
18
|
from openstackclient.tests.unit.compute.v2 import fakes as compute_fakes
|
|
@@ -21,19 +20,51 @@ from openstackclient.tests.unit import fakes
|
|
|
21
20
|
from openstackclient.tests.unit import utils as tests_utils
|
|
22
21
|
|
|
23
22
|
|
|
24
|
-
|
|
23
|
+
def _generate_fake_host():
|
|
24
|
+
return {
|
|
25
|
+
'service_id': 1,
|
|
26
|
+
'host': 'host1',
|
|
27
|
+
'uuid': 'host-id-' + uuid.uuid4().hex,
|
|
28
|
+
'vcpus': 10,
|
|
29
|
+
'memory_mb': 100,
|
|
30
|
+
'local_gb': 100,
|
|
31
|
+
'vcpus_used': 5,
|
|
32
|
+
'memory_mb_used': 50,
|
|
33
|
+
'local_gb_used': 10,
|
|
34
|
+
'hypervisor_type': 'xen',
|
|
35
|
+
'hypervisor_version': 1,
|
|
36
|
+
'hypervisor_hostname': 'devstack1',
|
|
37
|
+
'free_ram_mb': 50,
|
|
38
|
+
'free_disk_gb': 50,
|
|
39
|
+
'current_workload': 10,
|
|
40
|
+
'running_vms': 1,
|
|
41
|
+
'cpu_info': '',
|
|
42
|
+
'disk_available_least': 1,
|
|
43
|
+
'host_ip': '10.10.10.10',
|
|
44
|
+
'supported_instances': '',
|
|
45
|
+
'metrics': '',
|
|
46
|
+
'pci_stats': '',
|
|
47
|
+
'extra_resources': '',
|
|
48
|
+
'stats': '',
|
|
49
|
+
'numa_topology': '',
|
|
50
|
+
'ram_allocation_ratio': 1.0,
|
|
51
|
+
'cpu_allocation_ratio': 1.0,
|
|
52
|
+
'zone': 'zone-' + uuid.uuid4().hex,
|
|
53
|
+
'host_name': 'name-' + uuid.uuid4().hex,
|
|
54
|
+
'service': 'service-' + uuid.uuid4().hex,
|
|
55
|
+
'cpu': 4,
|
|
56
|
+
'disk_gb': 100,
|
|
57
|
+
'project': 'project-' + uuid.uuid4().hex,
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
|
|
25
61
|
class TestHostList(compute_fakes.TestComputev2):
|
|
26
|
-
_host = compute_fakes.create_one_host()
|
|
27
62
|
|
|
28
63
|
def setUp(self):
|
|
29
|
-
super(
|
|
30
|
-
|
|
31
|
-
self.compute_sdk_client.get.return_value = fakes.FakeResponse(
|
|
32
|
-
data={'hosts': [self._host]}
|
|
33
|
-
)
|
|
64
|
+
super().setUp()
|
|
34
65
|
|
|
66
|
+
self._host = _generate_fake_host()
|
|
35
67
|
self.columns = ('Host Name', 'Service', 'Zone')
|
|
36
|
-
|
|
37
68
|
self.data = [
|
|
38
69
|
(
|
|
39
70
|
self._host['host_name'],
|
|
@@ -42,10 +73,12 @@ class TestHostList(compute_fakes.TestComputev2):
|
|
|
42
73
|
)
|
|
43
74
|
]
|
|
44
75
|
|
|
76
|
+
self.compute_sdk_client.get.return_value = fakes.FakeResponse(
|
|
77
|
+
data={'hosts': [self._host]}
|
|
78
|
+
)
|
|
45
79
|
self.cmd = host.ListHost(self.app, None)
|
|
46
80
|
|
|
47
|
-
def test_host_list_no_option(self
|
|
48
|
-
h_mock.return_value = [self._host]
|
|
81
|
+
def test_host_list_no_option(self):
|
|
49
82
|
arglist = []
|
|
50
83
|
verifylist = []
|
|
51
84
|
|
|
@@ -59,8 +92,7 @@ class TestHostList(compute_fakes.TestComputev2):
|
|
|
59
92
|
self.assertEqual(self.columns, columns)
|
|
60
93
|
self.assertEqual(self.data, list(data))
|
|
61
94
|
|
|
62
|
-
def test_host_list_with_option(self
|
|
63
|
-
h_mock.return_value = [self._host]
|
|
95
|
+
def test_host_list_with_option(self):
|
|
64
96
|
arglist = [
|
|
65
97
|
'--zone',
|
|
66
98
|
self._host['zone'],
|
|
@@ -80,76 +112,60 @@ class TestHostList(compute_fakes.TestComputev2):
|
|
|
80
112
|
self.assertEqual(self.data, list(data))
|
|
81
113
|
|
|
82
114
|
|
|
83
|
-
@mock.patch('openstackclient.api.compute_v2.APIv2.host_set')
|
|
84
115
|
class TestHostSet(compute_fakes.TestComputev2):
|
|
85
116
|
def setUp(self):
|
|
86
|
-
super(
|
|
117
|
+
super().setUp()
|
|
87
118
|
|
|
88
|
-
self.
|
|
119
|
+
self._host = _generate_fake_host()
|
|
120
|
+
self.compute_sdk_client.put.return_value = fakes.FakeResponse()
|
|
89
121
|
|
|
90
122
|
self.cmd = host.SetHost(self.app, None)
|
|
91
123
|
|
|
92
|
-
def test_host_set_no_option(self
|
|
93
|
-
h_mock.return_value = self.host
|
|
94
|
-
h_mock.update.return_value = None
|
|
124
|
+
def test_host_set_no_option(self):
|
|
95
125
|
arglist = [
|
|
96
|
-
self.
|
|
126
|
+
self._host['host'],
|
|
97
127
|
]
|
|
98
128
|
verifylist = [
|
|
99
|
-
('host', self.
|
|
129
|
+
('host', self._host['host']),
|
|
100
130
|
]
|
|
101
131
|
|
|
102
132
|
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
103
133
|
|
|
104
134
|
result = self.cmd.take_action(parsed_args)
|
|
105
135
|
self.assertIsNone(result)
|
|
136
|
+
self.compute_sdk_client.put.assert_not_called()
|
|
106
137
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
def test_host_set(self, h_mock):
|
|
110
|
-
h_mock.return_value = self.host
|
|
111
|
-
h_mock.update.return_value = None
|
|
138
|
+
def test_host_set(self):
|
|
112
139
|
arglist = [
|
|
113
140
|
'--enable',
|
|
114
141
|
'--disable-maintenance',
|
|
115
|
-
self.
|
|
142
|
+
self._host['host'],
|
|
116
143
|
]
|
|
117
144
|
verifylist = [
|
|
118
145
|
('enable', True),
|
|
119
146
|
('enable_maintenance', False),
|
|
120
|
-
('host', self.
|
|
147
|
+
('host', self._host['host']),
|
|
121
148
|
]
|
|
122
149
|
|
|
123
150
|
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
124
151
|
|
|
125
152
|
result = self.cmd.take_action(parsed_args)
|
|
126
153
|
self.assertIsNone(result)
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
154
|
+
self.compute_sdk_client.put.assert_called_with(
|
|
155
|
+
f'/os-hosts/{self._host["host"]}',
|
|
156
|
+
json={
|
|
157
|
+
'maintenance_mode': 'disable',
|
|
158
|
+
'status': 'enable',
|
|
159
|
+
},
|
|
160
|
+
microversion='2.1',
|
|
130
161
|
)
|
|
131
162
|
|
|
132
163
|
|
|
133
|
-
@mock.patch('openstackclient.api.compute_v2.APIv2.host_show')
|
|
134
164
|
class TestHostShow(compute_fakes.TestComputev2):
|
|
135
|
-
_host = compute_fakes.create_one_host()
|
|
136
|
-
|
|
137
165
|
def setUp(self):
|
|
138
|
-
super(
|
|
139
|
-
|
|
140
|
-
output_data = {
|
|
141
|
-
"resource": {
|
|
142
|
-
"host": self._host['host'],
|
|
143
|
-
"project": self._host['project'],
|
|
144
|
-
"cpu": self._host['cpu'],
|
|
145
|
-
"memory_mb": self._host['memory_mb'],
|
|
146
|
-
"disk_gb": self._host['disk_gb'],
|
|
147
|
-
}
|
|
148
|
-
}
|
|
166
|
+
super().setUp()
|
|
149
167
|
|
|
150
|
-
self.
|
|
151
|
-
data={'host': [output_data]}
|
|
152
|
-
)
|
|
168
|
+
self._host = _generate_fake_host()
|
|
153
169
|
|
|
154
170
|
self.columns = (
|
|
155
171
|
'Host',
|
|
@@ -158,7 +174,6 @@ class TestHostShow(compute_fakes.TestComputev2):
|
|
|
158
174
|
'Memory MB',
|
|
159
175
|
'Disk GB',
|
|
160
176
|
)
|
|
161
|
-
|
|
162
177
|
self.data = [
|
|
163
178
|
(
|
|
164
179
|
self._host['host'],
|
|
@@ -169,10 +184,25 @@ class TestHostShow(compute_fakes.TestComputev2):
|
|
|
169
184
|
)
|
|
170
185
|
]
|
|
171
186
|
|
|
187
|
+
self.compute_sdk_client.get.return_value = fakes.FakeResponse(
|
|
188
|
+
data={
|
|
189
|
+
'host': [
|
|
190
|
+
{
|
|
191
|
+
'resource': {
|
|
192
|
+
'host': self._host['host'],
|
|
193
|
+
'project': self._host['project'],
|
|
194
|
+
'cpu': self._host['cpu'],
|
|
195
|
+
'memory_mb': self._host['memory_mb'],
|
|
196
|
+
'disk_gb': self._host['disk_gb'],
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
],
|
|
200
|
+
}
|
|
201
|
+
)
|
|
202
|
+
|
|
172
203
|
self.cmd = host.ShowHost(self.app, None)
|
|
173
204
|
|
|
174
|
-
def test_host_show_no_option(self
|
|
175
|
-
h_mock.host_show.return_value = [self._host]
|
|
205
|
+
def test_host_show_no_option(self):
|
|
176
206
|
arglist = []
|
|
177
207
|
verifylist = []
|
|
178
208
|
|
|
@@ -185,8 +215,7 @@ class TestHostShow(compute_fakes.TestComputev2):
|
|
|
185
215
|
verifylist,
|
|
186
216
|
)
|
|
187
217
|
|
|
188
|
-
def test_host_show_with_option(self
|
|
189
|
-
h_mock.return_value = [self._host]
|
|
218
|
+
def test_host_show_with_option(self):
|
|
190
219
|
arglist = [
|
|
191
220
|
self._host['host_name'],
|
|
192
221
|
]
|
|
@@ -11,13 +11,10 @@
|
|
|
11
11
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
12
12
|
# License for the specific language governing permissions and limitations
|
|
13
13
|
# under the License.
|
|
14
|
-
#
|
|
15
14
|
|
|
16
15
|
import json
|
|
17
|
-
from unittest import mock
|
|
18
16
|
|
|
19
|
-
from
|
|
20
|
-
from openstack import utils as sdk_utils
|
|
17
|
+
from openstack import exceptions as sdk_exceptions
|
|
21
18
|
from osc_lib.cli import format_columns
|
|
22
19
|
from osc_lib import exceptions
|
|
23
20
|
|
|
@@ -164,10 +161,7 @@ class TestHypervisorList(compute_fakes.TestComputev2):
|
|
|
164
161
|
exceptions.NotFound, self.cmd.take_action, parsed_args
|
|
165
162
|
)
|
|
166
163
|
|
|
167
|
-
|
|
168
|
-
def test_hypervisor_list_with_matching_and_pagination_options(
|
|
169
|
-
self, sm_mock
|
|
170
|
-
):
|
|
164
|
+
def test_hypervisor_list_with_matching_and_pagination_options(self):
|
|
171
165
|
arglist = [
|
|
172
166
|
'--matching',
|
|
173
167
|
self.hypervisors[0].name,
|
|
@@ -191,8 +185,7 @@ class TestHypervisorList(compute_fakes.TestComputev2):
|
|
|
191
185
|
'--matching is not compatible with --marker or --limit', str(ex)
|
|
192
186
|
)
|
|
193
187
|
|
|
194
|
-
|
|
195
|
-
def test_hypervisor_list_long_option(self, sm_mock):
|
|
188
|
+
def test_hypervisor_list_long_option(self):
|
|
196
189
|
arglist = [
|
|
197
190
|
'--long',
|
|
198
191
|
]
|
|
@@ -210,8 +203,9 @@ class TestHypervisorList(compute_fakes.TestComputev2):
|
|
|
210
203
|
self.assertEqual(self.columns_long, columns)
|
|
211
204
|
self.assertEqual(self.data_long, tuple(data))
|
|
212
205
|
|
|
213
|
-
|
|
214
|
-
|
|
206
|
+
def test_hypervisor_list_with_limit(self):
|
|
207
|
+
self.set_compute_api_version('2.33')
|
|
208
|
+
|
|
215
209
|
arglist = [
|
|
216
210
|
'--limit',
|
|
217
211
|
'1',
|
|
@@ -227,8 +221,9 @@ class TestHypervisorList(compute_fakes.TestComputev2):
|
|
|
227
221
|
limit=1, details=True
|
|
228
222
|
)
|
|
229
223
|
|
|
230
|
-
|
|
231
|
-
|
|
224
|
+
def test_hypervisor_list_with_limit_pre_v233(self):
|
|
225
|
+
self.set_compute_api_version('2.32')
|
|
226
|
+
|
|
232
227
|
arglist = [
|
|
233
228
|
'--limit',
|
|
234
229
|
'1',
|
|
@@ -246,8 +241,9 @@ class TestHypervisorList(compute_fakes.TestComputev2):
|
|
|
246
241
|
'--os-compute-api-version 2.33 or greater is required', str(ex)
|
|
247
242
|
)
|
|
248
243
|
|
|
249
|
-
|
|
250
|
-
|
|
244
|
+
def test_hypervisor_list_with_marker(self):
|
|
245
|
+
self.set_compute_api_version('2.33')
|
|
246
|
+
|
|
251
247
|
arglist = [
|
|
252
248
|
'--marker',
|
|
253
249
|
'test_hyp',
|
|
@@ -263,8 +259,9 @@ class TestHypervisorList(compute_fakes.TestComputev2):
|
|
|
263
259
|
marker='test_hyp', details=True
|
|
264
260
|
)
|
|
265
261
|
|
|
266
|
-
|
|
267
|
-
|
|
262
|
+
def test_hypervisor_list_with_marker_pre_v233(self):
|
|
263
|
+
self.set_compute_api_version('2.32')
|
|
264
|
+
|
|
268
265
|
arglist = [
|
|
269
266
|
'--marker',
|
|
270
267
|
'test_hyp',
|
|
@@ -413,8 +410,9 @@ class TestHypervisorShow(compute_fakes.TestComputev2):
|
|
|
413
410
|
# Get the command object to test
|
|
414
411
|
self.cmd = hypervisor.ShowHypervisor(self.app, None)
|
|
415
412
|
|
|
416
|
-
|
|
417
|
-
|
|
413
|
+
def test_hypervisor_show(self):
|
|
414
|
+
self.set_compute_api_version('2.88')
|
|
415
|
+
|
|
418
416
|
arglist = [
|
|
419
417
|
self.hypervisor.name,
|
|
420
418
|
]
|
|
@@ -431,10 +429,9 @@ class TestHypervisorShow(compute_fakes.TestComputev2):
|
|
|
431
429
|
self.assertEqual(self.columns_v288, columns)
|
|
432
430
|
self.assertCountEqual(self.data_v288, data)
|
|
433
431
|
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
def test_hypervisor_show_pre_v288(self, sm_mock):
|
|
432
|
+
def test_hypervisor_show_pre_v288(self):
|
|
433
|
+
self.set_compute_api_version('2.87')
|
|
434
|
+
|
|
438
435
|
arglist = [
|
|
439
436
|
self.hypervisor.name,
|
|
440
437
|
]
|
|
@@ -451,8 +448,9 @@ class TestHypervisorShow(compute_fakes.TestComputev2):
|
|
|
451
448
|
self.assertEqual(self.columns, columns)
|
|
452
449
|
self.assertCountEqual(self.data, data)
|
|
453
450
|
|
|
454
|
-
|
|
455
|
-
|
|
451
|
+
def test_hypervisor_show_pre_v228(self):
|
|
452
|
+
self.set_compute_api_version('2.27')
|
|
453
|
+
|
|
456
454
|
# before microversion 2.28, nova returned a stringified version of this
|
|
457
455
|
# field
|
|
458
456
|
self.hypervisor.cpu_info = json.dumps(self.hypervisor.cpu_info)
|
|
@@ -474,10 +472,9 @@ class TestHypervisorShow(compute_fakes.TestComputev2):
|
|
|
474
472
|
self.assertEqual(self.columns, columns)
|
|
475
473
|
self.assertCountEqual(self.data, data)
|
|
476
474
|
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
def test_hypervisor_show_uptime_not_implemented(self, sm_mock):
|
|
475
|
+
def test_hypervisor_show_uptime_not_implemented(self):
|
|
476
|
+
self.set_compute_api_version('2.87')
|
|
477
|
+
|
|
481
478
|
arglist = [
|
|
482
479
|
self.hypervisor.name,
|
|
483
480
|
]
|
|
@@ -487,7 +484,7 @@ class TestHypervisorShow(compute_fakes.TestComputev2):
|
|
|
487
484
|
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
488
485
|
|
|
489
486
|
self.compute_sdk_client.get_hypervisor_uptime.side_effect = (
|
|
490
|
-
|
|
487
|
+
sdk_exceptions.HttpException(http_status=501)
|
|
491
488
|
)
|
|
492
489
|
|
|
493
490
|
# In base command class ShowOne in cliff, abstract method take_action()
|
|
@@ -21,7 +21,7 @@ from openstackclient.tests.unit import fakes
|
|
|
21
21
|
|
|
22
22
|
class TestHypervisorStats(compute_fakes.TestComputev2):
|
|
23
23
|
def setUp(self):
|
|
24
|
-
super(
|
|
24
|
+
super().setUp()
|
|
25
25
|
|
|
26
26
|
self.compute_sdk_client.get = mock.Mock()
|
|
27
27
|
|
|
@@ -65,7 +65,7 @@ class TestHypervisorStatsShow(TestHypervisorStats):
|
|
|
65
65
|
_stats = create_one_hypervisor_stats()
|
|
66
66
|
|
|
67
67
|
def setUp(self):
|
|
68
|
-
super(
|
|
68
|
+
super().setUp()
|
|
69
69
|
|
|
70
70
|
self.compute_sdk_client.get.return_value = fakes.FakeResponse(
|
|
71
71
|
data={'hypervisor_statistics': self._stats}
|