Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace validate_apache_loglevel() with data type #2023

Conversation

alexjfisher
Copy link
Contributor

The function was introduced before Puppet 4 was released. It was
originally created to reduce duplicated use of stdlib's validate_re.

See #1097

@alexjfisher alexjfisher requested a review from a team as a code owner May 2, 2020 09:31
@alexjfisher alexjfisher force-pushed the replace_validate_apache_log_level_function branch from 10c6111 to ce072b1 Compare May 2, 2020 09:43
Copy link
Collaborator

@ekohl ekohl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice

it { is_expected.to allow_value(allowed_value) }
end

[
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about xemerg to test if ^ at the start is needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The regex is copied from the the function and is very lax and could be better. I thought about trying to make it stricter, but decided that a change like that might be suited to a separate PR.

As things stand a ^ at the beginning would be bad. The apache docs describe the allowed syntax as...

Syntax
LogLevel [module:]level [module:level] ...

I think in a perfect world, $log_level would have actually accepted an Array. I doubt it's worth introducing that sort of change now though.

@@ -0,0 +1,2 @@
# @summary As per http://httpd.apache.org/docs/current/mod/core.html#loglevel
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would @see be useful for the URL?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've had a go at making the puppet-strings based docs better. Changes to the REFERENCE.md aren't in this commit as it's very difficult to exclude unrelated changes. It looks like the REFERENCE.md will be updated as part of the release process.

The function was introduced before Puppet 4 was released.  It was
originally created to reduce duplicated use of stdlib's `validate_re`.

See puppetlabs#1097
@alexjfisher alexjfisher force-pushed the replace_validate_apache_log_level_function branch from ce072b1 to 426099e Compare May 2, 2020 18:15
@@ -195,8 +195,8 @@
# > **Note**: Do not configure this parameter manually without special reason.
#
# @param log_level
# Changes the error log's verbosity. Valid options are: `alert`, `crit`, `debug`, `emerg`, `error`,
# `info`, `notice` and `warn`.
# Configures the apache [LogLevel](https://httpd.apache.org/docs/current/mod/core.html#loglevel) directive
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# Configures the apache [LogLevel](https://httpd.apache.org/docs/current/mod/core.html#loglevel) directive
# Configures the Apache [LogLevel](https://httpd.apache.org/docs/current/mod/core.html#loglevel) directive

Copy link
Contributor

@sanfrancrisko sanfrancrisko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the change @alexjfisher ! LGTM. Had a previous comment about updating the REFERENCE until I realised it would be done as part of our release - so apologies, please ignore that comment if it landed in your inbox.

@sanfrancrisko sanfrancrisko merged commit cacfb7c into puppetlabs:master May 6, 2020
cegeka-jenkins pushed a commit to cegeka/puppet-apache that referenced this pull request Jul 15, 2020
…apache_log_level_function

Replace validate_apache_loglevel() with data type
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants