-
Notifications
You must be signed in to change notification settings - Fork 59
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
implement chef-server fetcher and reporter #135
Conversation
# TODO: should be available in inspec `json-min` reports out-of-the-box | ||
# TODO: raise warning when not a compliance-known profile | ||
def cc_profile_index(profiles) | ||
cc_profiles = tests_for_runner(profiles).map { |profile| profile[:compliance] if profile[:compliance] }.uniq.compact |
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 think this could be tests_for_runner(profiles).select { |profile| profile[:compliance] }.uniq.compact
:
irb(main):001:0> ls = [ { foo: nil }, { bar: 3 }, { foo: 4 }]
=> [{:foo=>nil}, {:bar=>3}, {:foo=>4}]
irb(main):002:0> ls.select {|x| x[:foo] }
=> [{:foo=>4}]
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.
In this case we would need:
tests_for_runner(profiles).select { |profile| profile[:compliance] }.map { |profile| profile[:compliance].uniq.compact
I think it reads better, although we loop more often. Thanks @srenatus
@@ -5,7 +5,7 @@ | |||
license 'Apache 2.0' | |||
description 'Allows for fetching and executing compliance profiles, and reporting its results' | |||
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) | |||
version '2.0.0' | |||
version '2.0.2' |
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.
do not change the version in this PR
f17e426
to
caaff08
Compare
Signed-off-by: Christoph Hartmann <chris@lollyrock.com>
caaff08
to
9ee6d0f
Compare
👍 on the code, testing against viz -- have to reboot real quick cause everything is hanging |
profile_id: profile_id, | ||
} | ||
} | ||
end |
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.
would prob be cool to have a test on this method someday... :)
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.
also, it could be moved to helper.rb
tested against viz -- all good 👍 |
This PR implements #129