Use validate_legacy

This changes all the puppet 3 validate_* functions
to use the validate_legacy function.

The validate_legacy function has been available since
about three years but require Puppet >= 4.4.0 and since
there is Puppet 4.10.12 as latest we should assume people
are running a fairly new Puppet 4 version.

This is the first step to then remove all validate function
calls and use proper types for parameter as described in spec [1].

[1] https://review.openstack.org/#/c/568929/

Change-Id: I4da049ff59fd71403f4d00cfad8c5f56041e1e6e
This commit is contained in:
Tobias Urdin 2019-02-23 23:23:09 +01:00
parent a1a3c25c4a
commit 52f9b4c5f7
9 changed files with 14 additions and 12 deletions

View File

@ -38,10 +38,10 @@ class murano::config (
include ::murano::deps include ::murano::deps
validate_hash($murano_config) validate_legacy(Hash, 'validate_hash', $murano_config)
validate_hash($murano_cfapi_config) validate_legacy(Hash, 'validate_hash', $murano_cfapi_config)
validate_hash($murano_paste_config) validate_legacy(Hash, 'validate_hash', $murano_paste_config)
validate_hash($murano_cfapi_paste_config) validate_legacy(Hash, 'validate_hash', $murano_cfapi_paste_config)
create_resources('murano_config', $murano_config) create_resources('murano_config', $murano_config)
create_resources('murano_cfapi_config', $murano_cfapi_config) create_resources('murano_cfapi_config', $murano_cfapi_config)

View File

@ -66,7 +66,8 @@ class murano::db (
$database_retry_interval_real = pick($::murano::database_retry_interval, $database_retry_interval) $database_retry_interval_real = pick($::murano::database_retry_interval, $database_retry_interval)
$database_max_overflow_real = pick($::murano::database_max_overflow, $database_max_overflow) $database_max_overflow_real = pick($::murano::database_max_overflow, $database_max_overflow)
validate_re($database_connection_real, '^(mysql(\+pymysql)?|postgresql):\/\/(\S+:\S+@\S+\/\S+)?') validate_legacy(Oslo::Dbconn, 'validate_re', $database_connection_real,
['^(mysql(\+pymysql)?|postgresql):\/\/(\S+:\S+@\S+\/\S+)?'])
oslo::db { 'murano_config': oslo::db { 'murano_config':
connection => $database_connection_real, connection => $database_connection_real,

View File

@ -44,7 +44,7 @@ class murano::db::mysql(
include ::murano::deps include ::murano::deps
validate_string($password) validate_legacy(String, 'validate_string', $password)
::openstacklib::db::mysql{ 'murano': ::openstacklib::db::mysql{ 'murano':
user => $user, user => $user,

View File

@ -44,7 +44,7 @@ class murano::db::mysql_cfapi(
include ::murano::deps include ::murano::deps
validate_string($password) validate_legacy(String, 'validate_string', $password)
::openstacklib::db::mysql{ 'murano_cfapi': ::openstacklib::db::mysql{ 'murano_cfapi':
user => $user, user => $user,

View File

@ -34,7 +34,7 @@ class murano::db::postgresql(
include ::murano::deps include ::murano::deps
validate_string($password) validate_legacy(String, 'validate_string', $password)
::openstacklib::db::postgresql { 'murano': ::openstacklib::db::postgresql { 'murano':
password_hash => postgresql_password($user, $password), password_hash => postgresql_password($user, $password),

View File

@ -34,7 +34,7 @@ class murano::db::postgresql_cfapi(
include ::murano::deps include ::murano::deps
validate_string($password) validate_legacy(String, 'validate_string', $password)
::openstacklib::db::postgresql { 'murano_cfapi': ::openstacklib::db::postgresql { 'murano_cfapi':
password_hash => postgresql_password($user, $password), password_hash => postgresql_password($user, $password),

View File

@ -53,7 +53,8 @@ class murano::db_cfapi (
if !is_service_default($database_connection) { if !is_service_default($database_connection) {
validate_re($database_connection, '^(mysql(\+pymysql)?|postgresql):\/\/(\S+:\S+@\S+\/\S+)?') validate_legacy(Oslo::Dbconn, 'validate_re', $database_connection,
['^(mysql(\+pymysql)?|postgresql):\/\/(\S+:\S+@\S+\/\S+)?'])
oslo::db { 'murano_cfapi_config': oslo::db { 'murano_cfapi_config':
connection => $database_connection, connection => $database_connection,

View File

@ -310,7 +310,7 @@ class murano(
include ::murano::policy include ::murano::policy
include ::murano::db include ::murano::db
validate_string($admin_password) validate_legacy(String, 'validate_string', $admin_password)
package { 'murano-common': package { 'murano-common':
ensure => $package_ensure, ensure => $package_ensure,

View File

@ -31,7 +31,7 @@ class murano::policy (
include ::murano::deps include ::murano::deps
include ::murano::params include ::murano::params
validate_hash($policies) validate_legacy(Hash, 'validate_hash', $policies)
Openstacklib::Policy::Base { Openstacklib::Policy::Base {
file_path => $policy_path, file_path => $policy_path,