Skip to content

Commit

Permalink
Merge pull request #2397 from igt-marcin-wasilewski/main
Browse files Browse the repository at this point in the history
strickter loglevel syntax verification
  • Loading branch information
Ramesh7 authored Sep 20, 2023
2 parents abb8410 + 96932e8 commit ab45655
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions spec/type_aliases/loglevel_spec.rb
Original file line number Diff line number Diff line change
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,8 @@
'',
[],
['info'],
'thisiswarning',
'errorerror',
].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
Original file line number Diff line number Diff line change
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])(\s+([a-z_\.]+:)?(emerg|alert|crit|error|warn|notice|info|debug|trace[1-8]))*\Z/]

0 comments on commit ab45655

Please sign in to comment.