-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace validate_apache_loglevel() with data type
The function was introduced before Puppet 4 was released. It was originally created to reduce duplicated use of stdlib's `validate_re`. See #1097
- Loading branch information
1 parent
e8465d2
commit 426099e
Showing
8 changed files
with
54 additions
and
119 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
require 'spec_helper' | ||
|
||
describe 'Apache::LogLevel' do | ||
[ | ||
'info', | ||
'warn ssl:info', | ||
'warn mod_ssl.c:info', | ||
'warn mod_ssl.c:info', | ||
'warn ssl_module:info', | ||
'trace4', | ||
].each do |allowed_value| | ||
it { is_expected.to allow_value(allowed_value) } | ||
end | ||
|
||
[ | ||
'garbage', | ||
'', | ||
[], | ||
['info'], | ||
].each do |invalid_value| | ||
it { is_expected.not_to allow_value(invalid_value) } | ||
end | ||
end |
38 changes: 0 additions & 38 deletions
38
spec/unit/puppet/parser/functions/validate_apache_log_level.rb
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# @summary A string that conforms to the Apache `LogLevel` syntax. | ||
# | ||
# A string that conforms to the Apache `LogLevel` syntax. | ||
# Different levels can be specified for individual apache modules. | ||
# | ||
# ie. `[module:]level [module:level] ...` | ||
# | ||
# The levels are (in order of decreasing significance): | ||
# * `emerg` | ||
# * `alert` | ||
# * `crit` | ||
# * `error` | ||
# * `warn` | ||
# * `notice` | ||
# * `info` | ||
# * `debug` | ||
# * `trace1` | ||
# * `trace2` | ||
# * `trace3` | ||
# * `trace4` | ||
# * `trace5` | ||
# * `trace6` | ||
# * `trace7` | ||
# * `trace8` | ||
# | ||
# @see https://httpd.apache.org/docs/current/mod/core.html#loglevel | ||
type Apache::LogLevel = Pattern[/(emerg|alert|crit|error|warn|notice|info|debug|trace[1-8])/] |