python-openstackclient 9.0.0__py3-none-any.whl → 10.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/__init__.py +2 -6
- openstackclient/api/api.py +41 -23
- openstackclient/api/compute_v2.py +44 -25
- openstackclient/api/object_store_v1.py +75 -97
- openstackclient/api/volume_v2.py +2 -1
- openstackclient/api/volume_v3.py +2 -1
- openstackclient/common/availability_zone.py +58 -42
- openstackclient/common/clientmanager.py +56 -29
- openstackclient/common/configuration.py +10 -3
- openstackclient/common/envvars.py +2 -2
- openstackclient/common/extension.py +14 -5
- openstackclient/common/limits.py +10 -5
- openstackclient/common/module.py +14 -6
- openstackclient/common/pagination.py +8 -2
- openstackclient/common/progressbar.py +7 -6
- openstackclient/common/project_cleanup.py +13 -7
- openstackclient/common/quota.py +97 -99
- openstackclient/common/versions.py +8 -2
- openstackclient/compute/client.py +7 -3
- openstackclient/compute/v2/agent.py +17 -10
- openstackclient/compute/v2/aggregate.py +36 -22
- openstackclient/compute/v2/console.py +14 -8
- openstackclient/compute/v2/console_connection.py +11 -3
- openstackclient/compute/v2/flavor.py +39 -21
- openstackclient/compute/v2/host.py +14 -6
- openstackclient/compute/v2/hypervisor.py +14 -5
- openstackclient/compute/v2/hypervisor_stats.py +10 -2
- openstackclient/compute/v2/keypair.py +29 -14
- openstackclient/compute/v2/server.py +249 -169
- openstackclient/compute/v2/server_backup.py +10 -4
- openstackclient/compute/v2/server_event.py +21 -12
- openstackclient/compute/v2/server_group.py +21 -11
- openstackclient/compute/v2/server_image.py +19 -10
- openstackclient/compute/v2/server_migration.py +24 -10
- openstackclient/compute/v2/server_share.py +274 -0
- openstackclient/compute/v2/server_volume.py +10 -4
- openstackclient/compute/v2/service.py +14 -7
- openstackclient/compute/v2/usage.py +26 -21
- openstackclient/identity/client.py +8 -3
- openstackclient/identity/common.py +78 -47
- openstackclient/identity/v2_0/catalog.py +14 -7
- openstackclient/identity/v2_0/ec2creds.py +21 -10
- openstackclient/identity/v2_0/endpoint.py +23 -11
- openstackclient/identity/v2_0/project.py +25 -14
- openstackclient/identity/v2_0/role.py +28 -14
- openstackclient/identity/v2_0/role_assignment.py +9 -3
- openstackclient/identity/v2_0/service.py +23 -11
- openstackclient/identity/v2_0/token.py +12 -5
- openstackclient/identity/v2_0/user.py +26 -15
- openstackclient/identity/v3/access_rule.py +26 -12
- openstackclient/identity/v3/application_credential.py +59 -24
- openstackclient/identity/v3/catalog.py +14 -7
- openstackclient/identity/v3/consumer.py +22 -11
- openstackclient/identity/v3/credential.py +36 -16
- openstackclient/identity/v3/domain.py +37 -18
- openstackclient/identity/v3/ec2creds.py +25 -12
- openstackclient/identity/v3/endpoint.py +42 -20
- openstackclient/identity/v3/endpoint_group.py +28 -17
- openstackclient/identity/v3/federation_protocol.py +38 -16
- openstackclient/identity/v3/group.py +55 -32
- openstackclient/identity/v3/identity_provider.py +92 -57
- openstackclient/identity/v3/implied_role.py +21 -9
- openstackclient/identity/v3/limit.py +38 -16
- openstackclient/identity/v3/mapping.py +26 -13
- openstackclient/identity/v3/policy.py +23 -12
- openstackclient/identity/v3/project.py +43 -23
- openstackclient/identity/v3/region.py +36 -16
- openstackclient/identity/v3/registered_limit.py +40 -16
- openstackclient/identity/v3/role.py +61 -31
- openstackclient/identity/v3/role_assignment.py +23 -6
- openstackclient/identity/v3/service.py +36 -16
- openstackclient/identity/v3/service_provider.py +37 -15
- openstackclient/identity/v3/tag.py +23 -6
- openstackclient/identity/v3/token.py +30 -14
- openstackclient/identity/v3/trust.py +32 -14
- openstackclient/identity/v3/unscoped_saml.py +10 -2
- openstackclient/identity/v3/user.py +49 -26
- openstackclient/image/client.py +7 -3
- openstackclient/image/v1/image.py +33 -26
- openstackclient/image/v2/cache.py +14 -9
- openstackclient/image/v2/image.py +74 -48
- openstackclient/image/v2/info.py +7 -1
- openstackclient/image/v2/metadef_namespaces.py +109 -13
- openstackclient/image/v2/metadef_objects.py +28 -15
- openstackclient/image/v2/metadef_properties.py +24 -13
- openstackclient/image/v2/metadef_resource_type_association.py +14 -7
- openstackclient/image/v2/metadef_resource_types.py +7 -1
- openstackclient/image/v2/task.py +15 -6
- openstackclient/locale/tr_TR/LC_MESSAGES/openstackclient.po +7 -192
- openstackclient/network/client.py +7 -2
- openstackclient/network/common.py +16 -241
- openstackclient/network/utils.py +36 -22
- openstackclient/network/v2/address_group.py +27 -16
- openstackclient/network/v2/address_scope.py +24 -13
- openstackclient/network/v2/bgpvpn/bgpvpn.py +463 -0
- openstackclient/network/v2/bgpvpn/constants.py +30 -0
- openstackclient/network/v2/bgpvpn/network_association.py +214 -0
- openstackclient/network/v2/bgpvpn/port_association.py +490 -0
- openstackclient/network/v2/bgpvpn/router_association.py +288 -0
- openstackclient/network/v2/default_security_group_rule.py +19 -10
- openstackclient/network/v2/floating_ip.py +110 -159
- openstackclient/network/v2/floating_ip_port_forwarding.py +30 -18
- openstackclient/network/v2/fwaas/__init__.py +0 -0
- openstackclient/network/v2/fwaas/group.py +466 -0
- openstackclient/network/v2/fwaas/policy.py +518 -0
- openstackclient/network/v2/fwaas/rule.py +574 -0
- openstackclient/network/v2/ip_availability.py +13 -5
- openstackclient/network/v2/l3_conntrack_helper.py +22 -13
- openstackclient/network/v2/local_ip.py +24 -13
- openstackclient/network/v2/local_ip_association.py +14 -7
- openstackclient/network/v2/ndp_proxy.py +20 -11
- openstackclient/network/v2/network.py +129 -196
- openstackclient/network/v2/network_agent.py +46 -25
- openstackclient/network/v2/network_auto_allocated_topology.py +22 -11
- openstackclient/network/v2/network_flavor.py +27 -16
- openstackclient/network/v2/network_flavor_profile.py +23 -12
- openstackclient/network/v2/network_meter.py +21 -10
- openstackclient/network/v2/network_meter_rule.py +21 -11
- openstackclient/network/v2/network_qos_policy.py +25 -15
- openstackclient/network/v2/network_qos_rule.py +32 -17
- openstackclient/network/v2/network_qos_rule_type.py +13 -5
- openstackclient/network/v2/network_rbac.py +23 -12
- openstackclient/network/v2/network_segment.py +20 -11
- openstackclient/network/v2/network_segment_range.py +56 -29
- openstackclient/network/v2/network_service_provider.py +7 -1
- openstackclient/network/v2/network_trunk.py +38 -22
- openstackclient/network/v2/port.py +54 -29
- openstackclient/network/v2/router.py +75 -52
- openstackclient/network/v2/security_group.py +87 -157
- openstackclient/network/v2/security_group_rule.py +100 -280
- openstackclient/network/v2/subnet.py +49 -28
- openstackclient/network/v2/subnet_pool.py +30 -17
- openstackclient/network/v2/taas/tap_flow.py +22 -11
- openstackclient/network/v2/taas/tap_mirror.py +22 -11
- openstackclient/network/v2/taas/tap_service.py +23 -12
- openstackclient/object/client.py +7 -2
- openstackclient/object/v1/account.py +13 -6
- openstackclient/object/v1/container.py +25 -15
- openstackclient/object/v1/object.py +25 -15
- openstackclient/py.typed +0 -0
- openstackclient/shell.py +46 -10
- openstackclient/tests/functional/base.py +55 -20
- openstackclient/tests/functional/common/test_extension.py +4 -0
- openstackclient/tests/functional/common/test_quota.py +3 -1
- openstackclient/tests/functional/compute/v2/common.py +14 -13
- openstackclient/tests/functional/compute/v2/test_flavor.py +3 -1
- openstackclient/tests/functional/compute/v2/test_server.py +3 -0
- openstackclient/tests/functional/identity/v2/common.py +10 -6
- openstackclient/tests/functional/identity/v2/test_role.py +4 -4
- openstackclient/tests/functional/identity/v3/common.py +25 -19
- openstackclient/tests/functional/identity/v3/test_group.py +20 -20
- openstackclient/tests/functional/identity/v3/test_idp.py +3 -1
- openstackclient/tests/functional/identity/v3/test_project.py +10 -10
- openstackclient/tests/functional/identity/v3/test_role.py +18 -18
- openstackclient/tests/functional/identity/v3/test_role_assignment.py +12 -12
- openstackclient/tests/functional/identity/v3/test_user.py +8 -8
- openstackclient/tests/functional/image/base.py +1 -6
- openstackclient/tests/functional/network/v2/common.py +5 -2
- openstackclient/tests/functional/network/v2/test_floating_ip.py +10 -4
- openstackclient/tests/functional/network/v2/test_ip_availability.py +4 -0
- openstackclient/tests/functional/network/v2/test_network_meter_rule.py +3 -2
- openstackclient/tests/functional/network/v2/test_network_segment.py +5 -0
- openstackclient/tests/functional/network/v2/test_subnet.py +13 -9
- openstackclient/tests/functional/object/v1/common.py +4 -0
- openstackclient/tests/functional/volume/v2/common.py +4 -0
- openstackclient/tests/functional/volume/v2/test_volume_snapshot.py +27 -11
- openstackclient/tests/functional/volume/v2/test_volume_type.py +2 -2
- openstackclient/tests/functional/volume/v3/common.py +4 -0
- openstackclient/tests/functional/volume/v3/test_volume_snapshot.py +11 -7
- openstackclient/tests/functional/volume/v3/test_volume_type.py +2 -2
- openstackclient/tests/unit/common/test_availability_zone.py +35 -49
- openstackclient/tests/unit/common/test_extension.py +2 -2
- openstackclient/tests/unit/common/test_module.py +12 -7
- openstackclient/tests/unit/common/test_project_cleanup.py +3 -1
- openstackclient/tests/unit/common/test_quota.py +6 -26
- openstackclient/tests/unit/compute/v2/fakes.py +25 -0
- openstackclient/tests/unit/compute/v2/test_flavor.py +28 -2
- openstackclient/tests/unit/compute/v2/test_keypair.py +6 -6
- openstackclient/tests/unit/compute/v2/test_server.py +11 -96
- openstackclient/tests/unit/compute/v2/test_server_share.py +287 -0
- openstackclient/tests/unit/identity/v3/fakes.py +3 -0
- openstackclient/tests/unit/identity/v3/test_group.py +4 -14
- openstackclient/tests/unit/identity/v3/test_identity_provider.py +303 -299
- openstackclient/tests/unit/identity/v3/test_user.py +4 -4
- openstackclient/tests/unit/image/v2/test_image.py +11 -11
- openstackclient/tests/unit/image/v2/test_metadef_namespaces.py +105 -6
- openstackclient/tests/unit/network/test_common.py +0 -155
- openstackclient/tests/unit/network/v2/bgpvpn/__init__.py +0 -0
- openstackclient/tests/unit/network/v2/bgpvpn/fakes.py +179 -0
- openstackclient/tests/unit/network/v2/bgpvpn/test_bgpvpn.py +584 -0
- openstackclient/tests/unit/network/v2/bgpvpn/test_network_association.py +285 -0
- openstackclient/tests/unit/network/v2/bgpvpn/test_port_association.py +384 -0
- openstackclient/tests/unit/network/v2/bgpvpn/test_router_association.py +297 -0
- openstackclient/tests/unit/network/v2/fwaas/__init__.py +0 -0
- openstackclient/tests/unit/network/v2/fwaas/test_group.py +897 -0
- openstackclient/tests/unit/network/v2/fwaas/test_policy.py +869 -0
- openstackclient/tests/unit/network/v2/fwaas/test_rule.py +980 -0
- openstackclient/tests/unit/network/v2/taas/{test_osc_tap_flow.py → test_tap_flow.py} +18 -25
- openstackclient/tests/unit/network/v2/taas/{test_osc_tap_mirror.py → test_tap_mirror.py} +19 -29
- openstackclient/tests/unit/network/v2/taas/{test_osc_tap_service.py → test_tap_service.py} +19 -29
- openstackclient/tests/unit/network/v2/test_address_group.py +2 -2
- openstackclient/tests/unit/network/v2/{test_floating_ip_network.py → test_floating_ip.py} +3 -2
- openstackclient/tests/unit/network/v2/test_floating_ip_port_forwarding.py +13 -13
- openstackclient/tests/unit/network/v2/test_network_agent.py +8 -4
- openstackclient/tests/unit/network/v2/test_network_auto_allocated_topology.py +3 -3
- openstackclient/tests/unit/network/v2/test_network_flavor.py +2 -2
- openstackclient/tests/unit/network/v2/test_network_qos_policy.py +1 -1
- openstackclient/tests/unit/network/v2/test_network_qos_rule.py +2 -2
- openstackclient/tests/unit/network/v2/test_network_rbac.py +1 -1
- openstackclient/tests/unit/network/v2/test_network_segment.py +1 -1
- openstackclient/tests/unit/network/v2/test_network_segment_range.py +7 -10
- openstackclient/tests/unit/network/v2/test_network_trunk.py +1 -1
- openstackclient/tests/unit/network/v2/test_router.py +8 -9
- openstackclient/tests/unit/network/v2/{test_security_group_network.py → test_security_group.py} +1 -20
- openstackclient/tests/unit/network/v2/{test_security_group_rule_network.py → test_security_group_rule.py} +7 -41
- openstackclient/tests/unit/network/v2/test_subnet.py +2 -1
- openstackclient/tests/unit/network/v2/test_subnet_pool.py +2 -1
- openstackclient/tests/unit/object/v1/fakes.py +8 -7
- openstackclient/tests/unit/object/v1/test_container.py +65 -101
- openstackclient/tests/unit/object/v1/test_container_all.py +8 -1
- openstackclient/tests/unit/object/v1/test_object.py +44 -84
- openstackclient/tests/unit/object/v1/test_object_all.py +8 -1
- openstackclient/tests/unit/test_hacking.py +108 -0
- openstackclient/tests/unit/volume/v2/fakes.py +1 -0
- openstackclient/tests/unit/volume/v2/test_volume_backup.py +1 -5
- openstackclient/tests/unit/volume/v2/test_volume_snapshot.py +2 -1
- openstackclient/tests/unit/volume/v2/test_volume_type.py +2 -4
- openstackclient/tests/unit/volume/v3/fakes.py +1 -0
- openstackclient/tests/unit/volume/v3/test_volume.py +60 -3
- openstackclient/tests/unit/volume/v3/test_volume_attachment.py +1 -1
- openstackclient/tests/unit/volume/v3/test_volume_backup.py +1 -5
- openstackclient/tests/unit/volume/v3/test_volume_snapshot.py +55 -1
- openstackclient/tests/unit/volume/v3/test_volume_type.py +2 -4
- openstackclient/volume/client.py +7 -3
- openstackclient/volume/v2/backup_record.py +15 -6
- openstackclient/volume/v2/consistency_group.py +29 -17
- openstackclient/volume/v2/consistency_group_snapshot.py +25 -10
- openstackclient/volume/v2/qos_specs.py +28 -17
- openstackclient/volume/v2/service.py +17 -6
- openstackclient/volume/v2/volume.py +57 -29
- openstackclient/volume/v2/volume_backend.py +19 -6
- openstackclient/volume/v2/volume_backup.py +46 -20
- openstackclient/volume/v2/volume_host.py +6 -4
- openstackclient/volume/v2/volume_snapshot.py +50 -24
- openstackclient/volume/v2/volume_transfer_request.py +31 -13
- openstackclient/volume/v2/volume_type.py +43 -24
- openstackclient/volume/v3/block_storage_cleanup.py +11 -3
- openstackclient/volume/v3/block_storage_cluster.py +19 -7
- openstackclient/volume/v3/block_storage_log_level.py +15 -6
- openstackclient/volume/v3/block_storage_manage.py +10 -4
- openstackclient/volume/v3/block_storage_resource_filter.py +17 -5
- openstackclient/volume/v3/service.py +16 -6
- openstackclient/volume/v3/volume.py +89 -39
- openstackclient/volume/v3/volume_attachment.py +43 -21
- openstackclient/volume/v3/volume_backup.py +53 -24
- openstackclient/volume/v3/volume_group.py +23 -13
- openstackclient/volume/v3/volume_group_snapshot.py +32 -13
- openstackclient/volume/v3/volume_group_type.py +26 -13
- openstackclient/volume/v3/volume_message.py +15 -7
- openstackclient/volume/v3/volume_snapshot.py +69 -32
- openstackclient/volume/v3/volume_transfer_request.py +31 -13
- openstackclient/volume/v3/volume_type.py +42 -24
- {python_openstackclient-9.0.0.dist-info → python_openstackclient-10.0.0.dist-info}/METADATA +6 -6
- {python_openstackclient-9.0.0.dist-info → python_openstackclient-10.0.0.dist-info}/RECORD +271 -260
- {python_openstackclient-9.0.0.dist-info → python_openstackclient-10.0.0.dist-info}/WHEEL +1 -1
- {python_openstackclient-9.0.0.dist-info → python_openstackclient-10.0.0.dist-info}/entry_points.txt +53 -1
- {python_openstackclient-9.0.0.dist-info → python_openstackclient-10.0.0.dist-info}/licenses/AUTHORS +4 -0
- python_openstackclient-10.0.0.dist-info/pbr.json +1 -0
- openstackclient/api/image_v1.py +0 -69
- openstackclient/api/image_v2.py +0 -79
- openstackclient/network/v2/floating_ip_pool.py +0 -38
- openstackclient/tests/functional/image/v1/test_image.py +0 -97
- openstackclient/tests/unit/api/test_image_v1.py +0 -96
- openstackclient/tests/unit/api/test_image_v2.py +0 -96
- openstackclient/tests/unit/network/v2/test_floating_ip_compute.py +0 -248
- openstackclient/tests/unit/network/v2/test_floating_ip_pool_compute.py +0 -49
- openstackclient/tests/unit/network/v2/test_floating_ip_pool_network.py +0 -39
- openstackclient/tests/unit/network/v2/test_network_compute.py +0 -404
- openstackclient/tests/unit/network/v2/test_security_group_compute.py +0 -392
- openstackclient/tests/unit/network/v2/test_security_group_rule_compute.py +0 -555
- python_openstackclient-9.0.0.dist-info/pbr.json +0 -1
- /openstackclient/{tests/functional/image/v1 → network/v2/bgpvpn}/__init__.py +0 -0
- {python_openstackclient-9.0.0.dist-info → python_openstackclient-10.0.0.dist-info}/licenses/LICENSE +0 -0
- {python_openstackclient-9.0.0.dist-info → python_openstackclient-10.0.0.dist-info}/top_level.txt +0 -0
|
@@ -1,248 +0,0 @@
|
|
|
1
|
-
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
|
2
|
-
# not use this file except in compliance with the License. You may obtain
|
|
3
|
-
# a copy of the License at
|
|
4
|
-
#
|
|
5
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
-
#
|
|
7
|
-
# Unless required by applicable law or agreed to in writing, software
|
|
8
|
-
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
9
|
-
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
10
|
-
# License for the specific language governing permissions and limitations
|
|
11
|
-
# under the License.
|
|
12
|
-
#
|
|
13
|
-
|
|
14
|
-
from unittest import mock
|
|
15
|
-
|
|
16
|
-
from osc_lib import exceptions
|
|
17
|
-
|
|
18
|
-
from openstackclient.api import compute_v2
|
|
19
|
-
from openstackclient.network.v2 import floating_ip as fip
|
|
20
|
-
from openstackclient.tests.unit.compute.v2 import fakes as compute_fakes
|
|
21
|
-
from openstackclient.tests.unit import utils as tests_utils
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
@mock.patch.object(compute_v2, 'create_floating_ip')
|
|
25
|
-
class TestCreateFloatingIPCompute(compute_fakes.TestComputev2):
|
|
26
|
-
_floating_ip = compute_fakes.create_one_floating_ip()
|
|
27
|
-
|
|
28
|
-
columns = (
|
|
29
|
-
'fixed_ip',
|
|
30
|
-
'id',
|
|
31
|
-
'instance_id',
|
|
32
|
-
'ip',
|
|
33
|
-
'pool',
|
|
34
|
-
)
|
|
35
|
-
|
|
36
|
-
data = (
|
|
37
|
-
_floating_ip['fixed_ip'],
|
|
38
|
-
_floating_ip['id'],
|
|
39
|
-
_floating_ip['instance_id'],
|
|
40
|
-
_floating_ip['ip'],
|
|
41
|
-
_floating_ip['pool'],
|
|
42
|
-
)
|
|
43
|
-
|
|
44
|
-
def setUp(self):
|
|
45
|
-
super().setUp()
|
|
46
|
-
|
|
47
|
-
self.app.client_manager.network_endpoint_enabled = False
|
|
48
|
-
|
|
49
|
-
self.cmd = fip.CreateFloatingIP(self.app, None)
|
|
50
|
-
|
|
51
|
-
def test_floating_ip_create_no_arg(self, fip_mock):
|
|
52
|
-
arglist = []
|
|
53
|
-
verifylist = []
|
|
54
|
-
|
|
55
|
-
self.assertRaises(
|
|
56
|
-
tests_utils.ParserException,
|
|
57
|
-
self.check_parser,
|
|
58
|
-
self.cmd,
|
|
59
|
-
arglist,
|
|
60
|
-
verifylist,
|
|
61
|
-
)
|
|
62
|
-
|
|
63
|
-
def test_floating_ip_create_default(self, fip_mock):
|
|
64
|
-
fip_mock.return_value = self._floating_ip
|
|
65
|
-
arglist = [
|
|
66
|
-
self._floating_ip['pool'],
|
|
67
|
-
]
|
|
68
|
-
verifylist = [
|
|
69
|
-
('network', self._floating_ip['pool']),
|
|
70
|
-
]
|
|
71
|
-
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
72
|
-
|
|
73
|
-
columns, data = self.cmd.take_action(parsed_args)
|
|
74
|
-
|
|
75
|
-
fip_mock.assert_called_once_with(
|
|
76
|
-
self.compute_client, self._floating_ip['pool']
|
|
77
|
-
)
|
|
78
|
-
self.assertEqual(self.columns, columns)
|
|
79
|
-
self.assertEqual(self.data, data)
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
@mock.patch.object(compute_v2, 'delete_floating_ip')
|
|
83
|
-
class TestDeleteFloatingIPCompute(compute_fakes.TestComputev2):
|
|
84
|
-
_floating_ips = compute_fakes.create_floating_ips(count=2)
|
|
85
|
-
|
|
86
|
-
def setUp(self):
|
|
87
|
-
super().setUp()
|
|
88
|
-
|
|
89
|
-
self.app.client_manager.network_endpoint_enabled = False
|
|
90
|
-
|
|
91
|
-
self.cmd = fip.DeleteFloatingIP(self.app, None)
|
|
92
|
-
|
|
93
|
-
def test_floating_ip_delete(self, fip_mock):
|
|
94
|
-
fip_mock.return_value = mock.Mock(return_value=None)
|
|
95
|
-
arglist = [
|
|
96
|
-
self._floating_ips[0]['id'],
|
|
97
|
-
]
|
|
98
|
-
verifylist = [
|
|
99
|
-
('floating_ip', [self._floating_ips[0]['id']]),
|
|
100
|
-
]
|
|
101
|
-
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
102
|
-
|
|
103
|
-
result = self.cmd.take_action(parsed_args)
|
|
104
|
-
|
|
105
|
-
fip_mock.assert_called_once_with(
|
|
106
|
-
self.compute_client, self._floating_ips[0]['id']
|
|
107
|
-
)
|
|
108
|
-
self.assertIsNone(result)
|
|
109
|
-
|
|
110
|
-
def test_floating_ip_delete_multi(self, fip_mock):
|
|
111
|
-
fip_mock.return_value = mock.Mock(return_value=None)
|
|
112
|
-
arglist = [
|
|
113
|
-
self._floating_ips[0]['id'],
|
|
114
|
-
self._floating_ips[1]['id'],
|
|
115
|
-
]
|
|
116
|
-
verifylist = [
|
|
117
|
-
('floating_ip', arglist),
|
|
118
|
-
]
|
|
119
|
-
|
|
120
|
-
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
121
|
-
result = self.cmd.take_action(parsed_args)
|
|
122
|
-
|
|
123
|
-
fip_mock.assert_has_calls(
|
|
124
|
-
[
|
|
125
|
-
mock.call(self.compute_client, self._floating_ips[0]['id']),
|
|
126
|
-
mock.call(self.compute_client, self._floating_ips[1]['id']),
|
|
127
|
-
]
|
|
128
|
-
)
|
|
129
|
-
self.assertIsNone(result)
|
|
130
|
-
|
|
131
|
-
def test_floating_ip_delete_multi_exception(self, fip_mock):
|
|
132
|
-
fip_mock.return_value = mock.Mock(return_value=None)
|
|
133
|
-
fip_mock.side_effect = [
|
|
134
|
-
mock.Mock(return_value=None),
|
|
135
|
-
exceptions.CommandError,
|
|
136
|
-
]
|
|
137
|
-
arglist = [
|
|
138
|
-
self._floating_ips[0]['id'],
|
|
139
|
-
'unexist_floating_ip',
|
|
140
|
-
]
|
|
141
|
-
verifylist = [
|
|
142
|
-
(
|
|
143
|
-
'floating_ip',
|
|
144
|
-
[self._floating_ips[0]['id'], 'unexist_floating_ip'],
|
|
145
|
-
)
|
|
146
|
-
]
|
|
147
|
-
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
148
|
-
|
|
149
|
-
try:
|
|
150
|
-
self.cmd.take_action(parsed_args)
|
|
151
|
-
self.fail('CommandError should be raised.')
|
|
152
|
-
except exceptions.CommandError as e:
|
|
153
|
-
self.assertEqual('1 of 2 floating_ips failed to delete.', str(e))
|
|
154
|
-
|
|
155
|
-
fip_mock.assert_any_call(
|
|
156
|
-
self.compute_client, self._floating_ips[0]['id']
|
|
157
|
-
)
|
|
158
|
-
fip_mock.assert_any_call(self.compute_client, 'unexist_floating_ip')
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
@mock.patch.object(compute_v2, 'list_floating_ips')
|
|
162
|
-
class TestListFloatingIPCompute(compute_fakes.TestComputev2):
|
|
163
|
-
_floating_ips = compute_fakes.create_floating_ips(count=3)
|
|
164
|
-
|
|
165
|
-
columns = (
|
|
166
|
-
'ID',
|
|
167
|
-
'Floating IP Address',
|
|
168
|
-
'Fixed IP Address',
|
|
169
|
-
'Server',
|
|
170
|
-
'Pool',
|
|
171
|
-
)
|
|
172
|
-
|
|
173
|
-
data = []
|
|
174
|
-
for ip in _floating_ips:
|
|
175
|
-
data.append(
|
|
176
|
-
(
|
|
177
|
-
ip['id'],
|
|
178
|
-
ip['ip'],
|
|
179
|
-
ip['fixed_ip'],
|
|
180
|
-
ip['instance_id'],
|
|
181
|
-
ip['pool'],
|
|
182
|
-
)
|
|
183
|
-
)
|
|
184
|
-
|
|
185
|
-
def setUp(self):
|
|
186
|
-
super().setUp()
|
|
187
|
-
|
|
188
|
-
self.app.client_manager.network_endpoint_enabled = False
|
|
189
|
-
|
|
190
|
-
self.cmd = fip.ListFloatingIP(self.app, None)
|
|
191
|
-
|
|
192
|
-
def test_floating_ip_list(self, fip_mock):
|
|
193
|
-
fip_mock.return_value = self._floating_ips
|
|
194
|
-
arglist = []
|
|
195
|
-
verifylist = []
|
|
196
|
-
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
197
|
-
|
|
198
|
-
columns, data = self.cmd.take_action(parsed_args)
|
|
199
|
-
|
|
200
|
-
fip_mock.assert_called_once_with(self.compute_client)
|
|
201
|
-
self.assertEqual(self.columns, columns)
|
|
202
|
-
self.assertEqual(self.data, list(data))
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
@mock.patch.object(compute_v2, 'get_floating_ip')
|
|
206
|
-
class TestShowFloatingIPCompute(compute_fakes.TestComputev2):
|
|
207
|
-
_floating_ip = compute_fakes.create_one_floating_ip()
|
|
208
|
-
|
|
209
|
-
columns = (
|
|
210
|
-
'fixed_ip',
|
|
211
|
-
'id',
|
|
212
|
-
'instance_id',
|
|
213
|
-
'ip',
|
|
214
|
-
'pool',
|
|
215
|
-
)
|
|
216
|
-
|
|
217
|
-
data = (
|
|
218
|
-
_floating_ip['fixed_ip'],
|
|
219
|
-
_floating_ip['id'],
|
|
220
|
-
_floating_ip['instance_id'],
|
|
221
|
-
_floating_ip['ip'],
|
|
222
|
-
_floating_ip['pool'],
|
|
223
|
-
)
|
|
224
|
-
|
|
225
|
-
def setUp(self):
|
|
226
|
-
super().setUp()
|
|
227
|
-
|
|
228
|
-
self.app.client_manager.network_endpoint_enabled = False
|
|
229
|
-
|
|
230
|
-
self.cmd = fip.ShowFloatingIP(self.app, None)
|
|
231
|
-
|
|
232
|
-
def test_floating_ip_show(self, fip_mock):
|
|
233
|
-
fip_mock.return_value = self._floating_ip
|
|
234
|
-
arglist = [
|
|
235
|
-
self._floating_ip['id'],
|
|
236
|
-
]
|
|
237
|
-
verifylist = [
|
|
238
|
-
('floating_ip', self._floating_ip['id']),
|
|
239
|
-
]
|
|
240
|
-
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
241
|
-
|
|
242
|
-
columns, data = self.cmd.take_action(parsed_args)
|
|
243
|
-
|
|
244
|
-
fip_mock.assert_called_once_with(
|
|
245
|
-
self.compute_client, self._floating_ip['id']
|
|
246
|
-
)
|
|
247
|
-
self.assertEqual(self.columns, columns)
|
|
248
|
-
self.assertEqual(self.data, data)
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
|
2
|
-
# not use this file except in compliance with the License. You may obtain
|
|
3
|
-
# a copy of the License at
|
|
4
|
-
#
|
|
5
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
-
#
|
|
7
|
-
# Unless required by applicable law or agreed to in writing, software
|
|
8
|
-
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
9
|
-
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
10
|
-
# License for the specific language governing permissions and limitations
|
|
11
|
-
# under the License.
|
|
12
|
-
#
|
|
13
|
-
|
|
14
|
-
from unittest import mock
|
|
15
|
-
|
|
16
|
-
from openstackclient.api import compute_v2
|
|
17
|
-
from openstackclient.network.v2 import floating_ip_pool
|
|
18
|
-
from openstackclient.tests.unit.compute.v2 import fakes as compute_fakes
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
@mock.patch.object(compute_v2, 'list_floating_ip_pools')
|
|
22
|
-
class TestListFloatingIPPoolCompute(compute_fakes.TestComputev2):
|
|
23
|
-
# The floating ip pools to list up
|
|
24
|
-
_floating_ip_pools = compute_fakes.create_floating_ip_pools(count=3)
|
|
25
|
-
|
|
26
|
-
columns = ('Name',)
|
|
27
|
-
|
|
28
|
-
data = []
|
|
29
|
-
for pool in _floating_ip_pools:
|
|
30
|
-
data.append((pool['name'],))
|
|
31
|
-
|
|
32
|
-
def setUp(self):
|
|
33
|
-
super().setUp()
|
|
34
|
-
|
|
35
|
-
self.app.client_manager.network_endpoint_enabled = False
|
|
36
|
-
|
|
37
|
-
self.cmd = floating_ip_pool.ListFloatingIPPool(self.app, None)
|
|
38
|
-
|
|
39
|
-
def test_floating_ip_list(self, fipp_mock):
|
|
40
|
-
fipp_mock.return_value = self._floating_ip_pools
|
|
41
|
-
arglist = []
|
|
42
|
-
verifylist = []
|
|
43
|
-
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
44
|
-
|
|
45
|
-
columns, data = self.cmd.take_action(parsed_args)
|
|
46
|
-
|
|
47
|
-
fipp_mock.assert_called_once_with(self.compute_client)
|
|
48
|
-
self.assertEqual(self.columns, columns)
|
|
49
|
-
self.assertEqual(self.data, list(data))
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
|
2
|
-
# not use this file except in compliance with the License. You may obtain
|
|
3
|
-
# a copy of the License at
|
|
4
|
-
#
|
|
5
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
-
#
|
|
7
|
-
# Unless required by applicable law or agreed to in writing, software
|
|
8
|
-
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
9
|
-
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
10
|
-
# License for the specific language governing permissions and limitations
|
|
11
|
-
# under the License.
|
|
12
|
-
#
|
|
13
|
-
|
|
14
|
-
from osc_lib import exceptions
|
|
15
|
-
|
|
16
|
-
from openstackclient.network.v2 import floating_ip_pool
|
|
17
|
-
from openstackclient.tests.unit.network.v2 import fakes as network_fakes
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
class TestFloatingIPPoolNetwork(network_fakes.TestNetworkV2):
|
|
21
|
-
def setUp(self):
|
|
22
|
-
super().setUp()
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
class TestListFloatingIPPoolNetwork(TestFloatingIPPoolNetwork):
|
|
26
|
-
def setUp(self):
|
|
27
|
-
super().setUp()
|
|
28
|
-
|
|
29
|
-
# Get the command object to test
|
|
30
|
-
self.cmd = floating_ip_pool.ListFloatingIPPool(self.app, None)
|
|
31
|
-
|
|
32
|
-
def test_floating_ip_list(self):
|
|
33
|
-
arglist = []
|
|
34
|
-
verifylist = []
|
|
35
|
-
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
36
|
-
|
|
37
|
-
self.assertRaises(
|
|
38
|
-
exceptions.CommandError, self.cmd.take_action, parsed_args
|
|
39
|
-
)
|