python-openstackclient 6.6.0__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 +7 -8
- 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.0.dist-info → python_openstackclient-7.0.0.dist-info}/AUTHORS +4 -0
- {python_openstackclient-6.6.0.dist-info → python_openstackclient-7.0.0.dist-info}/METADATA +3 -3
- python_openstackclient-7.0.0.dist-info/RECORD +502 -0
- {python_openstackclient-6.6.0.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.0.dist-info/RECORD +0 -489
- python_openstackclient-6.6.0.dist-info/pbr.json +0 -1
- {python_openstackclient-6.6.0.dist-info → python_openstackclient-7.0.0.dist-info}/LICENSE +0 -0
- {python_openstackclient-6.6.0.dist-info → python_openstackclient-7.0.0.dist-info}/WHEEL +0 -0
- {python_openstackclient-6.6.0.dist-info → python_openstackclient-7.0.0.dist-info}/top_level.txt +0 -0
|
@@ -30,7 +30,7 @@ from openstackclient.tests.unit import utils as tests_utils
|
|
|
30
30
|
|
|
31
31
|
class TestDefaultSecurityGroupRule(network_fakes.TestNetworkV2):
|
|
32
32
|
def setUp(self):
|
|
33
|
-
super(
|
|
33
|
+
super().setUp()
|
|
34
34
|
|
|
35
35
|
self.app.client_manager.sdk_connection = mock.Mock()
|
|
36
36
|
self.app.client_manager.sdk_connection.network = mock.Mock(
|
|
@@ -72,7 +72,7 @@ class TestCreateDefaultSecurityGroupRule(TestDefaultSecurityGroupRule):
|
|
|
72
72
|
'remote_ip_prefix': '0.0.0.0/0',
|
|
73
73
|
'location': 'MUNCHMUNCHMUNCH',
|
|
74
74
|
'used_in_default_sg': False,
|
|
75
|
-
'used_in_non_default_sg':
|
|
75
|
+
'used_in_non_default_sg': False,
|
|
76
76
|
}
|
|
77
77
|
attrs = attrs or {}
|
|
78
78
|
# Overwrite default attributes.
|
|
@@ -101,11 +101,11 @@ class TestCreateDefaultSecurityGroupRule(TestDefaultSecurityGroupRule):
|
|
|
101
101
|
)
|
|
102
102
|
|
|
103
103
|
def setUp(self):
|
|
104
|
-
super(
|
|
104
|
+
super().setUp()
|
|
105
105
|
|
|
106
106
|
# Get the command object to test
|
|
107
107
|
self.cmd = default_security_group_rule.CreateDefaultSecurityGroupRule(
|
|
108
|
-
self.app,
|
|
108
|
+
self.app, None
|
|
109
109
|
)
|
|
110
110
|
|
|
111
111
|
def test_create_all_remote_options(self):
|
|
@@ -217,13 +217,15 @@ class TestCreateDefaultSecurityGroupRule(TestDefaultSecurityGroupRule):
|
|
|
217
217
|
'protocol': self._default_sg_rule.protocol,
|
|
218
218
|
'remote_ip_prefix': self._default_sg_rule.remote_ip_prefix,
|
|
219
219
|
'used_in_default_sg': False,
|
|
220
|
-
'used_in_non_default_sg':
|
|
220
|
+
'used_in_non_default_sg': False,
|
|
221
221
|
}
|
|
222
222
|
)
|
|
223
223
|
self.assertEqual(self.expected_columns, columns)
|
|
224
224
|
self.assertEqual(self.expected_data, data)
|
|
225
225
|
|
|
226
|
-
def
|
|
226
|
+
def _test_create_protocol_any_helper(
|
|
227
|
+
self, for_default_sg=False, for_custom_sg=False
|
|
228
|
+
):
|
|
227
229
|
self._setup_default_security_group_rule(
|
|
228
230
|
{
|
|
229
231
|
'protocol': None,
|
|
@@ -236,9 +238,15 @@ class TestCreateDefaultSecurityGroupRule(TestDefaultSecurityGroupRule):
|
|
|
236
238
|
'--remote-ip',
|
|
237
239
|
self._default_sg_rule.remote_ip_prefix,
|
|
238
240
|
]
|
|
241
|
+
if for_default_sg:
|
|
242
|
+
arglist.append('--for-default-sg')
|
|
243
|
+
if for_custom_sg:
|
|
244
|
+
arglist.append('--for-custom-sg')
|
|
239
245
|
verifylist = [
|
|
240
246
|
('protocol', 'any'),
|
|
241
247
|
('remote_ip', self._default_sg_rule.remote_ip_prefix),
|
|
248
|
+
('for_default_sg', for_default_sg),
|
|
249
|
+
('for_custom_sg', for_custom_sg),
|
|
242
250
|
]
|
|
243
251
|
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
244
252
|
|
|
@@ -250,13 +258,27 @@ class TestCreateDefaultSecurityGroupRule(TestDefaultSecurityGroupRule):
|
|
|
250
258
|
'ethertype': self._default_sg_rule.ether_type,
|
|
251
259
|
'protocol': self._default_sg_rule.protocol,
|
|
252
260
|
'remote_ip_prefix': self._default_sg_rule.remote_ip_prefix,
|
|
253
|
-
'used_in_default_sg':
|
|
254
|
-
'used_in_non_default_sg':
|
|
261
|
+
'used_in_default_sg': for_default_sg,
|
|
262
|
+
'used_in_non_default_sg': for_custom_sg,
|
|
255
263
|
}
|
|
256
264
|
)
|
|
257
265
|
self.assertEqual(self.expected_columns, columns)
|
|
258
266
|
self.assertEqual(self.expected_data, data)
|
|
259
267
|
|
|
268
|
+
def test_create_protocol_any_not_for_default_sg(self):
|
|
269
|
+
self._test_create_protocol_any_helper()
|
|
270
|
+
|
|
271
|
+
def test_create_protocol_any_for_default_sg(self):
|
|
272
|
+
self._test_create_protocol_any_helper(for_default_sg=True)
|
|
273
|
+
|
|
274
|
+
def test_create_protocol_any_for_custom_sg(self):
|
|
275
|
+
self._test_create_protocol_any_helper(for_custom_sg=True)
|
|
276
|
+
|
|
277
|
+
def test_create_protocol_any_for_default_and_custom_sg(self):
|
|
278
|
+
self._test_create_protocol_any_helper(
|
|
279
|
+
for_default_sg=True, for_custom_sg=True
|
|
280
|
+
)
|
|
281
|
+
|
|
260
282
|
def test_create_remote_address_group(self):
|
|
261
283
|
self._setup_default_security_group_rule(
|
|
262
284
|
{
|
|
@@ -287,7 +309,7 @@ class TestCreateDefaultSecurityGroupRule(TestDefaultSecurityGroupRule):
|
|
|
287
309
|
'protocol': self._default_sg_rule.protocol,
|
|
288
310
|
'remote_address_group_id': self._default_sg_rule.remote_address_group_id,
|
|
289
311
|
'used_in_default_sg': False,
|
|
290
|
-
'used_in_non_default_sg':
|
|
312
|
+
'used_in_non_default_sg': False,
|
|
291
313
|
}
|
|
292
314
|
)
|
|
293
315
|
self.assertEqual(self.expected_columns, columns)
|
|
@@ -334,7 +356,7 @@ class TestCreateDefaultSecurityGroupRule(TestDefaultSecurityGroupRule):
|
|
|
334
356
|
'protocol': self._default_sg_rule.protocol,
|
|
335
357
|
'remote_group_id': 'remote-group-id',
|
|
336
358
|
'used_in_default_sg': False,
|
|
337
|
-
'used_in_non_default_sg':
|
|
359
|
+
'used_in_non_default_sg': False,
|
|
338
360
|
}
|
|
339
361
|
)
|
|
340
362
|
self.assertEqual(self.expected_columns, columns)
|
|
@@ -366,7 +388,7 @@ class TestCreateDefaultSecurityGroupRule(TestDefaultSecurityGroupRule):
|
|
|
366
388
|
'protocol': self._default_sg_rule.protocol,
|
|
367
389
|
'remote_group_id': 'remote-group-id',
|
|
368
390
|
'used_in_default_sg': False,
|
|
369
|
-
'used_in_non_default_sg':
|
|
391
|
+
'used_in_non_default_sg': False,
|
|
370
392
|
}
|
|
371
393
|
)
|
|
372
394
|
self.assertEqual(self.expected_columns, columns)
|
|
@@ -400,7 +422,7 @@ class TestCreateDefaultSecurityGroupRule(TestDefaultSecurityGroupRule):
|
|
|
400
422
|
'protocol': self._default_sg_rule.protocol,
|
|
401
423
|
'remote_ip_prefix': self._default_sg_rule.remote_ip_prefix,
|
|
402
424
|
'used_in_default_sg': False,
|
|
403
|
-
'used_in_non_default_sg':
|
|
425
|
+
'used_in_non_default_sg': False,
|
|
404
426
|
}
|
|
405
427
|
)
|
|
406
428
|
self.assertEqual(self.expected_columns, columns)
|
|
@@ -434,7 +456,7 @@ class TestCreateDefaultSecurityGroupRule(TestDefaultSecurityGroupRule):
|
|
|
434
456
|
'protocol': self._default_sg_rule.protocol,
|
|
435
457
|
'remote_ip_prefix': self._default_sg_rule.remote_ip_prefix,
|
|
436
458
|
'used_in_default_sg': False,
|
|
437
|
-
'used_in_non_default_sg':
|
|
459
|
+
'used_in_non_default_sg': False,
|
|
438
460
|
}
|
|
439
461
|
)
|
|
440
462
|
self.assertEqual(self.expected_columns, columns)
|
|
@@ -585,7 +607,7 @@ class TestCreateDefaultSecurityGroupRule(TestDefaultSecurityGroupRule):
|
|
|
585
607
|
'protocol': self._default_sg_rule.protocol,
|
|
586
608
|
'remote_ip_prefix': self._default_sg_rule.remote_ip_prefix,
|
|
587
609
|
'used_in_default_sg': False,
|
|
588
|
-
'used_in_non_default_sg':
|
|
610
|
+
'used_in_non_default_sg': False,
|
|
589
611
|
}
|
|
590
612
|
)
|
|
591
613
|
self.assertEqual(self.expected_columns, columns)
|
|
@@ -623,7 +645,7 @@ class TestCreateDefaultSecurityGroupRule(TestDefaultSecurityGroupRule):
|
|
|
623
645
|
'protocol': self._default_sg_rule.protocol,
|
|
624
646
|
'remote_ip_prefix': self._default_sg_rule.remote_ip_prefix,
|
|
625
647
|
'used_in_default_sg': False,
|
|
626
|
-
'used_in_non_default_sg':
|
|
648
|
+
'used_in_non_default_sg': False,
|
|
627
649
|
}
|
|
628
650
|
)
|
|
629
651
|
self.assertEqual(self.expected_columns, columns)
|
|
@@ -661,7 +683,7 @@ class TestCreateDefaultSecurityGroupRule(TestDefaultSecurityGroupRule):
|
|
|
661
683
|
'protocol': self._default_sg_rule.protocol,
|
|
662
684
|
'remote_ip_prefix': self._default_sg_rule.remote_ip_prefix,
|
|
663
685
|
'used_in_default_sg': False,
|
|
664
|
-
'used_in_non_default_sg':
|
|
686
|
+
'used_in_non_default_sg': False,
|
|
665
687
|
}
|
|
666
688
|
)
|
|
667
689
|
self.assertEqual(self.expected_columns, columns)
|
|
@@ -698,7 +720,7 @@ class TestCreateDefaultSecurityGroupRule(TestDefaultSecurityGroupRule):
|
|
|
698
720
|
'protocol': self._default_sg_rule.protocol,
|
|
699
721
|
'remote_ip_prefix': self._default_sg_rule.remote_ip_prefix,
|
|
700
722
|
'used_in_default_sg': False,
|
|
701
|
-
'used_in_non_default_sg':
|
|
723
|
+
'used_in_non_default_sg': False,
|
|
702
724
|
}
|
|
703
725
|
)
|
|
704
726
|
self.assertEqual(self.expected_columns, columns)
|
|
@@ -741,7 +763,7 @@ class TestCreateDefaultSecurityGroupRule(TestDefaultSecurityGroupRule):
|
|
|
741
763
|
'protocol': self._default_sg_rule.protocol,
|
|
742
764
|
'remote_ip_prefix': self._default_sg_rule.remote_ip_prefix,
|
|
743
765
|
'used_in_default_sg': False,
|
|
744
|
-
'used_in_non_default_sg':
|
|
766
|
+
'used_in_non_default_sg': False,
|
|
745
767
|
}
|
|
746
768
|
)
|
|
747
769
|
self.assertEqual(self.expected_columns, columns)
|
|
@@ -780,7 +802,7 @@ class TestCreateDefaultSecurityGroupRule(TestDefaultSecurityGroupRule):
|
|
|
780
802
|
'protocol': self._default_sg_rule.protocol,
|
|
781
803
|
'remote_ip_prefix': self._default_sg_rule.remote_ip_prefix,
|
|
782
804
|
'used_in_default_sg': False,
|
|
783
|
-
'used_in_non_default_sg':
|
|
805
|
+
'used_in_non_default_sg': False,
|
|
784
806
|
}
|
|
785
807
|
)
|
|
786
808
|
self.assertEqual(self.expected_columns, columns)
|
|
@@ -811,7 +833,7 @@ class TestCreateDefaultSecurityGroupRule(TestDefaultSecurityGroupRule):
|
|
|
811
833
|
'protocol': self._default_sg_rule.protocol,
|
|
812
834
|
'remote_ip_prefix': self._default_sg_rule.remote_ip_prefix,
|
|
813
835
|
'used_in_default_sg': False,
|
|
814
|
-
'used_in_non_default_sg':
|
|
836
|
+
'used_in_non_default_sg': False,
|
|
815
837
|
}
|
|
816
838
|
)
|
|
817
839
|
self.assertEqual(self.expected_columns, columns)
|
|
@@ -831,7 +853,7 @@ class TestDeleteDefaultSecurityGroupRule(TestDefaultSecurityGroupRule):
|
|
|
831
853
|
'remote_ip_prefix': '0.0.0.0/0',
|
|
832
854
|
'location': 'MUNCHMUNCHMUNCH',
|
|
833
855
|
'used_in_default_sg': False,
|
|
834
|
-
'used_in_non_default_sg':
|
|
856
|
+
'used_in_non_default_sg': False,
|
|
835
857
|
}
|
|
836
858
|
_default_sg_rules = list(
|
|
837
859
|
sdk_fakes.generate_fake_resources(
|
|
@@ -842,13 +864,13 @@ class TestDeleteDefaultSecurityGroupRule(TestDefaultSecurityGroupRule):
|
|
|
842
864
|
)
|
|
843
865
|
|
|
844
866
|
def setUp(self):
|
|
845
|
-
super(
|
|
867
|
+
super().setUp()
|
|
846
868
|
|
|
847
869
|
self.sdk_client.delete_default_security_group_rule.return_value = None
|
|
848
870
|
|
|
849
871
|
# Get the command object to test
|
|
850
872
|
self.cmd = default_security_group_rule.DeleteDefaultSecurityGroupRule(
|
|
851
|
-
self.app,
|
|
873
|
+
self.app, None
|
|
852
874
|
)
|
|
853
875
|
|
|
854
876
|
def test_default_security_group_rule_delete(self):
|
|
@@ -977,7 +999,7 @@ class TestListDefaultSecurityGroupRule(TestDefaultSecurityGroupRule):
|
|
|
977
999
|
)
|
|
978
1000
|
|
|
979
1001
|
def setUp(self):
|
|
980
|
-
super(
|
|
1002
|
+
super().setUp()
|
|
981
1003
|
|
|
982
1004
|
self.sdk_client.default_security_group_rules.return_value = (
|
|
983
1005
|
self._default_sg_rules
|
|
@@ -985,7 +1007,7 @@ class TestListDefaultSecurityGroupRule(TestDefaultSecurityGroupRule):
|
|
|
985
1007
|
|
|
986
1008
|
# Get the command object to test
|
|
987
1009
|
self.cmd = default_security_group_rule.ListDefaultSecurityGroupRule(
|
|
988
|
-
self.app,
|
|
1010
|
+
self.app, None
|
|
989
1011
|
)
|
|
990
1012
|
|
|
991
1013
|
def test_list_default(self):
|
|
@@ -1099,7 +1121,7 @@ class TestShowDefaultSecurityGroupRule(TestDefaultSecurityGroupRule):
|
|
|
1099
1121
|
)
|
|
1100
1122
|
|
|
1101
1123
|
def setUp(self):
|
|
1102
|
-
super(
|
|
1124
|
+
super().setUp()
|
|
1103
1125
|
|
|
1104
1126
|
self.sdk_client.find_default_security_group_rule.return_value = (
|
|
1105
1127
|
self._default_sg_rule
|
|
@@ -1107,7 +1129,7 @@ class TestShowDefaultSecurityGroupRule(TestDefaultSecurityGroupRule):
|
|
|
1107
1129
|
|
|
1108
1130
|
# Get the command object to test
|
|
1109
1131
|
self.cmd = default_security_group_rule.ShowDefaultSecurityGroupRule(
|
|
1110
|
-
self.app,
|
|
1132
|
+
self.app, None
|
|
1111
1133
|
)
|
|
1112
1134
|
|
|
1113
1135
|
def test_show_no_options(self):
|
|
@@ -12,21 +12,17 @@
|
|
|
12
12
|
#
|
|
13
13
|
|
|
14
14
|
from unittest import mock
|
|
15
|
-
from unittest.mock import call
|
|
16
15
|
|
|
17
16
|
from osc_lib import exceptions
|
|
18
17
|
|
|
18
|
+
from openstackclient.api import compute_v2
|
|
19
19
|
from openstackclient.network.v2 import floating_ip as fip
|
|
20
20
|
from openstackclient.tests.unit.compute.v2 import fakes as compute_fakes
|
|
21
21
|
from openstackclient.tests.unit import utils as tests_utils
|
|
22
22
|
|
|
23
23
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
@mock.patch('openstackclient.api.compute_v2.APIv2.floating_ip_create')
|
|
24
|
+
@mock.patch.object(compute_v2, 'create_floating_ip')
|
|
28
25
|
class TestCreateFloatingIPCompute(compute_fakes.TestComputev2):
|
|
29
|
-
# The floating ip to be deleted.
|
|
30
26
|
_floating_ip = compute_fakes.create_one_floating_ip()
|
|
31
27
|
|
|
32
28
|
columns = (
|
|
@@ -46,13 +42,10 @@ class TestCreateFloatingIPCompute(compute_fakes.TestComputev2):
|
|
|
46
42
|
)
|
|
47
43
|
|
|
48
44
|
def setUp(self):
|
|
49
|
-
super(
|
|
45
|
+
super().setUp()
|
|
50
46
|
|
|
51
47
|
self.app.client_manager.network_endpoint_enabled = False
|
|
52
48
|
|
|
53
|
-
# self.compute_client.floating_ips.create.return_value = self.floating_ip
|
|
54
|
-
|
|
55
|
-
# Get the command object to test
|
|
56
49
|
self.cmd = fip.CreateFloatingIP(self.app, None)
|
|
57
50
|
|
|
58
51
|
def test_floating_ip_create_no_arg(self, fip_mock):
|
|
@@ -79,22 +72,22 @@ class TestCreateFloatingIPCompute(compute_fakes.TestComputev2):
|
|
|
79
72
|
|
|
80
73
|
columns, data = self.cmd.take_action(parsed_args)
|
|
81
74
|
|
|
82
|
-
fip_mock.assert_called_once_with(
|
|
75
|
+
fip_mock.assert_called_once_with(
|
|
76
|
+
self.compute_sdk_client, self._floating_ip['pool']
|
|
77
|
+
)
|
|
83
78
|
self.assertEqual(self.columns, columns)
|
|
84
79
|
self.assertEqual(self.data, data)
|
|
85
80
|
|
|
86
81
|
|
|
87
|
-
@mock.patch(
|
|
82
|
+
@mock.patch.object(compute_v2, 'delete_floating_ip')
|
|
88
83
|
class TestDeleteFloatingIPCompute(compute_fakes.TestComputev2):
|
|
89
|
-
# The floating ips to be deleted.
|
|
90
84
|
_floating_ips = compute_fakes.create_floating_ips(count=2)
|
|
91
85
|
|
|
92
86
|
def setUp(self):
|
|
93
|
-
super(
|
|
87
|
+
super().setUp()
|
|
94
88
|
|
|
95
89
|
self.app.client_manager.network_endpoint_enabled = False
|
|
96
90
|
|
|
97
|
-
# Get the command object to test
|
|
98
91
|
self.cmd = fip.DeleteFloatingIP(self.app, None)
|
|
99
92
|
|
|
100
93
|
def test_floating_ip_delete(self, fip_mock):
|
|
@@ -109,27 +102,34 @@ class TestDeleteFloatingIPCompute(compute_fakes.TestComputev2):
|
|
|
109
102
|
|
|
110
103
|
result = self.cmd.take_action(parsed_args)
|
|
111
104
|
|
|
112
|
-
fip_mock.assert_called_once_with(
|
|
105
|
+
fip_mock.assert_called_once_with(
|
|
106
|
+
self.compute_sdk_client, self._floating_ips[0]['id']
|
|
107
|
+
)
|
|
113
108
|
self.assertIsNone(result)
|
|
114
109
|
|
|
115
110
|
def test_floating_ip_delete_multi(self, fip_mock):
|
|
116
111
|
fip_mock.return_value = mock.Mock(return_value=None)
|
|
117
|
-
arglist = [
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
arglist.append(f['id'])
|
|
112
|
+
arglist = [
|
|
113
|
+
self._floating_ips[0]['id'],
|
|
114
|
+
self._floating_ips[1]['id'],
|
|
115
|
+
]
|
|
122
116
|
verifylist = [
|
|
123
117
|
('floating_ip', arglist),
|
|
124
118
|
]
|
|
125
|
-
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
126
119
|
|
|
120
|
+
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
127
121
|
result = self.cmd.take_action(parsed_args)
|
|
128
122
|
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
123
|
+
fip_mock.assert_has_calls(
|
|
124
|
+
[
|
|
125
|
+
mock.call(
|
|
126
|
+
self.compute_sdk_client, self._floating_ips[0]['id']
|
|
127
|
+
),
|
|
128
|
+
mock.call(
|
|
129
|
+
self.compute_sdk_client, self._floating_ips[1]['id']
|
|
130
|
+
),
|
|
131
|
+
]
|
|
132
|
+
)
|
|
133
133
|
self.assertIsNone(result)
|
|
134
134
|
|
|
135
135
|
def test_floating_ip_delete_multi_exception(self, fip_mock):
|
|
@@ -156,13 +156,16 @@ class TestDeleteFloatingIPCompute(compute_fakes.TestComputev2):
|
|
|
156
156
|
except exceptions.CommandError as e:
|
|
157
157
|
self.assertEqual('1 of 2 floating_ips failed to delete.', str(e))
|
|
158
158
|
|
|
159
|
-
fip_mock.assert_any_call(
|
|
160
|
-
|
|
159
|
+
fip_mock.assert_any_call(
|
|
160
|
+
self.compute_sdk_client, self._floating_ips[0]['id']
|
|
161
|
+
)
|
|
162
|
+
fip_mock.assert_any_call(
|
|
163
|
+
self.compute_sdk_client, 'unexist_floating_ip'
|
|
164
|
+
)
|
|
161
165
|
|
|
162
166
|
|
|
163
|
-
@mock.patch(
|
|
167
|
+
@mock.patch.object(compute_v2, 'list_floating_ips')
|
|
164
168
|
class TestListFloatingIPCompute(compute_fakes.TestComputev2):
|
|
165
|
-
# The floating ips to be list up
|
|
166
169
|
_floating_ips = compute_fakes.create_floating_ips(count=3)
|
|
167
170
|
|
|
168
171
|
columns = (
|
|
@@ -186,11 +189,10 @@ class TestListFloatingIPCompute(compute_fakes.TestComputev2):
|
|
|
186
189
|
)
|
|
187
190
|
|
|
188
191
|
def setUp(self):
|
|
189
|
-
super(
|
|
192
|
+
super().setUp()
|
|
190
193
|
|
|
191
194
|
self.app.client_manager.network_endpoint_enabled = False
|
|
192
195
|
|
|
193
|
-
# Get the command object to test
|
|
194
196
|
self.cmd = fip.ListFloatingIP(self.app, None)
|
|
195
197
|
|
|
196
198
|
def test_floating_ip_list(self, fip_mock):
|
|
@@ -201,14 +203,13 @@ class TestListFloatingIPCompute(compute_fakes.TestComputev2):
|
|
|
201
203
|
|
|
202
204
|
columns, data = self.cmd.take_action(parsed_args)
|
|
203
205
|
|
|
204
|
-
fip_mock.assert_called_once_with()
|
|
206
|
+
fip_mock.assert_called_once_with(self.compute_sdk_client)
|
|
205
207
|
self.assertEqual(self.columns, columns)
|
|
206
208
|
self.assertEqual(self.data, list(data))
|
|
207
209
|
|
|
208
210
|
|
|
209
|
-
@mock.patch(
|
|
211
|
+
@mock.patch.object(compute_v2, 'get_floating_ip')
|
|
210
212
|
class TestShowFloatingIPCompute(compute_fakes.TestComputev2):
|
|
211
|
-
# The floating ip to display.
|
|
212
213
|
_floating_ip = compute_fakes.create_one_floating_ip()
|
|
213
214
|
|
|
214
215
|
columns = (
|
|
@@ -228,11 +229,10 @@ class TestShowFloatingIPCompute(compute_fakes.TestComputev2):
|
|
|
228
229
|
)
|
|
229
230
|
|
|
230
231
|
def setUp(self):
|
|
231
|
-
super(
|
|
232
|
+
super().setUp()
|
|
232
233
|
|
|
233
234
|
self.app.client_manager.network_endpoint_enabled = False
|
|
234
235
|
|
|
235
|
-
# Get the command object to test
|
|
236
236
|
self.cmd = fip.ShowFloatingIP(self.app, None)
|
|
237
237
|
|
|
238
238
|
def test_floating_ip_show(self, fip_mock):
|
|
@@ -247,6 +247,8 @@ class TestShowFloatingIPCompute(compute_fakes.TestComputev2):
|
|
|
247
247
|
|
|
248
248
|
columns, data = self.cmd.take_action(parsed_args)
|
|
249
249
|
|
|
250
|
-
fip_mock.assert_called_once_with(
|
|
250
|
+
fip_mock.assert_called_once_with(
|
|
251
|
+
self.compute_sdk_client, self._floating_ip['id']
|
|
252
|
+
)
|
|
251
253
|
self.assertEqual(self.columns, columns)
|
|
252
254
|
self.assertEqual(self.data, data)
|
|
@@ -24,12 +24,12 @@ from openstackclient.tests.unit import utils as tests_utils
|
|
|
24
24
|
|
|
25
25
|
class TestFloatingIPNetwork(network_fakes.TestNetworkV2):
|
|
26
26
|
def setUp(self):
|
|
27
|
-
super(
|
|
27
|
+
super().setUp()
|
|
28
28
|
|
|
29
29
|
# Get a shortcut to the ProjectManager Mock
|
|
30
|
-
self.projects_mock = self.
|
|
30
|
+
self.projects_mock = self.identity_client.projects
|
|
31
31
|
# Get a shortcut to the DomainManager Mock
|
|
32
|
-
self.domains_mock = self.
|
|
32
|
+
self.domains_mock = self.identity_client.domains
|
|
33
33
|
|
|
34
34
|
|
|
35
35
|
class TestCreateFloatingIPNetwork(TestFloatingIPNetwork):
|
|
@@ -81,7 +81,7 @@ class TestCreateFloatingIPNetwork(TestFloatingIPNetwork):
|
|
|
81
81
|
)
|
|
82
82
|
|
|
83
83
|
def setUp(self):
|
|
84
|
-
super(
|
|
84
|
+
super().setUp()
|
|
85
85
|
|
|
86
86
|
self.network_client.create_ip = mock.Mock(
|
|
87
87
|
return_value=self.floating_ip
|
|
@@ -95,7 +95,7 @@ class TestCreateFloatingIPNetwork(TestFloatingIPNetwork):
|
|
|
95
95
|
self.network_client.find_port = mock.Mock(return_value=self.port)
|
|
96
96
|
|
|
97
97
|
# Get the command object to test
|
|
98
|
-
self.cmd = fip.CreateFloatingIP(self.app,
|
|
98
|
+
self.cmd = fip.CreateFloatingIP(self.app, None)
|
|
99
99
|
|
|
100
100
|
def test_create_no_options(self):
|
|
101
101
|
arglist = []
|
|
@@ -301,12 +301,12 @@ class TestDeleteFloatingIPNetwork(TestFloatingIPNetwork):
|
|
|
301
301
|
floating_ips = network_fakes.FakeFloatingIP.create_floating_ips(count=2)
|
|
302
302
|
|
|
303
303
|
def setUp(self):
|
|
304
|
-
super(
|
|
304
|
+
super().setUp()
|
|
305
305
|
|
|
306
306
|
self.network_client.delete_ip = mock.Mock(return_value=None)
|
|
307
307
|
|
|
308
308
|
# Get the command object to test
|
|
309
|
-
self.cmd = fip.DeleteFloatingIP(self.app,
|
|
309
|
+
self.cmd = fip.DeleteFloatingIP(self.app, None)
|
|
310
310
|
|
|
311
311
|
def test_floating_ip_delete(self):
|
|
312
312
|
self.network_client.find_ip.side_effect = [
|
|
@@ -467,7 +467,7 @@ class TestListFloatingIPNetwork(TestFloatingIPNetwork):
|
|
|
467
467
|
)
|
|
468
468
|
|
|
469
469
|
def setUp(self):
|
|
470
|
-
super(
|
|
470
|
+
super().setUp()
|
|
471
471
|
|
|
472
472
|
self.network_client.ips = mock.Mock(return_value=self.floating_ips)
|
|
473
473
|
self.network_client.find_network = mock.Mock(
|
|
@@ -479,7 +479,7 @@ class TestListFloatingIPNetwork(TestFloatingIPNetwork):
|
|
|
479
479
|
)
|
|
480
480
|
|
|
481
481
|
# Get the command object to test
|
|
482
|
-
self.cmd = fip.ListFloatingIP(self.app,
|
|
482
|
+
self.cmd = fip.ListFloatingIP(self.app, None)
|
|
483
483
|
|
|
484
484
|
def test_floating_ip_list(self):
|
|
485
485
|
arglist = []
|
|
@@ -742,12 +742,12 @@ class TestShowFloatingIPNetwork(TestFloatingIPNetwork):
|
|
|
742
742
|
)
|
|
743
743
|
|
|
744
744
|
def setUp(self):
|
|
745
|
-
super(
|
|
745
|
+
super().setUp()
|
|
746
746
|
|
|
747
747
|
self.network_client.find_ip = mock.Mock(return_value=self.floating_ip)
|
|
748
748
|
|
|
749
749
|
# Get the command object to test
|
|
750
|
-
self.cmd = fip.ShowFloatingIP(self.app,
|
|
750
|
+
self.cmd = fip.ShowFloatingIP(self.app, None)
|
|
751
751
|
|
|
752
752
|
def test_floating_ip_show(self):
|
|
753
753
|
arglist = [
|
|
@@ -784,14 +784,14 @@ class TestSetFloatingIP(TestFloatingIPNetwork):
|
|
|
784
784
|
)
|
|
785
785
|
|
|
786
786
|
def setUp(self):
|
|
787
|
-
super(
|
|
787
|
+
super().setUp()
|
|
788
788
|
self.network_client.find_ip = mock.Mock(return_value=self.floating_ip)
|
|
789
789
|
self.network_client.find_port = mock.Mock(return_value=self.port)
|
|
790
790
|
self.network_client.update_ip = mock.Mock(return_value=None)
|
|
791
791
|
self.network_client.set_tags = mock.Mock(return_value=None)
|
|
792
792
|
|
|
793
793
|
# Get the command object to test
|
|
794
|
-
self.cmd = fip.SetFloatingIP(self.app,
|
|
794
|
+
self.cmd = fip.SetFloatingIP(self.app, None)
|
|
795
795
|
|
|
796
796
|
def test_port_option(self):
|
|
797
797
|
arglist = [
|
|
@@ -1035,13 +1035,13 @@ class TestUnsetFloatingIP(TestFloatingIPNetwork):
|
|
|
1035
1035
|
)
|
|
1036
1036
|
|
|
1037
1037
|
def setUp(self):
|
|
1038
|
-
super(
|
|
1038
|
+
super().setUp()
|
|
1039
1039
|
self.network_client.find_ip = mock.Mock(return_value=self.floating_ip)
|
|
1040
1040
|
self.network_client.update_ip = mock.Mock(return_value=None)
|
|
1041
1041
|
self.network_client.set_tags = mock.Mock(return_value=None)
|
|
1042
1042
|
|
|
1043
1043
|
# Get the command object to test
|
|
1044
|
-
self.cmd = fip.UnsetFloatingIP(self.app,
|
|
1044
|
+
self.cmd = fip.UnsetFloatingIP(self.app, None)
|
|
1045
1045
|
|
|
1046
1046
|
def test_floating_ip_unset_port(self):
|
|
1047
1047
|
arglist = [
|
|
@@ -13,14 +13,12 @@
|
|
|
13
13
|
|
|
14
14
|
from unittest import mock
|
|
15
15
|
|
|
16
|
+
from openstackclient.api import compute_v2
|
|
16
17
|
from openstackclient.network.v2 import floating_ip_pool
|
|
17
18
|
from openstackclient.tests.unit.compute.v2 import fakes as compute_fakes
|
|
18
19
|
|
|
19
20
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
@mock.patch('openstackclient.api.compute_v2.APIv2.floating_ip_pool_list')
|
|
21
|
+
@mock.patch.object(compute_v2, 'list_floating_ip_pools')
|
|
24
22
|
class TestListFloatingIPPoolCompute(compute_fakes.TestComputev2):
|
|
25
23
|
# The floating ip pools to list up
|
|
26
24
|
_floating_ip_pools = compute_fakes.create_floating_ip_pools(count=3)
|
|
@@ -32,11 +30,10 @@ class TestListFloatingIPPoolCompute(compute_fakes.TestComputev2):
|
|
|
32
30
|
data.append((pool['name'],))
|
|
33
31
|
|
|
34
32
|
def setUp(self):
|
|
35
|
-
super(
|
|
33
|
+
super().setUp()
|
|
36
34
|
|
|
37
35
|
self.app.client_manager.network_endpoint_enabled = False
|
|
38
36
|
|
|
39
|
-
# Get the command object to test
|
|
40
37
|
self.cmd = floating_ip_pool.ListFloatingIPPool(self.app, None)
|
|
41
38
|
|
|
42
39
|
def test_floating_ip_list(self, fipp_mock):
|
|
@@ -47,6 +44,6 @@ class TestListFloatingIPPoolCompute(compute_fakes.TestComputev2):
|
|
|
47
44
|
|
|
48
45
|
columns, data = self.cmd.take_action(parsed_args)
|
|
49
46
|
|
|
50
|
-
fipp_mock.assert_called_once_with()
|
|
47
|
+
fipp_mock.assert_called_once_with(self.compute_sdk_client)
|
|
51
48
|
self.assertEqual(self.columns, columns)
|
|
52
49
|
self.assertEqual(self.data, list(data))
|
|
@@ -19,17 +19,15 @@ from openstackclient.tests.unit.network.v2 import fakes as network_fakes
|
|
|
19
19
|
|
|
20
20
|
class TestFloatingIPPoolNetwork(network_fakes.TestNetworkV2):
|
|
21
21
|
def setUp(self):
|
|
22
|
-
super(
|
|
22
|
+
super().setUp()
|
|
23
23
|
|
|
24
24
|
|
|
25
25
|
class TestListFloatingIPPoolNetwork(TestFloatingIPPoolNetwork):
|
|
26
26
|
def setUp(self):
|
|
27
|
-
super(
|
|
27
|
+
super().setUp()
|
|
28
28
|
|
|
29
29
|
# Get the command object to test
|
|
30
|
-
self.cmd = floating_ip_pool.ListFloatingIPPool(
|
|
31
|
-
self.app, self.namespace
|
|
32
|
-
)
|
|
30
|
+
self.cmd = floating_ip_pool.ListFloatingIPPool(self.app, None)
|
|
33
31
|
|
|
34
32
|
def test_floating_ip_list(self):
|
|
35
33
|
arglist = []
|