Skip to content

Commit

Permalink
strickter loglevel syntax verification
Browse files Browse the repository at this point in the history
  • Loading branch information
igt-marcin-wasilewski committed Mar 27, 2023
1 parent 00138a1 commit 0c60c68
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions spec/type_aliases/loglevel_spec.rb
Expand Up @@ -10,6 +10,7 @@
'warn mod_ssl.c:info',
'warn ssl_module:info',
'trace4',
'ssl:info',
].each do |allowed_value|
it { is_expected.to allow_value(allowed_value) }
end
Expand All @@ -19,6 +20,7 @@
'',
[],
['info'],
'thisiswarning',
].each do |invalid_value|
it { is_expected.not_to allow_value(invalid_value) }
end
Expand Down
2 changes: 1 addition & 1 deletion types/loglevel.pp
Expand Up @@ -24,4 +24,4 @@
# * `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])/]
type Apache::LogLevel = Pattern[/\A(([a-z_\.]+:)?(emerg|alert|crit|error|warn|notice|info|debug|trace[1-8])\W*)+\Z/]

0 comments on commit 0c60c68

Please sign in to comment.