summaryrefslogtreecommitdiff
path: root/openstackclient/identity/common.py
diff options
authorThomas Goirand <zigo@debian.org>2026-02-27 19:32:22 +0100
committergit-ubuntu importer <ubuntu-devel-discuss@lists.ubuntu.com>2026-02-27 22:30:41 +0000
commiteea691be496ccaccbfa6c5317edd3529fb19f3e4 (patch)
tree0c5af2c99703c82796c0a06e129d867c64cc183f /openstackclient/identity/common.py
parent28412f7dd30f762954b495eb1fe0db14900e0b22 (diff)
9.0.0-1 (patches unapplied)import/9.0.0-1debian/experimental
Imported using git-ubuntu import.
Notes
Notes: * New upstream release. * Fixed (build-)depends for this release. * Removed patches applied upstream: - Fix_openstack_quota_show_without_cinder.patch - add-missing-backup_id-field.patch
Diffstat (limited to 'openstackclient/identity/common.py')
-rw-r--r--openstackclient/identity/common.py34
1 files changed, 33 insertions, 1 deletions
diff --git a/openstackclient/identity/common.py b/openstackclient/identity/common.py
index c6e6cfc..f33c370 100644
--- a/openstackclient/identity/common.py
+++ b/openstackclient/identity/common.py
@@ -99,7 +99,8 @@ def find_service_sdk(identity_client, name_type_or_id):
if next(services, None):
msg = _(
- "Multiple service matches found for '%(query)s', use an ID to be more specific."
+ "Multiple service matches found for '%(query)s', "
+ "use an ID to be more specific."
) % {"query": name_type_or_id}
raise exceptions.CommandError(msg)
@@ -255,6 +256,37 @@ def find_project(identity_client, name_or_id, domain_name_or_id=None):
)
+def find_project_id_sdk(
+ identity_client,
+ name_or_id,
+ domain_name_or_id=None,
+ *,
+ validate_actor_existence=True,
+ validate_domain_actor_existence=None,
+):
+ if domain_name_or_id is None:
+ return _find_sdk_id(
+ identity_client.find_project,
+ name_or_id=name_or_id,
+ validate_actor_existence=validate_actor_existence,
+ )
+
+ if validate_domain_actor_existence is None:
+ validate_domain_actor_existence = validate_actor_existence
+
+ domain_id = find_domain_id_sdk(
+ identity_client,
+ name_or_id=domain_name_or_id,
+ validate_actor_existence=validate_domain_actor_existence,
+ )
+ return _find_sdk_id(
+ identity_client.find_project,
+ name_or_id=name_or_id,
+ validate_actor_existence=validate_actor_existence,
+ domain_id=domain_id,
+ )
+
+
def find_user(identity_client, name_or_id, domain_name_or_id=None):
if domain_name_or_id is None:
return _find_identity_resource(