python-openstackclient 7.4.0__py3-none-any.whl → 8.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- openstackclient/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 +7 -5
- openstackclient/compute/v2/agent.py +5 -5
- openstackclient/compute/v2/aggregate.py +17 -15
- openstackclient/compute/v2/console.py +10 -4
- openstackclient/compute/v2/console_connection.py +48 -0
- 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 +18 -13
- openstackclient/compute/v2/server.py +144 -121
- openstackclient/compute/v2/server_backup.py +1 -1
- openstackclient/compute/v2/server_event.py +8 -17
- 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 +95 -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/application_credential.py +2 -2
- openstackclient/identity/v3/consumer.py +4 -3
- openstackclient/identity/v3/credential.py +6 -7
- openstackclient/identity/v3/domain.py +63 -44
- 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 +116 -72
- 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 +23 -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 +47 -11
- openstackclient/image/client.py +7 -5
- openstackclient/image/v1/image.py +11 -15
- openstackclient/image/v2/cache.py +2 -4
- openstackclient/image/v2/image.py +41 -48
- 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 -16
- 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 +69 -47
- 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 +7 -16
- 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 +53 -42
- openstackclient/network/v2/security_group.py +13 -19
- openstackclient/network/v2/security_group_rule.py +10 -11
- 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 +7 -3
- openstackclient/tests/functional/common/test_quota.py +3 -1
- openstackclient/tests/functional/compute/v2/common.py +12 -6
- openstackclient/tests/functional/compute/v2/test_keypair.py +41 -5
- 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 +85 -315
- 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 +34 -17
- openstackclient/tests/unit/compute/v2/test_console_connection.py +72 -0
- openstackclient/tests/unit/compute/v2/test_flavor.py +72 -72
- 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 +36 -29
- openstackclient/tests/unit/compute/v2/test_server.py +693 -606
- openstackclient/tests/unit/compute/v2/test_server_backup.py +36 -77
- openstackclient/tests/unit/compute/v2/test_server_event.py +18 -20
- openstackclient/tests/unit/compute/v2/test_server_group.py +25 -31
- openstackclient/tests/unit/compute/v2/test_server_image.py +37 -78
- openstackclient/tests/unit/compute/v2/test_server_migration.py +41 -41
- 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 +48 -26
- openstackclient/tests/unit/identity/v3/test_domain.py +115 -105
- openstackclient/tests/unit/identity/v3/test_endpoint.py +167 -172
- openstackclient/tests/unit/identity/v3/test_group.py +353 -202
- openstackclient/tests/unit/identity/v3/test_mappings.py +2 -2
- openstackclient/tests/unit/identity/v3/test_project.py +16 -0
- openstackclient/tests/unit/identity/v3/test_trust.py +5 -2
- openstackclient/tests/unit/identity/v3/test_user.py +102 -6
- openstackclient/tests/unit/image/v1/fakes.py +2 -2
- openstackclient/tests/unit/image/v1/test_image.py +8 -9
- openstackclient/tests/unit/image/v2/test_image.py +84 -46
- openstackclient/tests/unit/integ/cli/test_shell.py +1 -2
- openstackclient/tests/unit/network/test_common.py +2 -2
- openstackclient/tests/unit/network/v2/fakes.py +405 -485
- openstackclient/tests/unit/network/v2/test_floating_ip_compute.py +8 -14
- openstackclient/tests/unit/network/v2/test_floating_ip_network.py +62 -54
- openstackclient/tests/unit/network/v2/test_floating_ip_pool_compute.py +1 -1
- openstackclient/tests/unit/network/v2/test_l3_conntrack_helper.py +2 -2
- openstackclient/tests/unit/network/v2/test_ndp_proxy.py +1 -3
- openstackclient/tests/unit/network/v2/test_network.py +4 -4
- openstackclient/tests/unit/network/v2/test_network_agent.py +15 -29
- openstackclient/tests/unit/network/v2/test_network_compute.py +11 -11
- openstackclient/tests/unit/network/v2/test_network_qos_policy.py +16 -19
- openstackclient/tests/unit/network/v2/test_network_qos_rule.py +79 -152
- openstackclient/tests/unit/network/v2/test_network_qos_rule_type.py +4 -6
- openstackclient/tests/unit/network/v2/test_network_rbac.py +2 -2
- openstackclient/tests/unit/network/v2/test_network_trunk.py +2 -2
- openstackclient/tests/unit/network/v2/test_port.py +21 -22
- openstackclient/tests/unit/network/v2/test_router.py +130 -51
- openstackclient/tests/unit/network/v2/test_security_group_compute.py +11 -19
- openstackclient/tests/unit/network/v2/test_security_group_network.py +25 -27
- openstackclient/tests/unit/network/v2/test_security_group_rule_compute.py +15 -17
- openstackclient/tests/unit/network/v2/test_security_group_rule_network.py +33 -39
- openstackclient/tests/unit/object/v1/test_object_all.py +4 -3
- openstackclient/tests/unit/test_shell.py +16 -13
- openstackclient/tests/unit/volume/v2/fakes.py +1 -2
- openstackclient/tests/unit/volume/v2/test_service.py +57 -91
- openstackclient/tests/unit/volume/v2/test_volume.py +109 -106
- openstackclient/tests/unit/volume/v2/test_volume_backup.py +141 -148
- openstackclient/tests/unit/volume/v2/test_volume_snapshot.py +293 -283
- 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_block_storage_log_level.py +61 -71
- openstackclient/tests/unit/volume/v3/test_service.py +221 -141
- openstackclient/tests/unit/volume/v3/test_volume.py +131 -120
- openstackclient/tests/unit/volume/v3/test_volume_attachment.py +4 -4
- openstackclient/tests/unit/volume/v3/test_volume_backup.py +198 -203
- openstackclient/tests/unit/volume/v3/test_volume_snapshot.py +683 -49
- 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/service.py +41 -38
- openstackclient/volume/v2/volume.py +71 -53
- openstackclient/volume/v2/volume_backup.py +15 -10
- openstackclient/volume/v2/volume_snapshot.py +129 -93
- 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_log_level.py +22 -28
- openstackclient/volume/v3/block_storage_manage.py +1 -3
- openstackclient/volume/v3/service.py +105 -14
- openstackclient/volume/v3/volume.py +218 -58
- openstackclient/volume/v3/volume_attachment.py +3 -2
- openstackclient/volume/v3/volume_backup.py +31 -27
- openstackclient/volume/v3/volume_group.py +2 -1
- openstackclient/volume/v3/volume_group_snapshot.py +2 -1
- openstackclient/volume/v3/volume_snapshot.py +489 -13
- openstackclient/volume/v3/volume_type.py +10 -21
- {python_openstackclient-7.4.0.dist-info → python_openstackclient-8.1.0.dist-info}/AUTHORS +11 -0
- python_openstackclient-8.1.0.dist-info/METADATA +264 -0
- {python_openstackclient-7.4.0.dist-info → python_openstackclient-8.1.0.dist-info}/RECORD +238 -259
- {python_openstackclient-7.4.0.dist-info → python_openstackclient-8.1.0.dist-info}/WHEEL +1 -1
- {python_openstackclient-7.4.0.dist-info → python_openstackclient-8.1.0.dist-info}/entry_points.txt +7 -47
- python_openstackclient-8.1.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/METADATA +0 -172
- python_openstackclient-7.4.0.dist-info/pbr.json +0 -1
- {python_openstackclient-7.4.0.dist-info → python_openstackclient-8.1.0.dist-info}/LICENSE +0 -0
- {python_openstackclient-7.4.0.dist-info → python_openstackclient-8.1.0.dist-info}/top_level.txt +0 -0
|
@@ -149,7 +149,7 @@ class CreateFlavor(command.ShowOne):
|
|
|
149
149
|
return parser
|
|
150
150
|
|
|
151
151
|
def take_action(self, parsed_args):
|
|
152
|
-
compute_client = self.app.client_manager.
|
|
152
|
+
compute_client = self.app.client_manager.compute
|
|
153
153
|
identity_client = self.app.client_manager.identity
|
|
154
154
|
|
|
155
155
|
if parsed_args.project and parsed_args.public:
|
|
@@ -190,8 +190,7 @@ class CreateFlavor(command.ShowOne):
|
|
|
190
190
|
compute_client.flavor_add_tenant_access(flavor.id, project_id)
|
|
191
191
|
except Exception as e:
|
|
192
192
|
msg = _(
|
|
193
|
-
"Failed to add project %(project)s access to "
|
|
194
|
-
"flavor: %(e)s"
|
|
193
|
+
"Failed to add project %(project)s access to flavor: %(e)s"
|
|
195
194
|
)
|
|
196
195
|
LOG.error(msg, {'project': parsed_args.project, 'e': e})
|
|
197
196
|
if parsed_args.properties:
|
|
@@ -224,7 +223,7 @@ class DeleteFlavor(command.Command):
|
|
|
224
223
|
return parser
|
|
225
224
|
|
|
226
225
|
def take_action(self, parsed_args):
|
|
227
|
-
compute_client = self.app.client_manager.
|
|
226
|
+
compute_client = self.app.client_manager.compute
|
|
228
227
|
result = 0
|
|
229
228
|
for f in parsed_args.flavor:
|
|
230
229
|
try:
|
|
@@ -242,7 +241,7 @@ class DeleteFlavor(command.Command):
|
|
|
242
241
|
|
|
243
242
|
if result > 0:
|
|
244
243
|
total = len(parsed_args.flavor)
|
|
245
|
-
msg = _("%(result)s of %(total)s flavors failed
|
|
244
|
+
msg = _("%(result)s of %(total)s flavors failed to delete.") % {
|
|
246
245
|
'result': result,
|
|
247
246
|
'total': total,
|
|
248
247
|
}
|
|
@@ -297,7 +296,7 @@ class ListFlavor(command.Lister):
|
|
|
297
296
|
return parser
|
|
298
297
|
|
|
299
298
|
def take_action(self, parsed_args):
|
|
300
|
-
compute_client = self.app.client_manager.
|
|
299
|
+
compute_client = self.app.client_manager.compute
|
|
301
300
|
# is_public is ternary - None means give all flavors,
|
|
302
301
|
# True is public only and False is private only
|
|
303
302
|
# By default Nova assumes True and gives admins public flavors
|
|
@@ -330,7 +329,7 @@ class ListFlavor(command.Lister):
|
|
|
330
329
|
if parsed_args.long and not f.extra_specs:
|
|
331
330
|
compute_client.fetch_flavor_extra_specs(f)
|
|
332
331
|
|
|
333
|
-
columns = (
|
|
332
|
+
columns: tuple[str, ...] = (
|
|
334
333
|
"id",
|
|
335
334
|
"name",
|
|
336
335
|
"ram",
|
|
@@ -346,7 +345,7 @@ class ListFlavor(command.Lister):
|
|
|
346
345
|
"extra_specs",
|
|
347
346
|
)
|
|
348
347
|
|
|
349
|
-
column_headers = (
|
|
348
|
+
column_headers: tuple[str, ...] = (
|
|
350
349
|
"ID",
|
|
351
350
|
"Name",
|
|
352
351
|
"RAM",
|
|
@@ -404,9 +403,7 @@ class SetFlavor(command.Command):
|
|
|
404
403
|
parser.add_argument(
|
|
405
404
|
'--project',
|
|
406
405
|
metavar='<project>',
|
|
407
|
-
help=_(
|
|
408
|
-
'Set flavor access to project (name or ID) ' '(admin only)'
|
|
409
|
-
),
|
|
406
|
+
help=_('Set flavor access to project (name or ID) (admin only)'),
|
|
410
407
|
)
|
|
411
408
|
identity_common.add_project_domain_option_to_parser(parser)
|
|
412
409
|
parser.add_argument(
|
|
@@ -421,7 +418,7 @@ class SetFlavor(command.Command):
|
|
|
421
418
|
return parser
|
|
422
419
|
|
|
423
420
|
def take_action(self, parsed_args):
|
|
424
|
-
compute_client = self.app.client_manager.
|
|
421
|
+
compute_client = self.app.client_manager.compute
|
|
425
422
|
identity_client = self.app.client_manager.identity
|
|
426
423
|
|
|
427
424
|
try:
|
|
@@ -483,7 +480,7 @@ class SetFlavor(command.Command):
|
|
|
483
480
|
|
|
484
481
|
if result > 0:
|
|
485
482
|
raise exceptions.CommandError(
|
|
486
|
-
_("Command Failed: One or more of
|
|
483
|
+
_("Command Failed: One or more of the operations failed")
|
|
487
484
|
)
|
|
488
485
|
|
|
489
486
|
|
|
@@ -500,7 +497,7 @@ class ShowFlavor(command.ShowOne):
|
|
|
500
497
|
return parser
|
|
501
498
|
|
|
502
499
|
def take_action(self, parsed_args):
|
|
503
|
-
compute_client = self.app.client_manager.
|
|
500
|
+
compute_client = self.app.client_manager.compute
|
|
504
501
|
flavor = compute_client.find_flavor(
|
|
505
502
|
parsed_args.flavor, get_extra_specs=True, ignore_missing=False
|
|
506
503
|
)
|
|
@@ -560,8 +557,7 @@ class UnsetFlavor(command.Command):
|
|
|
560
557
|
'--project',
|
|
561
558
|
metavar='<project>',
|
|
562
559
|
help=_(
|
|
563
|
-
'Remove flavor access from project (name or ID) '
|
|
564
|
-
'(admin only)'
|
|
560
|
+
'Remove flavor access from project (name or ID) (admin only)'
|
|
565
561
|
),
|
|
566
562
|
)
|
|
567
563
|
identity_common.add_project_domain_option_to_parser(parser)
|
|
@@ -569,7 +565,7 @@ class UnsetFlavor(command.Command):
|
|
|
569
565
|
return parser
|
|
570
566
|
|
|
571
567
|
def take_action(self, parsed_args):
|
|
572
|
-
compute_client = self.app.client_manager.
|
|
568
|
+
compute_client = self.app.client_manager.compute
|
|
573
569
|
identity_client = self.app.client_manager.identity
|
|
574
570
|
|
|
575
571
|
try:
|
|
@@ -612,5 +608,5 @@ class UnsetFlavor(command.Command):
|
|
|
612
608
|
|
|
613
609
|
if result > 0:
|
|
614
610
|
raise exceptions.CommandError(
|
|
615
|
-
_("Command Failed: One or more of
|
|
611
|
+
_("Command Failed: One or more of the operations failed")
|
|
616
612
|
)
|
|
@@ -35,7 +35,7 @@ class ListHost(command.Lister):
|
|
|
35
35
|
return parser
|
|
36
36
|
|
|
37
37
|
def take_action(self, parsed_args):
|
|
38
|
-
compute_client = self.app.client_manager.
|
|
38
|
+
compute_client = self.app.client_manager.compute
|
|
39
39
|
|
|
40
40
|
self.log.warning(
|
|
41
41
|
"API has been deprecated; "
|
|
@@ -83,7 +83,7 @@ class SetHost(command.Command):
|
|
|
83
83
|
return parser
|
|
84
84
|
|
|
85
85
|
def take_action(self, parsed_args):
|
|
86
|
-
compute_client = self.app.client_manager.
|
|
86
|
+
compute_client = self.app.client_manager.compute
|
|
87
87
|
|
|
88
88
|
self.log.warning(
|
|
89
89
|
"API has been deprecated; "
|
|
@@ -121,7 +121,7 @@ class ShowHost(command.Lister):
|
|
|
121
121
|
return parser
|
|
122
122
|
|
|
123
123
|
def take_action(self, parsed_args):
|
|
124
|
-
compute_client = self.app.client_manager.
|
|
124
|
+
compute_client = self.app.client_manager.compute
|
|
125
125
|
|
|
126
126
|
self.log.warning(
|
|
127
127
|
"API has been deprecated; "
|
|
@@ -90,7 +90,7 @@ class ListHypervisor(command.Lister):
|
|
|
90
90
|
return parser
|
|
91
91
|
|
|
92
92
|
def take_action(self, parsed_args):
|
|
93
|
-
compute_client = self.app.client_manager.
|
|
93
|
+
compute_client = self.app.client_manager.compute
|
|
94
94
|
|
|
95
95
|
list_opts = {}
|
|
96
96
|
|
|
@@ -119,14 +119,20 @@ class ListHypervisor(command.Lister):
|
|
|
119
119
|
if parsed_args.matching:
|
|
120
120
|
list_opts['hypervisor_hostname_pattern'] = parsed_args.matching
|
|
121
121
|
|
|
122
|
-
column_headers = (
|
|
122
|
+
column_headers: tuple[str, ...] = (
|
|
123
123
|
"ID",
|
|
124
124
|
"Hypervisor Hostname",
|
|
125
125
|
"Hypervisor Type",
|
|
126
126
|
"Host IP",
|
|
127
127
|
"State",
|
|
128
128
|
)
|
|
129
|
-
columns
|
|
129
|
+
columns: tuple[str, ...] = (
|
|
130
|
+
'id',
|
|
131
|
+
'name',
|
|
132
|
+
'hypervisor_type',
|
|
133
|
+
'host_ip',
|
|
134
|
+
'state',
|
|
135
|
+
)
|
|
130
136
|
|
|
131
137
|
if parsed_args.long:
|
|
132
138
|
if not sdk_utils.supports_microversion(compute_client, '2.88'):
|
|
@@ -164,7 +170,7 @@ class ShowHypervisor(command.ShowOne):
|
|
|
164
170
|
return parser
|
|
165
171
|
|
|
166
172
|
def take_action(self, parsed_args):
|
|
167
|
-
compute_client = self.app.client_manager.
|
|
173
|
+
compute_client = self.app.client_manager.compute
|
|
168
174
|
|
|
169
175
|
hypervisor_id = compute_client.find_hypervisor(
|
|
170
176
|
parsed_args.hypervisor, ignore_missing=False, details=False
|
|
@@ -42,7 +42,7 @@ class ShowHypervisorStats(command.ShowOne):
|
|
|
42
42
|
def take_action(self, parsed_args):
|
|
43
43
|
# The command is deprecated since it is being dropped in Nova.
|
|
44
44
|
self.log.warning(_("This command is deprecated."))
|
|
45
|
-
compute_client = self.app.client_manager.
|
|
45
|
+
compute_client = self.app.client_manager.compute
|
|
46
46
|
# We do API request directly cause this deprecated method is not and
|
|
47
47
|
# will not be supported by OpenStackSDK.
|
|
48
48
|
response = compute_client.get(
|
|
@@ -61,14 +61,13 @@ def _generate_keypair():
|
|
|
61
61
|
def _get_keypair_columns(item, hide_pub_key=False, hide_priv_key=False):
|
|
62
62
|
# To maintain backwards compatibility we need to rename sdk props to
|
|
63
63
|
# whatever OSC was using before
|
|
64
|
-
column_map = {}
|
|
65
64
|
hidden_columns = ['links', 'location']
|
|
66
65
|
if hide_pub_key:
|
|
67
66
|
hidden_columns.append('public_key')
|
|
68
67
|
if hide_priv_key:
|
|
69
68
|
hidden_columns.append('private_key')
|
|
70
69
|
return utils.get_osc_show_columns_for_sdk_resource(
|
|
71
|
-
item,
|
|
70
|
+
item, {}, hidden_columns
|
|
72
71
|
)
|
|
73
72
|
|
|
74
73
|
|
|
@@ -121,13 +120,12 @@ class CreateKeypair(command.ShowOne):
|
|
|
121
120
|
return parser
|
|
122
121
|
|
|
123
122
|
def take_action(self, parsed_args):
|
|
124
|
-
compute_client = self.app.client_manager.
|
|
123
|
+
compute_client = self.app.client_manager.compute
|
|
125
124
|
identity_client = self.app.client_manager.identity
|
|
126
125
|
|
|
127
126
|
kwargs = {'name': parsed_args.name}
|
|
128
127
|
|
|
129
128
|
if parsed_args.public_key:
|
|
130
|
-
generated_keypair = None
|
|
131
129
|
try:
|
|
132
130
|
with open(os.path.expanduser(parsed_args.public_key)) as p:
|
|
133
131
|
public_key = p.read()
|
|
@@ -230,7 +228,7 @@ class DeleteKeypair(command.Command):
|
|
|
230
228
|
return parser
|
|
231
229
|
|
|
232
230
|
def take_action(self, parsed_args):
|
|
233
|
-
compute_client = self.app.client_manager.
|
|
231
|
+
compute_client = self.app.client_manager.compute
|
|
234
232
|
identity_client = self.app.client_manager.identity
|
|
235
233
|
|
|
236
234
|
kwargs = {}
|
|
@@ -258,13 +256,13 @@ class DeleteKeypair(command.Command):
|
|
|
258
256
|
except Exception as e:
|
|
259
257
|
result += 1
|
|
260
258
|
LOG.error(
|
|
261
|
-
_("Failed to delete key with name
|
|
259
|
+
_("Failed to delete key with name '%(name)s': %(e)s"),
|
|
262
260
|
{'name': n, 'e': e},
|
|
263
261
|
)
|
|
264
262
|
|
|
265
263
|
if result > 0:
|
|
266
264
|
total = len(parsed_args.name)
|
|
267
|
-
msg = _("%(result)s of %(total)s keys failed
|
|
265
|
+
msg = _("%(result)s of %(total)s keys failed to delete.") % {
|
|
268
266
|
'result': result,
|
|
269
267
|
'total': total,
|
|
270
268
|
}
|
|
@@ -300,8 +298,9 @@ class ListKeypair(command.Lister):
|
|
|
300
298
|
return parser
|
|
301
299
|
|
|
302
300
|
def take_action(self, parsed_args):
|
|
303
|
-
compute_client = self.app.client_manager.
|
|
301
|
+
compute_client = self.app.client_manager.compute
|
|
304
302
|
identity_client = self.app.client_manager.identity
|
|
303
|
+
identity_sdk_client = self.app.client_manager.sdk_connection.identity
|
|
305
304
|
|
|
306
305
|
kwargs = {}
|
|
307
306
|
|
|
@@ -347,11 +346,17 @@ class ListKeypair(command.Lister):
|
|
|
347
346
|
parsed_args.project,
|
|
348
347
|
parsed_args.project_domain,
|
|
349
348
|
).id
|
|
350
|
-
|
|
349
|
+
assignments = identity_sdk_client.role_assignments(
|
|
350
|
+
scope_project_id=project
|
|
351
|
+
)
|
|
352
|
+
user_ids = set()
|
|
353
|
+
for assignment in assignments:
|
|
354
|
+
if assignment.user:
|
|
355
|
+
user_ids.add(assignment.user['id'])
|
|
351
356
|
|
|
352
357
|
data = []
|
|
353
|
-
for
|
|
354
|
-
kwargs['user_id'] =
|
|
358
|
+
for user_id in user_ids:
|
|
359
|
+
kwargs['user_id'] = user_id
|
|
355
360
|
data.extend(compute_client.keypairs(**kwargs))
|
|
356
361
|
elif parsed_args.user:
|
|
357
362
|
if not sdk_utils.supports_microversion(compute_client, '2.10'):
|
|
@@ -372,7 +377,7 @@ class ListKeypair(command.Lister):
|
|
|
372
377
|
else:
|
|
373
378
|
data = compute_client.keypairs(**kwargs)
|
|
374
379
|
|
|
375
|
-
columns = ("Name", "Fingerprint")
|
|
380
|
+
columns: tuple[str, ...] = ("Name", "Fingerprint")
|
|
376
381
|
|
|
377
382
|
if sdk_utils.supports_microversion(compute_client, '2.2'):
|
|
378
383
|
columns += ("Type",)
|
|
@@ -411,7 +416,7 @@ class ShowKeypair(command.ShowOne):
|
|
|
411
416
|
return parser
|
|
412
417
|
|
|
413
418
|
def take_action(self, parsed_args):
|
|
414
|
-
compute_client = self.app.client_manager.
|
|
419
|
+
compute_client = self.app.client_manager.compute
|
|
415
420
|
identity_client = self.app.client_manager.identity
|
|
416
421
|
|
|
417
422
|
kwargs = {}
|