python-openstackclient 6.6.1__py3-none-any.whl → 7.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- openstackclient/api/api.py +4 -4
- openstackclient/api/compute_v2.py +352 -638
- openstackclient/api/image_v1.py +1 -1
- openstackclient/api/object_store_v1.py +3 -4
- openstackclient/common/availability_zone.py +1 -1
- openstackclient/common/clientmanager.py +24 -20
- openstackclient/common/configuration.py +1 -1
- openstackclient/common/extension.py +1 -1
- openstackclient/common/limits.py +67 -34
- openstackclient/common/module.py +3 -3
- openstackclient/common/progressbar.py +2 -2
- openstackclient/common/project_cleanup.py +5 -2
- openstackclient/common/quota.py +299 -423
- openstackclient/common/versions.py +1 -1
- openstackclient/compute/client.py +7 -116
- openstackclient/compute/v2/agent.py +75 -49
- openstackclient/compute/v2/aggregate.py +38 -32
- openstackclient/compute/v2/console.py +2 -2
- openstackclient/compute/v2/flavor.py +6 -6
- openstackclient/compute/v2/host.py +38 -33
- openstackclient/compute/v2/hypervisor.py +9 -6
- openstackclient/compute/v2/keypair.py +7 -8
- openstackclient/compute/v2/server.py +479 -396
- openstackclient/compute/v2/server_backup.py +1 -1
- openstackclient/compute/v2/server_group.py +4 -4
- openstackclient/compute/v2/server_image.py +1 -1
- openstackclient/compute/v2/server_migration.py +3 -4
- openstackclient/compute/v2/service.py +4 -4
- openstackclient/compute/v2/usage.py +3 -3
- openstackclient/identity/common.py +34 -0
- openstackclient/identity/v2_0/catalog.py +2 -2
- openstackclient/identity/v2_0/ec2creds.py +4 -4
- openstackclient/identity/v2_0/endpoint.py +4 -4
- openstackclient/identity/v2_0/project.py +6 -6
- openstackclient/identity/v2_0/role.py +5 -5
- openstackclient/identity/v2_0/role_assignment.py +1 -1
- openstackclient/identity/v2_0/service.py +4 -4
- openstackclient/identity/v2_0/token.py +2 -2
- openstackclient/identity/v2_0/user.py +7 -7
- openstackclient/identity/v3/access_rule.py +3 -3
- openstackclient/identity/v3/application_credential.py +125 -43
- openstackclient/identity/v3/catalog.py +2 -2
- openstackclient/identity/v3/consumer.py +4 -4
- openstackclient/identity/v3/credential.py +5 -5
- openstackclient/identity/v3/domain.py +5 -5
- openstackclient/identity/v3/ec2creds.py +4 -4
- openstackclient/identity/v3/endpoint.py +7 -7
- openstackclient/identity/v3/endpoint_group.py +8 -10
- openstackclient/identity/v3/federation_protocol.py +5 -5
- openstackclient/identity/v3/group.py +8 -8
- openstackclient/identity/v3/identity_provider.py +5 -5
- openstackclient/identity/v3/implied_role.py +3 -3
- openstackclient/identity/v3/limit.py +5 -5
- openstackclient/identity/v3/mapping.py +5 -5
- openstackclient/identity/v3/policy.py +5 -5
- openstackclient/identity/v3/project.py +5 -5
- openstackclient/identity/v3/region.py +5 -5
- openstackclient/identity/v3/registered_limit.py +5 -5
- openstackclient/identity/v3/role.py +7 -7
- openstackclient/identity/v3/role_assignment.py +92 -140
- openstackclient/identity/v3/service.py +64 -34
- openstackclient/identity/v3/service_provider.py +4 -4
- openstackclient/identity/v3/tag.py +2 -2
- openstackclient/identity/v3/token.py +5 -5
- openstackclient/identity/v3/trust.py +3 -3
- openstackclient/identity/v3/user.py +144 -80
- openstackclient/image/client.py +4 -4
- openstackclient/image/v1/image.py +8 -9
- openstackclient/image/v2/cache.py +12 -10
- openstackclient/image/v2/metadef_objects.py +44 -0
- openstackclient/image/v2/metadef_resource_type_association.py +189 -0
- openstackclient/image/v2/task.py +1 -1
- openstackclient/network/common.py +6 -5
- openstackclient/network/utils.py +2 -2
- openstackclient/network/v2/address_group.py +6 -6
- openstackclient/network/v2/address_scope.py +5 -5
- openstackclient/network/v2/default_security_group_rule.py +1 -1
- openstackclient/network/v2/floating_ip.py +8 -10
- openstackclient/network/v2/floating_ip_pool.py +6 -15
- openstackclient/network/v2/floating_ip_port_forwarding.py +5 -13
- openstackclient/network/v2/ip_availability.py +2 -2
- openstackclient/network/v2/l3_conntrack_helper.py +5 -5
- openstackclient/network/v2/network.py +8 -8
- openstackclient/network/v2/network_agent.py +8 -8
- openstackclient/network/v2/network_auto_allocated_topology.py +2 -2
- openstackclient/network/v2/network_flavor.py +6 -8
- openstackclient/network/v2/network_flavor_profile.py +4 -4
- openstackclient/network/v2/network_meter.py +3 -3
- openstackclient/network/v2/network_meter_rule.py +3 -3
- openstackclient/network/v2/network_qos_policy.py +5 -5
- openstackclient/network/v2/network_qos_rule.py +9 -9
- openstackclient/network/v2/network_qos_rule_type.py +1 -1
- openstackclient/network/v2/network_rbac.py +5 -5
- openstackclient/network/v2/network_segment.py +5 -5
- openstackclient/network/v2/network_segment_range.py +7 -7
- openstackclient/network/v2/network_trunk.py +7 -7
- openstackclient/network/v2/port.py +26 -12
- openstackclient/network/v2/router.py +403 -54
- openstackclient/network/v2/security_group.py +18 -14
- openstackclient/network/v2/security_group_rule.py +18 -15
- openstackclient/network/v2/subnet.py +15 -8
- openstackclient/network/v2/subnet_pool.py +6 -6
- openstackclient/object/v1/account.py +2 -2
- openstackclient/object/v1/container.py +7 -7
- openstackclient/object/v1/object.py +7 -7
- openstackclient/releasenotes/notes/volume-backup-created-at-list-b49ec893ae1f6b0d.yaml +4 -0
- openstackclient/shell.py +4 -6
- openstackclient/tests/functional/base.py +1 -1
- openstackclient/tests/functional/common/test_extension.py +1 -1
- openstackclient/tests/functional/common/test_help.py +2 -2
- openstackclient/tests/functional/common/test_module.py +1 -1
- openstackclient/tests/functional/common/test_quota.py +43 -61
- openstackclient/tests/functional/compute/v2/common.py +2 -2
- openstackclient/tests/functional/compute/v2/test_flavor.py +2 -2
- openstackclient/tests/functional/compute/v2/test_keypair.py +1 -1
- openstackclient/tests/functional/compute/v2/test_server.py +5 -5
- openstackclient/tests/functional/compute/v2/test_server_event.py +1 -1
- openstackclient/tests/functional/identity/v2/common.py +3 -3
- openstackclient/tests/functional/identity/v3/common.py +12 -4
- openstackclient/tests/functional/identity/v3/test_application_credential.py +6 -12
- openstackclient/tests/functional/identity/v3/test_domain.py +1 -3
- openstackclient/tests/functional/identity/v3/test_endpoint.py +1 -1
- openstackclient/tests/functional/identity/v3/test_idp.py +1 -1
- openstackclient/tests/functional/identity/v3/test_region.py +1 -3
- openstackclient/tests/functional/identity/v3/test_role.py +2 -2
- openstackclient/tests/functional/identity/v3/test_role_assignment.py +210 -0
- openstackclient/tests/functional/identity/v3/test_service.py +1 -3
- openstackclient/tests/functional/identity/v3/test_service_provider.py +1 -3
- openstackclient/tests/functional/image/base.py +1 -1
- openstackclient/tests/functional/image/v2/test_image.py +1 -1
- openstackclient/tests/functional/image/v2/test_info.py +1 -1
- openstackclient/tests/functional/network/v2/common.py +4 -6
- openstackclient/tests/functional/network/v2/test_network.py +5 -3
- openstackclient/tests/functional/network/v2/test_network_agent.py +7 -5
- openstackclient/tests/functional/network/v2/test_network_qos_rule.py +4 -4
- openstackclient/tests/functional/network/v2/test_port.py +11 -7
- openstackclient/tests/functional/network/v2/test_router.py +2 -2
- openstackclient/tests/functional/object/v1/common.py +1 -1
- openstackclient/tests/functional/object/v1/test_container.py +3 -3
- openstackclient/tests/functional/object/v1/test_object.py +9 -13
- openstackclient/tests/functional/volume/base.py +1 -1
- openstackclient/tests/functional/volume/v1/test_service.py +1 -1
- openstackclient/tests/functional/volume/v1/test_snapshot.py +2 -2
- openstackclient/tests/functional/volume/v1/test_transfer_request.py +2 -2
- openstackclient/tests/functional/volume/v1/test_volume_type.py +1 -1
- openstackclient/tests/functional/volume/v2/test_service.py +2 -2
- openstackclient/tests/functional/volume/v2/test_volume_backup.py +2 -2
- openstackclient/tests/functional/volume/v2/test_volume_snapshot.py +2 -2
- openstackclient/tests/functional/volume/v2/test_volume_type.py +1 -1
- openstackclient/tests/functional/volume/v3/test_volume_snapshot.py +2 -2
- openstackclient/tests/functional/volume/v3/test_volume_type.py +1 -1
- openstackclient/tests/unit/api/fakes.py +1 -1
- openstackclient/tests/unit/api/test_api.py +2 -2
- openstackclient/tests/unit/api/test_compute_v2.py +522 -707
- openstackclient/tests/unit/api/test_image_v1.py +1 -1
- openstackclient/tests/unit/api/test_image_v2.py +1 -1
- openstackclient/tests/unit/api/test_object_store_v1.py +4 -4
- openstackclient/tests/unit/common/test_limits.py +73 -35
- openstackclient/tests/unit/common/test_logs.py +2 -2
- openstackclient/tests/unit/common/test_module.py +4 -2
- openstackclient/tests/unit/common/test_project_cleanup.py +31 -6
- openstackclient/tests/unit/common/test_quota.py +490 -630
- openstackclient/tests/unit/compute/v2/fakes.py +37 -286
- openstackclient/tests/unit/compute/v2/test_agent.py +189 -147
- openstackclient/tests/unit/compute/v2/test_aggregate.py +87 -57
- openstackclient/tests/unit/compute/v2/test_console.py +4 -5
- openstackclient/tests/unit/compute/v2/test_flavor.py +59 -68
- openstackclient/tests/unit/compute/v2/test_host.py +83 -54
- openstackclient/tests/unit/compute/v2/test_hypervisor.py +57 -34
- openstackclient/tests/unit/compute/v2/test_hypervisor_stats.py +2 -2
- openstackclient/tests/unit/compute/v2/test_keypair.py +65 -50
- openstackclient/tests/unit/compute/v2/test_server.py +2850 -2453
- openstackclient/tests/unit/compute/v2/test_server_backup.py +1 -1
- openstackclient/tests/unit/compute/v2/test_server_event.py +14 -39
- openstackclient/tests/unit/compute/v2/test_server_group.py +28 -29
- openstackclient/tests/unit/compute/v2/test_server_migration.py +43 -68
- openstackclient/tests/unit/compute/v2/test_server_volume.py +17 -34
- openstackclient/tests/unit/compute/v2/test_service.py +34 -52
- openstackclient/tests/unit/compute/v2/test_usage.py +4 -4
- openstackclient/tests/unit/fakes.py +12 -12
- openstackclient/tests/unit/identity/v2_0/fakes.py +27 -10
- openstackclient/tests/unit/identity/v2_0/test_catalog.py +3 -3
- openstackclient/tests/unit/identity/v2_0/test_endpoint.py +7 -7
- openstackclient/tests/unit/identity/v2_0/test_project.py +8 -8
- openstackclient/tests/unit/identity/v2_0/test_role.py +10 -10
- openstackclient/tests/unit/identity/v2_0/test_role_assignment.py +4 -4
- openstackclient/tests/unit/identity/v2_0/test_service.py +6 -6
- openstackclient/tests/unit/identity/v2_0/test_token.py +4 -4
- openstackclient/tests/unit/identity/v2_0/test_user.py +8 -8
- openstackclient/tests/unit/identity/v3/fakes.py +59 -20
- openstackclient/tests/unit/identity/v3/test_access_rule.py +5 -5
- openstackclient/tests/unit/identity/v3/test_application_credential.py +207 -230
- openstackclient/tests/unit/identity/v3/test_catalog.py +3 -3
- openstackclient/tests/unit/identity/v3/test_consumer.py +7 -8
- openstackclient/tests/unit/identity/v3/test_credential.py +9 -9
- openstackclient/tests/unit/identity/v3/test_domain.py +8 -8
- openstackclient/tests/unit/identity/v3/test_endpoint.py +13 -13
- openstackclient/tests/unit/identity/v3/test_endpoint_group.py +12 -14
- openstackclient/tests/unit/identity/v3/test_group.py +12 -12
- openstackclient/tests/unit/identity/v3/test_identity_provider.py +8 -8
- openstackclient/tests/unit/identity/v3/test_implied_role.py +5 -5
- openstackclient/tests/unit/identity/v3/test_limit.py +7 -7
- openstackclient/tests/unit/identity/v3/test_mappings.py +7 -7
- openstackclient/tests/unit/identity/v3/test_oauth.py +5 -5
- openstackclient/tests/unit/identity/v3/test_project.py +16 -16
- openstackclient/tests/unit/identity/v3/test_protocol.py +7 -7
- openstackclient/tests/unit/identity/v3/test_region.py +7 -7
- openstackclient/tests/unit/identity/v3/test_registered_limit.py +12 -13
- openstackclient/tests/unit/identity/v3/test_role.py +13 -13
- openstackclient/tests/unit/identity/v3/test_role_assignment.py +410 -331
- openstackclient/tests/unit/identity/v3/test_service.py +90 -94
- openstackclient/tests/unit/identity/v3/test_service_provider.py +7 -7
- openstackclient/tests/unit/identity/v3/test_token.py +4 -4
- openstackclient/tests/unit/identity/v3/test_trust.py +9 -9
- openstackclient/tests/unit/identity/v3/test_unscoped_saml.py +4 -4
- openstackclient/tests/unit/identity/v3/test_user.py +299 -327
- openstackclient/tests/unit/image/v1/test_image.py +6 -6
- openstackclient/tests/unit/image/v2/fakes.py +46 -9
- openstackclient/tests/unit/image/v2/test_cache.py +2 -2
- openstackclient/tests/unit/image/v2/test_image.py +3 -3
- openstackclient/tests/unit/image/v2/test_metadef_objects.py +62 -0
- openstackclient/tests/unit/image/v2/test_metadef_resource_type_association.py +131 -0
- openstackclient/tests/unit/integ/base.py +1 -1
- openstackclient/tests/unit/integ/cli/test_project.py +4 -4
- openstackclient/tests/unit/integ/cli/test_shell.py +7 -7
- openstackclient/tests/unit/network/test_common.py +12 -21
- openstackclient/tests/unit/network/v2/fakes.py +64 -130
- openstackclient/tests/unit/network/v2/test_address_group.py +15 -15
- openstackclient/tests/unit/network/v2/test_address_scope.py +13 -13
- openstackclient/tests/unit/network/v2/test_default_security_group_rule.py +49 -27
- openstackclient/tests/unit/network/v2/test_floating_ip_compute.py +40 -38
- openstackclient/tests/unit/network/v2/test_floating_ip_network.py +15 -15
- openstackclient/tests/unit/network/v2/test_floating_ip_pool_compute.py +4 -7
- openstackclient/tests/unit/network/v2/test_floating_ip_pool_network.py +3 -5
- openstackclient/tests/unit/network/v2/test_floating_ip_port_forwarding.py +11 -11
- openstackclient/tests/unit/network/v2/test_ip_availability.py +6 -6
- openstackclient/tests/unit/network/v2/test_l3_conntrack_helper.py +11 -21
- openstackclient/tests/unit/network/v2/test_local_ip.py +7 -7
- openstackclient/tests/unit/network/v2/test_local_ip_association.py +3 -5
- openstackclient/tests/unit/network/v2/test_ndp_proxy.py +13 -13
- openstackclient/tests/unit/network/v2/test_network.py +23 -28
- openstackclient/tests/unit/network/v2/test_network_agent.py +17 -21
- openstackclient/tests/unit/network/v2/test_network_auto_allocated_topology.py +8 -8
- openstackclient/tests/unit/network/v2/test_network_compute.py +66 -65
- openstackclient/tests/unit/network/v2/test_network_flavor.py +17 -19
- openstackclient/tests/unit/network/v2/test_network_flavor_profile.py +13 -13
- openstackclient/tests/unit/network/v2/test_network_meter.py +11 -11
- openstackclient/tests/unit/network/v2/test_network_meter_rule.py +11 -11
- openstackclient/tests/unit/network/v2/test_network_qos_policy.py +11 -21
- openstackclient/tests/unit/network/v2/test_network_qos_rule.py +51 -77
- openstackclient/tests/unit/network/v2/test_network_qos_rule_type.py +5 -9
- openstackclient/tests/unit/network/v2/test_network_rbac.py +12 -12
- openstackclient/tests/unit/network/v2/test_network_segment.py +11 -15
- openstackclient/tests/unit/network/v2/test_network_segment_range.py +11 -13
- openstackclient/tests/unit/network/v2/test_network_service_provider.py +3 -5
- openstackclient/tests/unit/network/v2/test_network_trunk.py +11 -11
- openstackclient/tests/unit/network/v2/test_port.py +22 -25
- openstackclient/tests/unit/network/v2/test_router.py +721 -51
- openstackclient/tests/unit/network/v2/test_security_group_compute.py +65 -49
- openstackclient/tests/unit/network/v2/test_security_group_network.py +15 -15
- openstackclient/tests/unit/network/v2/test_security_group_rule_compute.py +57 -45
- openstackclient/tests/unit/network/v2/test_security_group_rule_network.py +11 -19
- openstackclient/tests/unit/network/v2/test_subnet.py +29 -25
- openstackclient/tests/unit/network/v2/test_subnet_pool.py +15 -15
- openstackclient/tests/unit/object/v1/fakes.py +1 -1
- openstackclient/tests/unit/object/v1/test_container.py +5 -5
- openstackclient/tests/unit/object/v1/test_container_all.py +6 -6
- openstackclient/tests/unit/object/v1/test_object.py +3 -3
- openstackclient/tests/unit/object/v1/test_object_all.py +5 -5
- openstackclient/tests/unit/test_shell.py +5 -5
- openstackclient/tests/unit/utils.py +4 -1
- openstackclient/tests/unit/volume/test_find_resource.py +2 -2
- openstackclient/tests/unit/volume/v1/fakes.py +5 -6
- openstackclient/tests/unit/volume/v1/test_volume.py +5 -4
- openstackclient/tests/unit/volume/v2/fakes.py +39 -259
- openstackclient/tests/unit/volume/v2/test_consistency_group_snapshot.py +5 -5
- openstackclient/tests/unit/volume/v2/test_qos_specs.py +9 -9
- openstackclient/tests/unit/volume/v2/test_volume.py +21 -87
- openstackclient/tests/unit/volume/v2/test_volume_backup.py +10 -368
- openstackclient/tests/unit/volume/v2/test_volume_snapshot.py +1 -1
- openstackclient/tests/unit/volume/v2/test_volume_transfer_request.py +0 -44
- openstackclient/tests/unit/volume/v2/test_volume_type.py +6 -87
- openstackclient/tests/unit/volume/v3/fakes.py +505 -22
- openstackclient/tests/unit/volume/v3/test_block_storage_cleanup.py +2 -3
- openstackclient/tests/unit/volume/v3/test_block_storage_cluster.py +10 -11
- openstackclient/tests/unit/volume/v3/test_block_storage_log_level.py +10 -6
- openstackclient/tests/unit/volume/v3/test_block_storage_manage.py +25 -17
- openstackclient/tests/unit/volume/v3/test_block_storage_resource_filter.py +6 -32
- openstackclient/tests/unit/volume/v3/test_service.py +271 -0
- openstackclient/tests/unit/volume/v3/test_volume.py +2177 -33
- openstackclient/tests/unit/volume/v3/test_volume_attachment.py +48 -52
- openstackclient/tests/unit/volume/v3/test_volume_backup.py +892 -0
- openstackclient/tests/unit/volume/v3/test_volume_group.py +19 -20
- openstackclient/tests/unit/volume/v3/test_volume_group_snapshot.py +14 -34
- openstackclient/tests/unit/volume/v3/test_volume_group_type.py +13 -16
- openstackclient/tests/unit/volume/v3/test_volume_message.py +10 -11
- openstackclient/tests/unit/volume/v3/test_volume_snapshot.py +161 -0
- openstackclient/tests/unit/volume/v3/test_volume_transfer_request.py +425 -0
- openstackclient/tests/unit/volume/v3/test_volume_type.py +1109 -0
- openstackclient/volume/v1/qos_specs.py +7 -7
- openstackclient/volume/v1/service.py +2 -2
- openstackclient/volume/v1/volume.py +12 -12
- openstackclient/volume/v1/volume_backup.py +7 -7
- openstackclient/volume/v1/volume_snapshot.py +8 -8
- openstackclient/volume/v1/volume_transfer_request.py +5 -5
- openstackclient/volume/v1/volume_type.py +7 -7
- openstackclient/volume/v2/backup_record.py +2 -2
- openstackclient/volume/v2/consistency_group.py +7 -9
- openstackclient/volume/v2/consistency_group_snapshot.py +4 -12
- openstackclient/volume/v2/qos_specs.py +7 -7
- openstackclient/volume/v2/service.py +2 -2
- openstackclient/volume/v2/volume.py +80 -80
- openstackclient/volume/v2/volume_backend.py +2 -2
- openstackclient/volume/v2/volume_backup.py +9 -217
- openstackclient/volume/v2/volume_host.py +2 -2
- openstackclient/volume/v2/volume_snapshot.py +8 -8
- openstackclient/volume/v2/volume_transfer_request.py +5 -37
- openstackclient/volume/v2/volume_type.py +7 -89
- openstackclient/volume/v3/service.py +56 -0
- openstackclient/volume/v3/volume.py +971 -0
- openstackclient/volume/v3/volume_attachment.py +31 -29
- openstackclient/volume/v3/volume_backup.py +670 -0
- openstackclient/volume/v3/volume_message.py +1 -1
- openstackclient/volume/v3/volume_snapshot.py +97 -0
- openstackclient/volume/v3/volume_transfer_request.py +233 -0
- openstackclient/volume/v3/volume_type.py +967 -0
- {python_openstackclient-6.6.1.dist-info → python_openstackclient-7.1.0.dist-info}/AUTHORS +6 -0
- {python_openstackclient-6.6.1.dist-info → python_openstackclient-7.1.0.dist-info}/METADATA +4 -4
- python_openstackclient-7.1.0.dist-info/RECORD +503 -0
- {python_openstackclient-6.6.1.dist-info → python_openstackclient-7.1.0.dist-info}/entry_points.txt +33 -27
- python_openstackclient-7.1.0.dist-info/pbr.json +1 -0
- python_openstackclient-6.6.1.dist-info/RECORD +0 -489
- python_openstackclient-6.6.1.dist-info/pbr.json +0 -1
- {python_openstackclient-6.6.1.dist-info → python_openstackclient-7.1.0.dist-info}/LICENSE +0 -0
- {python_openstackclient-6.6.1.dist-info → python_openstackclient-7.1.0.dist-info}/WHEEL +0 -0
- {python_openstackclient-6.6.1.dist-info → python_openstackclient-7.1.0.dist-info}/top_level.txt +0 -0
|
@@ -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',
|
|
@@ -299,13 +296,11 @@ class TestHypervisorShow(compute_fakes.TestComputev2):
|
|
|
299
296
|
}
|
|
300
297
|
)
|
|
301
298
|
|
|
302
|
-
# Return value of compute_client.find_hypervisor
|
|
303
299
|
self.compute_sdk_client.find_hypervisor.return_value = self.hypervisor
|
|
300
|
+
self.compute_sdk_client.get_hypervisor.return_value = self.hypervisor
|
|
304
301
|
|
|
305
|
-
# Return value of compute_client.aggregates()
|
|
306
302
|
self.compute_sdk_client.aggregates.return_value = []
|
|
307
303
|
|
|
308
|
-
# Return value of compute_client.get_hypervisor_uptime()
|
|
309
304
|
uptime_info = {
|
|
310
305
|
'status': self.hypervisor.status,
|
|
311
306
|
'state': self.hypervisor.state,
|
|
@@ -413,8 +408,9 @@ class TestHypervisorShow(compute_fakes.TestComputev2):
|
|
|
413
408
|
# Get the command object to test
|
|
414
409
|
self.cmd = hypervisor.ShowHypervisor(self.app, None)
|
|
415
410
|
|
|
416
|
-
|
|
417
|
-
|
|
411
|
+
def test_hypervisor_show(self):
|
|
412
|
+
self.set_compute_api_version('2.88')
|
|
413
|
+
|
|
418
414
|
arglist = [
|
|
419
415
|
self.hypervisor.name,
|
|
420
416
|
]
|
|
@@ -431,10 +427,16 @@ class TestHypervisorShow(compute_fakes.TestComputev2):
|
|
|
431
427
|
self.assertEqual(self.columns_v288, columns)
|
|
432
428
|
self.assertCountEqual(self.data_v288, data)
|
|
433
429
|
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
430
|
+
self.compute_sdk_client.find_hypervisor.assert_called_once_with(
|
|
431
|
+
self.hypervisor.name, ignore_missing=False, details=False
|
|
432
|
+
)
|
|
433
|
+
self.compute_sdk_client.get_hypervisor.assert_called_once_with(
|
|
434
|
+
self.hypervisor.id
|
|
435
|
+
)
|
|
436
|
+
|
|
437
|
+
def test_hypervisor_show_pre_v288(self):
|
|
438
|
+
self.set_compute_api_version('2.87')
|
|
439
|
+
|
|
438
440
|
arglist = [
|
|
439
441
|
self.hypervisor.name,
|
|
440
442
|
]
|
|
@@ -451,8 +453,16 @@ class TestHypervisorShow(compute_fakes.TestComputev2):
|
|
|
451
453
|
self.assertEqual(self.columns, columns)
|
|
452
454
|
self.assertCountEqual(self.data, data)
|
|
453
455
|
|
|
454
|
-
|
|
455
|
-
|
|
456
|
+
self.compute_sdk_client.find_hypervisor.assert_called_once_with(
|
|
457
|
+
self.hypervisor.name, ignore_missing=False, details=False
|
|
458
|
+
)
|
|
459
|
+
self.compute_sdk_client.get_hypervisor.assert_called_once_with(
|
|
460
|
+
self.hypervisor.id
|
|
461
|
+
)
|
|
462
|
+
|
|
463
|
+
def test_hypervisor_show_pre_v228(self):
|
|
464
|
+
self.set_compute_api_version('2.27')
|
|
465
|
+
|
|
456
466
|
# before microversion 2.28, nova returned a stringified version of this
|
|
457
467
|
# field
|
|
458
468
|
self.hypervisor.cpu_info = json.dumps(self.hypervisor.cpu_info)
|
|
@@ -474,10 +484,16 @@ class TestHypervisorShow(compute_fakes.TestComputev2):
|
|
|
474
484
|
self.assertEqual(self.columns, columns)
|
|
475
485
|
self.assertCountEqual(self.data, data)
|
|
476
486
|
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
487
|
+
self.compute_sdk_client.find_hypervisor.assert_called_once_with(
|
|
488
|
+
self.hypervisor.name, ignore_missing=False, details=False
|
|
489
|
+
)
|
|
490
|
+
self.compute_sdk_client.get_hypervisor.assert_called_once_with(
|
|
491
|
+
self.hypervisor.id
|
|
492
|
+
)
|
|
493
|
+
|
|
494
|
+
def test_hypervisor_show_uptime_not_implemented(self):
|
|
495
|
+
self.set_compute_api_version('2.87')
|
|
496
|
+
|
|
481
497
|
arglist = [
|
|
482
498
|
self.hypervisor.name,
|
|
483
499
|
]
|
|
@@ -487,7 +503,7 @@ class TestHypervisorShow(compute_fakes.TestComputev2):
|
|
|
487
503
|
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
488
504
|
|
|
489
505
|
self.compute_sdk_client.get_hypervisor_uptime.side_effect = (
|
|
490
|
-
|
|
506
|
+
sdk_exceptions.HttpException(http_status=501)
|
|
491
507
|
)
|
|
492
508
|
|
|
493
509
|
# In base command class ShowOne in cliff, abstract method take_action()
|
|
@@ -546,3 +562,10 @@ class TestHypervisorShow(compute_fakes.TestComputev2):
|
|
|
546
562
|
|
|
547
563
|
self.assertEqual(expected_columns, columns)
|
|
548
564
|
self.assertCountEqual(expected_data, data)
|
|
565
|
+
|
|
566
|
+
self.compute_sdk_client.find_hypervisor.assert_called_once_with(
|
|
567
|
+
self.hypervisor.name, ignore_missing=False, details=False
|
|
568
|
+
)
|
|
569
|
+
self.compute_sdk_client.get_hypervisor.assert_called_once_with(
|
|
570
|
+
self.hypervisor.id
|
|
571
|
+
)
|
|
@@ -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}
|