python-openstackclient 9.0.0__py3-none-any.whl → 10.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/__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 +59 -43
- 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 +36 -34
- openstackclient/common/pagination.py +50 -6
- openstackclient/common/progressbar.py +7 -6
- openstackclient/common/project_cleanup.py +11 -6
- openstackclient/common/quota.py +105 -103
- 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 +42 -22
- openstackclient/compute/v2/host.py +14 -6
- openstackclient/compute/v2/hypervisor.py +16 -5
- openstackclient/compute/v2/hypervisor_stats.py +10 -2
- openstackclient/compute/v2/keypair.py +35 -16
- openstackclient/compute/v2/server.py +268 -179
- openstackclient/compute/v2/server_backup.py +10 -4
- openstackclient/compute/v2/server_event.py +28 -12
- openstackclient/compute/v2/server_group.py +23 -11
- openstackclient/compute/v2/server_image.py +19 -10
- openstackclient/compute/v2/server_migration.py +27 -10
- openstackclient/compute/v2/server_share.py +274 -0
- openstackclient/compute/v2/server_volume.py +13 -5
- openstackclient/compute/v2/service.py +17 -8
- openstackclient/compute/v2/usage.py +28 -23
- openstackclient/identity/client.py +8 -3
- openstackclient/identity/common.py +82 -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 +32 -12
- openstackclient/identity/v3/application_credential.py +66 -24
- openstackclient/identity/v3/catalog.py +14 -7
- openstackclient/identity/v3/consumer.py +22 -11
- openstackclient/identity/v3/credential.py +39 -17
- openstackclient/identity/v3/domain.py +40 -19
- openstackclient/identity/v3/ec2creds.py +25 -12
- openstackclient/identity/v3/endpoint.py +98 -64
- openstackclient/identity/v3/endpoint_group.py +28 -17
- openstackclient/identity/v3/federation_protocol.py +44 -20
- openstackclient/identity/v3/group.py +64 -40
- openstackclient/identity/v3/identity_provider.py +95 -57
- openstackclient/identity/v3/implied_role.py +21 -9
- openstackclient/identity/v3/limit.py +42 -17
- openstackclient/identity/v3/mapping.py +58 -28
- openstackclient/identity/v3/policy.py +23 -12
- openstackclient/identity/v3/project.py +59 -26
- openstackclient/identity/v3/region.py +39 -17
- openstackclient/identity/v3/registered_limit.py +41 -16
- openstackclient/identity/v3/role.py +62 -31
- openstackclient/identity/v3/role_assignment.py +25 -7
- openstackclient/identity/v3/service.py +39 -17
- openstackclient/identity/v3/service_provider.py +40 -16
- openstackclient/identity/v3/tag.py +23 -6
- openstackclient/identity/v3/token.py +30 -14
- openstackclient/identity/v3/trust.py +39 -18
- openstackclient/identity/v3/unscoped_saml.py +10 -2
- openstackclient/identity/v3/user.py +86 -36
- openstackclient/image/client.py +7 -3
- openstackclient/image/v1/image.py +33 -26
- openstackclient/image/v2/cache.py +16 -11
- openstackclient/image/v2/image.py +88 -56
- openstackclient/image/v2/info.py +7 -1
- openstackclient/image/v2/metadef_namespaces.py +117 -20
- openstackclient/image/v2/metadef_objects.py +32 -19
- openstackclient/image/v2/metadef_properties.py +30 -16
- openstackclient/image/v2/metadef_resource_type_association.py +14 -7
- openstackclient/image/v2/metadef_resource_types.py +7 -1
- openstackclient/image/v2/task.py +25 -27
- 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 +27 -54
- openstackclient/network/v2/address_group.py +39 -16
- openstackclient/network/v2/address_scope.py +36 -20
- openstackclient/network/v2/bgpvpn/bgpvpn.py +477 -0
- openstackclient/network/v2/bgpvpn/constants.py +30 -0
- openstackclient/network/v2/bgpvpn/network_association.py +226 -0
- openstackclient/network/v2/bgpvpn/port_association.py +504 -0
- openstackclient/network/v2/bgpvpn/router_association.py +301 -0
- openstackclient/network/v2/default_security_group_rule.py +31 -14
- openstackclient/network/v2/floating_ip.py +121 -162
- openstackclient/network/v2/floating_ip_port_forwarding.py +41 -19
- openstackclient/network/v2/fwaas/__init__.py +0 -0
- openstackclient/network/v2/fwaas/group.py +499 -0
- openstackclient/network/v2/fwaas/policy.py +518 -0
- openstackclient/network/v2/fwaas/rule.py +610 -0
- openstackclient/network/v2/ip_availability.py +25 -8
- openstackclient/network/v2/l3_conntrack_helper.py +35 -13
- openstackclient/network/v2/local_ip.py +27 -13
- openstackclient/network/v2/local_ip_association.py +17 -7
- openstackclient/network/v2/ndp_proxy.py +23 -11
- openstackclient/network/v2/network.py +213 -213
- openstackclient/network/v2/network_agent.py +77 -34
- openstackclient/network/v2/network_auto_allocated_topology.py +27 -15
- openstackclient/network/v2/network_flavor.py +45 -21
- openstackclient/network/v2/network_flavor_profile.py +42 -17
- openstackclient/network/v2/network_meter.py +39 -15
- openstackclient/network/v2/network_meter_rule.py +40 -12
- openstackclient/network/v2/network_qos_policy.py +39 -21
- openstackclient/network/v2/network_qos_rule.py +48 -18
- openstackclient/network/v2/network_qos_rule_type.py +28 -9
- openstackclient/network/v2/network_rbac.py +34 -16
- openstackclient/network/v2/network_segment.py +32 -11
- openstackclient/network/v2/network_segment_range.py +70 -31
- openstackclient/network/v2/network_service_provider.py +7 -1
- openstackclient/network/v2/network_trunk.py +41 -22
- openstackclient/network/v2/port.py +141 -40
- openstackclient/network/v2/router.py +101 -67
- openstackclient/network/v2/security_group.py +97 -198
- openstackclient/network/v2/security_group_rule.py +115 -282
- openstackclient/network/v2/subnet.py +63 -34
- openstackclient/network/v2/subnet_pool.py +42 -24
- openstackclient/network/v2/taas/tap_flow.py +35 -14
- openstackclient/network/v2/taas/tap_mirror.py +28 -14
- openstackclient/network/v2/taas/tap_service.py +26 -12
- openstackclient/object/client.py +7 -2
- openstackclient/object/v1/account.py +13 -6
- openstackclient/object/v1/container.py +28 -16
- openstackclient/object/v1/object.py +28 -16
- 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 +59 -19
- openstackclient/tests/functional/identity/v3/test_application_credential.py +1 -1
- 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_mapping.py +81 -0
- 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_group.py +163 -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_limits.py +1 -1
- openstackclient/tests/unit/common/test_module.py +82 -44
- openstackclient/tests/unit/common/test_project_cleanup.py +3 -1
- openstackclient/tests/unit/common/test_quota.py +15 -26
- openstackclient/tests/unit/compute/v2/fakes.py +26 -57
- openstackclient/tests/unit/compute/v2/test_agent.py +4 -4
- openstackclient/tests/unit/compute/v2/test_aggregate.py +1 -1
- openstackclient/tests/unit/compute/v2/test_console.py +2 -2
- openstackclient/tests/unit/compute/v2/test_console_connection.py +1 -1
- openstackclient/tests/unit/compute/v2/test_flavor.py +29 -3
- openstackclient/tests/unit/compute/v2/test_host.py +3 -3
- openstackclient/tests/unit/compute/v2/test_hypervisor.py +2 -2
- openstackclient/tests/unit/compute/v2/test_hypervisor_stats.py +1 -1
- openstackclient/tests/unit/compute/v2/test_keypair.py +7 -7
- openstackclient/tests/unit/compute/v2/test_server.py +26 -111
- openstackclient/tests/unit/compute/v2/test_server_backup.py +1 -1
- openstackclient/tests/unit/compute/v2/test_server_event.py +2 -2
- openstackclient/tests/unit/compute/v2/test_server_group.py +1 -1
- openstackclient/tests/unit/compute/v2/test_server_image.py +1 -1
- openstackclient/tests/unit/compute/v2/test_server_migration.py +4 -4
- openstackclient/tests/unit/compute/v2/test_server_share.py +287 -0
- openstackclient/tests/unit/compute/v2/test_server_volume.py +2 -2
- openstackclient/tests/unit/compute/v2/test_service.py +3 -3
- openstackclient/tests/unit/compute/v2/test_usage.py +1 -1
- openstackclient/tests/unit/identity/v2_0/fakes.py +3 -7
- openstackclient/tests/unit/identity/v2_0/test_endpoint.py +1 -1
- openstackclient/tests/unit/identity/v2_0/test_project.py +1 -1
- openstackclient/tests/unit/identity/v2_0/test_role.py +1 -1
- openstackclient/tests/unit/identity/v2_0/test_role_assignment.py +1 -1
- openstackclient/tests/unit/identity/v2_0/test_service.py +1 -1
- openstackclient/tests/unit/identity/v2_0/test_token.py +2 -2
- openstackclient/tests/unit/identity/v2_0/test_user.py +1 -1
- openstackclient/tests/unit/identity/v3/fakes.py +8 -38
- openstackclient/tests/unit/identity/v3/test_access_rule.py +3 -3
- openstackclient/tests/unit/identity/v3/test_application_credential.py +4 -4
- openstackclient/tests/unit/identity/v3/test_credential.py +5 -5
- openstackclient/tests/unit/identity/v3/test_domain.py +5 -5
- openstackclient/tests/unit/identity/v3/test_endpoint.py +6 -6
- openstackclient/tests/unit/identity/v3/test_endpoint_group.py +1 -1
- openstackclient/tests/unit/identity/v3/test_group.py +12 -22
- openstackclient/tests/unit/identity/v3/test_identity_provider.py +303 -299
- openstackclient/tests/unit/identity/v3/test_implied_role.py +1 -1
- openstackclient/tests/unit/identity/v3/test_limit.py +5 -5
- openstackclient/tests/unit/identity/v3/test_mappings.py +163 -79
- openstackclient/tests/unit/identity/v3/test_project.py +28 -5
- openstackclient/tests/unit/identity/v3/test_protocol.py +3 -3
- openstackclient/tests/unit/identity/v3/test_region.py +5 -5
- openstackclient/tests/unit/identity/v3/test_registered_limit.py +5 -5
- openstackclient/tests/unit/identity/v3/test_role.py +8 -8
- openstackclient/tests/unit/identity/v3/test_role_assignment.py +1 -1
- openstackclient/tests/unit/identity/v3/test_service.py +5 -5
- openstackclient/tests/unit/identity/v3/test_token.py +2 -2
- openstackclient/tests/unit/identity/v3/test_trust.py +4 -4
- openstackclient/tests/unit/identity/v3/test_user.py +77 -10
- 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/fakes.py +5 -77
- openstackclient/tests/unit/network/v2/fwaas/__init__.py +0 -0
- openstackclient/tests/unit/network/v2/fwaas/test_group.py +923 -0
- openstackclient/tests/unit/network/v2/fwaas/test_policy.py +869 -0
- openstackclient/tests/unit/network/v2/fwaas/test_rule.py +1005 -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 +26 -2
- openstackclient/tests/unit/network/v2/test_address_scope.py +24 -0
- openstackclient/tests/unit/network/v2/{test_floating_ip_network.py → test_floating_ip.py} +27 -2
- openstackclient/tests/unit/network/v2/test_floating_ip_port_forwarding.py +37 -13
- openstackclient/tests/unit/network/v2/test_ip_availability.py +25 -0
- openstackclient/tests/unit/network/v2/test_l3_conntrack_helper.py +29 -3
- openstackclient/tests/unit/network/v2/test_network.py +74 -12
- openstackclient/tests/unit/network/v2/test_network_agent.py +58 -5
- openstackclient/tests/unit/network/v2/test_network_auto_allocated_topology.py +3 -3
- openstackclient/tests/unit/network/v2/test_network_flavor.py +26 -2
- openstackclient/tests/unit/network/v2/test_network_flavor_profile.py +24 -0
- openstackclient/tests/unit/network/v2/test_network_meter.py +24 -0
- openstackclient/tests/unit/network/v2/test_network_qos_policy.py +25 -1
- openstackclient/tests/unit/network/v2/test_network_qos_rule.py +2 -2
- openstackclient/tests/unit/network/v2/test_network_qos_rule_type.py +24 -0
- openstackclient/tests/unit/network/v2/test_network_rbac.py +25 -1
- openstackclient/tests/unit/network/v2/test_network_segment.py +25 -1
- openstackclient/tests/unit/network/v2/test_network_segment_range.py +31 -10
- openstackclient/tests/unit/network/v2/test_network_trunk.py +1 -1
- openstackclient/tests/unit/network/v2/test_port.py +166 -0
- openstackclient/tests/unit/network/v2/test_router.py +36 -16
- openstackclient/tests/unit/network/v2/{test_security_group_network.py → test_security_group.py} +11 -8
- openstackclient/tests/unit/network/v2/{test_security_group_rule_network.py → test_security_group_rule.py} +28 -37
- openstackclient/tests/unit/network/v2/test_subnet.py +30 -5
- openstackclient/tests/unit/network/v2/test_subnet_pool.py +26 -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 +21 -140
- openstackclient/tests/unit/volume/v2/test_volume_backup.py +6 -14
- openstackclient/tests/unit/volume/v2/test_volume_snapshot.py +8 -1
- openstackclient/tests/unit/volume/v2/test_volume_type.py +2 -4
- openstackclient/tests/unit/volume/v3/fakes.py +205 -100
- openstackclient/tests/unit/volume/v3/test_backup_record.py +114 -0
- openstackclient/tests/unit/volume/v3/test_consistency_group.py +720 -0
- openstackclient/tests/unit/volume/v3/test_consistency_group_snapshot.py +354 -0
- openstackclient/tests/unit/volume/v3/test_qos_specs.py +455 -0
- openstackclient/tests/unit/volume/v3/test_volume.py +60 -3
- openstackclient/tests/unit/volume/v3/test_volume_attachment.py +3 -1
- openstackclient/tests/unit/volume/v3/test_volume_backend.py +158 -0
- openstackclient/tests/unit/volume/v3/test_volume_backup.py +6 -14
- openstackclient/tests/unit/volume/v3/test_volume_group_type.py +65 -0
- openstackclient/tests/unit/volume/v3/test_volume_host.py +115 -0
- openstackclient/tests/unit/volume/v3/test_volume_snapshot.py +61 -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 +60 -30
- openstackclient/volume/v2/volume_backend.py +19 -6
- openstackclient/volume/v2/volume_backup.py +48 -23
- openstackclient/volume/v2/volume_host.py +6 -4
- openstackclient/volume/v2/volume_snapshot.py +49 -24
- openstackclient/volume/v2/volume_transfer_request.py +31 -13
- openstackclient/volume/v2/volume_type.py +43 -24
- openstackclient/volume/v3/backup_record.py +94 -0
- 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/consistency_group.py +400 -0
- openstackclient/volume/v3/consistency_group_snapshot.py +225 -0
- openstackclient/volume/v3/qos_specs.py +389 -0
- openstackclient/volume/v3/service.py +16 -6
- openstackclient/volume/v3/volume.py +92 -40
- openstackclient/volume/v3/volume_attachment.py +47 -21
- openstackclient/volume/v3/volume_backend.py +130 -0
- openstackclient/volume/v3/volume_backup.py +55 -27
- openstackclient/volume/v3/volume_group.py +23 -13
- openstackclient/volume/v3/volume_group_snapshot.py +34 -17
- openstackclient/volume/v3/volume_group_type.py +27 -14
- openstackclient/volume/v3/volume_host.py +74 -0
- openstackclient/volume/v3/volume_message.py +18 -8
- openstackclient/volume/v3/volume_snapshot.py +70 -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.1.0.dist-info}/METADATA +7 -8
- python_openstackclient-10.1.0.dist-info/RECORD +524 -0
- {python_openstackclient-9.0.0.dist-info → python_openstackclient-10.1.0.dist-info}/WHEEL +1 -1
- {python_openstackclient-9.0.0.dist-info → python_openstackclient-10.1.0.dist-info}/entry_points.txt +77 -25
- {python_openstackclient-9.0.0.dist-info → python_openstackclient-10.1.0.dist-info}/licenses/AUTHORS +9 -0
- python_openstackclient-10.1.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/RECORD +0 -499
- 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.1.0.dist-info}/licenses/LICENSE +0 -0
- {python_openstackclient-9.0.0.dist-info → python_openstackclient-10.1.0.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
# Copyright 2026 Openinfra Foundation
|
|
2
|
+
#
|
|
3
|
+
# All Rights Reserved.
|
|
4
|
+
#
|
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
|
6
|
+
# not use this file except in compliance with the License. You may obtain
|
|
7
|
+
# a copy of the License at
|
|
8
|
+
#
|
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
#
|
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
13
|
+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
14
|
+
# License for the specific language governing permissions and limitations
|
|
15
|
+
# under the License.
|
|
16
|
+
#
|
|
17
|
+
|
|
18
|
+
import operator
|
|
19
|
+
from unittest import mock
|
|
20
|
+
|
|
21
|
+
from osc_lib import exceptions
|
|
22
|
+
from osc_lib import utils as osc_utils
|
|
23
|
+
from osc_lib.utils import columns as column_util
|
|
24
|
+
|
|
25
|
+
from openstackclient.network.v2.bgpvpn import network_association
|
|
26
|
+
from openstackclient.tests.unit.network.v2.bgpvpn import fakes
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
columns_short = tuple(
|
|
30
|
+
col
|
|
31
|
+
for col, _, listing_mode in network_association._attr_map
|
|
32
|
+
if listing_mode in (column_util.LIST_BOTH, column_util.LIST_SHORT_ONLY)
|
|
33
|
+
)
|
|
34
|
+
columns_long = tuple(
|
|
35
|
+
col
|
|
36
|
+
for col, _, listing_mode in network_association._attr_map
|
|
37
|
+
if listing_mode in (column_util.LIST_BOTH, column_util.LIST_LONG_ONLY)
|
|
38
|
+
)
|
|
39
|
+
headers_short = tuple(
|
|
40
|
+
head
|
|
41
|
+
for _, head, listing_mode in network_association._attr_map
|
|
42
|
+
if listing_mode in (column_util.LIST_BOTH, column_util.LIST_SHORT_ONLY)
|
|
43
|
+
)
|
|
44
|
+
headers_long = tuple(
|
|
45
|
+
head
|
|
46
|
+
for _, head, listing_mode in network_association._attr_map
|
|
47
|
+
if listing_mode in (column_util.LIST_BOTH, column_util.LIST_LONG_ONLY)
|
|
48
|
+
)
|
|
49
|
+
sorted_attr_map = sorted(
|
|
50
|
+
network_association._attr_map, key=operator.itemgetter(1)
|
|
51
|
+
)
|
|
52
|
+
sorted_columns = tuple(col for col, _, _ in sorted_attr_map)
|
|
53
|
+
sorted_headers = tuple(head for _, head, _ in sorted_attr_map)
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
def _get_data(attrs, columns=sorted_columns):
|
|
57
|
+
return osc_utils.get_dict_properties(
|
|
58
|
+
attrs, columns, formatters=network_association._formatters
|
|
59
|
+
)
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
class TestCreateNetAssoc(fakes.TestNeutronClientBgpvpn):
|
|
63
|
+
def setUp(self):
|
|
64
|
+
super().setUp()
|
|
65
|
+
self.network_client.find_bgpvpn.side_effect = (
|
|
66
|
+
lambda name_or_id, **kwargs: {'id': name_or_id}
|
|
67
|
+
)
|
|
68
|
+
self.network_client.find_network.side_effect = (
|
|
69
|
+
lambda name_or_id, **kwargs: {'id': name_or_id}
|
|
70
|
+
)
|
|
71
|
+
self.cmd = network_association.CreateBgpvpnNetAssoc(self.app, None)
|
|
72
|
+
|
|
73
|
+
@mock.patch('osc_lib.cli.identity.find_project')
|
|
74
|
+
def test_create_network_association(self, mock_find_project):
|
|
75
|
+
fake_bgpvpn = fakes.create_one_bgpvpn()
|
|
76
|
+
fake_res = fakes.create_one_resource()
|
|
77
|
+
fake_assoc = fakes.create_one_network_association()
|
|
78
|
+
self.network_client.create_bgpvpn_network_association.return_value = (
|
|
79
|
+
fake_assoc
|
|
80
|
+
)
|
|
81
|
+
mock_find_project.return_value = mock.Mock(
|
|
82
|
+
id=fake_bgpvpn['project_id']
|
|
83
|
+
)
|
|
84
|
+
arglist = [
|
|
85
|
+
fake_bgpvpn['id'],
|
|
86
|
+
fake_res['id'],
|
|
87
|
+
'--project',
|
|
88
|
+
fake_bgpvpn['project_id'],
|
|
89
|
+
]
|
|
90
|
+
verifylist = [
|
|
91
|
+
('bgpvpn', fake_bgpvpn['id']),
|
|
92
|
+
('resource', fake_res['id']),
|
|
93
|
+
('project', fake_bgpvpn['project_id']),
|
|
94
|
+
]
|
|
95
|
+
|
|
96
|
+
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
97
|
+
|
|
98
|
+
cols, data = self.cmd.take_action(parsed_args)
|
|
99
|
+
|
|
100
|
+
self.network_client.create_bgpvpn_network_association.assert_called_once_with(
|
|
101
|
+
fake_bgpvpn['id'],
|
|
102
|
+
network_id=fake_res['id'],
|
|
103
|
+
project_id='fake_project_id',
|
|
104
|
+
)
|
|
105
|
+
self.assertEqual(sorted_columns, cols)
|
|
106
|
+
self.assertEqual(_get_data(fake_assoc), data)
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
class TestDeleteNetAssoc(fakes.TestNeutronClientBgpvpn):
|
|
110
|
+
def setUp(self):
|
|
111
|
+
super().setUp()
|
|
112
|
+
self.network_client.find_bgpvpn.side_effect = (
|
|
113
|
+
lambda name_or_id, **kwargs: {'id': name_or_id}
|
|
114
|
+
)
|
|
115
|
+
self.cmd = network_association.DeleteBgpvpnNetAssoc(self.app, None)
|
|
116
|
+
|
|
117
|
+
def test_delete_one_association(self):
|
|
118
|
+
fake_bgpvpn = fakes.create_one_bgpvpn()
|
|
119
|
+
fake_assoc = fakes.create_one_network_association()
|
|
120
|
+
arglist = [
|
|
121
|
+
fake_assoc['id'],
|
|
122
|
+
fake_bgpvpn['id'],
|
|
123
|
+
]
|
|
124
|
+
verifylist = [
|
|
125
|
+
('resource_association_ids', [fake_assoc['id']]),
|
|
126
|
+
('bgpvpn', fake_bgpvpn['id']),
|
|
127
|
+
]
|
|
128
|
+
|
|
129
|
+
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
130
|
+
|
|
131
|
+
result = self.cmd.take_action(parsed_args)
|
|
132
|
+
|
|
133
|
+
self.network_client.delete_bgpvpn_network_association.assert_called_once_with(
|
|
134
|
+
fake_bgpvpn['id'], fake_assoc['id']
|
|
135
|
+
)
|
|
136
|
+
self.assertIsNone(result)
|
|
137
|
+
|
|
138
|
+
def test_delete_multi_association(self):
|
|
139
|
+
count = 3
|
|
140
|
+
fake_bgpvpn = fakes.create_one_bgpvpn()
|
|
141
|
+
fake_assocs = fakes.create_network_associations(count=count)
|
|
142
|
+
fake_assoc_ids = [a['id'] for a in fake_assocs]
|
|
143
|
+
arglist = [*fake_assoc_ids, fake_bgpvpn['id']]
|
|
144
|
+
verifylist = [
|
|
145
|
+
('resource_association_ids', fake_assoc_ids),
|
|
146
|
+
('bgpvpn', fake_bgpvpn['id']),
|
|
147
|
+
]
|
|
148
|
+
|
|
149
|
+
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
150
|
+
|
|
151
|
+
result = self.cmd.take_action(parsed_args)
|
|
152
|
+
|
|
153
|
+
self.network_client.delete_bgpvpn_network_association.assert_has_calls(
|
|
154
|
+
[mock.call(fake_bgpvpn['id'], id) for id in fake_assoc_ids]
|
|
155
|
+
)
|
|
156
|
+
self.assertIsNone(result)
|
|
157
|
+
|
|
158
|
+
def test_delete_multi_association_with_unknown(self):
|
|
159
|
+
count = 3
|
|
160
|
+
fake_bgpvpn = fakes.create_one_bgpvpn()
|
|
161
|
+
fake_assocs = fakes.create_network_associations(count=count)
|
|
162
|
+
fake_assoc_ids = [a['id'] for a in fake_assocs]
|
|
163
|
+
|
|
164
|
+
def raise_unknown_resource(bgpvpn_id, association_id):
|
|
165
|
+
if str(count - 2) in association_id:
|
|
166
|
+
raise Exception()
|
|
167
|
+
|
|
168
|
+
self.network_client.delete_bgpvpn_network_association.side_effect = (
|
|
169
|
+
raise_unknown_resource
|
|
170
|
+
)
|
|
171
|
+
arglist = [*fake_assoc_ids, fake_bgpvpn['id']]
|
|
172
|
+
verifylist = [
|
|
173
|
+
('resource_association_ids', fake_assoc_ids),
|
|
174
|
+
('bgpvpn', fake_bgpvpn['id']),
|
|
175
|
+
]
|
|
176
|
+
|
|
177
|
+
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
178
|
+
|
|
179
|
+
self.assertRaises(
|
|
180
|
+
exceptions.CommandError, self.cmd.take_action, parsed_args
|
|
181
|
+
)
|
|
182
|
+
|
|
183
|
+
self.network_client.delete_bgpvpn_network_association.assert_has_calls(
|
|
184
|
+
[mock.call(fake_bgpvpn['id'], id) for id in fake_assoc_ids]
|
|
185
|
+
)
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
class TestListNetAssoc(fakes.TestNeutronClientBgpvpn):
|
|
189
|
+
def setUp(self):
|
|
190
|
+
super().setUp()
|
|
191
|
+
self.network_client.find_bgpvpn.side_effect = (
|
|
192
|
+
lambda name_or_id, **kwargs: {'id': name_or_id}
|
|
193
|
+
)
|
|
194
|
+
self.cmd = network_association.ListBgpvpnNetAssoc(self.app, None)
|
|
195
|
+
|
|
196
|
+
def test_list_network_associations(self):
|
|
197
|
+
count = 3
|
|
198
|
+
fake_bgpvpn = fakes.create_one_bgpvpn()
|
|
199
|
+
fake_assocs = fakes.create_network_associations(count=count)
|
|
200
|
+
self.network_client.bgpvpn_network_associations.return_value = (
|
|
201
|
+
fake_assocs
|
|
202
|
+
)
|
|
203
|
+
arglist = [
|
|
204
|
+
fake_bgpvpn['id'],
|
|
205
|
+
]
|
|
206
|
+
verifylist = [
|
|
207
|
+
('bgpvpn', fake_bgpvpn['id']),
|
|
208
|
+
]
|
|
209
|
+
|
|
210
|
+
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
211
|
+
|
|
212
|
+
headers, data = self.cmd.take_action(parsed_args)
|
|
213
|
+
|
|
214
|
+
self.network_client.bgpvpn_network_associations.assert_called_once_with(
|
|
215
|
+
fake_bgpvpn['id'], retrieve_all=True
|
|
216
|
+
)
|
|
217
|
+
self.assertEqual(headers, list(headers_short))
|
|
218
|
+
self.assertEqual(
|
|
219
|
+
list(data),
|
|
220
|
+
[_get_data(a, columns_short) for a in fake_assocs],
|
|
221
|
+
)
|
|
222
|
+
|
|
223
|
+
def test_list_network_associations_long_mode(self):
|
|
224
|
+
count = 3
|
|
225
|
+
fake_bgpvpn = fakes.create_one_bgpvpn()
|
|
226
|
+
fake_assocs = fakes.create_network_associations(count=count)
|
|
227
|
+
self.network_client.bgpvpn_network_associations.return_value = (
|
|
228
|
+
fake_assocs
|
|
229
|
+
)
|
|
230
|
+
arglist = [
|
|
231
|
+
'--long',
|
|
232
|
+
fake_bgpvpn['id'],
|
|
233
|
+
]
|
|
234
|
+
verifylist = [
|
|
235
|
+
('long', True),
|
|
236
|
+
('bgpvpn', fake_bgpvpn['id']),
|
|
237
|
+
]
|
|
238
|
+
|
|
239
|
+
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
240
|
+
|
|
241
|
+
headers, data = self.cmd.take_action(parsed_args)
|
|
242
|
+
|
|
243
|
+
self.network_client.bgpvpn_network_associations.assert_called_once_with(
|
|
244
|
+
fake_bgpvpn['id'], retrieve_all=True
|
|
245
|
+
)
|
|
246
|
+
self.assertEqual(headers, list(headers_long))
|
|
247
|
+
self.assertEqual(
|
|
248
|
+
list(data),
|
|
249
|
+
[_get_data(a, columns_long) for a in fake_assocs],
|
|
250
|
+
)
|
|
251
|
+
|
|
252
|
+
|
|
253
|
+
class TestShowNetAssoc(fakes.TestNeutronClientBgpvpn):
|
|
254
|
+
def setUp(self):
|
|
255
|
+
super().setUp()
|
|
256
|
+
self.network_client.find_bgpvpn.side_effect = (
|
|
257
|
+
lambda name_or_id, **kwargs: {'id': name_or_id}
|
|
258
|
+
)
|
|
259
|
+
self.cmd = network_association.ShowBgpvpnNetAssoc(self.app, None)
|
|
260
|
+
|
|
261
|
+
def test_show_network_association(self):
|
|
262
|
+
fake_bgpvpn = fakes.create_one_bgpvpn()
|
|
263
|
+
fake_assoc = fakes.create_one_network_association()
|
|
264
|
+
self.network_client.get_bgpvpn_network_association.return_value = (
|
|
265
|
+
fake_assoc
|
|
266
|
+
)
|
|
267
|
+
|
|
268
|
+
arglist = [
|
|
269
|
+
fake_assoc['id'],
|
|
270
|
+
fake_bgpvpn['id'],
|
|
271
|
+
]
|
|
272
|
+
verifylist = [
|
|
273
|
+
('resource_association_id', fake_assoc['id']),
|
|
274
|
+
('bgpvpn', fake_bgpvpn['id']),
|
|
275
|
+
]
|
|
276
|
+
|
|
277
|
+
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
278
|
+
|
|
279
|
+
columns, data = self.cmd.take_action(parsed_args)
|
|
280
|
+
|
|
281
|
+
self.network_client.get_bgpvpn_network_association.assert_called_once_with(
|
|
282
|
+
fake_bgpvpn['id'], fake_assoc['id']
|
|
283
|
+
)
|
|
284
|
+
self.assertEqual(sorted_columns, columns)
|
|
285
|
+
self.assertEqual(data, _get_data(fake_assoc))
|
|
@@ -0,0 +1,384 @@
|
|
|
1
|
+
# Copyright 2026 Openinfra Foundation
|
|
2
|
+
#
|
|
3
|
+
# All Rights Reserved.
|
|
4
|
+
#
|
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
|
6
|
+
# not use this file except in compliance with the License. You may obtain
|
|
7
|
+
# a copy of the License at
|
|
8
|
+
#
|
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
#
|
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
13
|
+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
14
|
+
# License for the specific language governing permissions and limitations
|
|
15
|
+
# under the License.
|
|
16
|
+
#
|
|
17
|
+
|
|
18
|
+
import operator
|
|
19
|
+
from unittest import mock
|
|
20
|
+
|
|
21
|
+
from osc_lib import exceptions
|
|
22
|
+
from osc_lib import utils as osc_utils
|
|
23
|
+
from osc_lib.utils import columns as column_util
|
|
24
|
+
|
|
25
|
+
from openstackclient.network.v2.bgpvpn import port_association
|
|
26
|
+
from openstackclient.tests.unit.network.v2.bgpvpn import fakes
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
columns_short = tuple(
|
|
30
|
+
col
|
|
31
|
+
for col, _, listing_mode in port_association._attr_map
|
|
32
|
+
if listing_mode in (column_util.LIST_BOTH, column_util.LIST_SHORT_ONLY)
|
|
33
|
+
)
|
|
34
|
+
columns_long = tuple(
|
|
35
|
+
col
|
|
36
|
+
for col, _, listing_mode in port_association._attr_map
|
|
37
|
+
if listing_mode in (column_util.LIST_BOTH, column_util.LIST_LONG_ONLY)
|
|
38
|
+
)
|
|
39
|
+
headers_short = tuple(
|
|
40
|
+
head
|
|
41
|
+
for _, head, listing_mode in port_association._attr_map
|
|
42
|
+
if listing_mode in (column_util.LIST_BOTH, column_util.LIST_SHORT_ONLY)
|
|
43
|
+
)
|
|
44
|
+
headers_long = tuple(
|
|
45
|
+
head
|
|
46
|
+
for _, head, listing_mode in port_association._attr_map
|
|
47
|
+
if listing_mode in (column_util.LIST_BOTH, column_util.LIST_LONG_ONLY)
|
|
48
|
+
)
|
|
49
|
+
sorted_attr_map = sorted(
|
|
50
|
+
port_association._attr_map, key=operator.itemgetter(1)
|
|
51
|
+
)
|
|
52
|
+
sorted_columns = tuple(col for col, _, _ in sorted_attr_map)
|
|
53
|
+
sorted_headers = tuple(head for _, head, _ in sorted_attr_map)
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
def _get_data(attrs, columns=sorted_columns):
|
|
57
|
+
return osc_utils.get_dict_properties(
|
|
58
|
+
attrs, columns, formatters=port_association._formatters
|
|
59
|
+
)
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
class TestCreatePortAssoc(fakes.TestNeutronClientBgpvpn):
|
|
63
|
+
def setUp(self):
|
|
64
|
+
super().setUp()
|
|
65
|
+
self.cmd = port_association.CreateBgpvpnPortAssoc(self.app, None)
|
|
66
|
+
self.fake_bgpvpn = fakes.create_one_bgpvpn()
|
|
67
|
+
self.fake_port = fakes.create_one_resource()
|
|
68
|
+
self.network_client.find_bgpvpn.side_effect = (
|
|
69
|
+
lambda name_or_id, **kwargs: {'id': name_or_id}
|
|
70
|
+
)
|
|
71
|
+
self.network_client.find_port.side_effect = (
|
|
72
|
+
lambda name_or_id, **kwargs: {'id': name_or_id}
|
|
73
|
+
)
|
|
74
|
+
self.fake_project = mock.Mock(id='fake_project_id')
|
|
75
|
+
self.identity_sdk_client.find_project = mock.Mock(
|
|
76
|
+
return_value=self.fake_project
|
|
77
|
+
)
|
|
78
|
+
|
|
79
|
+
@mock.patch('osc_lib.cli.identity.find_project')
|
|
80
|
+
def test_create_port_association(self, mock_find_project):
|
|
81
|
+
fake_assoc = fakes.create_one_port_association()
|
|
82
|
+
self.network_client.create_bgpvpn_port_association.return_value = (
|
|
83
|
+
fake_assoc
|
|
84
|
+
)
|
|
85
|
+
mock_find_project.return_value = mock.Mock(
|
|
86
|
+
id=self.fake_bgpvpn['project_id']
|
|
87
|
+
)
|
|
88
|
+
arglist = [
|
|
89
|
+
self.fake_bgpvpn['id'],
|
|
90
|
+
self.fake_port['id'],
|
|
91
|
+
'--project',
|
|
92
|
+
self.fake_bgpvpn['project_id'],
|
|
93
|
+
]
|
|
94
|
+
verifylist = [
|
|
95
|
+
('bgpvpn', self.fake_bgpvpn['id']),
|
|
96
|
+
('port', self.fake_port['id']),
|
|
97
|
+
('project', self.fake_bgpvpn['project_id']),
|
|
98
|
+
]
|
|
99
|
+
|
|
100
|
+
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
101
|
+
|
|
102
|
+
cols, _data = self.cmd.take_action(parsed_args)
|
|
103
|
+
|
|
104
|
+
self.network_client.create_bgpvpn_port_association.assert_called_once_with(
|
|
105
|
+
self.fake_bgpvpn['id'],
|
|
106
|
+
port_id=self.fake_port['id'],
|
|
107
|
+
project_id='fake_project_id',
|
|
108
|
+
routes=[],
|
|
109
|
+
)
|
|
110
|
+
self.assertIn('id', cols)
|
|
111
|
+
self.assertIn('port_id', cols)
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
class TestSetPortAssoc(fakes.TestNeutronClientBgpvpn):
|
|
115
|
+
def setUp(self):
|
|
116
|
+
super().setUp()
|
|
117
|
+
self.cmd = port_association.SetBgpvpnPortAssoc(self.app, None)
|
|
118
|
+
self.fake_bgpvpn = fakes.create_one_bgpvpn()
|
|
119
|
+
self.network_client.find_bgpvpn.side_effect = (
|
|
120
|
+
lambda name_or_id, **kwargs: {'id': name_or_id}
|
|
121
|
+
)
|
|
122
|
+
self.network_client.find_bgpvpn_port_association.return_value = {
|
|
123
|
+
'routes': []
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
def test_set_port_association_advertise(self):
|
|
127
|
+
fake_assoc = fakes.create_one_port_association()
|
|
128
|
+
arglist = [
|
|
129
|
+
fake_assoc['id'],
|
|
130
|
+
self.fake_bgpvpn['id'],
|
|
131
|
+
'--advertise-fixed-ips',
|
|
132
|
+
]
|
|
133
|
+
verifylist = [
|
|
134
|
+
('port_association_id', fake_assoc['id']),
|
|
135
|
+
('bgpvpn', self.fake_bgpvpn['id']),
|
|
136
|
+
]
|
|
137
|
+
|
|
138
|
+
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
139
|
+
result = self.cmd.take_action(parsed_args)
|
|
140
|
+
|
|
141
|
+
self.network_client.update_bgpvpn_port_association.assert_called_once_with(
|
|
142
|
+
self.fake_bgpvpn['id'],
|
|
143
|
+
fake_assoc['id'],
|
|
144
|
+
advertise_fixed_ips=True,
|
|
145
|
+
routes=[],
|
|
146
|
+
)
|
|
147
|
+
self.assertIsNone(result)
|
|
148
|
+
|
|
149
|
+
def test_set_port_association_no_advertise(self):
|
|
150
|
+
fake_assoc = fakes.create_one_port_association()
|
|
151
|
+
arglist = [
|
|
152
|
+
fake_assoc['id'],
|
|
153
|
+
self.fake_bgpvpn['id'],
|
|
154
|
+
'--no-advertise-fixed-ips',
|
|
155
|
+
]
|
|
156
|
+
verifylist = [
|
|
157
|
+
('port_association_id', fake_assoc['id']),
|
|
158
|
+
('bgpvpn', self.fake_bgpvpn['id']),
|
|
159
|
+
]
|
|
160
|
+
|
|
161
|
+
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
162
|
+
result = self.cmd.take_action(parsed_args)
|
|
163
|
+
|
|
164
|
+
self.network_client.update_bgpvpn_port_association.assert_called_once_with(
|
|
165
|
+
self.fake_bgpvpn['id'],
|
|
166
|
+
fake_assoc['id'],
|
|
167
|
+
advertise_fixed_ips=False,
|
|
168
|
+
routes=[],
|
|
169
|
+
)
|
|
170
|
+
self.assertIsNone(result)
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
class TestUnsetPortAssoc(fakes.TestNeutronClientBgpvpn):
|
|
174
|
+
def setUp(self):
|
|
175
|
+
super().setUp()
|
|
176
|
+
self.cmd = port_association.UnsetBgpvpnPortAssoc(self.app, None)
|
|
177
|
+
self.fake_bgpvpn = fakes.create_one_bgpvpn()
|
|
178
|
+
self.network_client.find_bgpvpn.side_effect = (
|
|
179
|
+
lambda name_or_id, **kwargs: {'id': name_or_id}
|
|
180
|
+
)
|
|
181
|
+
self.network_client.find_bgpvpn_port_association.return_value = {
|
|
182
|
+
'routes': []
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
def test_unset_port_association_advertise(self):
|
|
186
|
+
fake_assoc = fakes.create_one_port_association()
|
|
187
|
+
arglist = [
|
|
188
|
+
fake_assoc['id'],
|
|
189
|
+
self.fake_bgpvpn['id'],
|
|
190
|
+
'--advertise-fixed-ips',
|
|
191
|
+
]
|
|
192
|
+
verifylist = [
|
|
193
|
+
('port_association_id', fake_assoc['id']),
|
|
194
|
+
('bgpvpn', self.fake_bgpvpn['id']),
|
|
195
|
+
]
|
|
196
|
+
|
|
197
|
+
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
198
|
+
result = self.cmd.take_action(parsed_args)
|
|
199
|
+
|
|
200
|
+
self.network_client.update_bgpvpn_port_association.assert_called_once_with(
|
|
201
|
+
self.fake_bgpvpn['id'],
|
|
202
|
+
fake_assoc['id'],
|
|
203
|
+
advertise_fixed_ips=False,
|
|
204
|
+
routes=[],
|
|
205
|
+
)
|
|
206
|
+
self.assertIsNone(result)
|
|
207
|
+
|
|
208
|
+
|
|
209
|
+
class TestDeletePortAssoc(fakes.TestNeutronClientBgpvpn):
|
|
210
|
+
def setUp(self):
|
|
211
|
+
super().setUp()
|
|
212
|
+
self.network_client.find_bgpvpn.side_effect = (
|
|
213
|
+
lambda name_or_id, **kwargs: {'id': name_or_id}
|
|
214
|
+
)
|
|
215
|
+
self.cmd = port_association.DeleteBgpvpnPortAssoc(self.app, None)
|
|
216
|
+
|
|
217
|
+
def test_delete_one_association(self):
|
|
218
|
+
fake_bgpvpn = fakes.create_one_bgpvpn()
|
|
219
|
+
fake_assoc = fakes.create_one_port_association()
|
|
220
|
+
arglist = [
|
|
221
|
+
fake_assoc['id'],
|
|
222
|
+
fake_bgpvpn['id'],
|
|
223
|
+
]
|
|
224
|
+
verifylist = [
|
|
225
|
+
('port_association_ids', [fake_assoc['id']]),
|
|
226
|
+
('bgpvpn', fake_bgpvpn['id']),
|
|
227
|
+
]
|
|
228
|
+
|
|
229
|
+
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
230
|
+
|
|
231
|
+
result = self.cmd.take_action(parsed_args)
|
|
232
|
+
|
|
233
|
+
self.network_client.delete_bgpvpn_port_association.assert_called_once_with(
|
|
234
|
+
fake_bgpvpn['id'], fake_assoc['id']
|
|
235
|
+
)
|
|
236
|
+
self.assertIsNone(result)
|
|
237
|
+
|
|
238
|
+
def test_delete_multi_association(self):
|
|
239
|
+
count = 3
|
|
240
|
+
fake_bgpvpn = fakes.create_one_bgpvpn()
|
|
241
|
+
fake_assocs = fakes.create_port_associations(count=count)
|
|
242
|
+
fake_assoc_ids = [a['id'] for a in fake_assocs]
|
|
243
|
+
arglist = [*fake_assoc_ids, fake_bgpvpn['id']]
|
|
244
|
+
verifylist = [
|
|
245
|
+
('port_association_ids', fake_assoc_ids),
|
|
246
|
+
('bgpvpn', fake_bgpvpn['id']),
|
|
247
|
+
]
|
|
248
|
+
|
|
249
|
+
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
250
|
+
|
|
251
|
+
result = self.cmd.take_action(parsed_args)
|
|
252
|
+
|
|
253
|
+
self.network_client.delete_bgpvpn_port_association.assert_has_calls(
|
|
254
|
+
[mock.call(fake_bgpvpn['id'], id) for id in fake_assoc_ids]
|
|
255
|
+
)
|
|
256
|
+
self.assertIsNone(result)
|
|
257
|
+
|
|
258
|
+
def test_delete_multi_association_with_unknown(self):
|
|
259
|
+
count = 3
|
|
260
|
+
fake_bgpvpn = fakes.create_one_bgpvpn()
|
|
261
|
+
fake_assocs = fakes.create_port_associations(count=count)
|
|
262
|
+
fake_assoc_ids = [a['id'] for a in fake_assocs]
|
|
263
|
+
|
|
264
|
+
def raise_unknown_resource(bgpvpn_id, association_id):
|
|
265
|
+
if str(count - 2) in association_id:
|
|
266
|
+
raise Exception()
|
|
267
|
+
|
|
268
|
+
self.network_client.delete_bgpvpn_port_association.side_effect = (
|
|
269
|
+
raise_unknown_resource
|
|
270
|
+
)
|
|
271
|
+
arglist = [*fake_assoc_ids, fake_bgpvpn['id']]
|
|
272
|
+
verifylist = [
|
|
273
|
+
('port_association_ids', fake_assoc_ids),
|
|
274
|
+
('bgpvpn', fake_bgpvpn['id']),
|
|
275
|
+
]
|
|
276
|
+
|
|
277
|
+
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
278
|
+
|
|
279
|
+
self.assertRaises(
|
|
280
|
+
exceptions.CommandError, self.cmd.take_action, parsed_args
|
|
281
|
+
)
|
|
282
|
+
|
|
283
|
+
self.network_client.delete_bgpvpn_port_association.assert_has_calls(
|
|
284
|
+
[mock.call(fake_bgpvpn['id'], id) for id in fake_assoc_ids]
|
|
285
|
+
)
|
|
286
|
+
|
|
287
|
+
|
|
288
|
+
class TestListPortAssoc(fakes.TestNeutronClientBgpvpn):
|
|
289
|
+
def setUp(self):
|
|
290
|
+
super().setUp()
|
|
291
|
+
self.network_client.find_bgpvpn.side_effect = (
|
|
292
|
+
lambda name_or_id, **kwargs: {'id': name_or_id}
|
|
293
|
+
)
|
|
294
|
+
self.cmd = port_association.ListBgpvpnPortAssoc(self.app, None)
|
|
295
|
+
|
|
296
|
+
def test_list_port_associations(self):
|
|
297
|
+
count = 3
|
|
298
|
+
fake_bgpvpn = fakes.create_one_bgpvpn()
|
|
299
|
+
fake_assocs = fakes.create_port_associations(count=count)
|
|
300
|
+
self.network_client.bgpvpn_port_associations.return_value = fake_assocs
|
|
301
|
+
arglist = [
|
|
302
|
+
fake_bgpvpn['id'],
|
|
303
|
+
]
|
|
304
|
+
verifylist = [
|
|
305
|
+
('bgpvpn', fake_bgpvpn['id']),
|
|
306
|
+
]
|
|
307
|
+
|
|
308
|
+
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
309
|
+
|
|
310
|
+
headers, data = self.cmd.take_action(parsed_args)
|
|
311
|
+
|
|
312
|
+
self.network_client.bgpvpn_port_associations.assert_called_once_with(
|
|
313
|
+
fake_bgpvpn['id'], retrieve_all=True
|
|
314
|
+
)
|
|
315
|
+
self.assertEqual(headers, list(headers_short))
|
|
316
|
+
self.assertEqual(
|
|
317
|
+
list(data),
|
|
318
|
+
[_get_data(a, columns_short) for a in fake_assocs],
|
|
319
|
+
)
|
|
320
|
+
|
|
321
|
+
def test_list_port_associations_long_mode(self):
|
|
322
|
+
count = 3
|
|
323
|
+
fake_bgpvpn = fakes.create_one_bgpvpn()
|
|
324
|
+
fake_assocs = fakes.create_port_associations(count=count)
|
|
325
|
+
self.network_client.bgpvpn_port_associations.return_value = fake_assocs
|
|
326
|
+
arglist = [
|
|
327
|
+
'--long',
|
|
328
|
+
fake_bgpvpn['id'],
|
|
329
|
+
]
|
|
330
|
+
verifylist = [
|
|
331
|
+
('long', True),
|
|
332
|
+
('bgpvpn', fake_bgpvpn['id']),
|
|
333
|
+
]
|
|
334
|
+
|
|
335
|
+
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
336
|
+
|
|
337
|
+
headers, data = self.cmd.take_action(parsed_args)
|
|
338
|
+
|
|
339
|
+
self.network_client.bgpvpn_port_associations.assert_called_once_with(
|
|
340
|
+
fake_bgpvpn['id'], retrieve_all=True
|
|
341
|
+
)
|
|
342
|
+
self.assertEqual(headers, list(headers_long))
|
|
343
|
+
self.assertEqual(
|
|
344
|
+
list(data),
|
|
345
|
+
[_get_data(a, columns_long) for a in fake_assocs],
|
|
346
|
+
)
|
|
347
|
+
|
|
348
|
+
|
|
349
|
+
class TestShowPortAssoc(fakes.TestNeutronClientBgpvpn):
|
|
350
|
+
def setUp(self):
|
|
351
|
+
super().setUp()
|
|
352
|
+
self.network_client.find_bgpvpn.side_effect = (
|
|
353
|
+
lambda name_or_id, **kwargs: {'id': name_or_id}
|
|
354
|
+
)
|
|
355
|
+
self.cmd = port_association.ShowBgpvpnPortAssoc(self.app, None)
|
|
356
|
+
|
|
357
|
+
def test_show_port_association(self):
|
|
358
|
+
fake_bgpvpn = fakes.create_one_bgpvpn()
|
|
359
|
+
fake_assoc = fakes.create_one_port_association()
|
|
360
|
+
self.network_client.get_bgpvpn_port_association.return_value = (
|
|
361
|
+
fake_assoc
|
|
362
|
+
)
|
|
363
|
+
|
|
364
|
+
arglist = [
|
|
365
|
+
fake_assoc['id'],
|
|
366
|
+
fake_bgpvpn['id'],
|
|
367
|
+
]
|
|
368
|
+
verifylist = [
|
|
369
|
+
('port_association_id', fake_assoc['id']),
|
|
370
|
+
('bgpvpn', fake_bgpvpn['id']),
|
|
371
|
+
]
|
|
372
|
+
|
|
373
|
+
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
374
|
+
|
|
375
|
+
cols, _data = self.cmd.take_action(parsed_args)
|
|
376
|
+
|
|
377
|
+
self.network_client.get_bgpvpn_port_association.assert_called_once_with(
|
|
378
|
+
fake_bgpvpn['id'], fake_assoc['id']
|
|
379
|
+
)
|
|
380
|
+
# _transform_resource removes 'routes' and only adds
|
|
381
|
+
# prefix_routes/bgpvpn_routes if routes exist, so with empty
|
|
382
|
+
# routes the show columns won't include those fields
|
|
383
|
+
self.assertIn('id', cols)
|
|
384
|
+
self.assertIn('port_id', cols)
|