Skip to content

Commit

Permalink
Merge pull request redhat-openstack#263 from cmurphy/fix_validate_cmd
Browse files Browse the repository at this point in the history
Fix validate_cmd file resource parameter
  • Loading branch information
jonnytdevops committed Feb 12, 2015
2 parents 3a634af + a198e5d commit 164a9a0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 %'
Expand Down
8 changes: 7 additions & 1 deletion manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -185,10 +185,16 @@
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'))

Expand Down

0 comments on commit 164a9a0

Please sign in to comment.