Merge pull request #263 from cmurphy/fix_validate_cmd

Fix validate_cmd file resource parameter
This commit is contained in:
JT (Jonny) 2015-02-12 11:22:50 +00:00
commit 164a9a01a8
2 changed files with 8 additions and 1 deletions

View file

@ -218,6 +218,7 @@ Ensure there's a newline at the end of the fragments.
#####`validate_cmd`
Ensure the destination file passes the following validation command.
Only supported on Puppet >= 3.5.0.
######Example
- validate_cmd => '/usr/sbin/apache2 -t -f %'

View file

@ -185,10 +185,16 @@ define concat(
path => $path,
alias => "concat_${name}",
source => "${fragdir}/${concat_name}",
validate_cmd => $validate_cmd,
backup => $backup,
}
# Only newer versions of puppet 3.x support the validate_cmd parameter
if $validate_cmd {
File[$name] {
validate_cmd => $validate_cmd,
}
}
# remove extra whitespace from string interpolation to make testing easier
$command = strip(regsubst("${script_command} -o \"${fragdir}/${concat_name}\" -d \"${fragdir}\" ${warnflag} ${forceflag} ${orderflag} ${newlineflag}", '\s+', ' ', 'G'))