Skip to content

Commit

Permalink
Merge pull request puppetlabs#1664 from mmoll/sendfile_re
Browse files Browse the repository at this point in the history
use Enum instead of validate_re for $sendfile
  • Loading branch information
eputnam committed Aug 25, 2017
2 parents 4a65949 + 7869814 commit 92215e3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
$purge_vhost_dir = undef,
$purge_vdir = false,
$serveradmin = 'root@localhost',
$sendfile = 'On',
Enum['On', 'Off', 'on', 'off'] $sendfile = 'On',
$error_documents = false,
$timeout = '120',
$httpd_dir = $::apache::params::httpd_dir,
Expand Down Expand Up @@ -129,7 +129,6 @@
notify => Class['Apache::Service'],
}
}
validate_re($sendfile, [ '^[oO]n$' , '^[oO]ff$' ])

# declare the web server user and group
# Note: requiring the package means the package ought to create them and not puppet
Expand Down
2 changes: 1 addition & 1 deletion spec/classes/apache_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -636,7 +636,7 @@
it "should fail" do
expect do
catalogue
end.to raise_error(Puppet::Error, /"foo" does not match/)
end.to raise_error(Puppet::PreformattedError, /Evaluation Error: Error while evaluating a Resource Statement, Class\[Apache\]: parameter 'sendfile' expects a match for Enum\['Off', 'On', 'off', 'on'\], got 'foo'/)
end
end
context "On" do
Expand Down

0 comments on commit 92215e3

Please sign in to comment.