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 OracleLinux. #1416

Merged
merged 2 commits into from
Apr 4, 2016
Merged

Fix in custom fact "apache_version" for OracleLinux. #1416

merged 2 commits into from
Apr 4, 2016

Conversation

Reamer
Copy link

@Reamer Reamer commented Mar 31, 2016

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 OracleLinux 7.2, running apachectl -v produces the following output:

Server version: Apache/2.4.6 ()
Server built:   Nov 21 2015 05:34:59

The regex fails to match the output because it does not allow
nothing 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 OracleLinux 7.2, running apachectl -v produces the following output:

  Server version: Apache/2.4.6 ()
  Server built:   Nov 21 2015 05:34:59


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

  ^Server version: Apache\/([\w\.]+) \(([\w ]*)\)
@DavidS
Copy link
Contributor

DavidS commented Apr 4, 2016

Thanks for your submission! Please add your test data to https://github.com/puppetlabs/puppetlabs-apache/blob/master/spec/unit/apache_version_spec.rb to avoid regressions on this in the future.

@Reamer
Copy link
Author

Reamer commented Apr 4, 2016

@DavidS tests added

@DavidS DavidS removed the needs-tests label Apr 4, 2016
@DavidS DavidS merged commit 7c384f3 into puppetlabs:master Apr 4, 2016
@DavidS
Copy link
Contributor

DavidS commented Apr 4, 2016

Great!

@Reamer Reamer deleted the bugfix/apache_version branch April 4, 2016 14:09
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.

2 participants