Browse Source

Merge "Replace removed ironic api_endpoint by endpoint_override"

tags/16.2.1
Zuul 3 months ago
committed by Gerrit Code Review
parent
commit
602fe3d6a4
3 changed files with 37 additions and 31 deletions
  1. +28
    -15
      manifests/ironic/common.pp
  2. +6
    -0
      releasenotes/notes/nova-ironic-common-api_endpoint-be452cc86092eb4d.yaml
  3. +3
    -16
      spec/classes/nova_ironic_common_spec.rb

+ 28
- 15
manifests/ironic/common.pp View File

@@ -1,9 +1,5 @@
# == Class: nova::ironic::common
#
# [*api_endpoint*]
# The url for Ironic api endpoint.
# Defaults to 'http://127.0.0.1:6385/v1'
#
# [*auth_plugin*]
# The authentication plugin to use when connecting to nova.
# Defaults to 'password'
@@ -24,6 +20,10 @@
# The admin username for Ironic to connect to Nova.
# Defaults to 'admin'
#
# [*endpoint_override*]
# (optional) Override the endpoint to use to talk to Ironic.
# Defaults to $::os_service_default
#
# [*api_max_retries*]
# Max times for ironic driver to poll ironic api
#
@@ -38,32 +38,45 @@
# (Optional) Name of domain for $project_domain_name
# Defaults to 'Default'
#
# DEPRECATED PARAMETERS
#
# [*api_endpoint*]
# The url for Ironic api endpoint.
# Defaults to undef
#
class nova::ironic::common (
$api_endpoint = 'http://127.0.0.1:6385/v1',
$auth_plugin = 'password',
$auth_url = 'http://127.0.0.1:5000/',
$password = 'ironic',
$project_name = 'services',
$username = 'admin',
$endpoint_override = $::os_service_default,
$api_max_retries = $::os_service_default,
$api_retry_interval = $::os_service_default,
$user_domain_name = 'Default',
$project_domain_name = 'Default',
# DEPRECATED PARAMETERS
$api_endpoint = undef,
) {

include nova::deps

if $api_endpoint != undef {
warning('nova::ironic::common::api_endpoint is deprecated and has no effect. \
Use nova::ironic::common::endpoint_override instead.')
}

nova_config {
'ironic/auth_plugin': value => $auth_plugin;
'ironic/username': value => $username;
'ironic/password': value => $password, secret => true;
'ironic/auth_url': value => $auth_url;
'ironic/project_name': value => $project_name;
'ironic/api_endpoint': value => $api_endpoint;
'ironic/api_max_retries': value => $api_max_retries;
'ironic/api_retry_interval': value => $api_retry_interval;
'ironic/user_domain_name': value => $user_domain_name;
'ironic/project_domain_name': value => $project_domain_name;
'ironic/auth_plugin': value => $auth_plugin;
'ironic/username': value => $username;
'ironic/password': value => $password, secret => true;
'ironic/auth_url': value => $auth_url;
'ironic/project_name': value => $project_name;
'ironic/endpoint_override': value => $endpoint_override;
'ironic/api_max_retries': value => $api_max_retries;
'ironic/api_retry_interval': value => $api_retry_interval;
'ironic/user_domain_name': value => $user_domain_name;
'ironic/project_domain_name': value => $project_domain_name;
}

}

+ 6
- 0
releasenotes/notes/nova-ironic-common-api_endpoint-be452cc86092eb4d.yaml View File

@@ -0,0 +1,6 @@
---
deprecations:
- |
The nova::ironic::common::api_endpoint is deprecated and has no effect,
because the corresponding [ironic]api_endpoint was removed in Nova.
The nova::ironic::common::endpoint_override should be used instead.

+ 3
- 16
spec/classes/nova_ironic_common_spec.rb View File

@@ -11,7 +11,7 @@ describe 'nova::ironic::common' do
is_expected.to contain_nova_config('ironic/password').with_value('ironic').with_secret(true)
is_expected.to contain_nova_config('ironic/auth_url').with_value('http://127.0.0.1:5000/')
is_expected.to contain_nova_config('ironic/project_name').with_value('services')
is_expected.to contain_nova_config('ironic/api_endpoint').with_value('http://127.0.0.1:6385/v1')
is_expected.to contain_nova_config('ironic/endpoint_override').with_value('<SERVICE DEFAULT>')
is_expected.to contain_nova_config('ironic/api_max_retries').with('value' => '<SERVICE DEFAULT>')
is_expected.to contain_nova_config('ironic/api_retry_interval').with('value' => '<SERVICE DEFAULT>')
is_expected.to contain_nova_config('ironic/user_domain_name').with_value('Default')
@@ -27,7 +27,7 @@ describe 'nova::ironic::common' do
:password => 's3cr3t',
:auth_url => 'http://10.0.0.10:5000/',
:project_name => 'services2',
:api_endpoint => 'http://10.0.0.10:6385/v1',
:endpoint_override => 'http://10.0.0.10:6385/v1',
:api_max_retries => 60,
:api_retry_interval => 2,
:user_domain_name => 'custom_domain',
@@ -41,7 +41,7 @@ describe 'nova::ironic::common' do
is_expected.to contain_nova_config('ironic/password').with_value('s3cr3t').with_secret(true)
is_expected.to contain_nova_config('ironic/auth_url').with_value('http://10.0.0.10:5000/')
is_expected.to contain_nova_config('ironic/project_name').with_value('services2')
is_expected.to contain_nova_config('ironic/api_endpoint').with_value('http://10.0.0.10:6385/v1')
is_expected.to contain_nova_config('ironic/endpoint_override').with_value('http://10.0.0.10:6385/v1')
is_expected.to contain_nova_config('ironic/api_max_retries').with('value' => '60')
is_expected.to contain_nova_config('ironic/api_retry_interval').with('value' => '2')
is_expected.to contain_nova_config('ironic/user_domain_name').with('value' => 'custom_domain')
@@ -49,19 +49,6 @@ describe 'nova::ironic::common' do

end
end

context 'with deprecated parameters' do
let :params do
{
:api_endpoint => 'http://10.0.0.10:6385/v1',
}
end

it 'configures ironic in nova.conf' do
is_expected.to contain_nova_config('ironic/api_endpoint').with_value('http://10.0.0.10:6385/v1')

end
end
end

on_supported_os({


Loading…
Cancel
Save