From 73d596bb9e65361a76a38e83bcee45c6453df09a Mon Sep 17 00:00:00 2001 From: "Erlon R. Cruz" Date: Fri, 20 Oct 2023 17:37:28 -0300 Subject: [PATCH] Use admin_tenant_id as cinder internal tenant admin_tenant_id is more explicit than admin_tenant_name as project names might duplicate Charm-helpers-pr: https://github.com/juju/charm-helpers/pull/861 Depends-on: I6807128492cb184de3ef5f454d0ea745246b242e Closes-Bug: #2030755 Change-Id: Idbc2f3d12dcf325b4a53a3dda1ecfa75a199295a (cherry picked from commit ff442694d27e5481b9994a3dd4412a7a004d1c00) (cherry picked from commit 80115a2cb219c72b36adfb60b94c3cd56dbaf086) (cherry picked from commit e979c91908b0490ec78d9bc0f29254fdc38d1bb1) --- charmhelpers/contrib/openstack/context.py | 2 ++ templates/ocata/cinder.conf | 4 ++-- templates/ussuri/cinder.conf | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/charmhelpers/contrib/openstack/context.py b/charmhelpers/contrib/openstack/context.py index d894b6a6..82c17ba3 100644 --- a/charmhelpers/contrib/openstack/context.py +++ b/charmhelpers/contrib/openstack/context.py @@ -525,6 +525,7 @@ class IdentityServiceContext(OSContextGenerator): if float(api_version) > 2: ctxt.update({ 'admin_domain_name': _resolve('service_domain'), + 'service_user_id': _resolve('service_user_id'), 'service_project_id': _resolve('service_tenant_id'), 'service_domain_id': _resolve('service_domain_id')}) @@ -557,6 +558,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/ocata/cinder.conf b/templates/ocata/cinder.conf index 71fff66b..71a9e9ce 100644 --- a/templates/ocata/cinder.conf +++ b/templates/ocata/cinder.conf @@ -51,8 +51,8 @@ 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_user_id = {{ admin_user }} +cinder_internal_tenant_project_id = {{ admin_tenant_id }} +cinder_internal_tenant_user_id = {{ admin_user_id }} {% endif -%} {% include "parts/backends" %} diff --git a/templates/ussuri/cinder.conf b/templates/ussuri/cinder.conf index a4456bf2..ff4c0239 100644 --- a/templates/ussuri/cinder.conf +++ b/templates/ussuri/cinder.conf @@ -51,8 +51,8 @@ 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_user_id = {{ admin_user }} +cinder_internal_tenant_project_id = {{ admin_tenant_id }} +cinder_internal_tenant_user_id = {{ admin_user_id }} {% endif -%} {% include "parts/backends" %}