Merge "Use validate_legacy"

This commit is contained in:
Zuul 2019-02-25 19:20:03 +00:00 committed by Gerrit Code Review
commit c0fabacc57
9 changed files with 18 additions and 16 deletions

View File

@ -521,7 +521,8 @@ class glance::api(
# Set the pipeline, it is allowed to be blank
if $pipeline != '' {
validate_re($pipeline, '^(\w+([+]\w+)*)*$')
validate_legacy(Pattern[/^(\w+([+]\w+)*)*$/], 'validate_re', $pipeline, ['^(\w+([+]\w+)*)*$'])
glance_api_config {
'paste_deploy/flavor':
ensure => present,

View File

@ -66,8 +66,8 @@ class glance::api::db (
$database_retry_interval_real = pick($::glance::api::database_retry_interval, $database_retry_interval)
$database_max_overflow_real = pick($::glance::api::database_max_overflow, $database_max_overflow)
validate_re($database_connection_real,
'^(sqlite|mysql(\+pymysql)?|postgresql):\/\/(\S+:\S+@\S+\/\S+)?')
validate_legacy(Oslo::Dbconn, 'validate_re', $database_connection_real,
['^(sqlite|mysql(\+pymysql)?|postgresql):\/\/(\S+:\S+@\S+\/\S+)?'])
oslo::db { 'glance_api_config':
db_max_retries => $database_db_max_retries,

View File

@ -49,12 +49,12 @@ class glance::config (
include ::glance::deps
validate_hash($api_config)
validate_hash($api_paste_ini_config)
validate_hash($registry_config)
validate_hash($registry_paste_ini_config)
validate_hash($cache_config)
validate_hash($image_import_config)
validate_legacy(Hash, 'validate_hash', $api_config)
validate_legacy(Hash, 'validate_hash', $api_paste_ini_config)
validate_legacy(Hash, 'validate_hash', $registry_config)
validate_legacy(Hash, 'validate_hash', $registry_paste_ini_config)
validate_legacy(Hash, 'validate_hash', $cache_config)
validate_legacy(Hash, 'validate_hash', $image_import_config)
create_resources('glance_api_config', $api_config)
create_resources('glance_api_paste_ini', $api_paste_ini_config)

View File

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

View File

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

View File

@ -146,7 +146,8 @@ class glance::registry(
# Set the pipeline, it is allowed to be blank
if $pipeline != '' {
validate_re($pipeline, '^(\w+([+]\w+)*)*$')
validate_legacy(Pattern[/^(\w+([+]\w+)*)*$/], 'validate_re', $pipeline, ['^(\w+([+]\w+)*)*$'])
glance_registry_config {
'paste_deploy/flavor':
ensure => present,

View File

@ -66,8 +66,8 @@ class glance::registry::db (
$database_retry_interval_real = pick($::glance::registry::database_retry_interval, $database_retry_interval)
$database_max_overflow_real = pick($::glance::registry::database_max_overflow, $database_max_overflow)
validate_re($database_connection_real,
'^(sqlite|mysql(\+pymysql)?|postgresql):\/\/(\S+:\S+@\S+\/\S+)?')
validate_legacy(Oslo::Dbconn, 'validate_re', $database_connection_real,
['^(sqlite|mysql(\+pymysql)?|postgresql):\/\/(\S+:\S+@\S+\/\S+)?'])
oslo::db { 'glance_registry_config':
db_max_retries => $database_db_max_retries,

View File

@ -274,7 +274,7 @@ describe 'glance::api' do
end
it { expect { is_expected.to contain_glance_api_config('filter:paste_deploy/flavor') }.to\
raise_error(Puppet::Error, /validate_re\(\): .* does not match/) }
raise_error(Puppet::Error) }
end
end

View File

@ -150,7 +150,7 @@ describe 'glance::registry' do
end
it { expect { is_expected.to contain_glance_registry_config('filter:paste_deploy/flavor') }.to\
raise_error(Puppet::Error, /validate_re\(\): .* does not match/) }
raise_error(Puppet::Error) }
end
end