-
Notifications
You must be signed in to change notification settings - Fork 31
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
Add platform attribute to Scap class #191
Conversation
end | ||
|
||
def tempdir | ||
@tempdir ||= Pathname.new(Dir.tmpdir) | ||
end | ||
|
||
def xccdf_file | ||
@xccdf_file ||= self.class.xccdf_file | ||
@xccdf_file ||= self.class.xccdf_file(platform) |
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.
If the platform changes via the accessor, then this cache should be cleared, right? (same with oval_file)
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.
Alternately, use attr_reader instead, then enforce that callers must set the platform on initialize.
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.
I'm for the attr_reader
approach, I don't see someone reusing this object for different platforms so I think it makes sense to set it on initialization.
Newer versions of scap-security-guide (> 0.1.32) add new xccdf files which match our glob pattern, but do not contain the remediations for the rules we want to run. If we edit one of these files rather than the one for our target platform, the rules will not be remediated properly. Specifying the platform allows us to find the file we need. https://bugzilla.redhat.com/show_bug.cgi?id=1493193
a7534e2
to
8f90905
Compare
Checked commit carbonin@8f90905 with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0 lib/linux_admin/scap.rb
|
Newer versions of scap-security-guide (> 0.1.32) add new xccdf files which match our glob pattern, but do not contain the remediations for the rules we want to run.
If we edit one of these files rather than the one for our target platform, the rules will not be remediated properly.
Specifying the platform allows us to find the file we need.
https://bugzilla.redhat.com/show_bug.cgi?id=1493193