Use ids for cinder internal tenant and user

admin_tenant_id and admin_user_id are more explicit than
admin_tenant_name and admin_user as names could duplicate
and cause issues.

Includes sync from Charm-helpers PR #874 below

Charm-helpers-pr: https://github.com/juju/charm-helpers/pull/874

Closes-Bug: #2030755
Change-Id: Idbc2f3d12dcf325b4a53a3dda1ecfa75a199295a
This commit is contained in:
Erlon R. Cruz 2023-10-20 17:37:28 -03:00 committed by Rodrigo Barbieri
parent 39462317b6
commit ff442694d2
2 changed files with 7 additions and 2 deletions

View File

@ -545,7 +545,7 @@ class IdentityServiceContext(OSContextGenerator):
'internal_auth_url': internal_auth_url,
})
# we keep all veriables in ctxt for compatibility and
# we keep all variables in ctxt for compatibility and
# add nested dictionary for keystone_authtoken generic
# templating
if keystonemiddleware_os_release:
@ -557,6 +557,7 @@ class IdentityServiceContext(OSContextGenerator):
# NOTE(jamespage) this is required for >= icehouse
# so a missing value just indicates keystone needs
# upgrading
ctxt['admin_user_id'] = _resolve('service_user_id')
ctxt['admin_tenant_id'] = _resolve('service_tenant_id')
ctxt['admin_domain_id'] = _resolve('service_domain_id')
return ctxt

View File

@ -51,9 +51,13 @@ os_region_name = {{ region }}
volume_usage_audit_period = {{ volume_usage_audit_period }}
{% if auth_host -%}
cinder_internal_tenant_project_id = {{ admin_tenant_name }}
cinder_internal_tenant_project_id = {{ admin_tenant_id }}
{% if admin_user_id -%}
cinder_internal_tenant_user_id = {{ admin_user_id }}
{% else -%}
cinder_internal_tenant_user_id = {{ admin_user }}
{% endif -%}
{% endif -%}
{% include "parts/backends" %}
{% include "section-keystone-authtoken-mitaka" %}