python-openstackclient 7.4.0__py3-none-any.whl → 8.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/common/availability_zone.py +3 -6
- openstackclient/common/clientmanager.py +2 -1
- openstackclient/common/envvars.py +57 -0
- openstackclient/common/extension.py +3 -11
- openstackclient/common/limits.py +1 -1
- openstackclient/common/project_cleanup.py +3 -2
- openstackclient/common/quota.py +54 -28
- openstackclient/compute/client.py +2 -5
- openstackclient/compute/v2/agent.py +5 -5
- openstackclient/compute/v2/aggregate.py +17 -15
- openstackclient/compute/v2/console.py +3 -4
- openstackclient/compute/v2/flavor.py +14 -18
- openstackclient/compute/v2/host.py +3 -3
- openstackclient/compute/v2/hypervisor.py +10 -4
- openstackclient/compute/v2/hypervisor_stats.py +1 -1
- openstackclient/compute/v2/keypair.py +8 -10
- openstackclient/compute/v2/server.py +70 -112
- openstackclient/compute/v2/server_backup.py +1 -1
- openstackclient/compute/v2/server_event.py +7 -16
- openstackclient/compute/v2/server_group.py +6 -6
- openstackclient/compute/v2/server_image.py +1 -1
- openstackclient/compute/v2/server_migration.py +6 -6
- openstackclient/compute/v2/server_volume.py +4 -4
- openstackclient/compute/v2/service.py +9 -13
- openstackclient/compute/v2/usage.py +4 -6
- openstackclient/identity/client.py +2 -4
- openstackclient/identity/common.py +16 -17
- openstackclient/identity/v2_0/ec2creds.py +4 -3
- openstackclient/identity/v2_0/endpoint.py +12 -10
- openstackclient/identity/v2_0/project.py +6 -6
- openstackclient/identity/v2_0/role.py +1 -1
- openstackclient/identity/v2_0/service.py +7 -7
- openstackclient/identity/v2_0/user.py +6 -21
- openstackclient/identity/v3/access_rule.py +2 -5
- openstackclient/identity/v3/consumer.py +4 -3
- openstackclient/identity/v3/credential.py +6 -7
- openstackclient/identity/v3/domain.py +1 -1
- openstackclient/identity/v3/ec2creds.py +4 -3
- openstackclient/identity/v3/endpoint.py +104 -88
- openstackclient/identity/v3/endpoint_group.py +1 -1
- openstackclient/identity/v3/group.py +3 -4
- openstackclient/identity/v3/identity_provider.py +1 -2
- openstackclient/identity/v3/limit.py +4 -9
- openstackclient/identity/v3/mapping.py +4 -3
- openstackclient/identity/v3/policy.py +5 -8
- openstackclient/identity/v3/project.py +6 -6
- openstackclient/identity/v3/region.py +2 -5
- openstackclient/identity/v3/registered_limit.py +4 -8
- openstackclient/identity/v3/role.py +15 -16
- openstackclient/identity/v3/service.py +8 -8
- openstackclient/identity/v3/service_provider.py +3 -6
- openstackclient/identity/v3/tag.py +2 -2
- openstackclient/identity/v3/token.py +1 -2
- openstackclient/identity/v3/trust.py +74 -25
- openstackclient/identity/v3/user.py +9 -6
- openstackclient/image/client.py +2 -5
- openstackclient/image/v1/image.py +11 -15
- openstackclient/image/v2/cache.py +2 -4
- openstackclient/image/v2/image.py +30 -37
- openstackclient/image/v2/metadef_namespaces.py +4 -3
- openstackclient/image/v2/metadef_resource_type_association.py +1 -2
- openstackclient/image/v2/metadef_resource_types.py +1 -2
- openstackclient/locale/tr_TR/LC_MESSAGES/openstackclient.po +9 -1370
- openstackclient/network/client.py +4 -10
- openstackclient/network/common.py +16 -12
- openstackclient/network/utils.py +3 -3
- openstackclient/network/v2/address_group.py +5 -9
- openstackclient/network/v2/address_scope.py +2 -3
- openstackclient/network/v2/default_security_group_rule.py +1 -2
- openstackclient/network/v2/floating_ip.py +14 -21
- openstackclient/network/v2/floating_ip_port_forwarding.py +7 -7
- openstackclient/network/v2/ip_availability.py +1 -2
- openstackclient/network/v2/l3_conntrack_helper.py +8 -12
- openstackclient/network/v2/local_ip.py +24 -26
- openstackclient/network/v2/local_ip_association.py +4 -5
- openstackclient/network/v2/ndp_proxy.py +9 -10
- openstackclient/network/v2/network.py +12 -16
- openstackclient/network/v2/network_agent.py +29 -37
- openstackclient/network/v2/network_auto_allocated_topology.py +4 -5
- openstackclient/network/v2/network_flavor.py +1 -1
- openstackclient/network/v2/network_flavor_profile.py +5 -5
- openstackclient/network/v2/network_meter.py +3 -3
- openstackclient/network/v2/network_meter_rule.py +5 -8
- openstackclient/network/v2/network_qos_policy.py +4 -4
- openstackclient/network/v2/network_qos_rule.py +4 -5
- openstackclient/network/v2/network_rbac.py +4 -4
- openstackclient/network/v2/network_segment.py +6 -7
- openstackclient/network/v2/network_segment_range.py +16 -20
- openstackclient/network/v2/network_trunk.py +24 -16
- openstackclient/network/v2/port.py +28 -29
- openstackclient/network/v2/router.py +52 -41
- openstackclient/network/v2/security_group.py +8 -15
- openstackclient/network/v2/security_group_rule.py +9 -10
- openstackclient/network/v2/subnet.py +31 -30
- openstackclient/network/v2/subnet_pool.py +4 -4
- openstackclient/object/client.py +2 -3
- openstackclient/object/v1/container.py +2 -3
- openstackclient/object/v1/object.py +2 -9
- openstackclient/shell.py +22 -5
- openstackclient/tests/functional/base.py +2 -2
- openstackclient/tests/functional/common/test_quota.py +3 -1
- openstackclient/tests/functional/compute/v2/common.py +12 -6
- openstackclient/tests/functional/compute/v2/test_server.py +2 -3
- openstackclient/tests/functional/compute/v2/test_server_event.py +1 -1
- openstackclient/tests/functional/identity/v2/test_user.py +1 -1
- openstackclient/tests/functional/identity/v3/common.py +3 -8
- openstackclient/tests/functional/identity/v3/test_application_credential.py +10 -10
- openstackclient/tests/functional/identity/v3/test_endpoint.py +3 -3
- openstackclient/tests/functional/identity/v3/test_group.py +3 -3
- openstackclient/tests/functional/identity/v3/test_idp.py +3 -7
- openstackclient/tests/functional/identity/v3/test_limit.py +4 -4
- openstackclient/tests/functional/identity/v3/test_project.py +5 -14
- openstackclient/tests/functional/identity/v3/test_region.py +1 -3
- openstackclient/tests/functional/identity/v3/test_registered_limit.py +3 -3
- openstackclient/tests/functional/identity/v3/test_role.py +1 -1
- openstackclient/tests/functional/identity/v3/test_role_assignment.py +13 -31
- openstackclient/tests/functional/identity/v3/test_service_provider.py +3 -7
- openstackclient/tests/functional/identity/v3/test_user.py +8 -8
- openstackclient/tests/functional/network/v2/common.py +7 -3
- openstackclient/tests/functional/network/v2/test_address_group.py +4 -0
- openstackclient/tests/functional/network/v2/test_l3_conntrack_helper.py +15 -11
- openstackclient/tests/functional/network/v2/test_local_ip.py +4 -0
- openstackclient/tests/functional/network/v2/test_network_meter_rule.py +2 -2
- openstackclient/tests/functional/network/v2/test_network_ndp_proxy.py +2 -3
- openstackclient/tests/functional/network/v2/test_network_rbac.py +2 -2
- openstackclient/tests/functional/network/v2/test_network_trunk.py +1 -1
- openstackclient/tests/functional/network/v2/test_port.py +17 -7
- openstackclient/tests/functional/network/v2/test_router.py +42 -0
- openstackclient/tests/functional/network/v2/test_subnet_pool.py +4 -0
- openstackclient/tests/unit/api/test_compute_v2.py +67 -87
- openstackclient/tests/unit/common/test_availability_zone.py +6 -14
- openstackclient/tests/unit/common/test_command.py +1 -1
- openstackclient/tests/unit/common/test_extension.py +5 -7
- openstackclient/tests/unit/common/test_limits.py +1 -1
- openstackclient/tests/unit/common/test_project_cleanup.py +5 -6
- openstackclient/tests/unit/common/test_quota.py +51 -28
- openstackclient/tests/unit/compute/v2/fakes.py +4 -10
- openstackclient/tests/unit/compute/v2/test_agent.py +16 -16
- openstackclient/tests/unit/compute/v2/test_aggregate.py +56 -60
- openstackclient/tests/unit/compute/v2/test_console.py +16 -16
- openstackclient/tests/unit/compute/v2/test_flavor.py +71 -71
- openstackclient/tests/unit/compute/v2/test_host.py +8 -8
- openstackclient/tests/unit/compute/v2/test_hypervisor.py +22 -30
- openstackclient/tests/unit/compute/v2/test_hypervisor_stats.py +2 -2
- openstackclient/tests/unit/compute/v2/test_keypair.py +24 -24
- openstackclient/tests/unit/compute/v2/test_server.py +524 -560
- openstackclient/tests/unit/compute/v2/test_server_backup.py +5 -7
- openstackclient/tests/unit/compute/v2/test_server_event.py +16 -18
- openstackclient/tests/unit/compute/v2/test_server_group.py +25 -31
- openstackclient/tests/unit/compute/v2/test_server_image.py +6 -8
- openstackclient/tests/unit/compute/v2/test_server_migration.py +37 -37
- openstackclient/tests/unit/compute/v2/test_server_volume.py +12 -12
- openstackclient/tests/unit/compute/v2/test_service.py +39 -45
- openstackclient/tests/unit/compute/v2/test_usage.py +5 -5
- openstackclient/tests/unit/identity/v2_0/fakes.py +1 -1
- openstackclient/tests/unit/identity/v3/test_access_rule.py +1 -3
- openstackclient/tests/unit/identity/v3/test_application_credential.py +1 -1
- openstackclient/tests/unit/identity/v3/test_endpoint.py +167 -172
- openstackclient/tests/unit/identity/v3/test_mappings.py +2 -2
- openstackclient/tests/unit/identity/v3/test_trust.py +5 -2
- openstackclient/tests/unit/identity/v3/test_user.py +16 -0
- openstackclient/tests/unit/image/v1/fakes.py +2 -2
- openstackclient/tests/unit/image/v2/test_image.py +39 -1
- openstackclient/tests/unit/integ/cli/test_shell.py +1 -2
- openstackclient/tests/unit/network/test_common.py +2 -2
- openstackclient/tests/unit/network/v2/test_floating_ip_compute.py +8 -14
- openstackclient/tests/unit/network/v2/test_floating_ip_network.py +49 -35
- openstackclient/tests/unit/network/v2/test_floating_ip_pool_compute.py +1 -1
- openstackclient/tests/unit/network/v2/test_network_compute.py +11 -11
- openstackclient/tests/unit/network/v2/test_network_trunk.py +2 -2
- openstackclient/tests/unit/network/v2/test_port.py +4 -5
- openstackclient/tests/unit/network/v2/test_router.py +63 -0
- openstackclient/tests/unit/network/v2/test_security_group_compute.py +11 -19
- openstackclient/tests/unit/network/v2/test_security_group_rule_compute.py +14 -14
- openstackclient/tests/unit/object/v1/test_object_all.py +4 -3
- openstackclient/tests/unit/test_shell.py +16 -13
- openstackclient/tests/unit/volume/v2/test_volume.py +1 -1
- openstackclient/tests/unit/volume/v2/test_volume_transfer_request.py +1 -1
- openstackclient/tests/unit/volume/v3/fakes.py +2 -8
- openstackclient/tests/unit/volume/v3/test_volume.py +1 -1
- openstackclient/tests/unit/volume/v3/test_volume_attachment.py +3 -3
- openstackclient/tests/unit/volume/v3/test_volume_snapshot.py +1 -2
- openstackclient/tests/unit/volume/v3/test_volume_transfer_request.py +1 -1
- openstackclient/volume/client.py +1 -3
- openstackclient/volume/v2/consistency_group.py +4 -8
- openstackclient/volume/v2/consistency_group_snapshot.py +1 -2
- openstackclient/volume/v2/qos_specs.py +1 -2
- openstackclient/volume/v2/volume.py +8 -16
- openstackclient/volume/v2/volume_backup.py +6 -7
- openstackclient/volume/v2/volume_snapshot.py +8 -9
- openstackclient/volume/v2/volume_transfer_request.py +0 -3
- openstackclient/volume/v2/volume_type.py +10 -21
- openstackclient/volume/v3/block_storage_cluster.py +3 -3
- openstackclient/volume/v3/block_storage_manage.py +1 -3
- openstackclient/volume/v3/volume.py +18 -19
- openstackclient/volume/v3/volume_attachment.py +3 -2
- openstackclient/volume/v3/volume_backup.py +7 -8
- openstackclient/volume/v3/volume_group.py +2 -1
- openstackclient/volume/v3/volume_group_snapshot.py +2 -1
- openstackclient/volume/v3/volume_snapshot.py +4 -3
- openstackclient/volume/v3/volume_type.py +10 -21
- {python_openstackclient-7.4.0.dist-info → python_openstackclient-8.0.0.dist-info}/AUTHORS +3 -0
- {python_openstackclient-7.4.0.dist-info → python_openstackclient-8.0.0.dist-info}/METADATA +7 -13
- {python_openstackclient-7.4.0.dist-info → python_openstackclient-8.0.0.dist-info}/RECORD +209 -232
- {python_openstackclient-7.4.0.dist-info → python_openstackclient-8.0.0.dist-info}/WHEEL +1 -1
- {python_openstackclient-7.4.0.dist-info → python_openstackclient-8.0.0.dist-info}/entry_points.txt +0 -41
- python_openstackclient-8.0.0.dist-info/pbr.json +1 -0
- openstackclient/tests/functional/volume/v1/__init__.py +0 -0
- openstackclient/tests/functional/volume/v1/common.py +0 -35
- openstackclient/tests/functional/volume/v1/test_qos.py +0 -100
- openstackclient/tests/functional/volume/v1/test_service.py +0 -76
- openstackclient/tests/functional/volume/v1/test_snapshot.py +0 -232
- openstackclient/tests/functional/volume/v1/test_transfer_request.py +0 -111
- openstackclient/tests/functional/volume/v1/test_volume.py +0 -228
- openstackclient/tests/functional/volume/v1/test_volume_type.py +0 -213
- openstackclient/tests/unit/volume/v1/__init__.py +0 -0
- openstackclient/tests/unit/volume/v1/fakes.py +0 -615
- openstackclient/tests/unit/volume/v1/test_qos_specs.py +0 -471
- openstackclient/tests/unit/volume/v1/test_service.py +0 -295
- openstackclient/tests/unit/volume/v1/test_transfer_request.py +0 -380
- openstackclient/tests/unit/volume/v1/test_type.py +0 -633
- openstackclient/tests/unit/volume/v1/test_volume.py +0 -1447
- openstackclient/tests/unit/volume/v1/test_volume_backup.py +0 -435
- openstackclient/volume/v1/__init__.py +0 -0
- openstackclient/volume/v1/qos_specs.py +0 -377
- openstackclient/volume/v1/service.py +0 -136
- openstackclient/volume/v1/volume.py +0 -734
- openstackclient/volume/v1/volume_backup.py +0 -302
- openstackclient/volume/v1/volume_snapshot.py +0 -433
- openstackclient/volume/v1/volume_transfer_request.py +0 -200
- openstackclient/volume/v1/volume_type.py +0 -520
- python_openstackclient-7.4.0.dist-info/pbr.json +0 -1
- {python_openstackclient-7.4.0.dist-info → python_openstackclient-8.0.0.dist-info}/LICENSE +0 -0
- {python_openstackclient-7.4.0.dist-info → python_openstackclient-8.0.0.dist-info}/top_level.txt +0 -0
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
|
|
19
19
|
import itertools
|
|
20
20
|
import logging
|
|
21
|
+
import typing as ty
|
|
21
22
|
|
|
22
23
|
from osc_lib.command import command
|
|
23
24
|
from osc_lib import exceptions
|
|
@@ -32,19 +33,18 @@ LOG = logging.getLogger(__name__)
|
|
|
32
33
|
|
|
33
34
|
|
|
34
35
|
def _get_columns(item):
|
|
35
|
-
column_map = {}
|
|
36
36
|
hidden_columns = ['location', 'tenant_id']
|
|
37
37
|
return utils.get_osc_show_columns_for_sdk_resource(
|
|
38
|
-
item,
|
|
38
|
+
item, {}, hidden_columns
|
|
39
39
|
)
|
|
40
40
|
|
|
41
41
|
|
|
42
42
|
def _get_ranges(item):
|
|
43
43
|
item = sorted([int(i) for i in item])
|
|
44
44
|
for a, b in itertools.groupby(enumerate(item), lambda xy: xy[1] - xy[0]):
|
|
45
|
-
|
|
45
|
+
c = list(b)
|
|
46
46
|
yield (
|
|
47
|
-
f"{
|
|
47
|
+
f"{c[0][1]}-{c[-1][1]}" if c[0][1] != c[-1][1] else str(c[0][1])
|
|
48
48
|
)
|
|
49
49
|
|
|
50
50
|
|
|
@@ -59,7 +59,7 @@ def _is_prop_empty(columns, props, prop_name):
|
|
|
59
59
|
|
|
60
60
|
|
|
61
61
|
def _exchange_dict_keys_with_values(orig_dict):
|
|
62
|
-
updated_dict =
|
|
62
|
+
updated_dict: dict[str, ty.Any] = {}
|
|
63
63
|
for k, v in orig_dict.items():
|
|
64
64
|
k = [k]
|
|
65
65
|
if not updated_dict.get(v):
|
|
@@ -105,8 +105,7 @@ class CreateNetworkSegmentRange(
|
|
|
105
105
|
dest="private",
|
|
106
106
|
action="store_true",
|
|
107
107
|
help=_(
|
|
108
|
-
'Network segment range is assigned specifically to the '
|
|
109
|
-
'project'
|
|
108
|
+
'Network segment range is assigned specifically to the project'
|
|
110
109
|
),
|
|
111
110
|
)
|
|
112
111
|
shared_group.add_argument(
|
|
@@ -125,7 +124,7 @@ class CreateNetworkSegmentRange(
|
|
|
125
124
|
metavar='<project>',
|
|
126
125
|
help=_(
|
|
127
126
|
'Network segment range owner (name or ID). Optional when '
|
|
128
|
-
'the segment range is shared'
|
|
127
|
+
'the segment range is shared.'
|
|
129
128
|
),
|
|
130
129
|
)
|
|
131
130
|
identity_common.add_project_domain_option_to_parser(parser)
|
|
@@ -196,8 +195,7 @@ class CreateNetworkSegmentRange(
|
|
|
196
195
|
and parsed_args.physical_network
|
|
197
196
|
):
|
|
198
197
|
msg = _(
|
|
199
|
-
"--physical-network is only allowed with --network-type "
|
|
200
|
-
"vlan"
|
|
198
|
+
"--physical-network is only allowed with --network-type vlan"
|
|
201
199
|
)
|
|
202
200
|
raise exceptions.CommandError(msg)
|
|
203
201
|
|
|
@@ -323,7 +321,7 @@ class ListNetworkSegmentRange(command.Lister):
|
|
|
323
321
|
'--unused',
|
|
324
322
|
action='store_true',
|
|
325
323
|
help=_(
|
|
326
|
-
'List network segment ranges that have segments
|
|
324
|
+
'List network segment ranges that have segments not in use'
|
|
327
325
|
),
|
|
328
326
|
)
|
|
329
327
|
available_group = parser.add_mutually_exclusive_group()
|
|
@@ -353,10 +351,9 @@ class ListNetworkSegmentRange(command.Lister):
|
|
|
353
351
|
) % {'e': e}
|
|
354
352
|
raise exceptions.CommandError(msg)
|
|
355
353
|
|
|
356
|
-
|
|
357
|
-
data = network_client.network_segment_ranges(**filters)
|
|
354
|
+
data = network_client.network_segment_ranges()
|
|
358
355
|
|
|
359
|
-
headers = (
|
|
356
|
+
headers: tuple[str, ...] = (
|
|
360
357
|
'ID',
|
|
361
358
|
'Name',
|
|
362
359
|
'Default',
|
|
@@ -367,7 +364,7 @@ class ListNetworkSegmentRange(command.Lister):
|
|
|
367
364
|
'Minimum ID',
|
|
368
365
|
'Maximum ID',
|
|
369
366
|
)
|
|
370
|
-
columns = (
|
|
367
|
+
columns: tuple[str, ...] = (
|
|
371
368
|
'id',
|
|
372
369
|
'name',
|
|
373
370
|
'default',
|
|
@@ -389,16 +386,16 @@ class ListNetworkSegmentRange(command.Lister):
|
|
|
389
386
|
# should be listed in output.
|
|
390
387
|
parsed_args.long = True
|
|
391
388
|
if parsed_args.long:
|
|
392
|
-
headers
|
|
389
|
+
headers += (
|
|
393
390
|
'Used',
|
|
394
391
|
'Available',
|
|
395
392
|
)
|
|
396
|
-
columns
|
|
393
|
+
columns += (
|
|
397
394
|
'used',
|
|
398
395
|
'available',
|
|
399
396
|
)
|
|
400
397
|
|
|
401
|
-
display_props = tuple()
|
|
398
|
+
display_props: tuple[str, ...] = tuple()
|
|
402
399
|
for s in data:
|
|
403
400
|
props = utils.get_item_properties(s, columns)
|
|
404
401
|
if (
|
|
@@ -457,8 +454,7 @@ class SetNetworkSegmentRange(common.NeutronCommandWithExtraArgs):
|
|
|
457
454
|
)
|
|
458
455
|
except Exception as e:
|
|
459
456
|
msg = _(
|
|
460
|
-
'Network segment range set not supported by '
|
|
461
|
-
'Network API: %(e)s'
|
|
457
|
+
'Network segment range set not supported by Network API: %(e)s'
|
|
462
458
|
) % {'e': e}
|
|
463
459
|
raise exceptions.CommandError(msg)
|
|
464
460
|
|
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
"""Network trunk and subports action implementations"""
|
|
18
18
|
|
|
19
19
|
import logging
|
|
20
|
+
import typing as ty
|
|
20
21
|
|
|
21
22
|
from cliff import columns as cliff_columns
|
|
22
23
|
from osc_lib.cli import format_columns
|
|
@@ -69,8 +70,8 @@ class CreateNetworkTrunk(command.ShowOne):
|
|
|
69
70
|
help=_(
|
|
70
71
|
"Subport to add. Subport is of form "
|
|
71
72
|
"'port=<name or ID>,segmentation-type=<segmentation-type>,"
|
|
72
|
-
"segmentation-id=<segmentation-ID>' (
|
|
73
|
-
"
|
|
73
|
+
"segmentation-id=<segmentation-ID>' (repeat option "
|
|
74
|
+
"to add multiple subports)"
|
|
74
75
|
),
|
|
75
76
|
)
|
|
76
77
|
admin_group = parser.add_mutually_exclusive_group()
|
|
@@ -128,7 +129,7 @@ class DeleteNetworkTrunk(command.Command):
|
|
|
128
129
|
)
|
|
129
130
|
if result > 0:
|
|
130
131
|
total = len(parsed_args.trunk)
|
|
131
|
-
msg = _("%(result)s of %(total)s trunks failed
|
|
132
|
+
msg = _("%(result)s of %(total)s trunks failed to delete.") % {
|
|
132
133
|
'result': result,
|
|
133
134
|
'total': total,
|
|
134
135
|
}
|
|
@@ -151,8 +152,8 @@ class ListNetworkTrunk(command.Lister):
|
|
|
151
152
|
def take_action(self, parsed_args):
|
|
152
153
|
client = self.app.client_manager.network
|
|
153
154
|
data = client.trunks()
|
|
154
|
-
headers = ('ID', 'Name', 'Parent Port', 'Description')
|
|
155
|
-
columns = ('id', 'name', 'port_id', 'description')
|
|
155
|
+
headers: tuple[str, ...] = ('ID', 'Name', 'Parent Port', 'Description')
|
|
156
|
+
columns: tuple[str, ...] = ('id', 'name', 'port_id', 'description')
|
|
156
157
|
if parsed_args.long:
|
|
157
158
|
headers += (
|
|
158
159
|
'Status',
|
|
@@ -199,9 +200,9 @@ class SetNetworkTrunk(command.Command):
|
|
|
199
200
|
required_keys=['port'],
|
|
200
201
|
help=_(
|
|
201
202
|
"Subport to add. Subport is of form "
|
|
202
|
-
"'port=<name or ID>,segmentation-type=<segmentation-type
|
|
203
|
-
"
|
|
204
|
-
"
|
|
203
|
+
"'port=<name or ID>,segmentation-type=<segmentation-type>,"
|
|
204
|
+
"segmentation-id=<segmentation-ID>' (repeat option "
|
|
205
|
+
"to add multiple subports)"
|
|
205
206
|
),
|
|
206
207
|
)
|
|
207
208
|
admin_group = parser.add_mutually_exclusive_group()
|
|
@@ -277,8 +278,16 @@ class ListNetworkSubport(command.Lister):
|
|
|
277
278
|
client = self.app.client_manager.network
|
|
278
279
|
trunk_id = client.find_trunk(parsed_args.trunk)
|
|
279
280
|
data = client.get_trunk_subports(trunk_id)
|
|
280
|
-
headers
|
|
281
|
-
|
|
281
|
+
headers: tuple[str, ...] = (
|
|
282
|
+
'Port',
|
|
283
|
+
'Segmentation Type',
|
|
284
|
+
'Segmentation ID',
|
|
285
|
+
)
|
|
286
|
+
columns: tuple[str, ...] = (
|
|
287
|
+
'port_id',
|
|
288
|
+
'segmentation_type',
|
|
289
|
+
'segmentation_id',
|
|
290
|
+
)
|
|
282
291
|
return (
|
|
283
292
|
headers,
|
|
284
293
|
(
|
|
@@ -308,8 +317,8 @@ class UnsetNetworkTrunk(command.Command):
|
|
|
308
317
|
action='append',
|
|
309
318
|
dest='unset_subports',
|
|
310
319
|
help=_(
|
|
311
|
-
"Subport to
|
|
312
|
-
"(
|
|
320
|
+
"Subport to unset (name or ID of the port) "
|
|
321
|
+
"(repeat option to unset multiple subports)"
|
|
313
322
|
),
|
|
314
323
|
)
|
|
315
324
|
return parser
|
|
@@ -328,15 +337,14 @@ _formatters = {
|
|
|
328
337
|
|
|
329
338
|
|
|
330
339
|
def _get_columns(item):
|
|
331
|
-
column_map = {}
|
|
332
340
|
hidden_columns = ['location', 'tenant_id']
|
|
333
341
|
return osc_utils.get_osc_show_columns_for_sdk_resource(
|
|
334
|
-
item,
|
|
342
|
+
item, {}, hidden_columns
|
|
335
343
|
)
|
|
336
344
|
|
|
337
345
|
|
|
338
346
|
def _get_attrs_for_trunk(client_manager, parsed_args):
|
|
339
|
-
attrs = {}
|
|
347
|
+
attrs: dict[str, ty.Any] = {}
|
|
340
348
|
if parsed_args.name is not None:
|
|
341
349
|
attrs['name'] = str(parsed_args.name)
|
|
342
350
|
if parsed_args.description is not None:
|
|
@@ -393,7 +401,7 @@ def _format_subports(client_manager, subports):
|
|
|
393
401
|
|
|
394
402
|
|
|
395
403
|
def _get_attrs_for_subports(client_manager, parsed_args):
|
|
396
|
-
attrs =
|
|
404
|
+
attrs = []
|
|
397
405
|
if 'set_subports' in parsed_args and parsed_args.set_subports is not None:
|
|
398
406
|
attrs = _format_subports(client_manager, parsed_args.set_subports)
|
|
399
407
|
if (
|
|
@@ -17,6 +17,7 @@ import argparse
|
|
|
17
17
|
import copy
|
|
18
18
|
import json
|
|
19
19
|
import logging
|
|
20
|
+
import typing as ty
|
|
20
21
|
|
|
21
22
|
from cliff import columns as cliff_columns
|
|
22
23
|
from osc_lib.cli import format_columns
|
|
@@ -39,6 +40,8 @@ class AdminStateColumn(cliff_columns.FormattableColumn):
|
|
|
39
40
|
|
|
40
41
|
|
|
41
42
|
class SubPortColumn(format_columns.ListDictColumn):
|
|
43
|
+
_value: ty.Any
|
|
44
|
+
|
|
42
45
|
def _retrieve_subports(self):
|
|
43
46
|
if isinstance(self._value, dict):
|
|
44
47
|
self._value = self._value['sub_ports']
|
|
@@ -347,8 +350,8 @@ def _add_updatable_args(parser, create=False):
|
|
|
347
350
|
help=_(
|
|
348
351
|
"VNIC type for this port (direct | direct-physical | "
|
|
349
352
|
"macvtap | normal | baremetal | virtio-forwarder | vdpa | "
|
|
350
|
-
"remote-managed
|
|
351
|
-
"default: normal)"
|
|
353
|
+
"remote-managed) "
|
|
354
|
+
"(default: normal)"
|
|
352
355
|
),
|
|
353
356
|
)
|
|
354
357
|
parser.add_argument(
|
|
@@ -368,8 +371,7 @@ def _add_updatable_args(parser, create=False):
|
|
|
368
371
|
'--dns-name',
|
|
369
372
|
metavar='<dns-name>',
|
|
370
373
|
help=_(
|
|
371
|
-
"Set DNS name for this port "
|
|
372
|
-
"(requires DNS integration extension)"
|
|
374
|
+
"Set DNS name for this port (requires DNS integration extension)"
|
|
373
375
|
),
|
|
374
376
|
)
|
|
375
377
|
numa_affinity_policy_group = parser.add_mutually_exclusive_group()
|
|
@@ -406,7 +408,7 @@ def _add_updatable_args(parser, create=False):
|
|
|
406
408
|
'(requires port-hints extension) '
|
|
407
409
|
'(requires port-hint-ovs-tx-steering extension for alias: '
|
|
408
410
|
'ovs-tx-steering) '
|
|
409
|
-
'(repeat option to set multiple hints)'
|
|
411
|
+
'(repeat option to set multiple hints).'
|
|
410
412
|
),
|
|
411
413
|
)
|
|
412
414
|
port_trusted = parser.add_mutually_exclusive_group()
|
|
@@ -416,7 +418,7 @@ def _add_updatable_args(parser, create=False):
|
|
|
416
418
|
help=_(
|
|
417
419
|
"Set port to be trusted. This will be populated into the "
|
|
418
420
|
"'binding:profile' dictionary and passed to the services "
|
|
419
|
-
"which expect it in this dictionary (for example, Nova)"
|
|
421
|
+
"which expect it in this dictionary (for example, Nova)."
|
|
420
422
|
),
|
|
421
423
|
)
|
|
422
424
|
port_trusted.add_argument(
|
|
@@ -425,7 +427,7 @@ def _add_updatable_args(parser, create=False):
|
|
|
425
427
|
help=_(
|
|
426
428
|
"Set port to be not trusted. This will be populated into the "
|
|
427
429
|
"'binding:profile' dictionary and passed to the services "
|
|
428
|
-
"which expect it in this dictionary (for example, Nova)"
|
|
430
|
+
"which expect it in this dictionary (for example, Nova)."
|
|
429
431
|
),
|
|
430
432
|
)
|
|
431
433
|
|
|
@@ -512,7 +514,7 @@ class CreatePort(command.ShowOne, common.NeutronCommandWithExtraArgs):
|
|
|
512
514
|
fixed_ip.add_argument(
|
|
513
515
|
'--no-fixed-ip',
|
|
514
516
|
action='store_true',
|
|
515
|
-
help=_("No IP or subnet for this port
|
|
517
|
+
help=_("No IP or subnet set for this port"),
|
|
516
518
|
)
|
|
517
519
|
parser.add_argument(
|
|
518
520
|
'--binding-profile',
|
|
@@ -520,8 +522,8 @@ class CreatePort(command.ShowOne, common.NeutronCommandWithExtraArgs):
|
|
|
520
522
|
action=JSONKeyValueAction,
|
|
521
523
|
help=_(
|
|
522
524
|
"Custom data to be passed as binding:profile. Data may "
|
|
523
|
-
"be passed as <key>=<value> or JSON
|
|
524
|
-
"(repeat option to set multiple binding:profile data)"
|
|
525
|
+
"be passed as <key>=<value> or JSON "
|
|
526
|
+
"(repeat option to set multiple binding:profile data)."
|
|
525
527
|
),
|
|
526
528
|
)
|
|
527
529
|
admin_group = parser.add_mutually_exclusive_group()
|
|
@@ -596,7 +598,7 @@ class CreatePort(command.ShowOne, common.NeutronCommandWithExtraArgs):
|
|
|
596
598
|
port_security.add_argument(
|
|
597
599
|
'--enable-port-security',
|
|
598
600
|
action='store_true',
|
|
599
|
-
help=_("Enable port security for this port (
|
|
601
|
+
help=_("Enable port security for this port (default)"),
|
|
600
602
|
)
|
|
601
603
|
port_security.add_argument(
|
|
602
604
|
'--disable-port-security',
|
|
@@ -619,7 +621,7 @@ class CreatePort(command.ShowOne, common.NeutronCommandWithExtraArgs):
|
|
|
619
621
|
parser.add_argument(
|
|
620
622
|
'--device-profile',
|
|
621
623
|
metavar='<device-profile>',
|
|
622
|
-
help=_('
|
|
624
|
+
help=_('Port device profile'),
|
|
623
625
|
)
|
|
624
626
|
parser.add_argument(
|
|
625
627
|
'--hardware-offload-type',
|
|
@@ -753,7 +755,7 @@ class DeletePort(command.Command):
|
|
|
753
755
|
|
|
754
756
|
if result > 0:
|
|
755
757
|
total = len(parsed_args.port)
|
|
756
|
-
msg = _("%(result)s of %(total)s ports failed
|
|
758
|
+
msg = _("%(result)s of %(total)s ports failed to delete.") % {
|
|
757
759
|
'result': result,
|
|
758
760
|
'total': total,
|
|
759
761
|
}
|
|
@@ -901,7 +903,7 @@ class ListPort(command.Lister):
|
|
|
901
903
|
)
|
|
902
904
|
filters['device_id'] = _router.id
|
|
903
905
|
if parsed_args.server:
|
|
904
|
-
compute_client = self.app.client_manager.
|
|
906
|
+
compute_client = self.app.client_manager.compute
|
|
905
907
|
server = compute_client.find_server(
|
|
906
908
|
parsed_args.server,
|
|
907
909
|
ignore_missing=False,
|
|
@@ -944,15 +946,12 @@ class ListPort(command.Lister):
|
|
|
944
946
|
for item in columns
|
|
945
947
|
]
|
|
946
948
|
|
|
947
|
-
headers, attrs = utils.calculate_header_and_attrs(
|
|
948
|
-
column_headers, columns, parsed_args
|
|
949
|
-
)
|
|
950
949
|
return (
|
|
951
|
-
|
|
950
|
+
column_headers,
|
|
952
951
|
(
|
|
953
952
|
utils.get_item_properties(
|
|
954
953
|
s,
|
|
955
|
-
|
|
954
|
+
columns,
|
|
956
955
|
formatters=_list_formatters,
|
|
957
956
|
)
|
|
958
957
|
for s in data
|
|
@@ -996,7 +995,7 @@ class SetPort(common.NeutronCommandWithExtraArgs):
|
|
|
996
995
|
'--no-fixed-ip',
|
|
997
996
|
action='store_true',
|
|
998
997
|
help=_(
|
|
999
|
-
"Clear existing information of fixed IP addresses."
|
|
998
|
+
"Clear existing information of fixed IP addresses. "
|
|
1000
999
|
"Specify both --fixed-ip and --no-fixed-ip "
|
|
1001
1000
|
"to overwrite the current fixed IP addresses."
|
|
1002
1001
|
),
|
|
@@ -1007,8 +1006,8 @@ class SetPort(common.NeutronCommandWithExtraArgs):
|
|
|
1007
1006
|
action=JSONKeyValueAction,
|
|
1008
1007
|
help=_(
|
|
1009
1008
|
"Custom data to be passed as binding:profile. Data may "
|
|
1010
|
-
"be passed as <key>=<value> or JSON
|
|
1011
|
-
"(repeat option to set multiple binding:profile data)"
|
|
1009
|
+
"be passed as <key>=<value> or JSON "
|
|
1010
|
+
"(repeat option to set multiple binding:profile data)."
|
|
1012
1011
|
),
|
|
1013
1012
|
)
|
|
1014
1013
|
parser.add_argument(
|
|
@@ -1075,8 +1074,8 @@ class SetPort(common.NeutronCommandWithExtraArgs):
|
|
|
1075
1074
|
help=_(
|
|
1076
1075
|
"Clear existing allowed-address pairs associated "
|
|
1077
1076
|
"with this port. "
|
|
1078
|
-
"
|
|
1079
|
-
"to overwrite the current allowed-address pairs
|
|
1077
|
+
"Specify both --allowed-address and --no-allowed-address "
|
|
1078
|
+
"to overwrite the current allowed-address pairs."
|
|
1080
1079
|
),
|
|
1081
1080
|
)
|
|
1082
1081
|
parser.add_argument(
|
|
@@ -1100,7 +1099,7 @@ class SetPort(common.NeutronCommandWithExtraArgs):
|
|
|
1100
1099
|
help=_(
|
|
1101
1100
|
"Set data plane status of this port (ACTIVE | DOWN). "
|
|
1102
1101
|
"Unset it to None with the 'port unset' command "
|
|
1103
|
-
"(requires data plane status extension)"
|
|
1102
|
+
"(requires data plane status extension)."
|
|
1104
1103
|
),
|
|
1105
1104
|
)
|
|
1106
1105
|
uplink_status_group = parser.add_mutually_exclusive_group()
|
|
@@ -1262,7 +1261,7 @@ class UnsetPort(common.NeutronUnsetCommandWithExtraArgs):
|
|
|
1262
1261
|
action='append',
|
|
1263
1262
|
help=_(
|
|
1264
1263
|
"Desired key which should be removed from binding:profile "
|
|
1265
|
-
"(repeat option to unset multiple binding:profile
|
|
1264
|
+
"(repeat option to unset multiple binding:profile keys)"
|
|
1266
1265
|
),
|
|
1267
1266
|
)
|
|
1268
1267
|
parser.add_argument(
|
|
@@ -1298,7 +1297,7 @@ class UnsetPort(common.NeutronUnsetCommandWithExtraArgs):
|
|
|
1298
1297
|
parser.add_argument(
|
|
1299
1298
|
'--data-plane-status',
|
|
1300
1299
|
action='store_true',
|
|
1301
|
-
help=_("Clear existing
|
|
1300
|
+
help=_("Clear existing data plane status information"),
|
|
1302
1301
|
)
|
|
1303
1302
|
parser.add_argument(
|
|
1304
1303
|
'--numa-policy',
|
|
@@ -1309,13 +1308,13 @@ class UnsetPort(common.NeutronUnsetCommandWithExtraArgs):
|
|
|
1309
1308
|
'--host',
|
|
1310
1309
|
action='store_true',
|
|
1311
1310
|
default=False,
|
|
1312
|
-
help=_("Clear host binding for the port
|
|
1311
|
+
help=_("Clear host binding for the port"),
|
|
1313
1312
|
)
|
|
1314
1313
|
parser.add_argument(
|
|
1315
1314
|
'--hints',
|
|
1316
1315
|
action='store_true',
|
|
1317
1316
|
default=False,
|
|
1318
|
-
help=_("Clear hints for the port
|
|
1317
|
+
help=_("Clear hints for the port"),
|
|
1319
1318
|
)
|
|
1320
1319
|
_tag.add_tag_option_to_parser_for_unset(parser, _('port'))
|
|
1321
1320
|
parser.add_argument(
|