Deprecate service validation for nova-api
Following the past deprecation in puppet-keystone[1], this change deprecates service validation for nova-api. [1] 3c95205e0253895e477b9135c10f5175d4166cfc Change-Id: I6c409232f5b5120b93d1d47ffa416309d3d9d643
This commit is contained in:
@@ -79,26 +79,6 @@
|
|||||||
# (Optional) Set max request body size
|
# (Optional) Set max request body size
|
||||||
# Defaults to $::os_service_default.
|
# Defaults to $::os_service_default.
|
||||||
#
|
#
|
||||||
# [*validate*]
|
|
||||||
# (optional) Whether to validate the service is working after any service refreshes
|
|
||||||
# Defaults to false
|
|
||||||
#
|
|
||||||
# [*validation_options*]
|
|
||||||
# (optional) Service validation options
|
|
||||||
# Should be a hash of options defined in openstacklib::service_validation
|
|
||||||
# If empty, defaults values are taken from openstacklib function.
|
|
||||||
# Default command list nova flavors.
|
|
||||||
# Require validate set at True.
|
|
||||||
# Example:
|
|
||||||
# nova::api::validation_options:
|
|
||||||
# nova-api:
|
|
||||||
# command: check_nova.py
|
|
||||||
# path: /usr/bin:/bin:/usr/sbin:/sbin
|
|
||||||
# provider: shell
|
|
||||||
# tries: 5
|
|
||||||
# try_sleep: 10
|
|
||||||
# Defaults to {}
|
|
||||||
#
|
|
||||||
# [*service_name*]
|
# [*service_name*]
|
||||||
# (optional) Name of the service that will be providing the
|
# (optional) Name of the service that will be providing the
|
||||||
# server functionality of nova-api.
|
# server functionality of nova-api.
|
||||||
@@ -198,6 +178,18 @@
|
|||||||
# (optional) The rate limiting factory to use
|
# (optional) The rate limiting factory to use
|
||||||
# Defaults to undef
|
# Defaults to undef
|
||||||
#
|
#
|
||||||
|
# [*validate*]
|
||||||
|
# (optional) Whether to validate the service is working after any service refreshes
|
||||||
|
# Defaults to undef
|
||||||
|
#
|
||||||
|
# [*validation_options*]
|
||||||
|
# (optional) Service validation options
|
||||||
|
# Should be a hash of options defined in openstacklib::service_validation
|
||||||
|
# If empty, defaults values are taken from openstacklib function.
|
||||||
|
# Default command list nova flavors.
|
||||||
|
# Require validate set at True.
|
||||||
|
# Defaults to undef
|
||||||
|
#
|
||||||
class nova::api(
|
class nova::api(
|
||||||
$enabled = true,
|
$enabled = true,
|
||||||
$manage_service = true,
|
$manage_service = true,
|
||||||
@@ -214,8 +206,6 @@ class nova::api(
|
|||||||
$sync_db = true,
|
$sync_db = true,
|
||||||
$sync_db_api = true,
|
$sync_db_api = true,
|
||||||
$db_online_data_migrations = false,
|
$db_online_data_migrations = false,
|
||||||
$validate = false,
|
|
||||||
$validation_options = {},
|
|
||||||
$instance_name_template = $::os_service_default,
|
$instance_name_template = $::os_service_default,
|
||||||
$service_name = $::nova::params::api_service_name,
|
$service_name = $::nova::params::api_service_name,
|
||||||
$metadata_service_name = $::nova::params::api_metadata_service_name,
|
$metadata_service_name = $::nova::params::api_metadata_service_name,
|
||||||
@@ -239,6 +229,8 @@ class nova::api(
|
|||||||
$install_cinder_client = undef,
|
$install_cinder_client = undef,
|
||||||
$ratelimits = undef,
|
$ratelimits = undef,
|
||||||
$ratelimits_factory = undef,
|
$ratelimits_factory = undef,
|
||||||
|
$validate = undef,
|
||||||
|
$validation_options = undef,
|
||||||
) inherits nova::params {
|
) inherits nova::params {
|
||||||
|
|
||||||
include nova::deps
|
include nova::deps
|
||||||
@@ -260,6 +252,13 @@ class nova::api(
|
|||||||
warning('The nova::api::ratelimits parameter has been deprecated and has no effect')
|
warning('The nova::api::ratelimits parameter has been deprecated and has no effect')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if $validate != undef {
|
||||||
|
warning('The nova::api::validate parameter has been deprecated and has no effect')
|
||||||
|
}
|
||||||
|
if $validation_options != undef {
|
||||||
|
warning('The nova::api::validation_options parameter has been deprecated and has no effect')
|
||||||
|
}
|
||||||
|
|
||||||
if $instance_name_template {
|
if $instance_name_template {
|
||||||
$instance_name_template_real = $instance_name_template
|
$instance_name_template_real = $instance_name_template
|
||||||
} else {
|
} else {
|
||||||
@@ -373,27 +372,4 @@ as a standalone service, or httpd for being run by a httpd server")
|
|||||||
if $db_online_data_migrations {
|
if $db_online_data_migrations {
|
||||||
include nova::db::online_data_migrations
|
include nova::db::online_data_migrations
|
||||||
}
|
}
|
||||||
|
|
||||||
if $validate {
|
|
||||||
$authtoken_values = {
|
|
||||||
'username' => $::nova::keystone::authtoken::username,
|
|
||||||
'password' => $::nova::keystone::authtoken::password,
|
|
||||||
'project_name' => $::nova::keystone::authtoken::project_name,
|
|
||||||
'www_authenticate_uri' => $::nova::keystone::authtoken::www_authenticate_uri,
|
|
||||||
}
|
|
||||||
$authtoken = merge($authtoken_values, $::nova::keystone::authtoken::params)
|
|
||||||
$defaults = {
|
|
||||||
'nova-api' => {
|
|
||||||
'command' => @("CMD"/L)
|
|
||||||
nova --os-auth-url ${authtoken['www_authenticate_uri']} \
|
|
||||||
--os-project-name ${authtoken['project_name']} \
|
|
||||||
--os-username ${authtoken['username']} \
|
|
||||||
--os-password ${authtoken['password']} \
|
|
||||||
flavor-list
|
|
||||||
|- CMD
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$validation_options_hash = merge ($defaults, $validation_options)
|
|
||||||
create_resources('openstacklib::service_validation', $validation_options_hash, {'subscribe' => 'Anchor[nova::service::end]'})
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,6 @@
|
|||||||
|
---
|
||||||
|
deprecations:
|
||||||
|
- |
|
||||||
|
The service validation feature of the ``nova::api`` class is deprecated,
|
||||||
|
and the ``nova::api::validate`` parameter and
|
||||||
|
the ``nova::api::validate_options`` parameter have no effect now.
|
||||||
@@ -35,7 +35,6 @@ describe 'nova::api' do
|
|||||||
)
|
)
|
||||||
is_expected.to contain_package('nova-api').that_requires('Anchor[nova::install::begin]')
|
is_expected.to contain_package('nova-api').that_requires('Anchor[nova::install::begin]')
|
||||||
is_expected.to contain_package('nova-api').that_notifies('Anchor[nova::install::end]')
|
is_expected.to contain_package('nova-api').that_notifies('Anchor[nova::install::end]')
|
||||||
is_expected.to_not contain_exec('validate_nova_api')
|
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'enable metadata in evenlet configuration' do
|
it 'enable metadata in evenlet configuration' do
|
||||||
@@ -147,32 +146,6 @@ describe 'nova::api' do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'while validating the service with default command' do
|
|
||||||
before do
|
|
||||||
params.merge!({
|
|
||||||
:validate => true,
|
|
||||||
})
|
|
||||||
end
|
|
||||||
it { is_expected.to contain_openstacklib__service_validation('nova-api').with(
|
|
||||||
:command => 'nova --os-auth-url http://127.0.0.1:5000/ --os-project-name services --os-username novae --os-password passw0rd flavor-list',
|
|
||||||
:subscribe => 'Anchor[nova::service::end]',
|
|
||||||
)}
|
|
||||||
|
|
||||||
end
|
|
||||||
|
|
||||||
context 'while validating the service with custom command' do
|
|
||||||
before do
|
|
||||||
params.merge!({
|
|
||||||
:validate => true,
|
|
||||||
:validation_options => { 'nova-api' => { 'command' => 'my-script' } }
|
|
||||||
})
|
|
||||||
end
|
|
||||||
it { is_expected.to contain_openstacklib__service_validation('nova-api').with(
|
|
||||||
:command => 'my-script',
|
|
||||||
:subscribe => 'Anchor[nova::service::end]',
|
|
||||||
)}
|
|
||||||
end
|
|
||||||
|
|
||||||
context 'while not managing service state' do
|
context 'while not managing service state' do
|
||||||
before do
|
before do
|
||||||
params.merge!({
|
params.merge!({
|
||||||
|
|||||||
Reference in New Issue
Block a user