Rename *_domain parameters to *_domain_name

... so that the parameter names clearly indicate that domain name
should be used instead of domain id.
This patch also change the default value of these domain parameters
from 'default' to 'Default', because now 'Default' is commonly used
as the name for default domain.

Change-Id: I4bce039248041ac2ccb74975cf8b97ea938efd67
This commit is contained in:
Takashi Kajinami 2020-05-01 23:07:32 +09:00
parent 4f6f25f1ea
commit 95a4d48aeb
4 changed files with 52 additions and 14 deletions

View File

@ -81,13 +81,13 @@
# (Optional) File path
# Defaults to '/root/openrc'.
#
# [*project_domain*]
# [*project_domain_name*]
# (Optional) Project domain in v3 api.
# Defaults to 'default'.
# Defaults to 'Default'.
#
# [*user_domain*]
# [*user_domain_name*]
# (Optional) User domain in v3 api.
# Defaults to 'default'.
# Defaults to 'Default'.
#
# [*auth_type*]
# (Optional) Authentication type to load.
@ -117,6 +117,16 @@
# (Optional) Object API version to use.
# Defaults to undef.
#
# DEPRECATED PARAMETERS
#
# [*project_domain*]
# (Optional) Project domain in v3 api.
# Defaults to 'Default'.
#
# [*user_domain*]
# (Optional) User domain in v3 api.
# Defaults to 'Default'.
#
class openstack_extras::auth_file (
$password,
$auth_url = 'http://127.0.0.1:5000/v3/',
@ -127,8 +137,8 @@ class openstack_extras::auth_file (
$project_name = 'openstack',
$region_name = 'RegionOne',
$use_no_cache = true,
$project_domain = 'default',
$user_domain = 'default',
$project_domain_name = 'Default',
$user_domain_name = 'Default',
$auth_type = undef,
$os_interface = 'public',
$os_endpoint_type = 'publicURL',
@ -145,8 +155,27 @@ class openstack_extras::auth_file (
$volume_api_version = undef,
$identity_api_version = '3',
$object_api_version = undef,
# DEPRECATED PARAMETERS
$project_domain = undef,
$user_domain = undef,
) {
if $project_domain != undef {
warning('project_domain is deprecated and will be removed in a future release. \
Use project_domain_name instead')
$project_domain_name_real = $project_domain
} else {
$project_domain_name_real = $project_domain_name
}
if $user_domain != undef {
warning('user_domain is deprecated and will be removed in a future release. \
Use user_domain_name instead')
$user_domain_name_real = $user_domain
} else {
$user_domain_name_real = $user_domain_name
}
file { $path:
owner => 'root',
group => 'root',

View File

@ -0,0 +1,9 @@
---
deprecations:
- |
The following parameters in ``openstack_extras::auth_file`` class has been
deprecated and will be removed in a future release. Use new parameters
instead.
- ``user_domain`` (now renamed to ``user_domain_name``)
- ``project_domain`` (now renamed to ``project_domain_name``)

View File

@ -26,8 +26,8 @@ describe 'openstack_extras::auth_file' do
'export OS_AUTH_URL=\'http://127.0.0.1:5000/v3/\'',
'export OS_AUTH_STRATEGY=\'keystone\'',
'export OS_REGION_NAME=\'RegionOne\'',
'export OS_PROJECT_DOMAIN_NAME=\'default\'',
'export OS_USER_DOMAIN_NAME=\'default\'',
'export OS_PROJECT_DOMAIN_NAME=\'Default\'',
'export OS_USER_DOMAIN_NAME=\'Default\'',
'export OS_INTERFACE=\'public\'',
'export OS_ENDPOINT_TYPE=\'publicURL\'',
'export CINDER_ENDPOINT_TYPE=\'publicURL\'',
@ -61,8 +61,8 @@ describe 'openstack_extras::auth_file' do
:neutron_endpoint_type => 'internalURL',
:auth_strategy => 'no_auth',
:path => '/path/to/file',
:user_domain => 'anotherdomain',
:project_domain => 'anotherdomain',
:user_domain_name => 'anotherdomain',
:project_domain_name => 'anotherdomain',
:compute_api_version => '2.1',
:network_api_version => '2.0',
:image_api_version => '2',

View File

@ -15,11 +15,11 @@ export OS_PASSWORD='<%= @password.gsub(/'/){ %q(\') } %>'
export OS_AUTH_URL='<%= @auth_url %>'
export OS_AUTH_STRATEGY='<%= @auth_strategy %>'
export OS_REGION_NAME='<%= @region_name %>'
<% if @project_domain -%>
export OS_PROJECT_DOMAIN_NAME='<%= @project_domain %>'
<% if @project_domain_name_real -%>
export OS_PROJECT_DOMAIN_NAME='<%= @project_domain_name_real %>'
<% end -%>
<% if @user_domain -%>
export OS_USER_DOMAIN_NAME='<%= @user_domain %>'
<% if @user_domain_name_real -%>
export OS_USER_DOMAIN_NAME='<%= @user_domain_name_real %>'
<% end -%>
<% if @auth_type -%>
export OS_AUTH_TYPE='<%= @auth_type %>'