From ff442694d27e5481b9994a3dd4412a7a004d1c00 Mon Sep 17 00:00:00 2001 From: "Erlon R. Cruz" Date: Fri, 20 Oct 2023 17:37:28 -0300 Subject: [PATCH] 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 --- charmhelpers/contrib/openstack/context.py | 3 ++- templates/ussuri/cinder.conf | 6 +++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/charmhelpers/contrib/openstack/context.py b/charmhelpers/contrib/openstack/context.py index 42f15032..1e667fb0 100644 --- a/charmhelpers/contrib/openstack/context.py +++ b/charmhelpers/contrib/openstack/context.py @@ -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 diff --git a/templates/ussuri/cinder.conf b/templates/ussuri/cinder.conf index a4456bf2..e513aa52 100644 --- a/templates/ussuri/cinder.conf +++ b/templates/ussuri/cinder.conf @@ -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" %}