Skip to content

Commit

Permalink
Merge pull request voxpupuli#590 from 3flex/540-refine-worker_process…
Browse files Browse the repository at this point in the history
…es-validation

config: refined worker_processes validation
  • Loading branch information
3flex committed Apr 10, 2015
2 parents c003661 + 9f3185e commit df3a6d1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion manifests/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
) inherits ::nginx::params {

### Validations ###
if (!is_string($worker_processes)) and (!is_integer($worker_processes)) {
if ($worker_processes != 'auto') and (!is_integer($worker_processes)) {
fail('$worker_processes must be an integer or have value "auto".')
}
if (!is_integer($worker_connections)) {
Expand Down
6 changes: 6 additions & 0 deletions spec/classes/config_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,12 @@
:value => '4',
:match => 'worker_processes 4;',
},
{
:title => 'should set worker_processes',
:attr => 'worker_processes',
:value => 'auto',
:match => 'worker_processes auto;',
},
{
:title => 'should set worker_rlimit_nofile',
:attr => 'worker_rlimit_nofile',
Expand Down

0 comments on commit df3a6d1

Please sign in to comment.