-
Notifications
You must be signed in to change notification settings - Fork 683
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 apache conf #1014
Fix apache conf #1014
Conversation
@davidcpell this should fix your issue |
@@ -21,7 +21,7 @@ class ApacheConf < Inspec.resource(1) | |||
|
|||
def initialize(conf_path = nil) | |||
@conf_path = conf_path || inspec.apache.conf_path | |||
@conf_dir = File.dirname(@conf_path) | |||
@conf_dir = inspec.os.debian? ? File.dirname(@conf_path) : inspec.apache.conf_dir |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jeremymv2 I am thinking about moving that logic to inspec.apache
. So we would use File.dirname(@conf_path)
only if conf_path
is defined. Otherwise we always read the conf_dir
from the apache resource. What do you think?
This is a great improvement of our test coverage @jeremymv2 |
Thanks a lot @jeremymv2 💯 |
apache_conf.conf_dir
was resolving incorrectly when OS was NOT Ubuntu || Debian.It would end up resulting in find_file() exit 1 errors like below:
It should be using a
conf_dir
of/etc/httpd
so that find_files will search/etc/httpd/conf.d/*.conf
instead of/etc/httpd/conf/conf.d/*.conf
.This PR corrects the problem and resolves #1013