diff --git a/manifests/ctlplugin.pp b/manifests/ctlplugin.pp index cceb9c9..e64cab9 100644 --- a/manifests/ctlplugin.pp +++ b/manifests/ctlplugin.pp @@ -16,7 +16,7 @@ include supervisord # parameter validation - validate_string($ctl_factory) + validate_legacy(String, 'validate_string', $ctl_factory) concat::fragment { "ctlplugin:${name}": target => $supervisord::config_file, diff --git a/manifests/eventlistener.pp b/manifests/eventlistener.pp index 796cab2..6fe63d0 100644 --- a/manifests/eventlistener.pp +++ b/manifests/eventlistener.pp @@ -47,36 +47,36 @@ include supervisord # parameter validation - validate_string($command) - validate_re($ensure_process, ['running', 'stopped', 'removed', 'unmanaged']) - if !is_integer($buffer_size) { validate_re($buffer_size, '^\d+')} - if $events { validate_array($events) } - if $result_handler { validate_string($result_handler) } - if $numprocs { if !is_integer($numprocs) { validate_re($numprocs, '^\d+')} } - if $numprocs_start { if !is_integer($numprocs_start) { validate_re($numprocs_start, '^\d+')} } - if $priority { if !is_integer($priority) { validate_re($priority, '^\d+') } } - if $autostart { if !is_bool($autostart) { validate_re($autostart, ['true', 'false']) } } - if $autorestart { if !is_bool($autorestart) { validate_re($autorestart, ['true', 'false', 'unexpected']) } } - if $startsecs { if !is_integer($startsecs) { validate_re($startsecs, '^\d+')} } - if $startretries { if !is_integer($startretries) { validate_re($startretries, '^\d+')} } - if $exitcodes { validate_string($exitcodes)} - if $stopsignal { validate_re($stopsignal, ['TERM', 'HUP', 'INT', 'QUIT', 'KILL', 'USR1', 'USR2']) } - if $stopwaitsecs { if !is_integer($stopwaitsecs) { validate_re($stopwaitsecs, '^\d+')} } - if $stopasgroup { validate_bool($stopasgroup) } - if $killasgroup { validate_bool($killasgroup) } - if $user { validate_string($user) } - if $redirect_stderr { validate_bool($redirect_stderr) } - validate_string($stdout_logfile) - if $stdout_logfile_maxbytes { validate_string($stdout_logfile_maxbytes) } - if $stdout_logfile_backups { if !is_integer($stdout_logfile_backups) { validate_re($stdout_logfile_backups, '^\d+')} } - if $stdout_events_enabled { validate_bool($stdout_events_enabled) } - validate_string($stderr_logfile) - if $stderr_logfile_maxbytes { validate_string($stderr_logfile_maxbytes) } - if $stderr_logfile_backups { if !is_integer($stderr_logfile_backups) { validate_re($stderr_logfile_backups, '^\d+')} } - if $stderr_events_enabled { validate_bool($stderr_events_enabled) } - if $directory { validate_absolute_path($directory) } - if $umask { validate_re($umask, '^[0-7][0-7][0-7]$') } - validate_re($config_file_mode, '^0[0-7][0-7][0-7]$') + validate_legacy(String, 'validate_string', $command) + validate_legacy('Optional[String]', 'validate_re', $ensure_process, ['running', 'stopped', 'removed', 'unmanaged']) + if $buffer_size !~ Integer { validate_legacy('Optional[String]', 'validate_re', $buffer_size, ['^\d+'])} + if $events { validate_legacy(Array, 'validate_array', $events) } + if $result_handler { validate_legacy(String, 'validate_string', $result_handler) } + if $numprocs { if $numprocs !~ Integer { validate_legacy('Optional[String]', 'validate_re', $numprocs, ['^\d+'])} } + if $numprocs_start { if $numprocs_start !~ Integer { validate_legacy('Optional[String]', 'validate_re', $numprocs_start, ['^\d+'])} } + if $priority { if $priority !~ Integer { validate_legacy('Optional[String]', 'validate_re', $priority, ['^\d+']) } } + if $autostart { if $autostart !~ Boolean { validate_legacy('Optional[String]', 'validate_re', $autostart, ['true', 'false']) } } + if $autorestart { if $autorestart !~ Boolean { validate_legacy('Optional[String]', 'validate_re', $autorestart, ['true', 'false', 'unexpected']) } } + if $startsecs { if $startsecs !~ Integer { validate_legacy('Optional[String]', 'validate_re', $startsecs, ['^\d+'])} } + if $startretries { if $startretries !~ Integer { validate_legacy('Optional[String]', 'validate_re', $startretries, ['^\d+'])} } + if $exitcodes { validate_legacy(String, 'validate_string', $exitcodes)} + if $stopsignal { validate_legacy('Optional[String]', 'validate_re', $stopsignal, ['TERM', 'HUP', 'INT', 'QUIT', 'KILL', 'USR1', 'USR2']) } + if $stopwaitsecs { if $stopwaitsecs !~ Integer { validate_legacy('Optional[String]', 'validate_re', $stopwaitsecs, ['^\d+'])} } + if $stopasgroup { validate_legacy(Boolean, 'validate_bool', $stopasgroup) } + if $killasgroup { validate_legacy(Boolean, 'validate_bool', $killasgroup) } + if $user { validate_legacy(String, 'validate_string', $user) } + if $redirect_stderr { validate_legacy(Boolean, 'validate_bool', $redirect_stderr) } + validate_legacy(String, 'validate_string', $stdout_logfile) + if $stdout_logfile_maxbytes { validate_legacy(String, 'validate_string', $stdout_logfile_maxbytes) } + if $stdout_logfile_backups { if $stdout_logfile_backups !~ Integer { validate_legacy('Optional[String]', 'validate_re', $stdout_logfile_backups, ['^\d+'])} } + if $stdout_events_enabled { validate_legacy(Boolean, 'validate_bool', $stdout_events_enabled) } + validate_legacy(String, 'validate_string', $stderr_logfile) + if $stderr_logfile_maxbytes { validate_legacy(String, 'validate_string', $stderr_logfile_maxbytes) } + if $stderr_logfile_backups { if $stderr_logfile_backups !~ Integer { validate_legacy('Optional[String]', 'validate_re', $stderr_logfile_backups, ['^\d+'])} } + if $stderr_events_enabled { validate_legacy(Boolean, 'validate_bool', $stderr_events_enabled) } + if $directory { validate_legacy(Stdlib::Compat::Absolute_Path, 'validate_absolute_path', $directory) } + if $umask { validate_legacy('Optional[String]', 'validate_re', $umask, ['^[0-7][0-7][0-7]$']) } + validate_legacy('Optional[String]', 'validate_re', $config_file_mode, ['^0[0-7][0-7][0-7]$']) # create the correct log variables $stdout_logfile_path = $stdout_logfile ? { @@ -101,11 +101,11 @@ # convert environment data into a csv if $env_var { $env_hash = hiera_hash($env_var) - validate_hash($env_hash) + validate_legacy(Hash, 'validate_hash', $env_hash) $env_string = hash2csv($env_hash) } elsif $_event_environment { - validate_hash($_event_environment) + validate_legacy(Hash, 'validate_hash', $_event_environment) $env_string = hash2csv($_event_environment) } diff --git a/manifests/fcgi_program.pp b/manifests/fcgi_program.pp index 9146591..6d48c45 100644 --- a/manifests/fcgi_program.pp +++ b/manifests/fcgi_program.pp @@ -49,37 +49,37 @@ include supervisord # parameter validation - validate_string($command) - validate_re($ensure_process, ['running', 'stopped', 'removed', 'unmanaged']) - validate_re($socket, ['^tcp:\/\/.*:\d+$', '^unix:\/\/\/']) - if $process_name { validate_string($process_name) } - if $numprocs { if !is_integer($numprocs) { validate_re($numprocs, '^\d+')} } - if $numprocs_start { if !is_integer($numprocs_start) { validate_re($numprocs_start, '^\d+')} } - if $priority { if !is_integer($priority) { validate_re($priority, '^\d+') } } - if $autostart { if !is_bool($autostart) { validate_re($autostart, ['true', 'false']) } } - if $autorestart { if !is_bool($autorestart) { validate_re($autorestart, ['true', 'false', 'unexpected']) } } - if $startsecs { if !is_integer($startsecs) { validate_re($startsecs, '^\d+')} } - if $startretries { if !is_integer($startretries) { validate_re($startretries, '^\d+')} } - if $exitcodes { validate_string($exitcodes)} - if $stopsignal { validate_re($stopsignal, ['TERM', 'HUP', 'INT', 'QUIT', 'KILL', 'USR1', 'USR2']) } - if $stopwaitsecs { if !is_integer($stopwaitsecs) { validate_re($stopwaitsecs, '^\d+')} } - if $stopasgroup { validate_bool($stopasgroup) } - if $killasgroup { validate_bool($killasgroup) } - if $user { validate_string($user) } - if $redirect_stderr { validate_bool($redirect_stderr) } - validate_string($stdout_logfile) - if $stdout_logfile_maxbytes { validate_string($stdout_logfile_maxbytes) } - if $stdout_logfile_backups { if !is_integer($stdout_logfile_backups) { validate_re($stdout_logfile_backups, '^\d+')} } - if $stdout_capture_maxbytes { validate_string($stdout_capture_maxbytes) } - if $stdout_events_enabled { validate_bool($stdout_events_enabled) } - validate_string($stderr_logfile) - if $stderr_logfile_maxbytes { validate_string($stderr_logfile_maxbytes) } - if $stderr_logfile_backups { if !is_integer($stderr_logfile_backups) { validate_re($stderr_logfile_backups, '^\d+')} } - if $stderr_capture_maxbytes { validate_string($stderr_capture_maxbytes) } - if $stderr_events_enabled { validate_bool($stderr_events_enabled) } - if $directory { validate_absolute_path($directory) } - if $umask { validate_re($umask, '^[0-7][0-7][0-7]$') } - validate_re($config_file_mode, '^0[0-7][0-7][0-7]$') + validate_legacy(String, 'validate_string', $command) + validate_legacy('Optional[String]', 'validate_re', $ensure_process, ['running', 'stopped', 'removed', 'unmanaged']) + validate_legacy('Optional[String]', 'validate_re', $socket, ['^tcp:\/\/.*:\d+$', '^unix:\/\/\/']) + if $process_name { validate_legacy(String, 'validate_string', $process_name) } + if $numprocs { if $numprocs !~ Integer { validate_legacy('Optional[String]', 'validate_re', $numprocs, ['^\d+'])} } + if $numprocs_start { if $numprocs_start !~ Integer { validate_legacy('Optional[String]', 'validate_re', $numprocs_start, ['^\d+'])} } + if $priority { if $priority !~ Integer { validate_legacy('Optional[String]', 'validate_re', $priority, ['^\d+']) } } + if $autostart { if $autostart !~ Boolean { validate_legacy('Optional[String]', 'validate_re', $autostart, ['true', 'false']) } } + if $autorestart { if $autorestart !~ Boolean { validate_legacy('Optional[String]', 'validate_re', $autorestart, ['true', 'false', 'unexpected']) } } + if $startsecs { if $startsecs !~ Integer { validate_legacy('Optional[String]', 'validate_re', $startsecs, ['^\d+'])} } + if $startretries { if $startretries !~ Integer { validate_legacy('Optional[String]', 'validate_re', $startretries, ['^\d+'])} } + if $exitcodes { validate_legacy(String, 'validate_string', $exitcodes)} + if $stopsignal { validate_legacy('Optional[String]', 'validate_re', $stopsignal, ['TERM', 'HUP', 'INT', 'QUIT', 'KILL', 'USR1', 'USR2']) } + if $stopwaitsecs { if $stopwaitsecs !~ Integer { validate_legacy('Optional[String]', 'validate_re', $stopwaitsecs, ['^\d+'])} } + if $stopasgroup { validate_legacy(Boolean, 'validate_bool', $stopasgroup) } + if $killasgroup { validate_legacy(Boolean, 'validate_bool', $killasgroup) } + if $user { validate_legacy(String, 'validate_string', $user) } + if $redirect_stderr { validate_legacy(Boolean, 'validate_bool', $redirect_stderr) } + validate_legacy(String, 'validate_string', $stdout_logfile) + if $stdout_logfile_maxbytes { validate_legacy(String, 'validate_string', $stdout_logfile_maxbytes) } + if $stdout_logfile_backups { if $stdout_logfile_backups !~ Integer { validate_legacy('Optional[String]', 'validate_re', $stdout_logfile_backups, ['^\d+'])} } + if $stdout_capture_maxbytes { validate_legacy(String, 'validate_string', $stdout_capture_maxbytes) } + if $stdout_events_enabled { validate_legacy(Boolean, 'validate_bool', $stdout_events_enabled) } + validate_legacy(String, 'validate_string', $stderr_logfile) + if $stderr_logfile_maxbytes { validate_legacy(String, 'validate_string', $stderr_logfile_maxbytes) } + if $stderr_logfile_backups { if $stderr_logfile_backups !~ Integer { validate_legacy('Optional[String]', 'validate_re', $stderr_logfile_backups, ['^\d+'])} } + if $stderr_capture_maxbytes { validate_legacy(String, 'validate_string', $stderr_capture_maxbytes) } + if $stderr_events_enabled { validate_legacy(Boolean, 'validate_bool', $stderr_events_enabled) } + if $directory { validate_legacy(Stdlib::Compat::Absolute_Path, 'validate_absolute_path', $directory) } + if $umask { validate_legacy('Optional[String]', 'validate_re', $umask, ['^[0-7][0-7][0-7]$']) } + validate_legacy('Optional[String]', 'validate_re', $config_file_mode, ['^0[0-7][0-7][0-7]$']) # create the correct log variables $stdout_logfile_path = $stdout_logfile ? { @@ -104,11 +104,11 @@ # convert environment data into a csv if $env_var { $env_hash = hiera_hash($env_var) - validate_hash($env_hash) + validate_legacy(Hash, 'validate_hash', $env_hash) $env_string = hash2csv($env_hash) } elsif $_program_environment { - validate_hash($_program_environment) + validate_legacy(Hash, 'validate_hash', $_program_environment) $env_string = hash2csv($_program_environment) } diff --git a/manifests/group.pp b/manifests/group.pp index 5504819..74f4e1b 100644 --- a/manifests/group.pp +++ b/manifests/group.pp @@ -15,9 +15,9 @@ include supervisord # parameter validation - validate_array($programs) - if $priority { if !is_integer($priority) { validate_re($priority, '^\d+', "invalid priority value of: ${priority}") } } - validate_re($config_file_mode, '^0[0-7][0-7][0-7]$') + validate_legacy(Array, 'validate_array', $programs) + if $priority { if $priority !~ Integer { validate_legacy('Optional[String]', 'validate_re', $priority, ['^\d+']) } } + validate_legacy('Optional[String]', 'validate_re', $config_file_mode, ['^0[0-7][0-7][0-7]$']) $progstring = array2csv($programs) $conf = "${supervisord::config_include}/group_${name}.conf" diff --git a/manifests/init.pp b/manifests/init.pp index e9e6de5..65837b5 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -83,40 +83,39 @@ ) inherits supervisord::params { - validate_bool($install_pip) - validate_bool($install_init) - validate_bool($nodaemon) - validate_bool($unix_socket) - validate_bool($unix_auth) - validate_bool($inet_server) - validate_bool($inet_auth) - validate_bool($strip_ansi) - validate_bool($nocleanup) - - validate_hash($eventlisteners) - validate_hash($fcgi_programs) - validate_hash($groups) - validate_hash($programs) - - validate_absolute_path($config_include) - validate_absolute_path($log_path) - validate_absolute_path($run_path) - if $childlogdir { validate_absolute_path($childlogdir) } - if $directory { validate_absolute_path($directory) } + validate_legacy(Boolean, 'validate_bool', $install_pip) + validate_legacy(Boolean, 'validate_bool', $install_init) + validate_legacy(Boolean, 'validate_bool', $nodaemon) + validate_legacy(Boolean, 'validate_bool', $unix_socket) + validate_legacy(Boolean, 'validate_bool', $unix_auth) + validate_legacy(Boolean, 'validate_bool', $inet_server) + validate_legacy(Boolean, 'validate_bool', $inet_auth) + validate_legacy(Boolean, 'validate_bool', $strip_ansi) + validate_legacy(Boolean, 'validate_bool', $nocleanup) + + validate_legacy(Hash, 'validate_hash', $eventlisteners) + validate_legacy(Hash, 'validate_hash', $fcgi_programs) + validate_legacy(Hash, 'validate_hash', $groups) + validate_legacy(Hash, 'validate_hash', $programs) + + validate_legacy(Stdlib::Compat::Absolute_Path, 'validate_absolute_path', $config_include) + validate_legacy(Stdlib::Compat::Absolute_Path, 'validate_absolute_path', $log_path) + validate_legacy(Stdlib::Compat::Absolute_Path, 'validate_absolute_path', $run_path) + if $childlogdir { validate_legacy(Stdlib::Compat::Absolute_Path, 'validate_absolute_path', $childlogdir) } + if $directory { validate_legacy(Stdlib::Compat::Absolute_Path, 'validate_absolute_path', $directory) } $log_levels = ['^critical$', '^error$', '^warn$', '^info$', '^debug$', '^trace$', '^blather$'] - validate_re($log_level, $log_levels, "invalid log_level: ${log_level}") - validate_re($logfile_maxbytes,'^[0-9]*(?:KB|MB|GB)?', "invalid logfile_maxbytes: ${$logfile_maxbytes}") - validate_re($umask, '^0[0-7][0-7]$', "invalid umask: ${umask}.") - validate_re($unix_socket_mode, '^[0-7][0-7][0-7][0-7]$', "invalid unix_socket_mode: ${unix_socket_mode}") - validate_re($ctl_socket, ['^unix$', '^inet$'], "invalid ctl_socket: ${ctl_socket}") - validate_re($config_file_mode, '^0[0-7][0-7][0-7]$') - if $pip_proxy { validate_re($pip_proxy, ['^https?:\/\/.*$'], "invalid pip_proxy: ${pip_proxy}") } - - if ! is_integer($logfile_backups) { fail("invalid logfile_backups: ${logfile_backups}.")} - if ! is_integer($minfds) { fail("invalid minfds: ${minfds}.")} - if ! is_integer($minprocs) { fail("invalid minprocs: ${minprocs}.")} - if ! is_integer($inet_server_port) { fail("invalid inet_server_port: ${inet_server_port}.")} + validate_legacy('Optional[String]', 'validate_re', $log_level, $log_levels) + validate_legacy('Optional[String]', 'validate_re', $logfile_maxbytes, ['^[0-9]*(?:KB|MB|GB)?']) + validate_legacy('Optional[String]', 'validate_re', $umask, ['^0[0-7][0-7]$']) + validate_legacy('Optional[String]', 'validate_re', $unix_socket_mode, ['^[0-7][0-7][0-7][0-7]$']) + validate_legacy('Optional[String]', 'validate_re', $ctl_socket, ['^unix$', '^inet$']) + validate_legacy('Optional[String]', 'validate_re', $config_file_mode, ['^0[0-7][0-7][0-7]$']) + if $pip_proxy { validate_legacy('Optional[String]', 'validate_re', $pip_proxy, ['^https?:\/\/.*$']) } + if $logfile_backups !~ Integer { validate_legacy('Optional[String]', 'validate_re', $logfile_backups, ['^\d+'])} + if $minfds !~ Integer { validate_legacy('Optional[String]', 'validate_re', $minfds, ['^\d+'])} + if $minprocs !~ Integer { validate_legacy('Optional[String]', 'validate_re', $minprocs, ['^\d+'])} + if $inet_server_port !~ Integer { validate_legacy('Optional[String]', 'validate_re', $inet_server_port, ['^\d+'])} if $unix_socket and $inet_server { $use_ctl_socket = $ctl_socket @@ -142,13 +141,13 @@ } if $unix_auth { - validate_string($unix_username) - validate_string($unix_password) + validate_legacy(String, 'validate_string', $unix_username) + validate_legacy(String, 'validate_string', $unix_password) } if $inet_auth { - validate_string($inet_username) - validate_string($inet_password) + validate_legacy(String, 'validate_string', $inet_username) + validate_legacy(String, 'validate_string', $inet_password) } # Handle deprecated $environment variable @@ -159,17 +158,17 @@ } if $env_var { - validate_hash($env_var) + validate_legacy(Hash, 'validate_hash', $env_var) $env_hash = hiera($env_var) $env_string = hash2csv($env_hash) } elsif $_global_environment { - validate_hash($_global_environment) + validate_legacy(Hash, 'validate_hash', $_global_environment) $env_string = hash2csv($_global_environment) } if $config_dirs { - validate_array($config_dirs) + validate_legacy(Array, 'validate_array', $config_dirs) $config_include_string = join($config_dirs, ' ') } else { diff --git a/manifests/program.pp b/manifests/program.pp index 05c7e3a..7dfffe7 100644 --- a/manifests/program.pp +++ b/manifests/program.pp @@ -46,36 +46,36 @@ include supervisord # parameter validation - validate_string($command) - validate_re($ensure_process, ['running', 'stopped', 'removed', 'unmanaged']) - if $process_name { validate_string($process_name) } - if $numprocs { if !is_integer($numprocs) { validate_re($numprocs, '^\d+')} } - if $numprocs_start { if !is_integer($numprocs_start) { validate_re($numprocs_start, '^\d+')} } - if $priority { if !is_integer($priority) { validate_re($priority, '^\d+') } } - if $autostart { if !is_bool($autostart) { validate_re($autostart, ['true', 'false']) } } - if $autorestart { if !is_bool($autorestart) { validate_re($autorestart, ['true', 'false', 'unexpected']) } } - if $startsecs { if !is_integer($startsecs) { validate_re($startsecs, '^\d+')} } - if $startretries { if !is_integer($startretries) { validate_re($startretries, '^\d+')} } - if $exitcodes { validate_string($exitcodes)} - if $stopsignal { validate_re($stopsignal, ['TERM', 'HUP', 'INT', 'QUIT', 'KILL', 'USR1', 'USR2']) } - if $stopwaitsecs { if !is_integer($stopwaitsecs) { validate_re($stopwaitsecs, '^\d+')} } - if $stopasgroup { validate_bool($stopasgroup) } - if $killasgroup { validate_bool($killasgroup) } - if $user { validate_string($user) } - if $redirect_stderr { validate_bool($redirect_stderr) } - validate_string($stdout_logfile) - if $stdout_logfile_maxbytes { validate_string($stdout_logfile_maxbytes) } - if $stdout_logfile_backups { if !is_integer($stdout_logfile_backups) { validate_re($stdout_logfile_backups, '^\d+')} } - if $stdout_capture_maxbytes { validate_string($stdout_capture_maxbytes) } - if $stdout_events_enabled { validate_bool($stdout_events_enabled) } - validate_string($stderr_logfile) - if $stderr_logfile_maxbytes { validate_string($stderr_logfile_maxbytes) } - if $stderr_logfile_backups { if !is_integer($stderr_logfile_backups) { validate_re($stderr_logfile_backups, '^\d+')} } - if $stderr_capture_maxbytes { validate_string($stderr_capture_maxbytes) } - if $stderr_events_enabled { validate_bool($stderr_events_enabled) } - if $directory { validate_absolute_path($directory) } - if $umask { validate_re($umask, '^[0-7][0-7][0-7]$') } - validate_re($config_file_mode, '^0[0-7][0-7][0-7]$') + validate_legacy(String, 'validate_string', $command) + validate_legacy(String, 'validate_string', $ensure_process, ['running', 'stopped', 'removed', 'unmanaged']) + if $process_name { validate_legacy(String, 'validate_string', $process_name) } + if $numprocs { if $numprocs !~ Integer { validate_legacy(String, 'validate_string', $numprocs, ['^\d+'])} } + if $numprocs_start { if $numprocs_start !~ Integer { validate_legacy(String, 'validate_string', $numprocs_start, ['^\d+'])} } + if $priority { if $priority !~ Integer { validate_legacy(String, 'validate_string', $priority, ['^\d+']) } } + if $autostart { if $autostart !~ Boolean { validate_legacy(String, 'validate_string', $autostart, ['true', 'false']) } } + if $autorestart { if $autorestart !~ Boolean { validate_legacy(String, 'validate_string', $autorestart, ['true', 'false', 'unexpected']) } } + if $startsecs { if $startsecs !~ Integer { validate_legacy(String, 'validate_string', $startsecs, ['^\d+'])} } + if $startretries { if $startretries !~ Integer { validate_legacy(String, 'validate_string', $startretries, ['^\d+'])} } + if $exitcodes { validate_legacy(String, 'validate_string', $exitcodes)} + if $stopsignal { validate_legacy(String, 'validate_string', $stopsignal, ['TERM', 'HUP', 'INT', 'QUIT', 'KILL', 'USR1', 'USR2']) } + if $stopwaitsecs { if $stopwaitsecs !~ Integer { validate_legacy(String, 'validate_string', $stopwaitsecs, ['^\d+'])} } + if $stopasgroup { validate_legacy(Boolean, 'validate_bool', $stopasgroup) } + if $killasgroup { validate_legacy(Boolean, 'validate_bool', $killasgroup) } + if $user { validate_legacy(String, 'validate_string', $user) } + if $redirect_stderr { validate_legacy(Boolean, 'validate_bool', $redirect_stderr) } + validate_legacy(String, 'validate_string', $stdout_logfile) + if $stdout_logfile_maxbytes { validate_legacy(String, 'validate_string', $stdout_logfile_maxbytes) } + if $stdout_logfile_backups { if $stdout_logfile_backups !~ Integer { validate_legacy(String, 'validate_string', $stdout_logfile_backups, ['^\d+'])} } + if $stdout_capture_maxbytes { validate_legacy(String, 'validate_string', $stdout_capture_maxbytes) } + if $stdout_events_enabled { validate_legacy(Boolean, 'validate_bool', $stdout_events_enabled) } + validate_legacy(String, 'validate_string', $stderr_logfile) + if $stderr_logfile_maxbytes { validate_legacy(String, 'validate_string', $stderr_logfile_maxbytes) } + if $stderr_logfile_backups { if $stderr_logfile_backups !~ Integer { validate_legacy(String, 'validate_string', $stderr_logfile_backups, ['^\d+'])} } + if $stderr_capture_maxbytes { validate_legacy(String, 'validate_string', $stderr_capture_maxbytes) } + if $stderr_events_enabled { validate_legacy(Boolean, 'validate_bool', $stderr_events_enabled) } + if $directory { validate_legacy(Stdlib::Compat::Absolute_Path, 'validate_absolute_path', $directory) } + if $umask { validate_legacy(String, 'validate_string', $umask, ['^[0-7][0-7][0-7]$']) } + validate_legacy(String, 'validate_string', $config_file_mode, ['^0[0-7][0-7][0-7]$']) # create the correct log variables $stdout_logfile_path = $stdout_logfile ? { @@ -100,11 +100,11 @@ # convert environment data into a csv if $env_var { $env_hash = hiera_hash($env_var) - validate_hash($env_hash) + validate_legacy(Hash, 'validate_hash', $env_hash) $env_string = hash2csv($env_hash) } elsif $_program_environment { - validate_hash($_program_environment) + validate_legacy(Hash, 'validate_hash', $_program_environment) $env_string = hash2csv($_program_environment) } diff --git a/manifests/rpcinterface.pp b/manifests/rpcinterface.pp index 2dd2c27..60412c2 100644 --- a/manifests/rpcinterface.pp +++ b/manifests/rpcinterface.pp @@ -15,8 +15,8 @@ include supervisord # parameter validation - if $retries { if !is_integer($retries) { validate_re($retries, '^\d+')}} - validate_re($config_file_mode, '^0[0-7][0-7][0-7]$') + if $retries { if $retries !~ Integer { validate_legacy('Optional[String]', 'validate_re', $retries, ['^\d+'])}} + validate_legacy('Optional[String]', 'validate_re', $config_file_mode, ['^0[0-7][0-7][0-7]$']) $conf = "${supervisord::config_include}/rpcinterface_${name}.conf" diff --git a/manifests/supervisorctl.pp b/manifests/supervisorctl.pp index 67dd3b1..cf6b6eb 100644 --- a/manifests/supervisorctl.pp +++ b/manifests/supervisorctl.pp @@ -9,8 +9,8 @@ $unless = undef ) { - validate_string($command) - validate_string($process) + validate_legacy(String, 'validate_string', $command) + validate_legacy(String, 'validate_string', $process) $supervisorctl = $::supervisord::executable_ctl diff --git a/metadata.json b/metadata.json index f6b172e..fa3f4e6 100644 --- a/metadata.json +++ b/metadata.json @@ -27,7 +27,7 @@ } ], "dependencies": [ - { "name": "puppetlabs/stdlib", "version_requirement": ">= 4.4.0 <5.0.0" }, + { "name": "puppetlabs/stdlib", "version_requirement": ">= 4.13.0 <5.0.0" }, { "name": "puppetlabs/concat", "version_requirement": ">= 1.0.0 <5.0.0" } ] }