python-openstackclient 8.3.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 +126 -114
- 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 +251 -171
- 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 +103 -41
- 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 +26 -12
- 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 +71 -50
- 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 +115 -92
- openstackclient/identity/v3/mapping.py +26 -13
- openstackclient/identity/v3/policy.py +23 -12
- openstackclient/identity/v3/project.py +211 -122
- openstackclient/identity/v3/region.py +36 -16
- openstackclient/identity/v3/registered_limit.py +116 -109
- 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 -17
- 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 +76 -49
- 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_limit.py +47 -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/image/v2/test_metadef_objects.py +69 -0
- 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 +56 -138
- 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 +62 -23
- 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 +17 -104
- 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_limit.py +197 -145
- openstackclient/tests/unit/identity/v3/test_project.py +831 -512
- openstackclient/tests/unit/identity/v3/test_protocol.py +97 -88
- openstackclient/tests/unit/identity/v3/test_registered_limit.py +355 -220
- openstackclient/tests/unit/identity/v3/test_user.py +4 -4
- openstackclient/tests/unit/image/v2/test_image.py +16 -16
- 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_consistency_group.py +8 -2
- openstackclient/tests/unit/volume/v2/test_volume.py +7 -6
- 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 +94 -15
- 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 +37 -25
- openstackclient/volume/v2/consistency_group_snapshot.py +27 -12
- openstackclient/volume/v2/qos_specs.py +30 -19
- openstackclient/volume/v2/service.py +17 -6
- openstackclient/volume/v2/volume.py +69 -34
- openstackclient/volume/v2/volume_backend.py +19 -6
- openstackclient/volume/v2/volume_backup.py +48 -22
- openstackclient/volume/v2/volume_host.py +6 -4
- openstackclient/volume/v2/volume_snapshot.py +52 -26
- openstackclient/volume/v2/volume_transfer_request.py +33 -15
- openstackclient/volume/v2/volume_type.py +46 -27
- 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 +103 -46
- openstackclient/volume/v3/volume_attachment.py +43 -21
- openstackclient/volume/v3/volume_backup.py +55 -26
- 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 +71 -34
- openstackclient/volume/v3/volume_transfer_request.py +33 -15
- openstackclient/volume/v3/volume_type.py +45 -27
- {python_openstackclient-8.3.0.dist-info → python_openstackclient-10.0.0.dist-info}/METADATA +6 -6
- {python_openstackclient-8.3.0.dist-info → python_openstackclient-10.0.0.dist-info}/RECORD +279 -267
- {python_openstackclient-8.3.0.dist-info → python_openstackclient-10.0.0.dist-info}/WHEEL +1 -1
- {python_openstackclient-8.3.0.dist-info → python_openstackclient-10.0.0.dist-info}/entry_points.txt +53 -1
- {python_openstackclient-8.3.0.dist-info → python_openstackclient-10.0.0.dist-info}/licenses/AUTHORS +9 -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-8.3.0.dist-info/pbr.json +0 -1
- /openstackclient/{tests/functional/image/v1 → network/v2/bgpvpn}/__init__.py +0 -0
- {python_openstackclient-8.3.0.dist-info → python_openstackclient-10.0.0.dist-info}/licenses/LICENSE +0 -0
- {python_openstackclient-8.3.0.dist-info → python_openstackclient-10.0.0.dist-info}/top_level.txt +0 -0
|
@@ -12,25 +12,32 @@
|
|
|
12
12
|
|
|
13
13
|
"""Network action implementations"""
|
|
14
14
|
|
|
15
|
+
import argparse
|
|
16
|
+
from collections.abc import Iterable, Sequence
|
|
17
|
+
import logging
|
|
18
|
+
from typing import Any
|
|
19
|
+
|
|
15
20
|
from cliff import columns as cliff_columns
|
|
16
21
|
from osc_lib.cli import format_columns
|
|
17
22
|
from osc_lib import exceptions
|
|
18
23
|
from osc_lib import utils
|
|
19
24
|
from osc_lib.utils import tags as _tag
|
|
20
25
|
|
|
21
|
-
from openstackclient
|
|
26
|
+
from openstackclient import command
|
|
22
27
|
from openstackclient.i18n import _
|
|
23
28
|
from openstackclient.identity import common as identity_common
|
|
24
29
|
from openstackclient.network import common
|
|
25
30
|
|
|
31
|
+
LOG = logging.getLogger(__name__)
|
|
32
|
+
|
|
26
33
|
|
|
27
34
|
class AdminStateColumn(cliff_columns.FormattableColumn[bool]):
|
|
28
|
-
def human_readable(self):
|
|
35
|
+
def human_readable(self) -> str:
|
|
29
36
|
return 'UP' if self._value else 'DOWN'
|
|
30
37
|
|
|
31
38
|
|
|
32
39
|
class RouterExternalColumn(cliff_columns.FormattableColumn[bool]):
|
|
33
|
-
def human_readable(self):
|
|
40
|
+
def human_readable(self) -> str:
|
|
34
41
|
return 'External' if self._value else 'Internal'
|
|
35
42
|
|
|
36
43
|
|
|
@@ -47,7 +54,7 @@ _formatters = {
|
|
|
47
54
|
}
|
|
48
55
|
|
|
49
56
|
|
|
50
|
-
def _get_columns_network(item):
|
|
57
|
+
def _get_columns_network(item: Any) -> tuple[tuple[str, ...], tuple[str, ...]]:
|
|
51
58
|
column_map = {
|
|
52
59
|
'subnet_ids': 'subnets',
|
|
53
60
|
'is_admin_state_up': 'admin_state_up',
|
|
@@ -67,11 +74,13 @@ def _get_columns_network(item):
|
|
|
67
74
|
)
|
|
68
75
|
|
|
69
76
|
|
|
70
|
-
def _get_columns_compute(item):
|
|
77
|
+
def _get_columns_compute(item: Any) -> tuple[tuple[str, ...], tuple[str, ...]]:
|
|
71
78
|
return utils.get_osc_show_columns_for_sdk_resource(item, {})
|
|
72
79
|
|
|
73
80
|
|
|
74
|
-
def _get_attrs_network(
|
|
81
|
+
def _get_attrs_network(
|
|
82
|
+
client_manager: Any, parsed_args: argparse.Namespace
|
|
83
|
+
) -> dict[str, Any]:
|
|
75
84
|
attrs = {}
|
|
76
85
|
if parsed_args.name is not None:
|
|
77
86
|
attrs['name'] = parsed_args.name
|
|
@@ -143,7 +152,9 @@ def _get_attrs_network(client_manager, parsed_args):
|
|
|
143
152
|
return attrs
|
|
144
153
|
|
|
145
154
|
|
|
146
|
-
def _get_attrs_compute(
|
|
155
|
+
def _get_attrs_compute(
|
|
156
|
+
client_manager: Any, parsed_args: argparse.Namespace
|
|
157
|
+
) -> dict[str, Any]:
|
|
147
158
|
attrs = {}
|
|
148
159
|
if parsed_args.name is not None:
|
|
149
160
|
attrs['name'] = parsed_args.name
|
|
@@ -156,7 +167,7 @@ def _get_attrs_compute(client_manager, parsed_args):
|
|
|
156
167
|
return attrs
|
|
157
168
|
|
|
158
169
|
|
|
159
|
-
def _add_additional_network_options(parser):
|
|
170
|
+
def _add_additional_network_options(parser: argparse.ArgumentParser) -> None:
|
|
160
171
|
# Add additional network options
|
|
161
172
|
|
|
162
173
|
parser.add_argument(
|
|
@@ -199,12 +210,11 @@ def _add_additional_network_options(parser):
|
|
|
199
210
|
|
|
200
211
|
# TODO(sindhu): Use the SDK resource mapped attribute names once the
|
|
201
212
|
# OSC minimum requirements include SDK 1.0.
|
|
202
|
-
class CreateNetwork(
|
|
203
|
-
common.NetworkAndComputeShowOne, common.NeutronCommandWithExtraArgs
|
|
204
|
-
):
|
|
213
|
+
class CreateNetwork(command.ShowOne, common.NeutronCommandWithExtraArgs):
|
|
205
214
|
_description = _("Create new network")
|
|
206
215
|
|
|
207
|
-
def
|
|
216
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
217
|
+
parser = super().get_parser(prog_name)
|
|
208
218
|
parser.add_argument(
|
|
209
219
|
'name', metavar='<name>', help=_("New network name")
|
|
210
220
|
)
|
|
@@ -220,35 +230,32 @@ class CreateNetwork(
|
|
|
220
230
|
action='store_true',
|
|
221
231
|
help=_("Do not share the network between projects"),
|
|
222
232
|
)
|
|
223
|
-
return parser
|
|
224
|
-
|
|
225
|
-
def update_parser_network(self, parser):
|
|
226
233
|
admin_group = parser.add_mutually_exclusive_group()
|
|
227
234
|
admin_group.add_argument(
|
|
228
235
|
'--enable',
|
|
229
236
|
action='store_true',
|
|
230
237
|
default=True,
|
|
231
|
-
help=
|
|
238
|
+
help=_("Enable network (default)"),
|
|
232
239
|
)
|
|
233
240
|
admin_group.add_argument(
|
|
234
241
|
'--disable',
|
|
235
242
|
action='store_true',
|
|
236
|
-
help=
|
|
243
|
+
help=_("Disable network"),
|
|
237
244
|
)
|
|
238
245
|
parser.add_argument(
|
|
239
246
|
'--project',
|
|
240
247
|
metavar='<project>',
|
|
241
|
-
help=
|
|
248
|
+
help=_("Owner's project (name or ID)"),
|
|
242
249
|
)
|
|
243
250
|
parser.add_argument(
|
|
244
251
|
'--description',
|
|
245
252
|
metavar='<description>',
|
|
246
|
-
help=
|
|
253
|
+
help=_("Set network description"),
|
|
247
254
|
)
|
|
248
255
|
parser.add_argument(
|
|
249
256
|
'--mtu',
|
|
250
257
|
metavar='<mtu>',
|
|
251
|
-
help=
|
|
258
|
+
help=_("Set network mtu"),
|
|
252
259
|
)
|
|
253
260
|
identity_common.add_project_domain_option_to_parser(parser)
|
|
254
261
|
parser.add_argument(
|
|
@@ -256,133 +263,99 @@ class CreateNetwork(
|
|
|
256
263
|
action='append',
|
|
257
264
|
dest='availability_zone_hints',
|
|
258
265
|
metavar='<availability-zone>',
|
|
259
|
-
help=
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
"repeat option to set multiple availability zones)"
|
|
264
|
-
)
|
|
266
|
+
help=_(
|
|
267
|
+
"Availability Zone in which to create this network "
|
|
268
|
+
"(Network Availability Zone extension required, "
|
|
269
|
+
"repeat option to set multiple availability zones)"
|
|
265
270
|
),
|
|
266
271
|
)
|
|
267
272
|
port_security_group = parser.add_mutually_exclusive_group()
|
|
268
273
|
port_security_group.add_argument(
|
|
269
274
|
'--enable-port-security',
|
|
270
275
|
action='store_true',
|
|
271
|
-
help=
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
"this network (default)"
|
|
275
|
-
)
|
|
276
|
+
help=_(
|
|
277
|
+
"Enable port security by default for ports created on "
|
|
278
|
+
"this network (default)"
|
|
276
279
|
),
|
|
277
280
|
)
|
|
278
281
|
port_security_group.add_argument(
|
|
279
282
|
'--disable-port-security',
|
|
280
283
|
action='store_true',
|
|
281
|
-
help=
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
"this network"
|
|
285
|
-
)
|
|
284
|
+
help=_(
|
|
285
|
+
"Disable port security by default for ports created on "
|
|
286
|
+
"this network"
|
|
286
287
|
),
|
|
287
288
|
)
|
|
288
289
|
external_router_grp = parser.add_mutually_exclusive_group()
|
|
289
290
|
external_router_grp.add_argument(
|
|
290
291
|
'--external',
|
|
291
292
|
action='store_true',
|
|
292
|
-
help=
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
"(external-net extension required)"
|
|
298
|
-
)
|
|
293
|
+
help=_(
|
|
294
|
+
"The network has an external routing facility that is not "
|
|
295
|
+
"managed by Neutron and can be used. For example: "
|
|
296
|
+
"openstack router set --external-gateway NETWORK "
|
|
297
|
+
"(external-net extension required)"
|
|
299
298
|
),
|
|
300
299
|
)
|
|
301
300
|
external_router_grp.add_argument(
|
|
302
301
|
'--internal',
|
|
303
302
|
action='store_true',
|
|
304
|
-
help=
|
|
305
|
-
_("Opposite of '--external' (default)")
|
|
306
|
-
),
|
|
303
|
+
help=_("Opposite of '--external' (default)"),
|
|
307
304
|
)
|
|
308
305
|
default_router_grp = parser.add_mutually_exclusive_group()
|
|
309
306
|
default_router_grp.add_argument(
|
|
310
307
|
'--default',
|
|
311
308
|
action='store_true',
|
|
312
|
-
help=
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
"external network"
|
|
316
|
-
)
|
|
309
|
+
help=_(
|
|
310
|
+
"Specify if this network should be used as the default "
|
|
311
|
+
"external network"
|
|
317
312
|
),
|
|
318
313
|
)
|
|
319
314
|
default_router_grp.add_argument(
|
|
320
315
|
'--no-default',
|
|
321
316
|
action='store_true',
|
|
322
|
-
help=
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
"(default)"
|
|
326
|
-
)
|
|
317
|
+
help=_(
|
|
318
|
+
"Do not use the network as the default external network "
|
|
319
|
+
"(default)"
|
|
327
320
|
),
|
|
328
321
|
)
|
|
329
322
|
parser.add_argument(
|
|
330
323
|
'--qos-policy',
|
|
331
324
|
metavar='<qos-policy>',
|
|
332
|
-
help=
|
|
333
|
-
_("QoS policy to attach to this network (name or ID)")
|
|
334
|
-
),
|
|
325
|
+
help=_("QoS policy to attach to this network (name or ID)"),
|
|
335
326
|
)
|
|
336
327
|
vlan_transparent_grp = parser.add_mutually_exclusive_group()
|
|
337
328
|
vlan_transparent_grp.add_argument(
|
|
338
329
|
'--transparent-vlan',
|
|
339
330
|
action='store_true',
|
|
340
|
-
help=
|
|
341
|
-
_("Make the network VLAN transparent")
|
|
342
|
-
),
|
|
331
|
+
help=_("Make the network VLAN transparent"),
|
|
343
332
|
)
|
|
344
333
|
vlan_transparent_grp.add_argument(
|
|
345
334
|
'--no-transparent-vlan',
|
|
346
335
|
action='store_true',
|
|
347
|
-
help=
|
|
348
|
-
_("Do not make the network VLAN transparent")
|
|
349
|
-
),
|
|
336
|
+
help=_("Do not make the network VLAN transparent"),
|
|
350
337
|
)
|
|
351
338
|
|
|
352
339
|
vlan_qinq_grp = parser.add_mutually_exclusive_group()
|
|
353
340
|
vlan_qinq_grp.add_argument(
|
|
354
341
|
'--qinq-vlan',
|
|
355
342
|
action='store_true',
|
|
356
|
-
help=
|
|
357
|
-
_("Enable VLAN QinQ (S-Tag ethtype 0x8a88) for the network")
|
|
358
|
-
),
|
|
343
|
+
help=_("Enable VLAN QinQ (S-Tag ethtype 0x8a88) for the network"),
|
|
359
344
|
)
|
|
360
345
|
vlan_qinq_grp.add_argument(
|
|
361
346
|
'--no-qinq-vlan',
|
|
362
347
|
action='store_true',
|
|
363
|
-
help=
|
|
364
|
-
_("Disable VLAN QinQ (S-Tag ethtype 0x8a88) for the network")
|
|
365
|
-
),
|
|
348
|
+
help=_("Disable VLAN QinQ (S-Tag ethtype 0x8a88) for the network"),
|
|
366
349
|
)
|
|
367
350
|
|
|
368
351
|
_add_additional_network_options(parser)
|
|
369
|
-
_tag.add_tag_option_to_parser_for_create(
|
|
370
|
-
parser, _('network'), enhance_help=self.enhance_help_neutron
|
|
371
|
-
)
|
|
352
|
+
_tag.add_tag_option_to_parser_for_create(parser, _('network'))
|
|
372
353
|
return parser
|
|
373
354
|
|
|
374
|
-
def
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
required=True,
|
|
379
|
-
help=self.enhance_help_nova_network(
|
|
380
|
-
_("IPv4 subnet for fixed IPs (in CIDR notation)")
|
|
381
|
-
),
|
|
382
|
-
)
|
|
383
|
-
return parser
|
|
384
|
-
|
|
385
|
-
def take_action_network(self, client, parsed_args):
|
|
355
|
+
def take_action(
|
|
356
|
+
self, parsed_args: argparse.Namespace
|
|
357
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
358
|
+
client = self.app.client_manager.network
|
|
386
359
|
attrs = _get_attrs_network(self.app.client_manager, parsed_args)
|
|
387
360
|
if parsed_args.transparent_vlan:
|
|
388
361
|
attrs['vlan_transparent'] = True
|
|
@@ -425,81 +398,85 @@ class CreateNetwork(
|
|
|
425
398
|
data = utils.get_item_properties(obj, columns, formatters=_formatters)
|
|
426
399
|
return (display_columns, data)
|
|
427
400
|
|
|
428
|
-
def take_action_compute(self, client, parsed_args):
|
|
429
|
-
attrs = _get_attrs_compute(self.app.client_manager, parsed_args)
|
|
430
|
-
obj = compute_v2.create_network(client, **attrs)
|
|
431
|
-
display_columns, columns = _get_columns_compute(obj)
|
|
432
|
-
data = utils.get_dict_properties(obj, columns)
|
|
433
|
-
return (display_columns, data)
|
|
434
|
-
|
|
435
401
|
|
|
436
|
-
class DeleteNetwork(
|
|
402
|
+
class DeleteNetwork(command.Command):
|
|
437
403
|
_description = _("Delete network(s)")
|
|
438
404
|
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
r = None
|
|
442
|
-
|
|
443
|
-
def update_parser_common(self, parser):
|
|
405
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
406
|
+
parser = super().get_parser(prog_name)
|
|
444
407
|
parser.add_argument(
|
|
445
408
|
'network',
|
|
446
409
|
metavar="<network>",
|
|
447
410
|
nargs="+",
|
|
448
411
|
help=_("Network(s) to delete (name or ID)"),
|
|
449
412
|
)
|
|
450
|
-
|
|
451
413
|
return parser
|
|
452
414
|
|
|
453
|
-
def
|
|
454
|
-
|
|
455
|
-
|
|
415
|
+
def take_action(self, parsed_args: argparse.Namespace) -> None:
|
|
416
|
+
client = self.app.client_manager.network
|
|
417
|
+
result = 0
|
|
418
|
+
|
|
419
|
+
for net in parsed_args.network:
|
|
420
|
+
try:
|
|
421
|
+
obj = client.find_network(net, ignore_missing=False)
|
|
422
|
+
client.delete_network(obj)
|
|
423
|
+
except Exception as e:
|
|
424
|
+
result += 1
|
|
425
|
+
LOG.error(
|
|
426
|
+
_(
|
|
427
|
+
"Failed to delete network with "
|
|
428
|
+
"name or ID '%(network)s': %(e)s"
|
|
429
|
+
),
|
|
430
|
+
{'network': net, 'e': e},
|
|
431
|
+
)
|
|
456
432
|
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
433
|
+
if result > 0:
|
|
434
|
+
total = len(parsed_args.network)
|
|
435
|
+
msg = _("%(result)s of %(total)s networks failed to delete.") % {
|
|
436
|
+
'result': result,
|
|
437
|
+
'total': total,
|
|
438
|
+
}
|
|
439
|
+
raise exceptions.CommandError(msg)
|
|
460
440
|
|
|
461
441
|
|
|
462
442
|
# TODO(sindhu): Use the SDK resource mapped attribute names once the
|
|
463
443
|
# OSC minimum requirements include SDK 1.0.
|
|
464
|
-
class ListNetwork(
|
|
444
|
+
class ListNetwork(command.Lister):
|
|
465
445
|
_description = _("List networks")
|
|
466
446
|
|
|
467
|
-
def
|
|
447
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
448
|
+
parser = super().get_parser(prog_name)
|
|
468
449
|
router_ext_group = parser.add_mutually_exclusive_group()
|
|
469
450
|
router_ext_group.add_argument(
|
|
470
451
|
'--external',
|
|
471
452
|
action='store_true',
|
|
472
|
-
help=
|
|
453
|
+
help=_("List only external networks"),
|
|
473
454
|
)
|
|
474
455
|
router_ext_group.add_argument(
|
|
475
456
|
'--internal',
|
|
476
457
|
action='store_true',
|
|
477
|
-
help=
|
|
458
|
+
help=_("List only internal networks"),
|
|
478
459
|
)
|
|
479
460
|
parser.add_argument(
|
|
480
461
|
'--long',
|
|
481
462
|
action='store_true',
|
|
482
|
-
help=
|
|
483
|
-
_("List additional fields in output")
|
|
484
|
-
),
|
|
463
|
+
help=_("List additional fields in output"),
|
|
485
464
|
)
|
|
486
465
|
parser.add_argument(
|
|
487
466
|
'--name',
|
|
488
467
|
metavar='<name>',
|
|
489
|
-
help=
|
|
490
|
-
_("List only networks with the specified name")
|
|
491
|
-
),
|
|
468
|
+
help=_("List only networks with the specified name"),
|
|
492
469
|
)
|
|
493
470
|
admin_state_group = parser.add_mutually_exclusive_group()
|
|
494
471
|
admin_state_group.add_argument(
|
|
495
472
|
'--enable',
|
|
496
473
|
action='store_true',
|
|
497
|
-
help=
|
|
474
|
+
help=_("List only enabled networks"),
|
|
498
475
|
)
|
|
499
476
|
admin_state_group.add_argument(
|
|
500
477
|
'--disable',
|
|
501
478
|
action='store_true',
|
|
502
|
-
help=
|
|
479
|
+
help=_("List only disabled networks"),
|
|
503
480
|
)
|
|
504
481
|
parser.add_argument(
|
|
505
482
|
'--project',
|
|
@@ -508,85 +485,69 @@ class ListNetwork(common.NetworkAndComputeLister):
|
|
|
508
485
|
"List only networks with the specified project (name or ID)"
|
|
509
486
|
),
|
|
510
487
|
)
|
|
511
|
-
identity_common.add_project_domain_option_to_parser(
|
|
512
|
-
parser, enhance_help=self.enhance_help_neutron
|
|
513
|
-
)
|
|
488
|
+
identity_common.add_project_domain_option_to_parser(parser)
|
|
514
489
|
shared_group = parser.add_mutually_exclusive_group()
|
|
515
490
|
shared_group.add_argument(
|
|
516
491
|
'--share',
|
|
517
492
|
action='store_true',
|
|
518
|
-
help=
|
|
519
|
-
_("List only networks shared between projects")
|
|
520
|
-
),
|
|
493
|
+
help=_("List only networks shared between projects"),
|
|
521
494
|
)
|
|
522
495
|
shared_group.add_argument(
|
|
523
496
|
'--no-share',
|
|
524
497
|
action='store_true',
|
|
525
|
-
help=
|
|
526
|
-
_("List only networks not shared between projects")
|
|
527
|
-
),
|
|
498
|
+
help=_("List only networks not shared between projects"),
|
|
528
499
|
)
|
|
529
500
|
parser.add_argument(
|
|
530
501
|
'--status',
|
|
531
502
|
metavar='<status>',
|
|
532
503
|
choices=['ACTIVE', 'BUILD', 'DOWN', 'ERROR'],
|
|
533
|
-
help=
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
"('ACTIVE', 'BUILD', 'DOWN', 'ERROR')"
|
|
537
|
-
)
|
|
504
|
+
help=_(
|
|
505
|
+
"List only networks with the specified status "
|
|
506
|
+
"('ACTIVE', 'BUILD', 'DOWN', 'ERROR')"
|
|
538
507
|
),
|
|
539
508
|
)
|
|
540
509
|
parser.add_argument(
|
|
541
510
|
'--provider-network-type',
|
|
542
511
|
metavar='<provider-network-type>',
|
|
543
512
|
choices=['flat', 'geneve', 'gre', 'local', 'vlan', 'vxlan'],
|
|
544
|
-
help=
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
"vlan and vxlan."
|
|
550
|
-
)
|
|
513
|
+
help=_(
|
|
514
|
+
"List only networks with the specified physical "
|
|
515
|
+
"mechanisms. "
|
|
516
|
+
"The supported options are: flat, geneve, gre, local, "
|
|
517
|
+
"vlan and vxlan."
|
|
551
518
|
),
|
|
552
519
|
)
|
|
553
520
|
parser.add_argument(
|
|
554
521
|
'--provider-physical-network',
|
|
555
522
|
metavar='<provider-physical-network>',
|
|
556
523
|
dest='physical_network',
|
|
557
|
-
help=
|
|
558
|
-
|
|
559
|
-
"List only networks with the specified physical network "
|
|
560
|
-
"name"
|
|
561
|
-
)
|
|
524
|
+
help=_(
|
|
525
|
+
"List only networks with the specified physical network name"
|
|
562
526
|
),
|
|
563
527
|
)
|
|
564
528
|
parser.add_argument(
|
|
565
529
|
'--provider-segment',
|
|
566
530
|
metavar='<provider-segment>',
|
|
567
531
|
dest='segmentation_id',
|
|
568
|
-
help=
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
"Tunnel ID for GENEVE/GRE/VXLAN networks)"
|
|
573
|
-
)
|
|
532
|
+
help=_(
|
|
533
|
+
"List only networks with the specified provider segment "
|
|
534
|
+
"ID (VLAN ID for VLAN networks or "
|
|
535
|
+
"Tunnel ID for GENEVE/GRE/VXLAN networks)"
|
|
574
536
|
),
|
|
575
537
|
)
|
|
576
538
|
parser.add_argument(
|
|
577
539
|
'--agent',
|
|
578
540
|
metavar='<agent-id>',
|
|
579
541
|
dest='agent_id',
|
|
580
|
-
help=
|
|
581
|
-
_('List only networks hosted the specified agent (ID only)')
|
|
582
|
-
),
|
|
583
|
-
)
|
|
584
|
-
_tag.add_tag_filtering_option_to_parser(
|
|
585
|
-
parser, _('networks'), enhance_help=self.enhance_help_neutron
|
|
542
|
+
help=_('List only networks hosted the specified agent (ID only)'),
|
|
586
543
|
)
|
|
544
|
+
_tag.add_tag_filtering_option_to_parser(parser, _('networks'))
|
|
587
545
|
return parser
|
|
588
546
|
|
|
589
|
-
def
|
|
547
|
+
def take_action(
|
|
548
|
+
self, parsed_args: argparse.Namespace
|
|
549
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
550
|
+
client = self.app.client_manager.network
|
|
590
551
|
identity_client = self.app.client_manager.identity
|
|
591
552
|
if parsed_args.long:
|
|
592
553
|
columns: tuple[str, ...] = (
|
|
@@ -708,39 +669,13 @@ class ListNetwork(common.NetworkAndComputeLister):
|
|
|
708
669
|
),
|
|
709
670
|
)
|
|
710
671
|
|
|
711
|
-
def take_action_compute(self, client, parsed_args):
|
|
712
|
-
columns = (
|
|
713
|
-
'id',
|
|
714
|
-
'label',
|
|
715
|
-
'cidr',
|
|
716
|
-
)
|
|
717
|
-
column_headers = (
|
|
718
|
-
'ID',
|
|
719
|
-
'Name',
|
|
720
|
-
'Subnet',
|
|
721
|
-
)
|
|
722
|
-
|
|
723
|
-
data = compute_v2.list_networks(client)
|
|
724
|
-
|
|
725
|
-
return (
|
|
726
|
-
column_headers,
|
|
727
|
-
(
|
|
728
|
-
utils.get_dict_properties(
|
|
729
|
-
s,
|
|
730
|
-
columns,
|
|
731
|
-
formatters=_formatters,
|
|
732
|
-
)
|
|
733
|
-
for s in data
|
|
734
|
-
),
|
|
735
|
-
)
|
|
736
|
-
|
|
737
672
|
|
|
738
673
|
# TODO(sindhu): Use the SDK resource mapped attribute names once the
|
|
739
674
|
# OSC minimum requirements include SDK 1.0.
|
|
740
675
|
class SetNetwork(common.NeutronCommandWithExtraArgs):
|
|
741
676
|
_description = _("Set network properties")
|
|
742
677
|
|
|
743
|
-
def get_parser(self, prog_name):
|
|
678
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
744
679
|
parser = super().get_parser(prog_name)
|
|
745
680
|
parser.add_argument(
|
|
746
681
|
'network',
|
|
@@ -839,7 +774,7 @@ class SetNetwork(common.NeutronCommandWithExtraArgs):
|
|
|
839
774
|
_add_additional_network_options(parser)
|
|
840
775
|
return parser
|
|
841
776
|
|
|
842
|
-
def take_action(self, parsed_args):
|
|
777
|
+
def take_action(self, parsed_args: argparse.Namespace) -> None:
|
|
843
778
|
client = self.app.client_manager.network
|
|
844
779
|
obj = client.find_network(parsed_args.network, ignore_missing=False)
|
|
845
780
|
|
|
@@ -857,10 +792,11 @@ class SetNetwork(common.NeutronCommandWithExtraArgs):
|
|
|
857
792
|
_tag.update_tags_for_set(client, obj, parsed_args)
|
|
858
793
|
|
|
859
794
|
|
|
860
|
-
class ShowNetwork(
|
|
795
|
+
class ShowNetwork(command.ShowOne):
|
|
861
796
|
_description = _("Show network details")
|
|
862
797
|
|
|
863
|
-
def
|
|
798
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
799
|
+
parser = super().get_parser(prog_name)
|
|
864
800
|
parser.add_argument(
|
|
865
801
|
'network',
|
|
866
802
|
metavar="<network>",
|
|
@@ -868,23 +804,20 @@ class ShowNetwork(common.NetworkAndComputeShowOne):
|
|
|
868
804
|
)
|
|
869
805
|
return parser
|
|
870
806
|
|
|
871
|
-
def
|
|
807
|
+
def take_action(
|
|
808
|
+
self, parsed_args: argparse.Namespace
|
|
809
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
810
|
+
client = self.app.client_manager.network
|
|
872
811
|
obj = client.find_network(parsed_args.network, ignore_missing=False)
|
|
873
812
|
display_columns, columns = _get_columns_network(obj)
|
|
874
813
|
data = utils.get_item_properties(obj, columns, formatters=_formatters)
|
|
875
814
|
return (display_columns, data)
|
|
876
815
|
|
|
877
|
-
def take_action_compute(self, client, parsed_args):
|
|
878
|
-
obj = compute_v2.find_network(client, parsed_args.network)
|
|
879
|
-
display_columns, columns = _get_columns_compute(obj)
|
|
880
|
-
data = utils.get_dict_properties(obj, columns)
|
|
881
|
-
return (display_columns, data)
|
|
882
|
-
|
|
883
816
|
|
|
884
817
|
class UnsetNetwork(common.NeutronUnsetCommandWithExtraArgs):
|
|
885
818
|
_description = _("Unset network properties")
|
|
886
819
|
|
|
887
|
-
def get_parser(self, prog_name):
|
|
820
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
888
821
|
parser = super().get_parser(prog_name)
|
|
889
822
|
parser.add_argument(
|
|
890
823
|
'network',
|
|
@@ -894,7 +827,7 @@ class UnsetNetwork(common.NeutronUnsetCommandWithExtraArgs):
|
|
|
894
827
|
_tag.add_tag_option_to_parser_for_unset(parser, _('network'))
|
|
895
828
|
return parser
|
|
896
829
|
|
|
897
|
-
def take_action(self, parsed_args):
|
|
830
|
+
def take_action(self, parsed_args: argparse.Namespace) -> None:
|
|
898
831
|
client = self.app.client_manager.network
|
|
899
832
|
obj = client.find_network(parsed_args.network, ignore_missing=False)
|
|
900
833
|
|