Remove deprecated parameters
* glance::api::sql_connection (deprecated since 4.1.0) * glance::api::sql_idle_timeout (deprecated since 4.1.0) * glance::registry::sql_connection (deprecated since 4.1.0) * glance::registry::sql_idle_timeout (deprecated since 4.1.0) Change-Id: Ibfe4e1a0a9f2f9f79b3fc76ef6a93ce429f72ed4
This commit is contained in:
parent
916a90ebdc
commit
e16f86e37c
20
README.md
20
README.md
@ -45,19 +45,19 @@ To utilize the glance module's functionality you will need to declare multiple r
|
||||
|
||||
```puppet
|
||||
class { 'glance::api':
|
||||
verbose => true,
|
||||
keystone_tenant => 'services',
|
||||
keystone_user => 'glance',
|
||||
keystone_password => '12345',
|
||||
sql_connection => 'mysql://glance:12345@127.0.0.1/glance',
|
||||
verbose => true,
|
||||
keystone_tenant => 'services',
|
||||
keystone_user => 'glance',
|
||||
keystone_password => '12345',
|
||||
database_connection => 'mysql://glance:12345@127.0.0.1/glance',
|
||||
}
|
||||
|
||||
class { 'glance::registry':
|
||||
verbose => true,
|
||||
keystone_tenant => 'services',
|
||||
keystone_user => 'glance',
|
||||
keystone_password => '12345',
|
||||
sql_connection => 'mysql://glance:12345@127.0.0.1/glance',
|
||||
verbose => true,
|
||||
keystone_tenant => 'services',
|
||||
keystone_user => 'glance',
|
||||
keystone_password => '12345',
|
||||
database_connection => 'mysql://glance:12345@127.0.0.1/glance',
|
||||
}
|
||||
|
||||
class { 'glance::backend::file': }
|
||||
|
@ -104,14 +104,6 @@
|
||||
# (optional) Whether to enable services.
|
||||
# Defaults to true.
|
||||
#
|
||||
# [*sql_idle_timeout*]
|
||||
# (optional) Deprecated. Use database_idle_timeout instead
|
||||
# Defaults to false
|
||||
#
|
||||
# [*sql_connection*]
|
||||
# (optional) Deprecated. Use database_connection instead.
|
||||
# Defaults to false
|
||||
#
|
||||
# [*database_connection*]
|
||||
# (optional) Connection url to connect to nova database.
|
||||
# Defaults to 'sqlite:///var/lib/glance/glance.sqlite'
|
||||
@ -204,8 +196,6 @@ class glance::api(
|
||||
$os_region_name = 'RegionOne',
|
||||
# DEPRECATED PARAMETERS
|
||||
$mysql_module = undef,
|
||||
$sql_idle_timeout = false,
|
||||
$sql_connection = false,
|
||||
) inherits glance {
|
||||
|
||||
include glance::policy
|
||||
@ -243,34 +233,20 @@ class glance::api(
|
||||
require => Class['glance']
|
||||
}
|
||||
|
||||
if $sql_connection {
|
||||
warning('The sql_connection parameter is deprecated, use database_connection instead.')
|
||||
$database_connection_real = $sql_connection
|
||||
} else {
|
||||
$database_connection_real = $database_connection
|
||||
}
|
||||
|
||||
if $sql_idle_timeout {
|
||||
warning('The sql_idle_timeout parameter is deprecated, use database_idle_timeout instead.')
|
||||
$database_idle_timeout_real = $sql_idle_timeout
|
||||
} else {
|
||||
$database_idle_timeout_real = $database_idle_timeout
|
||||
}
|
||||
|
||||
if $database_connection_real {
|
||||
if($database_connection_real =~ /mysql:\/\/\S+:\S+@\S+\/\S+/) {
|
||||
if $database_connection {
|
||||
if($database_connection =~ /mysql:\/\/\S+:\S+@\S+\/\S+/) {
|
||||
require 'mysql::bindings'
|
||||
require 'mysql::bindings::python'
|
||||
} elsif($database_connection_real =~ /postgresql:\/\/\S+:\S+@\S+\/\S+/) {
|
||||
} elsif($database_connection =~ /postgresql:\/\/\S+:\S+@\S+\/\S+/) {
|
||||
|
||||
} elsif($database_connection_real =~ /sqlite:\/\//) {
|
||||
} elsif($database_connection =~ /sqlite:\/\//) {
|
||||
|
||||
} else {
|
||||
fail("Invalid db connection ${database_connection_real}")
|
||||
fail("Invalid db connection ${database_connection}")
|
||||
}
|
||||
glance_api_config {
|
||||
'database/connection': value => $database_connection_real, secret => true;
|
||||
'database/idle_timeout': value => $database_idle_timeout_real;
|
||||
'database/connection': value => $database_connection, secret => true;
|
||||
'database/idle_timeout': value => $database_idle_timeout;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -29,14 +29,6 @@
|
||||
# If set to boolean false, it will not log to any directory.
|
||||
# Defaults to '/var/log/glance'
|
||||
#
|
||||
# [*sql_idle_timeout*]
|
||||
# (optional) Deprecated. Use database_idle_timeout instead
|
||||
# Defaults to false
|
||||
#
|
||||
# [*sql_connection*]
|
||||
# (optional) Deprecated. Use database_connection instead.
|
||||
# Defaults to false
|
||||
#
|
||||
# [*database_connection*]
|
||||
# (optional) Connection url to connect to nova database.
|
||||
# Defaults to 'sqlite:///var/lib/glance/glance.sqlite'
|
||||
@ -141,8 +133,6 @@ class glance::registry(
|
||||
$ca_file = false,
|
||||
# DEPRECATED PARAMETERS
|
||||
$mysql_module = undef,
|
||||
$sql_idle_timeout = false,
|
||||
$sql_connection = false,
|
||||
) inherits glance {
|
||||
|
||||
require keystone::python
|
||||
@ -170,34 +160,20 @@ class glance::registry(
|
||||
require => Class['glance']
|
||||
}
|
||||
|
||||
if $sql_connection {
|
||||
warning('The sql_connection parameter is deprecated, use database_connection instead.')
|
||||
$database_connection_real = $sql_connection
|
||||
} else {
|
||||
$database_connection_real = $database_connection
|
||||
}
|
||||
|
||||
if $sql_idle_timeout {
|
||||
warning('The sql_idle_timeout parameter is deprecated, use database_idle_timeout instead.')
|
||||
$database_idle_timeout_real = $sql_idle_timeout
|
||||
} else {
|
||||
$database_idle_timeout_real = $database_idle_timeout
|
||||
}
|
||||
|
||||
if $database_connection_real {
|
||||
if($database_connection_real =~ /mysql:\/\/\S+:\S+@\S+\/\S+/) {
|
||||
if $database_connection {
|
||||
if($database_connection =~ /mysql:\/\/\S+:\S+@\S+\/\S+/) {
|
||||
require 'mysql::bindings'
|
||||
require 'mysql::bindings::python'
|
||||
} elsif($database_connection_real =~ /postgresql:\/\/\S+:\S+@\S+\/\S+/) {
|
||||
} elsif($database_connection =~ /postgresql:\/\/\S+:\S+@\S+\/\S+/) {
|
||||
|
||||
} elsif($database_connection_real =~ /sqlite:\/\//) {
|
||||
} elsif($database_connection =~ /sqlite:\/\//) {
|
||||
|
||||
} else {
|
||||
fail("Invalid db connection ${database_connection_real}")
|
||||
fail("Invalid db connection ${database_connection}")
|
||||
}
|
||||
glance_registry_config {
|
||||
'database/connection': value => $database_connection_real, secret => true;
|
||||
'database/idle_timeout': value => $database_idle_timeout_real;
|
||||
'database/connection': value => $database_connection, secret => true;
|
||||
'database/idle_timeout': value => $database_idle_timeout;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -337,20 +337,6 @@ describe 'glance::api' do
|
||||
it { should contain_glance_api_config('DEFAULT/known_stores').with_value("glance.store.filesystem.Store,glance.store.http.Store") }
|
||||
end
|
||||
|
||||
describe 'with deprecated sql parameters' do
|
||||
let :params do
|
||||
default_params.merge({
|
||||
:sql_connection => 'mysql://user:pass@db/db',
|
||||
:sql_idle_timeout => '30'
|
||||
})
|
||||
end
|
||||
|
||||
it 'configures database' do
|
||||
should contain_glance_api_config('database/connection').with_value('mysql://user:pass@db/db')
|
||||
should contain_glance_api_config('database/idle_timeout').with_value('30')
|
||||
end
|
||||
end
|
||||
|
||||
describe 'on Debian platforms' do
|
||||
let :facts do
|
||||
{ :osfamily => 'Debian' }
|
||||
|
@ -292,20 +292,6 @@ describe 'glance::registry' do
|
||||
end
|
||||
end
|
||||
|
||||
describe 'with deprecated sql parameters' do
|
||||
let :params do
|
||||
default_params.merge({
|
||||
:sql_connection => 'mysql://user:pass@db/db',
|
||||
:sql_idle_timeout => '30'
|
||||
})
|
||||
end
|
||||
|
||||
it 'configures database' do
|
||||
should contain_glance_registry_config('database/connection').with_value('mysql://user:pass@db/db')
|
||||
should contain_glance_registry_config('database/idle_timeout').with_value('30')
|
||||
end
|
||||
end
|
||||
|
||||
describe 'on Debian platforms' do
|
||||
let :facts do
|
||||
{ :osfamily => 'Debian' }
|
||||
|
@ -19,13 +19,13 @@ node glance_keystone_mysql {
|
||||
password => 'ChangeMe',
|
||||
}
|
||||
class { 'glance::api':
|
||||
verbose => true,
|
||||
debug => true,
|
||||
auth_type => 'keystone',
|
||||
keystone_tenant => 'services',
|
||||
keystone_user => 'glance',
|
||||
keystone_password => 'glance_password',
|
||||
sql_connection => 'mysql://glance:glance@127.0.0.1/glance',
|
||||
verbose => true,
|
||||
debug => true,
|
||||
auth_type => 'keystone',
|
||||
keystone_tenant => 'services',
|
||||
keystone_user => 'glance',
|
||||
keystone_password => 'glance_password',
|
||||
database_connection => 'mysql://glance:glance@127.0.0.1/glance',
|
||||
}
|
||||
class { 'glance::backend::file': }
|
||||
|
||||
@ -39,13 +39,13 @@ node glance_keystone_mysql {
|
||||
}
|
||||
|
||||
class { 'glance::registry':
|
||||
verbose => true,
|
||||
debug => true,
|
||||
auth_type => 'keystone',
|
||||
keystone_tenant => 'services',
|
||||
keystone_user => 'glance',
|
||||
keystone_password => 'glance_password',
|
||||
sql_connection => 'mysql://glance:glance@127.0.0.1/glance',
|
||||
verbose => true,
|
||||
debug => true,
|
||||
auth_type => 'keystone',
|
||||
keystone_tenant => 'services',
|
||||
keystone_user => 'glance',
|
||||
keystone_password => 'glance_password',
|
||||
database_connection => 'mysql://glance:glance@127.0.0.1/glance',
|
||||
}
|
||||
class { 'glance::keystone::auth':
|
||||
password => 'glance_pass',
|
||||
|
Loading…
Reference in New Issue
Block a user