python-openstackclient 8.2.0__py3-none-any.whl → 8.3.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/api/object_store_v1.py +4 -1
- openstackclient/command.py +27 -0
- openstackclient/common/availability_zone.py +1 -1
- openstackclient/common/clientmanager.py +59 -21
- openstackclient/common/configuration.py +1 -1
- openstackclient/common/extension.py +1 -1
- openstackclient/common/limits.py +1 -1
- openstackclient/common/module.py +4 -2
- openstackclient/common/project_cleanup.py +10 -8
- openstackclient/common/quota.py +23 -6
- openstackclient/common/versions.py +1 -2
- openstackclient/compute/v2/agent.py +1 -1
- openstackclient/compute/v2/aggregate.py +6 -5
- openstackclient/compute/v2/console.py +5 -3
- openstackclient/compute/v2/console_connection.py +1 -1
- openstackclient/compute/v2/flavor.py +1 -1
- openstackclient/compute/v2/host.py +1 -1
- openstackclient/compute/v2/hypervisor.py +1 -1
- openstackclient/compute/v2/hypervisor_stats.py +1 -1
- openstackclient/compute/v2/keypair.py +1 -1
- openstackclient/compute/v2/server.py +76 -27
- openstackclient/compute/v2/server_backup.py +1 -1
- openstackclient/compute/v2/server_event.py +1 -1
- openstackclient/compute/v2/server_group.py +4 -2
- openstackclient/compute/v2/server_image.py +1 -1
- openstackclient/compute/v2/server_migration.py +1 -1
- openstackclient/compute/v2/server_volume.py +1 -1
- openstackclient/compute/v2/service.py +1 -1
- openstackclient/compute/v2/usage.py +6 -4
- openstackclient/identity/common.py +2 -1
- openstackclient/identity/v2_0/catalog.py +3 -2
- openstackclient/identity/v2_0/ec2creds.py +1 -1
- openstackclient/identity/v2_0/endpoint.py +1 -1
- openstackclient/identity/v2_0/project.py +17 -7
- openstackclient/identity/v2_0/role.py +1 -1
- openstackclient/identity/v2_0/role_assignment.py +3 -3
- openstackclient/identity/v2_0/service.py +1 -1
- openstackclient/identity/v2_0/token.py +1 -1
- openstackclient/identity/v2_0/user.py +2 -2
- openstackclient/identity/v3/access_rule.py +16 -4
- openstackclient/identity/v3/application_credential.py +30 -10
- openstackclient/identity/v3/catalog.py +3 -3
- openstackclient/identity/v3/consumer.py +1 -1
- openstackclient/identity/v3/credential.py +1 -1
- openstackclient/identity/v3/domain.py +10 -4
- openstackclient/identity/v3/ec2creds.py +1 -1
- openstackclient/identity/v3/endpoint.py +33 -12
- openstackclient/identity/v3/endpoint_group.py +1 -1
- openstackclient/identity/v3/federation_protocol.py +1 -1
- openstackclient/identity/v3/group.py +11 -5
- openstackclient/identity/v3/identity_provider.py +12 -10
- openstackclient/identity/v3/implied_role.py +1 -1
- openstackclient/identity/v3/limit.py +1 -1
- openstackclient/identity/v3/mapping.py +1 -1
- openstackclient/identity/v3/policy.py +1 -1
- openstackclient/identity/v3/project.py +10 -3
- openstackclient/identity/v3/region.py +1 -1
- openstackclient/identity/v3/registered_limit.py +16 -11
- openstackclient/identity/v3/role.py +20 -39
- openstackclient/identity/v3/role_assignment.py +12 -23
- openstackclient/identity/v3/service.py +1 -1
- openstackclient/identity/v3/service_provider.py +1 -1
- openstackclient/identity/v3/tag.py +3 -2
- openstackclient/identity/v3/token.py +3 -2
- openstackclient/identity/v3/trust.py +4 -2
- openstackclient/identity/v3/unscoped_saml.py +1 -1
- openstackclient/identity/v3/user.py +22 -13
- openstackclient/image/v1/image.py +19 -16
- openstackclient/image/v2/cache.py +1 -1
- openstackclient/image/v2/image.py +14 -11
- openstackclient/image/v2/info.py +1 -1
- openstackclient/image/v2/metadef_namespaces.py +1 -1
- openstackclient/image/v2/metadef_objects.py +1 -1
- openstackclient/image/v2/metadef_properties.py +3 -2
- openstackclient/image/v2/metadef_resource_type_association.py +1 -1
- openstackclient/image/v2/metadef_resource_types.py +1 -1
- openstackclient/image/v2/task.py +1 -1
- openstackclient/network/common.py +10 -9
- openstackclient/network/v2/address_group.py +4 -3
- openstackclient/network/v2/address_scope.py +8 -6
- openstackclient/network/v2/default_security_group_rule.py +9 -8
- openstackclient/network/v2/floating_ip.py +16 -9
- openstackclient/network/v2/floating_ip_port_forwarding.py +9 -6
- openstackclient/network/v2/ip_availability.py +7 -4
- openstackclient/network/v2/l3_conntrack_helper.py +11 -4
- openstackclient/network/v2/local_ip.py +13 -7
- openstackclient/network/v2/local_ip_association.py +7 -4
- openstackclient/network/v2/ndp_proxy.py +13 -6
- openstackclient/network/v2/network.py +33 -16
- openstackclient/network/v2/network_agent.py +5 -5
- openstackclient/network/v2/network_auto_allocated_topology.py +1 -1
- openstackclient/network/v2/network_flavor.py +1 -1
- openstackclient/network/v2/network_flavor_profile.py +1 -1
- openstackclient/network/v2/network_meter.py +1 -1
- openstackclient/network/v2/network_meter_rule.py +1 -1
- openstackclient/network/v2/network_qos_policy.py +7 -5
- openstackclient/network/v2/network_qos_rule.py +1 -1
- openstackclient/network/v2/network_qos_rule_type.py +1 -1
- openstackclient/network/v2/network_rbac.py +8 -5
- openstackclient/network/v2/network_segment.py +2 -2
- openstackclient/network/v2/network_segment_range.py +13 -6
- openstackclient/network/v2/network_service_provider.py +1 -1
- openstackclient/network/v2/network_trunk.py +65 -42
- openstackclient/network/v2/port.py +22 -20
- openstackclient/network/v2/router.py +19 -8
- openstackclient/network/v2/security_group.py +10 -6
- openstackclient/network/v2/security_group_rule.py +11 -5
- openstackclient/network/v2/subnet.py +17 -18
- openstackclient/network/v2/subnet_pool.py +11 -9
- openstackclient/network/v2/taas/__init__.py +0 -0
- openstackclient/network/v2/taas/tap_flow.py +245 -0
- openstackclient/network/v2/taas/tap_mirror.py +237 -0
- openstackclient/network/v2/taas/tap_service.py +211 -0
- openstackclient/object/v1/account.py +1 -1
- openstackclient/object/v1/container.py +1 -1
- openstackclient/object/v1/object.py +1 -1
- openstackclient/shell.py +18 -8
- openstackclient/tests/functional/identity/v3/test_catalog.py +42 -23
- openstackclient/tests/functional/identity/v3/test_role_assignment.py +174 -0
- openstackclient/tests/functional/image/v2/test_cache.py +54 -0
- openstackclient/tests/functional/image/v2/test_metadef_resource_type.py +55 -0
- openstackclient/tests/unit/common/test_command.py +1 -1
- openstackclient/tests/unit/common/test_extension.py +2 -3
- openstackclient/tests/unit/common/test_module.py +14 -7
- openstackclient/tests/unit/common/test_quota.py +20 -0
- openstackclient/tests/unit/compute/v2/test_aggregate.py +5 -3
- openstackclient/tests/unit/compute/v2/test_console.py +1 -4
- openstackclient/tests/unit/compute/v2/test_flavor.py +1 -3
- openstackclient/tests/unit/compute/v2/test_hypervisor_stats.py +1 -9
- openstackclient/tests/unit/compute/v2/test_server.py +364 -30
- openstackclient/tests/unit/compute/v2/test_server_backup.py +1 -3
- openstackclient/tests/unit/compute/v2/test_service.py +1 -3
- openstackclient/tests/unit/fakes.py +35 -134
- openstackclient/tests/unit/identity/test_common.py +100 -0
- openstackclient/tests/unit/identity/v2_0/test_project.py +4 -4
- openstackclient/tests/unit/identity/v3/fakes.py +10 -2
- openstackclient/tests/unit/identity/v3/test_application_credential.py +3 -3
- openstackclient/tests/unit/identity/v3/test_domain.py +1 -1
- openstackclient/tests/unit/identity/v3/test_endpoint.py +1 -1
- openstackclient/tests/unit/identity/v3/test_group.py +4 -2
- openstackclient/tests/unit/identity/v3/test_identity_provider.py +10 -10
- openstackclient/tests/unit/identity/v3/test_oauth.py +1 -1
- openstackclient/tests/unit/identity/v3/test_project.py +1 -1
- openstackclient/tests/unit/identity/v3/test_registered_limit.py +2 -2
- openstackclient/tests/unit/identity/v3/test_role.py +1 -82
- openstackclient/tests/unit/identity/v3/test_user.py +7 -51
- openstackclient/tests/unit/image/v2/test_image.py +111 -0
- openstackclient/tests/unit/network/test_common.py +9 -13
- openstackclient/tests/unit/network/v2/taas/__init__.py +0 -0
- openstackclient/tests/unit/network/v2/taas/test_osc_tap_flow.py +276 -0
- openstackclient/tests/unit/network/v2/taas/test_osc_tap_mirror.py +288 -0
- openstackclient/tests/unit/network/v2/taas/test_osc_tap_service.py +271 -0
- openstackclient/tests/unit/network/v2/test_address_group.py +19 -22
- openstackclient/tests/unit/network/v2/test_address_scope.py +10 -15
- openstackclient/tests/unit/network/v2/test_default_security_group_rule.py +38 -49
- openstackclient/tests/unit/network/v2/test_floating_ip_network.py +21 -27
- openstackclient/tests/unit/network/v2/test_floating_ip_port_forwarding.py +21 -18
- openstackclient/tests/unit/network/v2/test_ip_availability.py +6 -8
- openstackclient/tests/unit/network/v2/test_l3_conntrack_helper.py +6 -15
- openstackclient/tests/unit/network/v2/test_local_ip.py +12 -23
- openstackclient/tests/unit/network/v2/test_local_ip_association.py +13 -18
- openstackclient/tests/unit/network/v2/test_ndp_proxy.py +11 -21
- openstackclient/tests/unit/network/v2/test_network.py +41 -37
- openstackclient/tests/unit/network/v2/test_network_agent.py +13 -20
- openstackclient/tests/unit/network/v2/test_network_auto_allocated_topology.py +5 -8
- openstackclient/tests/unit/network/v2/test_network_flavor.py +14 -26
- openstackclient/tests/unit/network/v2/test_network_flavor_profile.py +14 -17
- openstackclient/tests/unit/network/v2/test_network_meter.py +7 -17
- openstackclient/tests/unit/network/v2/test_network_meter_rule.py +10 -20
- openstackclient/tests/unit/network/v2/test_network_qos_policy.py +7 -13
- openstackclient/tests/unit/network/v2/test_network_qos_rule.py +44 -54
- openstackclient/tests/unit/network/v2/test_network_qos_rule_type.py +2 -7
- openstackclient/tests/unit/network/v2/test_network_rbac.py +21 -36
- openstackclient/tests/unit/network/v2/test_network_segment.py +13 -29
- openstackclient/tests/unit/network/v2/test_network_segment_range.py +20 -19
- openstackclient/tests/unit/network/v2/test_network_service_provider.py +1 -4
- openstackclient/tests/unit/network/v2/test_network_trunk.py +52 -47
- openstackclient/tests/unit/network/v2/test_port.py +75 -86
- openstackclient/tests/unit/network/v2/test_router.py +104 -126
- openstackclient/tests/unit/network/v2/test_security_group_network.py +19 -26
- openstackclient/tests/unit/network/v2/test_security_group_rule_network.py +17 -18
- openstackclient/tests/unit/network/v2/test_subnet.py +35 -46
- openstackclient/tests/unit/network/v2/test_subnet_pool.py +21 -33
- openstackclient/tests/unit/volume/test_find_resource.py +4 -13
- openstackclient/tests/unit/volume/v2/test_volume_backup.py +3 -1
- openstackclient/tests/unit/volume/v3/test_volume.py +4 -0
- openstackclient/tests/unit/volume/v3/test_volume_backup.py +9 -0
- openstackclient/volume/client.py +7 -17
- openstackclient/volume/v2/backup_record.py +1 -1
- openstackclient/volume/v2/consistency_group.py +1 -1
- openstackclient/volume/v2/consistency_group_snapshot.py +1 -1
- openstackclient/volume/v2/qos_specs.py +1 -1
- openstackclient/volume/v2/service.py +1 -1
- openstackclient/volume/v2/volume.py +2 -2
- openstackclient/volume/v2/volume_backend.py +1 -1
- openstackclient/volume/v2/volume_backup.py +5 -3
- openstackclient/volume/v2/volume_host.py +1 -2
- openstackclient/volume/v2/volume_snapshot.py +2 -2
- openstackclient/volume/v2/volume_transfer_request.py +1 -1
- openstackclient/volume/v2/volume_type.py +11 -6
- openstackclient/volume/v3/block_storage_cleanup.py +1 -1
- openstackclient/volume/v3/block_storage_cluster.py +1 -1
- openstackclient/volume/v3/block_storage_log_level.py +1 -1
- openstackclient/volume/v3/block_storage_manage.py +1 -1
- openstackclient/volume/v3/block_storage_resource_filter.py +1 -1
- openstackclient/volume/v3/service.py +1 -1
- openstackclient/volume/v3/volume.py +2 -2
- openstackclient/volume/v3/volume_attachment.py +6 -5
- openstackclient/volume/v3/volume_backup.py +18 -3
- openstackclient/volume/v3/volume_group.py +1 -1
- openstackclient/volume/v3/volume_group_snapshot.py +1 -1
- openstackclient/volume/v3/volume_group_type.py +1 -1
- openstackclient/volume/v3/volume_message.py +1 -1
- openstackclient/volume/v3/volume_snapshot.py +2 -2
- openstackclient/volume/v3/volume_transfer_request.py +1 -1
- openstackclient/volume/v3/volume_type.py +15 -9
- {python_openstackclient-8.2.0.dist-info → python_openstackclient-8.3.0.dist-info}/METADATA +15 -13
- {python_openstackclient-8.2.0.dist-info → python_openstackclient-8.3.0.dist-info}/RECORD +224 -213
- {python_openstackclient-8.2.0.dist-info → python_openstackclient-8.3.0.dist-info}/WHEEL +1 -1
- {python_openstackclient-8.2.0.dist-info → python_openstackclient-8.3.0.dist-info}/entry_points.txt +15 -0
- {python_openstackclient-8.2.0.dist-info → python_openstackclient-8.3.0.dist-info/licenses}/AUTHORS +10 -0
- python_openstackclient-8.3.0.dist-info/pbr.json +1 -0
- openstackclient/tests/unit/common/test_logs.py +0 -221
- python_openstackclient-8.2.0.dist-info/pbr.json +0 -1
- {python_openstackclient-8.2.0.dist-info → python_openstackclient-8.3.0.dist-info/licenses}/LICENSE +0 -0
- {python_openstackclient-8.2.0.dist-info → python_openstackclient-8.3.0.dist-info}/top_level.txt +0 -0
|
@@ -18,24 +18,25 @@
|
|
|
18
18
|
import datetime
|
|
19
19
|
import json
|
|
20
20
|
import logging
|
|
21
|
+
import typing as ty
|
|
21
22
|
import uuid
|
|
22
23
|
|
|
23
24
|
from cliff import columns as cliff_columns
|
|
24
|
-
from osc_lib.command import command
|
|
25
25
|
from osc_lib import exceptions
|
|
26
26
|
from osc_lib import utils
|
|
27
27
|
|
|
28
|
+
from openstackclient import command
|
|
28
29
|
from openstackclient.i18n import _
|
|
29
30
|
from openstackclient.identity import common
|
|
30
31
|
|
|
31
32
|
LOG = logging.getLogger(__name__)
|
|
32
33
|
|
|
33
34
|
|
|
34
|
-
class RolesColumn(cliff_columns.FormattableColumn):
|
|
35
|
+
class RolesColumn(cliff_columns.FormattableColumn[ty.Any]):
|
|
35
36
|
"""Generate a formatted string of role names."""
|
|
36
37
|
|
|
37
38
|
def human_readable(self):
|
|
38
|
-
return utils.format_list(r['name'] for r in self._value)
|
|
39
|
+
return utils.format_list(list(r['name'] for r in self._value))
|
|
39
40
|
|
|
40
41
|
|
|
41
42
|
def _format_application_credential(
|
|
@@ -148,6 +149,7 @@ class CreateApplicationCredential(command.ShowOne):
|
|
|
148
149
|
parser.add_argument(
|
|
149
150
|
'--role',
|
|
150
151
|
metavar='<role>',
|
|
152
|
+
dest='roles',
|
|
151
153
|
action='append',
|
|
152
154
|
default=[],
|
|
153
155
|
help=_(
|
|
@@ -204,10 +206,15 @@ class CreateApplicationCredential(command.ShowOne):
|
|
|
204
206
|
def take_action(self, parsed_args):
|
|
205
207
|
identity_client = self.app.client_manager.sdk_connection.identity
|
|
206
208
|
conn = self.app.client_manager.sdk_connection
|
|
207
|
-
|
|
209
|
+
auth = conn.config.get_auth()
|
|
210
|
+
if auth is None:
|
|
211
|
+
# this will never happen
|
|
212
|
+
raise exceptions.CommandError('invalid authentication info')
|
|
213
|
+
|
|
214
|
+
user_id = auth.get_user_id(conn.identity)
|
|
208
215
|
|
|
209
216
|
role_ids = []
|
|
210
|
-
for role in parsed_args.
|
|
217
|
+
for role in parsed_args.roles:
|
|
211
218
|
if is_uuid_like(role):
|
|
212
219
|
role_ids.append({'id': role})
|
|
213
220
|
else:
|
|
@@ -272,13 +279,18 @@ class DeleteApplicationCredential(command.Command):
|
|
|
272
279
|
def take_action(self, parsed_args):
|
|
273
280
|
identity_client = self.app.client_manager.sdk_connection.identity
|
|
274
281
|
conn = self.app.client_manager.sdk_connection
|
|
275
|
-
|
|
282
|
+
auth = conn.config.get_auth()
|
|
283
|
+
if auth is None:
|
|
284
|
+
# this will never happen
|
|
285
|
+
raise exceptions.CommandError('invalid authentication info')
|
|
286
|
+
|
|
287
|
+
user_id = auth.get_user_id(conn.identity)
|
|
276
288
|
|
|
277
289
|
errors = 0
|
|
278
290
|
for ac in parsed_args.application_credential:
|
|
279
291
|
try:
|
|
280
292
|
app_cred = identity_client.find_application_credential(
|
|
281
|
-
user_id, ac
|
|
293
|
+
user_id, ac, ignore_missing=False
|
|
282
294
|
)
|
|
283
295
|
identity_client.delete_application_credential(
|
|
284
296
|
user_id, app_cred.id
|
|
@@ -325,7 +337,11 @@ class ListApplicationCredential(command.Lister):
|
|
|
325
337
|
)
|
|
326
338
|
else:
|
|
327
339
|
conn = self.app.client_manager.sdk_connection
|
|
328
|
-
|
|
340
|
+
auth = conn.config.get_auth()
|
|
341
|
+
if auth is None:
|
|
342
|
+
# this will never happen
|
|
343
|
+
raise exceptions.CommandError('invalid authentication info')
|
|
344
|
+
user_id = auth.get_user_id(conn.identity)
|
|
329
345
|
|
|
330
346
|
application_credentials = identity_client.application_credentials(
|
|
331
347
|
user=user_id
|
|
@@ -349,10 +365,14 @@ class ShowApplicationCredential(command.ShowOne):
|
|
|
349
365
|
def take_action(self, parsed_args):
|
|
350
366
|
identity_client = self.app.client_manager.sdk_connection.identity
|
|
351
367
|
conn = self.app.client_manager.sdk_connection
|
|
352
|
-
|
|
368
|
+
auth = conn.config.get_auth()
|
|
369
|
+
if auth is None:
|
|
370
|
+
# this will never happen
|
|
371
|
+
raise exceptions.CommandError('invalid authentication info')
|
|
372
|
+
user_id = auth.get_user_id(conn.identity)
|
|
353
373
|
|
|
354
374
|
application_credential = identity_client.find_application_credential(
|
|
355
|
-
user_id, parsed_args.application_credential
|
|
375
|
+
user_id, parsed_args.application_credential, ignore_missing=False
|
|
356
376
|
)
|
|
357
377
|
|
|
358
378
|
return _format_application_credential(application_credential)
|
|
@@ -9,24 +9,24 @@
|
|
|
9
9
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
10
10
|
# License for the specific language governing permissions and limitations
|
|
11
11
|
# under the License.
|
|
12
|
-
#
|
|
13
12
|
|
|
14
13
|
"""Identity v3 Service Catalog action implementations"""
|
|
15
14
|
|
|
16
15
|
import logging
|
|
16
|
+
import typing as ty
|
|
17
17
|
|
|
18
18
|
from cliff import columns as cliff_columns
|
|
19
|
-
from osc_lib.command import command
|
|
20
19
|
from osc_lib import exceptions
|
|
21
20
|
from osc_lib import utils
|
|
22
21
|
|
|
22
|
+
from openstackclient import command
|
|
23
23
|
from openstackclient.i18n import _
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
LOG = logging.getLogger(__name__)
|
|
27
27
|
|
|
28
28
|
|
|
29
|
-
class EndpointsColumn(cliff_columns.FormattableColumn):
|
|
29
|
+
class EndpointsColumn(cliff_columns.FormattableColumn[ty.Any]):
|
|
30
30
|
def human_readable(self):
|
|
31
31
|
if not self._value:
|
|
32
32
|
return ""
|
|
@@ -17,10 +17,10 @@
|
|
|
17
17
|
|
|
18
18
|
import logging
|
|
19
19
|
|
|
20
|
-
from osc_lib.command import command
|
|
21
20
|
from osc_lib import exceptions
|
|
22
21
|
from osc_lib import utils
|
|
23
22
|
|
|
23
|
+
from openstackclient import command
|
|
24
24
|
from openstackclient.i18n import _
|
|
25
25
|
from openstackclient.identity import common
|
|
26
26
|
|
|
@@ -18,10 +18,10 @@
|
|
|
18
18
|
import logging
|
|
19
19
|
|
|
20
20
|
from openstack import exceptions as sdk_exceptions
|
|
21
|
-
from osc_lib.command import command
|
|
22
21
|
from osc_lib import exceptions
|
|
23
22
|
from osc_lib import utils
|
|
24
23
|
|
|
24
|
+
from openstackclient import command
|
|
25
25
|
from openstackclient.i18n import _
|
|
26
26
|
from openstackclient.identity import common
|
|
27
27
|
|
|
@@ -107,7 +107,9 @@ class CreateDomain(command.ShowOne):
|
|
|
107
107
|
)
|
|
108
108
|
except sdk_exceptions.ConflictException:
|
|
109
109
|
if parsed_args.or_show:
|
|
110
|
-
domain = identity_client.find_domain(
|
|
110
|
+
domain = identity_client.find_domain(
|
|
111
|
+
parsed_args.name, ignore_missing=False
|
|
112
|
+
)
|
|
111
113
|
LOG.info(_('Returning existing domain %s'), domain.name)
|
|
112
114
|
else:
|
|
113
115
|
raise
|
|
@@ -238,7 +240,9 @@ class SetDomain(command.Command):
|
|
|
238
240
|
|
|
239
241
|
def take_action(self, parsed_args):
|
|
240
242
|
identity_client = self.app.client_manager.sdk_connection.identity
|
|
241
|
-
domain = identity_client.find_domain(
|
|
243
|
+
domain = identity_client.find_domain(
|
|
244
|
+
parsed_args.domain, ignore_missing=False
|
|
245
|
+
)
|
|
242
246
|
kwargs = {}
|
|
243
247
|
if parsed_args.name:
|
|
244
248
|
kwargs['name'] = parsed_args.name
|
|
@@ -266,6 +270,8 @@ class ShowDomain(command.ShowOne):
|
|
|
266
270
|
|
|
267
271
|
def take_action(self, parsed_args):
|
|
268
272
|
identity_client = self.app.client_manager.sdk_connection.identity
|
|
269
|
-
domain = identity_client.find_domain(
|
|
273
|
+
domain = identity_client.find_domain(
|
|
274
|
+
parsed_args.domain, ignore_missing=False
|
|
275
|
+
)
|
|
270
276
|
|
|
271
277
|
return _format_domain(domain)
|
|
@@ -14,10 +14,10 @@
|
|
|
14
14
|
|
|
15
15
|
import logging
|
|
16
16
|
|
|
17
|
-
from osc_lib.command import command
|
|
18
17
|
from osc_lib import exceptions
|
|
19
18
|
from osc_lib import utils
|
|
20
19
|
|
|
20
|
+
from openstackclient import command
|
|
21
21
|
from openstackclient.i18n import _
|
|
22
22
|
from openstackclient.identity import common
|
|
23
23
|
|
|
@@ -17,10 +17,10 @@
|
|
|
17
17
|
|
|
18
18
|
import logging
|
|
19
19
|
|
|
20
|
-
from osc_lib.command import command
|
|
21
20
|
from osc_lib import exceptions
|
|
22
21
|
from osc_lib import utils
|
|
23
22
|
|
|
23
|
+
from openstackclient import command
|
|
24
24
|
from openstackclient.i18n import _
|
|
25
25
|
from openstackclient.identity import common
|
|
26
26
|
|
|
@@ -169,7 +169,9 @@ class DeleteEndpoint(command.Command):
|
|
|
169
169
|
result = 0
|
|
170
170
|
for i in parsed_args.endpoint:
|
|
171
171
|
try:
|
|
172
|
-
endpoint_id = identity_client.find_endpoint(
|
|
172
|
+
endpoint_id = identity_client.find_endpoint(
|
|
173
|
+
i, ignore_missing=False
|
|
174
|
+
).id
|
|
173
175
|
identity_client.delete_endpoint(endpoint_id)
|
|
174
176
|
except Exception as e:
|
|
175
177
|
result += 1
|
|
@@ -230,12 +232,25 @@ class ListEndpoint(command.Lister):
|
|
|
230
232
|
|
|
231
233
|
endpoint = None
|
|
232
234
|
if parsed_args.endpoint:
|
|
233
|
-
endpoint = identity_client.find_endpoint(
|
|
234
|
-
|
|
235
|
+
endpoint = identity_client.find_endpoint(
|
|
236
|
+
parsed_args.endpoint, ignore_missing=False
|
|
237
|
+
)
|
|
238
|
+
|
|
239
|
+
project_domain_id = None
|
|
240
|
+
if parsed_args.project_domain:
|
|
241
|
+
project_domain_id = common._find_sdk_id(
|
|
242
|
+
identity_client.find_domain,
|
|
243
|
+
name_or_id=parsed_args.project_domain,
|
|
244
|
+
)
|
|
245
|
+
|
|
246
|
+
project_id = None
|
|
235
247
|
if parsed_args.project:
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
248
|
+
project_id = common._find_sdk_id(
|
|
249
|
+
identity_client.find_project,
|
|
250
|
+
name_or_id=common._get_token_resource(
|
|
251
|
+
identity_client, 'project', parsed_args.project
|
|
252
|
+
),
|
|
253
|
+
domain_id=project_domain_id,
|
|
239
254
|
)
|
|
240
255
|
|
|
241
256
|
if endpoint:
|
|
@@ -273,15 +288,17 @@ class ListEndpoint(command.Lister):
|
|
|
273
288
|
region = identity_client.get_region(parsed_args.region)
|
|
274
289
|
kwargs['region_id'] = region.id
|
|
275
290
|
|
|
276
|
-
if
|
|
291
|
+
if project_id:
|
|
277
292
|
data = list(
|
|
278
|
-
identity_client.project_endpoints(project=
|
|
293
|
+
identity_client.project_endpoints(project=project_id)
|
|
279
294
|
)
|
|
280
295
|
else:
|
|
281
296
|
data = list(identity_client.endpoints(**kwargs))
|
|
282
297
|
|
|
283
298
|
for ep in data:
|
|
284
|
-
service = identity_client.find_service(
|
|
299
|
+
service = identity_client.find_service(
|
|
300
|
+
ep.service_id, ignore_missing=False
|
|
301
|
+
)
|
|
285
302
|
ep.service_name = getattr(service, 'name', '')
|
|
286
303
|
ep.service_type = service.type
|
|
287
304
|
|
|
@@ -382,7 +399,9 @@ class SetEndpoint(command.Command):
|
|
|
382
399
|
|
|
383
400
|
def take_action(self, parsed_args):
|
|
384
401
|
identity_client = self.app.client_manager.sdk_connection.identity
|
|
385
|
-
endpoint = identity_client.find_endpoint(
|
|
402
|
+
endpoint = identity_client.find_endpoint(
|
|
403
|
+
parsed_args.endpoint, ignore_missing=False
|
|
404
|
+
)
|
|
386
405
|
|
|
387
406
|
kwargs = {}
|
|
388
407
|
|
|
@@ -429,7 +448,9 @@ class ShowEndpoint(command.ShowOne):
|
|
|
429
448
|
|
|
430
449
|
def take_action(self, parsed_args):
|
|
431
450
|
identity_client = self.app.client_manager.sdk_connection.identity
|
|
432
|
-
endpoint = identity_client.find_endpoint(
|
|
451
|
+
endpoint = identity_client.find_endpoint(
|
|
452
|
+
parsed_args.endpoint, ignore_missing=False
|
|
453
|
+
)
|
|
433
454
|
|
|
434
455
|
service = common.find_service_sdk(identity_client, endpoint.service_id)
|
|
435
456
|
|
|
@@ -16,10 +16,10 @@
|
|
|
16
16
|
import json
|
|
17
17
|
import logging
|
|
18
18
|
|
|
19
|
-
from osc_lib.command import command
|
|
20
19
|
from osc_lib import exceptions
|
|
21
20
|
from osc_lib import utils
|
|
22
21
|
|
|
22
|
+
from openstackclient import command
|
|
23
23
|
from openstackclient.i18n import _
|
|
24
24
|
from openstackclient.identity import common
|
|
25
25
|
|
|
@@ -18,10 +18,10 @@
|
|
|
18
18
|
import logging
|
|
19
19
|
|
|
20
20
|
from openstack import exceptions as sdk_exc
|
|
21
|
-
from osc_lib.command import command
|
|
22
21
|
from osc_lib import exceptions
|
|
23
22
|
from osc_lib import utils
|
|
24
23
|
|
|
24
|
+
from openstackclient import command
|
|
25
25
|
from openstackclient.i18n import _
|
|
26
26
|
from openstackclient.identity import common
|
|
27
27
|
|
|
@@ -211,10 +211,15 @@ class CreateGroup(command.ShowOne):
|
|
|
211
211
|
if parsed_args.or_show:
|
|
212
212
|
if parsed_args.domain:
|
|
213
213
|
group = identity_client.find_group(
|
|
214
|
-
parsed_args.name,
|
|
214
|
+
parsed_args.name,
|
|
215
|
+
domain_id=parsed_args.domain,
|
|
216
|
+
ignore_missing=False,
|
|
215
217
|
)
|
|
216
218
|
else:
|
|
217
|
-
group = identity_client.find_group(
|
|
219
|
+
group = identity_client.find_group(
|
|
220
|
+
parsed_args.name,
|
|
221
|
+
ignore_missing=False,
|
|
222
|
+
)
|
|
218
223
|
LOG.info(_('Returning existing group %s'), group.name)
|
|
219
224
|
else:
|
|
220
225
|
raise
|
|
@@ -310,8 +315,9 @@ class ListGroup(command.Lister):
|
|
|
310
315
|
parsed_args.user_domain,
|
|
311
316
|
)
|
|
312
317
|
if domain:
|
|
313
|
-
# NOTE(0weng): The API doesn't actually support filtering
|
|
314
|
-
# so this doesn't really do
|
|
318
|
+
# NOTE(0weng): The API doesn't actually support filtering
|
|
319
|
+
# additionally by domain_id, so this doesn't really do
|
|
320
|
+
# anything.
|
|
315
321
|
data = identity_client.user_groups(user, domain_id=domain)
|
|
316
322
|
else:
|
|
317
323
|
data = identity_client.user_groups(user)
|
|
@@ -16,10 +16,10 @@
|
|
|
16
16
|
import logging
|
|
17
17
|
|
|
18
18
|
from osc_lib.cli import format_columns
|
|
19
|
-
from osc_lib.command import command
|
|
20
19
|
from osc_lib import exceptions
|
|
21
20
|
from osc_lib import utils
|
|
22
21
|
|
|
22
|
+
from openstackclient import command
|
|
23
23
|
from openstackclient.i18n import _
|
|
24
24
|
from openstackclient.identity import common
|
|
25
25
|
|
|
@@ -41,6 +41,7 @@ class CreateIdentityProvider(command.ShowOne):
|
|
|
41
41
|
identity_remote_id_provider.add_argument(
|
|
42
42
|
'--remote-id',
|
|
43
43
|
metavar='<remote-id>',
|
|
44
|
+
dest='remote_ids',
|
|
44
45
|
action='append',
|
|
45
46
|
help=_(
|
|
46
47
|
'Remote IDs to associate with the Identity Provider '
|
|
@@ -99,16 +100,15 @@ class CreateIdentityProvider(command.ShowOne):
|
|
|
99
100
|
|
|
100
101
|
def take_action(self, parsed_args):
|
|
101
102
|
identity_client = self.app.client_manager.identity
|
|
103
|
+
remote_ids: list[str] | None = None
|
|
102
104
|
if parsed_args.remote_id_file:
|
|
103
105
|
file_content = utils.read_blob_file_contents(
|
|
104
106
|
parsed_args.remote_id_file
|
|
105
107
|
)
|
|
106
108
|
remote_ids = file_content.splitlines()
|
|
107
109
|
remote_ids = list(map(str.strip, remote_ids))
|
|
108
|
-
|
|
109
|
-
remote_ids =
|
|
110
|
-
parsed_args.remote_id if parsed_args.remote_id else None
|
|
111
|
-
)
|
|
110
|
+
elif parsed_args.remote_ids:
|
|
111
|
+
remote_ids = parsed_args.remote_ids
|
|
112
112
|
|
|
113
113
|
domain_id = None
|
|
114
114
|
if parsed_args.domain:
|
|
@@ -137,8 +137,9 @@ class CreateIdentityProvider(command.ShowOne):
|
|
|
137
137
|
)
|
|
138
138
|
|
|
139
139
|
idp._info.pop('links', None)
|
|
140
|
-
remote_ids = format_columns.ListColumn(
|
|
141
|
-
|
|
140
|
+
idp._info['remote_ids'] = format_columns.ListColumn(
|
|
141
|
+
idp._info.pop('remote_ids', [])
|
|
142
|
+
)
|
|
142
143
|
return zip(*sorted(idp._info.items()))
|
|
143
144
|
|
|
144
145
|
|
|
@@ -240,6 +241,7 @@ class SetIdentityProvider(command.Command):
|
|
|
240
241
|
identity_remote_id_provider.add_argument(
|
|
241
242
|
'--remote-id',
|
|
242
243
|
metavar='<remote-id>',
|
|
244
|
+
dest='remote_ids',
|
|
243
245
|
action='append',
|
|
244
246
|
help=_(
|
|
245
247
|
'Remote IDs to associate with the Identity Provider '
|
|
@@ -287,8 +289,8 @@ class SetIdentityProvider(command.Command):
|
|
|
287
289
|
)
|
|
288
290
|
remote_ids = file_content.splitlines()
|
|
289
291
|
remote_ids = list(map(str.strip, remote_ids))
|
|
290
|
-
elif parsed_args.
|
|
291
|
-
remote_ids = parsed_args.
|
|
292
|
+
elif parsed_args.remote_ids:
|
|
293
|
+
remote_ids = parsed_args.remote_ids
|
|
292
294
|
|
|
293
295
|
# Setup keyword args for the client
|
|
294
296
|
kwargs = {}
|
|
@@ -298,7 +300,7 @@ class SetIdentityProvider(command.Command):
|
|
|
298
300
|
kwargs['enabled'] = True
|
|
299
301
|
if parsed_args.disable:
|
|
300
302
|
kwargs['enabled'] = False
|
|
301
|
-
if parsed_args.remote_id_file or parsed_args.
|
|
303
|
+
if parsed_args.remote_id_file or parsed_args.remote_ids:
|
|
302
304
|
kwargs['remote_ids'] = remote_ids
|
|
303
305
|
|
|
304
306
|
# TODO(pas-ha) actually check for 3.14 microversion
|
|
@@ -15,10 +15,10 @@
|
|
|
15
15
|
|
|
16
16
|
import logging
|
|
17
17
|
|
|
18
|
-
from osc_lib.command import command
|
|
19
18
|
from osc_lib import exceptions
|
|
20
19
|
from osc_lib import utils
|
|
21
20
|
|
|
21
|
+
from openstackclient import command
|
|
22
22
|
from openstackclient.i18n import _
|
|
23
23
|
from openstackclient.identity import common as common_utils
|
|
24
24
|
|
|
@@ -19,10 +19,10 @@ import logging
|
|
|
19
19
|
|
|
20
20
|
from keystoneauth1 import exceptions as ks_exc
|
|
21
21
|
from osc_lib.cli import parseractions
|
|
22
|
-
from osc_lib.command import command
|
|
23
22
|
from osc_lib import exceptions
|
|
24
23
|
from osc_lib import utils
|
|
25
24
|
|
|
25
|
+
from openstackclient import command
|
|
26
26
|
from openstackclient.i18n import _
|
|
27
27
|
from openstackclient.identity import common
|
|
28
28
|
from openstackclient.identity.v3 import tag
|
|
@@ -73,8 +73,8 @@ class CreateProject(command.ShowOne):
|
|
|
73
73
|
parser.add_argument(
|
|
74
74
|
'--property',
|
|
75
75
|
metavar='<key=value>',
|
|
76
|
-
action=parseractions.KeyValueAction,
|
|
77
76
|
dest='properties',
|
|
77
|
+
action=parseractions.KeyValueAction,
|
|
78
78
|
help=_(
|
|
79
79
|
'Add a property to <name> '
|
|
80
80
|
'(repeat option to set multiple properties)'
|
|
@@ -146,7 +146,14 @@ class CreateProject(command.ShowOne):
|
|
|
146
146
|
|
|
147
147
|
|
|
148
148
|
class DeleteProject(command.Command):
|
|
149
|
-
_description = _(
|
|
149
|
+
_description = _(
|
|
150
|
+
"Delete project(s). This command will remove specified "
|
|
151
|
+
"existing project(s) if an active user is authorized to do "
|
|
152
|
+
"this. If there are resources managed by other services "
|
|
153
|
+
"(for example, Nova, Neutron, Cinder) associated with "
|
|
154
|
+
"specified project(s), delete operation will proceed "
|
|
155
|
+
"regardless."
|
|
156
|
+
)
|
|
150
157
|
|
|
151
158
|
def get_parser(self, prog_name):
|
|
152
159
|
parser = super().get_parser(prog_name)
|
|
@@ -15,10 +15,10 @@
|
|
|
15
15
|
|
|
16
16
|
import logging
|
|
17
17
|
|
|
18
|
-
from osc_lib.command import command
|
|
19
18
|
from osc_lib import exceptions
|
|
20
19
|
from osc_lib import utils
|
|
21
20
|
|
|
21
|
+
from openstackclient import command
|
|
22
22
|
from openstackclient.i18n import _
|
|
23
23
|
from openstackclient.identity import common as common_utils
|
|
24
24
|
|
|
@@ -44,7 +44,10 @@ class CreateRegisteredLimit(command.ShowOne):
|
|
|
44
44
|
'--service',
|
|
45
45
|
metavar='<service>',
|
|
46
46
|
required=True,
|
|
47
|
-
help=_(
|
|
47
|
+
help=_(
|
|
48
|
+
'Service responsible for the resource to limit (required) '
|
|
49
|
+
'(name or ID)'
|
|
50
|
+
),
|
|
48
51
|
)
|
|
49
52
|
parser.add_argument(
|
|
50
53
|
'--default-limit',
|
|
@@ -106,10 +109,10 @@ class DeleteRegisteredLimit(command.Command):
|
|
|
106
109
|
def get_parser(self, prog_name):
|
|
107
110
|
parser = super().get_parser(prog_name)
|
|
108
111
|
parser.add_argument(
|
|
109
|
-
'
|
|
110
|
-
metavar='<registered-
|
|
112
|
+
'registered_limits',
|
|
113
|
+
metavar='<registered-limits>',
|
|
111
114
|
nargs="+",
|
|
112
|
-
help=_('Registered limit to delete (ID)'),
|
|
115
|
+
help=_('Registered limit(s) to delete (ID)'),
|
|
113
116
|
)
|
|
114
117
|
return parser
|
|
115
118
|
|
|
@@ -117,7 +120,7 @@ class DeleteRegisteredLimit(command.Command):
|
|
|
117
120
|
identity_client = self.app.client_manager.identity
|
|
118
121
|
|
|
119
122
|
errors = 0
|
|
120
|
-
for registered_limit_id in parsed_args.
|
|
123
|
+
for registered_limit_id in parsed_args.registered_limits:
|
|
121
124
|
try:
|
|
122
125
|
identity_client.registered_limits.delete(registered_limit_id)
|
|
123
126
|
except Exception as e:
|
|
@@ -134,7 +137,7 @@ class DeleteRegisteredLimit(command.Command):
|
|
|
134
137
|
)
|
|
135
138
|
|
|
136
139
|
if errors > 0:
|
|
137
|
-
total = len(parsed_args.
|
|
140
|
+
total = len(parsed_args.registered_limits)
|
|
138
141
|
msg = _(
|
|
139
142
|
"%(errors)s of %(total)s registered limits failed to delete."
|
|
140
143
|
) % {'errors': errors, 'total': total}
|
|
@@ -149,7 +152,9 @@ class ListRegisteredLimit(command.Lister):
|
|
|
149
152
|
parser.add_argument(
|
|
150
153
|
'--service',
|
|
151
154
|
metavar='<service>',
|
|
152
|
-
help=_(
|
|
155
|
+
help=_(
|
|
156
|
+
'Service responsible for the resource to limit (name or ID)'
|
|
157
|
+
),
|
|
153
158
|
)
|
|
154
159
|
parser.add_argument(
|
|
155
160
|
'--resource-name',
|
|
@@ -228,9 +233,9 @@ class SetRegisteredLimit(command.ShowOne):
|
|
|
228
233
|
'--service',
|
|
229
234
|
metavar='<service>',
|
|
230
235
|
help=_(
|
|
231
|
-
'Service to be updated responsible for the resource to '
|
|
232
|
-
'
|
|
233
|
-
'be different than existing value otherwise it will be '
|
|
236
|
+
'Service to be updated responsible for the resource to limit '
|
|
237
|
+
'(name or ID). Either --service, --resource-name or --region '
|
|
238
|
+
'must be different than existing value otherwise it will be '
|
|
234
239
|
'duplicate entry'
|
|
235
240
|
),
|
|
236
241
|
)
|