From 4b3962b803dd973a1f2759949be5f6e4d4f17d16 Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Sat, 8 Jan 2022 12:58:05 +0900 Subject: [PATCH] Fix ignored auth_url parameters The change d9759d24884cee443b5e9bd57bde1fb738271fdd incorrectly implement parameter usage and it made auth_url parameters of the following classes ineffective. - trove::taskmanager - trove::conductor This change fixes these two parameters and ensures these the given values are used to define config values. These parameters are also deprecated to be replaced completely by the service_credential classes. Change-Id: I028af124586ce366545b189694f9459597ce5ac1 --- manifests/conductor.pp | 13 ++++++----- manifests/conductor/service_credentials.pp | 10 ++------- manifests/taskmanager.pp | 22 +++++++++---------- manifests/taskmanager/service_credentials.pp | 10 ++------- .../notes/fix-auth_url-330322b223994b41.yaml | 17 ++++++++++++++ 5 files changed, 40 insertions(+), 32 deletions(-) create mode 100644 releasenotes/notes/fix-auth_url-330322b223994b41.yaml diff --git a/manifests/conductor.pp b/manifests/conductor.pp index e0d792b8..0170b31e 100644 --- a/manifests/conductor.pp +++ b/manifests/conductor.pp @@ -38,10 +38,6 @@ # (optional) Syslog facility to receive log lines. # Defaults to 'LOG_USER'. # -# [*auth_url*] -# (optional) Authentication URL. -# Defaults to 'http://localhost:5000/v3'. -# # [*conductor_manager*] # (optional) Trove conductor manager. # Defaults to 'trove.conductor.manager.Manager'. @@ -58,6 +54,12 @@ # (optional) If False doesn't trace SQL requests. # Default: $::os_service_default # +# DEPRECATED PARAMETERS +# +# [*auth_url*] +# (optional) Authentication URL. +# Defaults to undef +# class trove::conductor( $enabled = true, $manage_service = true, @@ -67,11 +69,12 @@ class trove::conductor( $log_dir = '/var/log/trove', $use_syslog = $::os_service_default, $log_facility = $::os_service_default, - $auth_url = 'http://localhost:5000/v3', $conductor_manager = 'trove.conductor.manager.Manager', $workers = $::os_workers, $enable_profiler = $::os_service_default, $trace_sqlalchemy = $::os_service_default, + # DEPRECATED PARAMETERS + $auth_url = undef ) inherits trove { include trove::deps diff --git a/manifests/conductor/service_credentials.pp b/manifests/conductor/service_credentials.pp index 077f82e1..e34311a2 100644 --- a/manifests/conductor/service_credentials.pp +++ b/manifests/conductor/service_credentials.pp @@ -30,7 +30,7 @@ # class trove::conductor::service_credentials ( $password = $::os_service_default, - $auth_url = undef, + $auth_url = 'http://127.0.0.1:5000/v3', $region_name = 'RegionOne', $username = 'trove', $project_name = 'services', @@ -40,13 +40,7 @@ class trove::conductor::service_credentials ( include trove::deps - if $auth_url == undef { - warning('The auto detection of auth_url from www_authenticate_uri will be \ -removed in a future release. Please set trove::conductor::service_credentials::auth_url .') - $auth_url_base = pick($::trove::keystone::authtoken::www_authenticate_uri, 'http://127.0.0.1:5000/v3') - } else { - $auth_url_base = $auth_url - } + $auth_url_base = pick($::trove::conductor::auth_url, $auth_url) $auth_url_real = "${regsubst($auth_url_base, '(\/v3$|\/v2.0$|\/$)', '')}/v3" $username_real = pick($::trove::nova_proxy_admin_user, $username) diff --git a/manifests/taskmanager.pp b/manifests/taskmanager.pp index 2e5cf45e..ccd07e74 100644 --- a/manifests/taskmanager.pp +++ b/manifests/taskmanager.pp @@ -60,14 +60,16 @@ # (optional) Syslog facility to receive log lines. # Defaults to 'LOG_USER'. # -# [*auth_url*] -# (optional) Authentication URL. -# Defaults to 'http://localhost:5000/v3'. -# # [*guestagent_config_file*] # (optional) Trove guest agent configuration file. # Defaults to '/etc/trove/trove-guestagent.conf'. # +# [*taskmanager_manager*] +# Trove taskmanager entry point. +# Defaults to 'trove.taskmanager.manager.Manager'. +# +# DEPRECATED OPTIONS +# # [*default_neutron_networks*] # (optional) The network that trove will attach by default. # Defaults to undef. @@ -76,16 +78,14 @@ # (optional) Message queue name the Taskmanager will listen to. # Defaults to 'taskmanager'. # -# [*taskmanager_manager*] -# Trove taskmanager entry point. -# Defaults to 'trove.taskmanager.manager.Manager'. -# -# DEPRECATED OPTIONS -# # [*use_guestagent_template*] # (optional) Use template to provision trove guest agent configuration file. # Defaults to true. # +# [*auth_url*] +# (optional) Authentication URL. +# Defaults to undef +# class trove::taskmanager( $enabled = true, $manage_service = true, @@ -95,7 +95,6 @@ class trove::taskmanager( $use_syslog = $::os_service_default, $guest_log_file = '/var/log/trove/trove-guestagent.log', $log_facility = $::os_service_default, - $auth_url = 'http://localhost:5000/v3', $package_ensure = 'present', $guestagent_config_file = '/etc/trove/trove-guestagent.conf', $taskmanager_manager = 'trove.taskmanager.manager.Manager', @@ -103,6 +102,7 @@ class trove::taskmanager( $default_neutron_networks = undef, $taskmanager_queue = undef, $use_guestagent_template = true, + $auth_url = undef, ) inherits trove { include trove::deps diff --git a/manifests/taskmanager/service_credentials.pp b/manifests/taskmanager/service_credentials.pp index d5416b60..6f7ae7b2 100644 --- a/manifests/taskmanager/service_credentials.pp +++ b/manifests/taskmanager/service_credentials.pp @@ -30,7 +30,7 @@ # class trove::taskmanager::service_credentials ( $password = $::os_service_default, - $auth_url = undef, + $auth_url = 'http://127.0.0.1:5000/v3', $region_name = 'RegionOne', $username = 'trove', $project_name = 'services', @@ -40,13 +40,7 @@ class trove::taskmanager::service_credentials ( include trove::deps - if $auth_url == undef { - warning('The auto detection of auth_url from www_authenticate_uri will be \ -removed in a future release. Please set trove::taskmanager::service_credentials::auth_url .') - $auth_url_base = pick($::trove::keystone::authtoken::www_authenticate_uri, 'http://127.0.0.1:5000/v3') - } else { - $auth_url_base = $auth_url - } + $auth_url_base = pick($::trove::taskmanager::auth_url, $auth_url) $auth_url_real = "${regsubst($auth_url_base, '(\/v3$|\/v2.0$|\/$)', '')}/v3" $username_real = pick($::trove::nova_proxy_admin_user, $username) diff --git a/releasenotes/notes/fix-auth_url-330322b223994b41.yaml b/releasenotes/notes/fix-auth_url-330322b223994b41.yaml new file mode 100644 index 00000000..561fae7c --- /dev/null +++ b/releasenotes/notes/fix-auth_url-330322b223994b41.yaml @@ -0,0 +1,17 @@ +--- +deprecations: + - | + The ``trove::taskmanager::auth_url parameter has been deprecated. Use + the ``trove::taskmanager::service_credentials::auth_url`` parameter + instead. + + - | + The ``trove::conductor::auth_url parameter has been deprecated. Use + the ``trove::conductor::service_credentials::auth_url`` parameter + instead. + +fixes: + - | + Now the ``trove::taskmanager::auth_url`` parameter and + the ``trove:conductor::auth_url`` parameter take effect and are used to + define value of ``[service_credentials] auth_url`` parameter.