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

Fix in custom fact "apache_version" for RHEL. #1360

Merged
merged 1 commit into from
Feb 5, 2016

Conversation

BobVincentatNCRdotcom
Copy link

The custom fact defined by lib/facter/apache_version.rb runs
"apachectl -v" and applies the following regular expression:

^Server version: Apache\/([\w\.]+) \(([\w]+)\)

On RHEL 7.1, running apachectl -v produces the following output:

Server version: Apache/2.4.6 (Red Hat Enterprise Linux)

The regex fails to match the output because it does not allow
for whitespace inside the parentheses. The following modified
regex matches properly:

^Server version: Apache\/([\w\.]+) \(([\w ]+)\)

The custom fact defined by lib/facter/apache_version.rb runs
"apachectl -v" and applies the following regular expression:

  ^Server version: Apache\/([\w\.]+) \(([\w]+)\)

On RHEL 7.1, running apachectl -v produces the following output:

  Server version: Apache/2.4.6 (Red Hat Enterprise Linux)

The regex fails to match the output because it does not allow
for whitespace inside the parentheses.  The following modified
regex matches properly:

  ^Server version: Apache\/([\w\.]+) \(([\w ]+)\)
@BobVincentatNCRdotcom
Copy link
Author

For easy googling, the error shown on puppet runs without this patch is as follows:

Error: Facter: error while resolving custom fact "apache_version": undefined method `[]' for nil:NilClass

bmjen added a commit that referenced this pull request Feb 5, 2016
Fix in custom fact "apache_version" for RHEL.
@bmjen bmjen merged commit d441dd4 into puppetlabs:master Feb 5, 2016
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