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
|
@@ -65,17 +65,11 @@ class ServerActionEventColumn(columns.FormattableColumn):
|
|
|
65
65
|
"""
|
|
66
66
|
|
|
67
67
|
def _format_event(self, event):
|
|
68
|
-
column_map = {}
|
|
69
68
|
hidden_columns = ['id', 'name', 'location']
|
|
70
69
|
_, columns = utils.get_osc_show_columns_for_sdk_resource(
|
|
71
|
-
event,
|
|
72
|
-
column_map,
|
|
73
|
-
hidden_columns,
|
|
74
|
-
)
|
|
75
|
-
data = utils.get_item_properties(
|
|
76
|
-
event,
|
|
77
|
-
columns,
|
|
70
|
+
event, {}, hidden_columns
|
|
78
71
|
)
|
|
72
|
+
data = utils.get_item_properties(event, columns)
|
|
79
73
|
return dict(zip(columns, data))
|
|
80
74
|
|
|
81
75
|
def human_readable(self):
|
|
@@ -88,7 +82,6 @@ class ServerActionEventColumn(columns.FormattableColumn):
|
|
|
88
82
|
|
|
89
83
|
|
|
90
84
|
def _get_server_event_columns(item, client):
|
|
91
|
-
column_map = {}
|
|
92
85
|
hidden_columns = ['name', 'server_id', 'links', 'location']
|
|
93
86
|
|
|
94
87
|
if not sdk_utils.supports_microversion(client, '2.58'):
|
|
@@ -96,9 +89,7 @@ def _get_server_event_columns(item, client):
|
|
|
96
89
|
hidden_columns.append('updated_at')
|
|
97
90
|
|
|
98
91
|
return utils.get_osc_show_columns_for_sdk_resource(
|
|
99
|
-
item,
|
|
100
|
-
column_map,
|
|
101
|
-
hidden_columns,
|
|
92
|
+
item, {}, hidden_columns
|
|
102
93
|
)
|
|
103
94
|
|
|
104
95
|
|
|
@@ -148,7 +139,7 @@ class ListServerEvent(command.Lister):
|
|
|
148
139
|
return parser
|
|
149
140
|
|
|
150
141
|
def take_action(self, parsed_args):
|
|
151
|
-
compute_client = self.app.client_manager.
|
|
142
|
+
compute_client = self.app.client_manager.compute
|
|
152
143
|
|
|
153
144
|
kwargs = {}
|
|
154
145
|
|
|
@@ -220,13 +211,13 @@ class ListServerEvent(command.Lister):
|
|
|
220
211
|
|
|
221
212
|
data = compute_client.server_actions(server_id, **kwargs)
|
|
222
213
|
|
|
223
|
-
columns = (
|
|
214
|
+
columns: tuple[str, ...] = (
|
|
224
215
|
'request_id',
|
|
225
216
|
'server_id',
|
|
226
217
|
'action',
|
|
227
218
|
'start_time',
|
|
228
219
|
)
|
|
229
|
-
column_headers = (
|
|
220
|
+
column_headers: tuple[str, ...] = (
|
|
230
221
|
'Request ID',
|
|
231
222
|
'Server ID',
|
|
232
223
|
'Action',
|
|
@@ -275,7 +266,7 @@ class ShowServerEvent(command.ShowOne):
|
|
|
275
266
|
return parser
|
|
276
267
|
|
|
277
268
|
def take_action(self, parsed_args):
|
|
278
|
-
compute_client = self.app.client_manager.
|
|
269
|
+
compute_client = self.app.client_manager.compute
|
|
279
270
|
|
|
280
271
|
try:
|
|
281
272
|
server_id = compute_client.find_server(
|
|
@@ -93,7 +93,7 @@ class CreateServerGroup(command.ShowOne):
|
|
|
93
93
|
return parser
|
|
94
94
|
|
|
95
95
|
def take_action(self, parsed_args):
|
|
96
|
-
compute_client = self.app.client_manager.
|
|
96
|
+
compute_client = self.app.client_manager.compute
|
|
97
97
|
|
|
98
98
|
if parsed_args.policy in ('soft-affinity', 'soft-anti-affinity'):
|
|
99
99
|
if not sdk_utils.supports_microversion(compute_client, '2.15'):
|
|
@@ -153,7 +153,7 @@ class DeleteServerGroup(command.Command):
|
|
|
153
153
|
return parser
|
|
154
154
|
|
|
155
155
|
def take_action(self, parsed_args):
|
|
156
|
-
compute_client = self.app.client_manager.
|
|
156
|
+
compute_client = self.app.client_manager.compute
|
|
157
157
|
result = 0
|
|
158
158
|
for group in parsed_args.server_group:
|
|
159
159
|
try:
|
|
@@ -197,7 +197,7 @@ class ListServerGroup(command.Lister):
|
|
|
197
197
|
return parser
|
|
198
198
|
|
|
199
199
|
def take_action(self, parsed_args):
|
|
200
|
-
compute_client = self.app.client_manager.
|
|
200
|
+
compute_client = self.app.client_manager.compute
|
|
201
201
|
|
|
202
202
|
kwargs = {}
|
|
203
203
|
|
|
@@ -216,12 +216,12 @@ class ListServerGroup(command.Lister):
|
|
|
216
216
|
if sdk_utils.supports_microversion(compute_client, '2.64'):
|
|
217
217
|
policy_key = 'Policy'
|
|
218
218
|
|
|
219
|
-
columns = (
|
|
219
|
+
columns: tuple[str, ...] = (
|
|
220
220
|
'id',
|
|
221
221
|
'name',
|
|
222
222
|
policy_key.lower(),
|
|
223
223
|
)
|
|
224
|
-
column_headers = (
|
|
224
|
+
column_headers: tuple[str, ...] = (
|
|
225
225
|
'ID',
|
|
226
226
|
'Name',
|
|
227
227
|
policy_key,
|
|
@@ -264,7 +264,7 @@ class ShowServerGroup(command.ShowOne):
|
|
|
264
264
|
return parser
|
|
265
265
|
|
|
266
266
|
def take_action(self, parsed_args):
|
|
267
|
-
compute_client = self.app.client_manager.
|
|
267
|
+
compute_client = self.app.client_manager.compute
|
|
268
268
|
group = compute_client.find_server_group(
|
|
269
269
|
parsed_args.server_group, ignore_missing=False
|
|
270
270
|
)
|
|
@@ -72,7 +72,7 @@ class CreateServerImage(command.ShowOne):
|
|
|
72
72
|
self.app.stdout.write(f'\rProgress: {progress}')
|
|
73
73
|
self.app.stdout.flush()
|
|
74
74
|
|
|
75
|
-
compute_client = self.app.client_manager.
|
|
75
|
+
compute_client = self.app.client_manager.compute
|
|
76
76
|
image_client = self.app.client_manager.image
|
|
77
77
|
|
|
78
78
|
server = compute_client.find_server(
|
|
@@ -154,7 +154,7 @@ class ListMigration(command.Lister):
|
|
|
154
154
|
)
|
|
155
155
|
|
|
156
156
|
def take_action(self, parsed_args):
|
|
157
|
-
compute_client = self.app.client_manager.
|
|
157
|
+
compute_client = self.app.client_manager.compute
|
|
158
158
|
identity_client = self.app.client_manager.identity
|
|
159
159
|
|
|
160
160
|
search_opts = {}
|
|
@@ -289,7 +289,7 @@ class ShowMigration(command.ShowOne):
|
|
|
289
289
|
return parser
|
|
290
290
|
|
|
291
291
|
def take_action(self, parsed_args):
|
|
292
|
-
compute_client = self.app.client_manager.
|
|
292
|
+
compute_client = self.app.client_manager.compute
|
|
293
293
|
|
|
294
294
|
if not sdk_utils.supports_microversion(compute_client, '2.24'):
|
|
295
295
|
msg = _(
|
|
@@ -333,7 +333,7 @@ class ShowMigration(command.ShowOne):
|
|
|
333
333
|
ignore_missing=False,
|
|
334
334
|
)
|
|
335
335
|
|
|
336
|
-
column_headers = (
|
|
336
|
+
column_headers: tuple[str, ...] = (
|
|
337
337
|
'ID',
|
|
338
338
|
'Server UUID',
|
|
339
339
|
'Status',
|
|
@@ -352,7 +352,7 @@ class ShowMigration(command.ShowOne):
|
|
|
352
352
|
'Updated At',
|
|
353
353
|
)
|
|
354
354
|
|
|
355
|
-
columns = (
|
|
355
|
+
columns: tuple[str, ...] = (
|
|
356
356
|
'id',
|
|
357
357
|
'server_id',
|
|
358
358
|
'status',
|
|
@@ -404,7 +404,7 @@ class AbortMigration(command.Command):
|
|
|
404
404
|
return parser
|
|
405
405
|
|
|
406
406
|
def take_action(self, parsed_args):
|
|
407
|
-
compute_client = self.app.client_manager.
|
|
407
|
+
compute_client = self.app.client_manager.compute
|
|
408
408
|
|
|
409
409
|
if not sdk_utils.supports_microversion(compute_client, '2.24'):
|
|
410
410
|
msg = _(
|
|
@@ -469,7 +469,7 @@ class ForceCompleteMigration(command.Command):
|
|
|
469
469
|
return parser
|
|
470
470
|
|
|
471
471
|
def take_action(self, parsed_args):
|
|
472
|
-
compute_client = self.app.client_manager.
|
|
472
|
+
compute_client = self.app.client_manager.compute
|
|
473
473
|
|
|
474
474
|
if not sdk_utils.supports_microversion(compute_client, '2.22'):
|
|
475
475
|
msg = _(
|
|
@@ -34,7 +34,7 @@ class ListServerVolume(command.Lister):
|
|
|
34
34
|
return parser
|
|
35
35
|
|
|
36
36
|
def take_action(self, parsed_args):
|
|
37
|
-
compute_client = self.app.client_manager.
|
|
37
|
+
compute_client = self.app.client_manager.compute
|
|
38
38
|
|
|
39
39
|
server = compute_client.find_server(
|
|
40
40
|
parsed_args.server,
|
|
@@ -42,8 +42,8 @@ class ListServerVolume(command.Lister):
|
|
|
42
42
|
)
|
|
43
43
|
volumes = compute_client.volume_attachments(server)
|
|
44
44
|
|
|
45
|
-
columns = ()
|
|
46
|
-
column_headers = ()
|
|
45
|
+
columns: tuple[str, ...] = ()
|
|
46
|
+
column_headers: tuple[str, ...] = ()
|
|
47
47
|
|
|
48
48
|
if not sdk_utils.supports_microversion(compute_client, '2.89'):
|
|
49
49
|
columns += ('id',)
|
|
@@ -114,7 +114,7 @@ class SetServerVolume(command.Command):
|
|
|
114
114
|
return parser
|
|
115
115
|
|
|
116
116
|
def take_action(self, parsed_args):
|
|
117
|
-
compute_client = self.app.client_manager.
|
|
117
|
+
compute_client = self.app.client_manager.compute
|
|
118
118
|
volume_client = self.app.client_manager.sdk_connection.volume
|
|
119
119
|
|
|
120
120
|
if parsed_args.delete_on_termination is not None:
|
|
@@ -52,7 +52,7 @@ class DeleteService(command.Command):
|
|
|
52
52
|
return parser
|
|
53
53
|
|
|
54
54
|
def take_action(self, parsed_args):
|
|
55
|
-
compute_client = self.app.client_manager.
|
|
55
|
+
compute_client = self.app.client_manager.compute
|
|
56
56
|
result = 0
|
|
57
57
|
for s in parsed_args.service:
|
|
58
58
|
try:
|
|
@@ -70,7 +70,7 @@ class DeleteService(command.Command):
|
|
|
70
70
|
if result > 0:
|
|
71
71
|
total = len(parsed_args.service)
|
|
72
72
|
msg = _(
|
|
73
|
-
"%(result)s of %(total)s compute services failed
|
|
73
|
+
"%(result)s of %(total)s compute services failed to delete."
|
|
74
74
|
) % {'result': result, 'total': total}
|
|
75
75
|
raise exceptions.CommandError(msg)
|
|
76
76
|
|
|
@@ -108,8 +108,8 @@ deployment."""
|
|
|
108
108
|
return parser
|
|
109
109
|
|
|
110
110
|
def take_action(self, parsed_args):
|
|
111
|
-
compute_client = self.app.client_manager.
|
|
112
|
-
columns = (
|
|
111
|
+
compute_client = self.app.client_manager.compute
|
|
112
|
+
columns: tuple[str, ...] = (
|
|
113
113
|
"id",
|
|
114
114
|
"binary",
|
|
115
115
|
"host",
|
|
@@ -118,7 +118,7 @@ deployment."""
|
|
|
118
118
|
"state",
|
|
119
119
|
"updated_at",
|
|
120
120
|
)
|
|
121
|
-
column_headers = (
|
|
121
|
+
column_headers: tuple[str, ...] = (
|
|
122
122
|
"ID",
|
|
123
123
|
"Binary",
|
|
124
124
|
"Host",
|
|
@@ -153,8 +153,7 @@ class SetService(command.Command):
|
|
|
153
153
|
"service",
|
|
154
154
|
metavar="<service>",
|
|
155
155
|
help=_(
|
|
156
|
-
"Name of service (Binary name), for example "
|
|
157
|
-
"``nova-compute``"
|
|
156
|
+
"Name of service (Binary name), for example ``nova-compute``"
|
|
158
157
|
),
|
|
159
158
|
)
|
|
160
159
|
enabled_group = parser.add_mutually_exclusive_group()
|
|
@@ -222,7 +221,7 @@ class SetService(command.Command):
|
|
|
222
221
|
return services[0]
|
|
223
222
|
|
|
224
223
|
def take_action(self, parsed_args):
|
|
225
|
-
compute_client = self.app.client_manager.
|
|
224
|
+
compute_client = self.app.client_manager.compute
|
|
226
225
|
|
|
227
226
|
if (
|
|
228
227
|
parsed_args.enable or not parsed_args.disable
|
|
@@ -281,9 +280,7 @@ class SetService(command.Command):
|
|
|
281
280
|
force_down = False
|
|
282
281
|
if force_down is not None:
|
|
283
282
|
if not sdk_utils.supports_microversion(compute_client, '2.11'):
|
|
284
|
-
msg = _(
|
|
285
|
-
'--os-compute-api-version 2.11 or later is ' 'required'
|
|
286
|
-
)
|
|
283
|
+
msg = _('--os-compute-api-version 2.11 or later is required')
|
|
287
284
|
raise exceptions.CommandError(msg)
|
|
288
285
|
try:
|
|
289
286
|
compute_client.update_service_forced_down(
|
|
@@ -299,7 +296,6 @@ class SetService(command.Command):
|
|
|
299
296
|
|
|
300
297
|
if result > 0:
|
|
301
298
|
msg = _(
|
|
302
|
-
"Compute service %(service)s of host %(host)s failed to "
|
|
303
|
-
"set."
|
|
299
|
+
"Compute service %(service)s of host %(host)s failed to set."
|
|
304
300
|
) % {"service": parsed_args.service, "host": parsed_args.host}
|
|
305
301
|
raise exceptions.CommandError(msg)
|
|
@@ -115,8 +115,7 @@ class ListUsage(command.Lister):
|
|
|
115
115
|
metavar="<start>",
|
|
116
116
|
default=None,
|
|
117
117
|
help=_(
|
|
118
|
-
"Usage range start date, ex 2012-01-20"
|
|
119
|
-
" (default: 4 weeks ago)"
|
|
118
|
+
"Usage range start date, ex 2012-01-20 (default: 4 weeks ago)"
|
|
120
119
|
),
|
|
121
120
|
)
|
|
122
121
|
parser.add_argument(
|
|
@@ -136,7 +135,7 @@ class ListUsage(command.Lister):
|
|
|
136
135
|
else:
|
|
137
136
|
return project
|
|
138
137
|
|
|
139
|
-
compute_client = self.app.client_manager.
|
|
138
|
+
compute_client = self.app.client_manager.compute
|
|
140
139
|
columns = (
|
|
141
140
|
"project_id",
|
|
142
141
|
"server_usages",
|
|
@@ -222,8 +221,7 @@ class ShowUsage(command.ShowOne):
|
|
|
222
221
|
metavar="<start>",
|
|
223
222
|
default=None,
|
|
224
223
|
help=_(
|
|
225
|
-
"Usage range start date, ex 2012-01-20"
|
|
226
|
-
" (default: 4 weeks ago)"
|
|
224
|
+
"Usage range start date, ex 2012-01-20 (default: 4 weeks ago)"
|
|
227
225
|
),
|
|
228
226
|
)
|
|
229
227
|
parser.add_argument(
|
|
@@ -236,7 +234,7 @@ class ShowUsage(command.ShowOne):
|
|
|
236
234
|
|
|
237
235
|
def take_action(self, parsed_args):
|
|
238
236
|
identity_client = self.app.client_manager.identity
|
|
239
|
-
compute_client = self.app.client_manager.
|
|
237
|
+
compute_client = self.app.client_manager.compute
|
|
240
238
|
date_cli_format = "%Y-%m-%d"
|
|
241
239
|
now = datetime.datetime.now(datetime.timezone.utc).replace(tzinfo=None)
|
|
242
240
|
|
|
@@ -11,7 +11,6 @@
|
|
|
11
11
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
12
12
|
# License for the specific language governing permissions and limitations
|
|
13
13
|
# under the License.
|
|
14
|
-
#
|
|
15
14
|
|
|
16
15
|
import logging
|
|
17
16
|
|
|
@@ -20,9 +19,9 @@ from osc_lib import utils
|
|
|
20
19
|
|
|
21
20
|
from openstackclient.i18n import _
|
|
22
21
|
|
|
23
|
-
|
|
24
22
|
LOG = logging.getLogger(__name__)
|
|
25
23
|
|
|
24
|
+
# global variables used when building the shell
|
|
26
25
|
DEFAULT_API_VERSION = '3'
|
|
27
26
|
API_VERSION_OPTION = 'os_identity_api_version'
|
|
28
27
|
API_NAME = 'identity'
|
|
@@ -64,8 +63,7 @@ def build_option_parser(parser):
|
|
|
64
63
|
metavar='<identity-api-version>',
|
|
65
64
|
default=utils.env('OS_IDENTITY_API_VERSION'),
|
|
66
65
|
help=_(
|
|
67
|
-
'Identity API version, default=%s '
|
|
68
|
-
'(Env: OS_IDENTITY_API_VERSION)'
|
|
66
|
+
'Identity API version, default=%s (Env: OS_IDENTITY_API_VERSION)'
|
|
69
67
|
)
|
|
70
68
|
% DEFAULT_API_VERSION,
|
|
71
69
|
)
|
|
@@ -88,23 +88,22 @@ def find_service_sdk(identity_client, name_type_or_id):
|
|
|
88
88
|
raise exceptions.CommandError(e.message)
|
|
89
89
|
|
|
90
90
|
# search for service type
|
|
91
|
-
services = identity_client.services()
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
raise exceptions.CommandError(msg % name_type_or_id)
|
|
91
|
+
services = identity_client.services(type=name_type_or_id)
|
|
92
|
+
try:
|
|
93
|
+
service = next(services)
|
|
94
|
+
except StopIteration:
|
|
95
|
+
msg = _(
|
|
96
|
+
"No service with a type, name or ID of '%(query)s' exists."
|
|
97
|
+
) % {"query": name_type_or_id}
|
|
98
|
+
raise exceptions.CommandError(msg)
|
|
99
|
+
|
|
100
|
+
if next(services, None):
|
|
101
|
+
msg = _(
|
|
102
|
+
"Multiple service matches found for '%(query)s', use an ID to be more specific."
|
|
103
|
+
) % {"query": name_type_or_id}
|
|
104
|
+
raise exceptions.CommandError(msg)
|
|
106
105
|
|
|
107
|
-
return
|
|
106
|
+
return service
|
|
108
107
|
|
|
109
108
|
|
|
110
109
|
def get_resource(manager, name_type_or_id):
|
|
@@ -335,7 +334,7 @@ def add_inherited_option_to_parser(parser):
|
|
|
335
334
|
action='store_true',
|
|
336
335
|
default=False,
|
|
337
336
|
help=_(
|
|
338
|
-
'Specifies if the role grant is inheritable to the sub
|
|
337
|
+
'Specifies if the role grant is inheritable to the sub projects'
|
|
339
338
|
),
|
|
340
339
|
)
|
|
341
340
|
|
|
@@ -128,9 +128,10 @@ class DeleteEC2Creds(command.Command):
|
|
|
128
128
|
|
|
129
129
|
if result > 0:
|
|
130
130
|
total = len(parsed_args.access_keys)
|
|
131
|
-
msg = _(
|
|
132
|
-
|
|
133
|
-
|
|
131
|
+
msg = _("%(result)s of %(total)s EC2 keys failed to delete.") % {
|
|
132
|
+
'result': result,
|
|
133
|
+
'total': total,
|
|
134
|
+
}
|
|
134
135
|
raise exceptions.CommandError(msg)
|
|
135
136
|
|
|
136
137
|
|
|
@@ -111,9 +111,10 @@ class DeleteEndpoint(command.Command):
|
|
|
111
111
|
|
|
112
112
|
if result > 0:
|
|
113
113
|
total = len(parsed_args.endpoints)
|
|
114
|
-
msg = _(
|
|
115
|
-
|
|
116
|
-
|
|
114
|
+
msg = _("%(result)s of %(total)s endpoints failed to delete.") % {
|
|
115
|
+
'result': result,
|
|
116
|
+
'total': total,
|
|
117
|
+
}
|
|
117
118
|
raise exceptions.CommandError(msg)
|
|
118
119
|
|
|
119
120
|
|
|
@@ -132,18 +133,19 @@ class ListEndpoint(command.Lister):
|
|
|
132
133
|
|
|
133
134
|
def take_action(self, parsed_args):
|
|
134
135
|
identity_client = self.app.client_manager.identity
|
|
136
|
+
|
|
137
|
+
columns: tuple[str, ...] = (
|
|
138
|
+
'ID',
|
|
139
|
+
'Region',
|
|
140
|
+
'Service Name',
|
|
141
|
+
'Service Type',
|
|
142
|
+
)
|
|
135
143
|
if parsed_args.long:
|
|
136
|
-
columns
|
|
137
|
-
'ID',
|
|
138
|
-
'Region',
|
|
139
|
-
'Service Name',
|
|
140
|
-
'Service Type',
|
|
144
|
+
columns += (
|
|
141
145
|
'PublicURL',
|
|
142
146
|
'AdminURL',
|
|
143
147
|
'InternalURL',
|
|
144
148
|
)
|
|
145
|
-
else:
|
|
146
|
-
columns = ('ID', 'Region', 'Service Name', 'Service Type')
|
|
147
149
|
data = identity_client.endpoints.list()
|
|
148
150
|
|
|
149
151
|
for ep in data:
|
|
@@ -140,9 +140,10 @@ class DeleteProject(command.Command):
|
|
|
140
140
|
|
|
141
141
|
if errors > 0:
|
|
142
142
|
total = len(parsed_args.projects)
|
|
143
|
-
msg = _(
|
|
144
|
-
|
|
145
|
-
|
|
143
|
+
msg = _("%(errors)s of %(total)s projects failed to delete.") % {
|
|
144
|
+
'errors': errors,
|
|
145
|
+
'total': total,
|
|
146
|
+
}
|
|
146
147
|
raise exceptions.CommandError(msg)
|
|
147
148
|
|
|
148
149
|
|
|
@@ -169,10 +170,9 @@ class ListProject(command.Lister):
|
|
|
169
170
|
return parser
|
|
170
171
|
|
|
171
172
|
def take_action(self, parsed_args):
|
|
173
|
+
columns: tuple[str, ...] = ('ID', 'Name')
|
|
172
174
|
if parsed_args.long:
|
|
173
|
-
columns
|
|
174
|
-
else:
|
|
175
|
-
columns = ('ID', 'Name')
|
|
175
|
+
columns += ('Description', 'Enabled')
|
|
176
176
|
data = self.app.client_manager.identity.tenants.list()
|
|
177
177
|
if parsed_args.sort:
|
|
178
178
|
data = utils.sort_items(data, parsed_args.sort)
|
|
@@ -143,7 +143,7 @@ class DeleteRole(command.Command):
|
|
|
143
143
|
|
|
144
144
|
if errors > 0:
|
|
145
145
|
total = len(parsed_args.roles)
|
|
146
|
-
msg = _("%(errors)s of %(total)s roles failed
|
|
146
|
+
msg = _("%(errors)s of %(total)s roles failed to delete.") % {
|
|
147
147
|
'errors': errors,
|
|
148
148
|
'total': total,
|
|
149
149
|
}
|
|
@@ -100,9 +100,10 @@ class DeleteService(command.Command):
|
|
|
100
100
|
|
|
101
101
|
if result > 0:
|
|
102
102
|
total = len(parsed_args.services)
|
|
103
|
-
msg = _(
|
|
104
|
-
|
|
105
|
-
|
|
103
|
+
msg = _("%(result)s of %(total)s services failed to delete.") % {
|
|
104
|
+
'result': result,
|
|
105
|
+
'total': total,
|
|
106
|
+
}
|
|
106
107
|
raise exceptions.CommandError(msg)
|
|
107
108
|
|
|
108
109
|
|
|
@@ -120,10 +121,9 @@ class ListService(command.Lister):
|
|
|
120
121
|
return parser
|
|
121
122
|
|
|
122
123
|
def take_action(self, parsed_args):
|
|
124
|
+
columns: tuple[str, ...] = ('ID', 'Name', 'Type')
|
|
123
125
|
if parsed_args.long:
|
|
124
|
-
columns
|
|
125
|
-
else:
|
|
126
|
-
columns = ('ID', 'Name', 'Type')
|
|
126
|
+
columns += ('Description',)
|
|
127
127
|
data = self.app.client_manager.identity.services.list()
|
|
128
128
|
return (
|
|
129
129
|
columns,
|
|
@@ -164,7 +164,7 @@ class ShowService(command.ShowOne):
|
|
|
164
164
|
return zip(*sorted(info.items()))
|
|
165
165
|
|
|
166
166
|
msg = _(
|
|
167
|
-
"No service catalog with a type, name or ID of '%s'
|
|
167
|
+
"No service catalog with a type, name or ID of '%s' exists."
|
|
168
168
|
) % (parsed_args.service)
|
|
169
169
|
raise exceptions.CommandError(msg)
|
|
170
170
|
else:
|
|
@@ -194,7 +194,7 @@ class DeleteUser(command.Command):
|
|
|
194
194
|
|
|
195
195
|
if errors > 0:
|
|
196
196
|
total = len(parsed_args.users)
|
|
197
|
-
msg = _("%(errors)s of %(total)s users failed
|
|
197
|
+
msg = _("%(errors)s of %(total)s users failed to delete.") % {
|
|
198
198
|
'errors': errors,
|
|
199
199
|
'total': total,
|
|
200
200
|
}
|
|
@@ -230,21 +230,11 @@ class ListUser(command.Lister):
|
|
|
230
230
|
)
|
|
231
231
|
project = project.id
|
|
232
232
|
|
|
233
|
+
columns: tuple[str, ...] = ('id', 'name')
|
|
234
|
+
column_headers: tuple[str, ...] = ('ID', 'Name')
|
|
233
235
|
if parsed_args.long:
|
|
234
|
-
columns
|
|
235
|
-
|
|
236
|
-
'Name',
|
|
237
|
-
'tenantId',
|
|
238
|
-
'Email',
|
|
239
|
-
'Enabled',
|
|
240
|
-
)
|
|
241
|
-
column_headers = (
|
|
242
|
-
'ID',
|
|
243
|
-
'Name',
|
|
244
|
-
'Project',
|
|
245
|
-
'Email',
|
|
246
|
-
'Enabled',
|
|
247
|
-
)
|
|
236
|
+
columns += ('tenantId', 'email', 'enabled')
|
|
237
|
+
column_headers += ('Project', 'Email', 'Enabled')
|
|
248
238
|
# Cache the project list
|
|
249
239
|
project_cache = {}
|
|
250
240
|
try:
|
|
@@ -256,15 +246,10 @@ class ListUser(command.Lister):
|
|
|
256
246
|
formatters['tenantId'] = functools.partial(
|
|
257
247
|
ProjectColumn, project_cache=project_cache
|
|
258
248
|
)
|
|
259
|
-
else:
|
|
260
|
-
columns = column_headers = ('ID', 'Name')
|
|
261
249
|
data = identity_client.users.list(tenant_id=project)
|
|
262
250
|
|
|
263
251
|
if parsed_args.project:
|
|
264
|
-
|
|
265
|
-
for s in data:
|
|
266
|
-
d[s.id] = s
|
|
267
|
-
data = d.values()
|
|
252
|
+
data = {s.id: s for s in data}.values()
|
|
268
253
|
|
|
269
254
|
if parsed_args.long:
|
|
270
255
|
# FIXME(dtroyer): Sometimes user objects have 'tenant_id' instead
|
|
@@ -54,17 +54,14 @@ class DeleteAccessRule(command.Command):
|
|
|
54
54
|
except Exception as e:
|
|
55
55
|
errors += 1
|
|
56
56
|
LOG.error(
|
|
57
|
-
_(
|
|
58
|
-
"Failed to delete access rule with "
|
|
59
|
-
"ID '%(ac)s': %(e)s"
|
|
60
|
-
),
|
|
57
|
+
_("Failed to delete access rule with ID '%(ac)s': %(e)s"),
|
|
61
58
|
{'ac': ac, 'e': e},
|
|
62
59
|
)
|
|
63
60
|
|
|
64
61
|
if errors > 0:
|
|
65
62
|
total = len(parsed_args.access_rule)
|
|
66
63
|
msg = _(
|
|
67
|
-
"%(errors)s of %(total)s access rules failed
|
|
64
|
+
"%(errors)s of %(total)s access rules failed to delete."
|
|
68
65
|
) % {'errors': errors, 'total': total}
|
|
69
66
|
raise exceptions.CommandError(msg)
|
|
70
67
|
|
|
@@ -82,9 +82,10 @@ class DeleteConsumer(command.Command):
|
|
|
82
82
|
|
|
83
83
|
if result > 0:
|
|
84
84
|
total = len(parsed_args.consumer)
|
|
85
|
-
msg = _(
|
|
86
|
-
|
|
87
|
-
|
|
85
|
+
msg = _("%(result)s of %(total)s consumers failed to delete.") % {
|
|
86
|
+
'result': result,
|
|
87
|
+
'total': total,
|
|
88
|
+
}
|
|
88
89
|
raise exceptions.CommandError(msg)
|
|
89
90
|
|
|
90
91
|
|
|
@@ -70,8 +70,7 @@ class CreateCredential(command.ShowOne):
|
|
|
70
70
|
'--project',
|
|
71
71
|
metavar='<project>',
|
|
72
72
|
help=_(
|
|
73
|
-
'Project which limits the scope of '
|
|
74
|
-
'the credential (name or ID)'
|
|
73
|
+
'Project which limits the scope of the credential (name or ID)'
|
|
75
74
|
),
|
|
76
75
|
)
|
|
77
76
|
return parser
|
|
@@ -128,9 +127,10 @@ class DeleteCredential(command.Command):
|
|
|
128
127
|
|
|
129
128
|
if result > 0:
|
|
130
129
|
total = len(parsed_args.credential)
|
|
131
|
-
msg = _(
|
|
132
|
-
|
|
133
|
-
|
|
130
|
+
msg = _("%(result)s of %(total)s credential failed to delete.") % {
|
|
131
|
+
'result': result,
|
|
132
|
+
'total': total,
|
|
133
|
+
}
|
|
134
134
|
raise exceptions.CommandError(msg)
|
|
135
135
|
|
|
136
136
|
|
|
@@ -219,8 +219,7 @@ class SetCredential(command.Command):
|
|
|
219
219
|
'--project',
|
|
220
220
|
metavar='<project>',
|
|
221
221
|
help=_(
|
|
222
|
-
'Project which limits the scope of '
|
|
223
|
-
'the credential (name or ID)'
|
|
222
|
+
'Project which limits the scope of the credential (name or ID)'
|
|
224
223
|
),
|
|
225
224
|
)
|
|
226
225
|
return parser
|
|
@@ -124,7 +124,7 @@ class DeleteDomain(command.Command):
|
|
|
124
124
|
|
|
125
125
|
if result > 0:
|
|
126
126
|
total = len(parsed_args.domain)
|
|
127
|
-
msg = _("%(result)s of %(total)s domains failed
|
|
127
|
+
msg = _("%(result)s of %(total)s domains failed to delete.") % {
|
|
128
128
|
'result': result,
|
|
129
129
|
'total': total,
|
|
130
130
|
}
|