Skip to content

Commit

Permalink
* force_language_priority can be now an array and language_priority a…
Browse files Browse the repository at this point in the history
… string

* coerce parameters to an array
  • Loading branch information
amateo committed Jun 12, 2014
1 parent 198aa99 commit 9f19e32
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
8 changes: 6 additions & 2 deletions manifests/mod/negotiation.pp
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,12 @@
'no', 'pl', 'pt', 'pt-BR', 'ru', 'sv', 'zh-CN',
'zh-TW' ],
) {
validate_string($force_language_priority)
validate_array($language_priority)
if !is_array($force_language_priority) and !is_string($force_language_priority) {
fail('force_languague_priority must be a string or array of strings')
}
if !is_array($language_priority) and !is_string($language_priority) {
fail('force_languague_priority must be a string or array of strings')
}

::apache::mod { 'negotiation': }
# Template uses no variables
Expand Down
4 changes: 2 additions & 2 deletions templates/mod/negotiation.conf.erb
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
LanguagePriority <%= @language_priority.join(' ') %>
ForceLanguagePriority <%= @force_language_priority %>
LanguagePriority <%= Array(@language_priority).join(' ') %>
ForceLanguagePriority <%= Array(@force_language_priority).join(' ') %>

0 comments on commit 9f19e32

Please sign in to comment.