-
Notifications
You must be signed in to change notification settings - Fork 682
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
Use target helpers in Inspec::Profile#from_file #413
Conversation
Phew, so travis-ci has |
current output: $ inspec check test/unit/mock/profiles/complete-profile.tgz I, [2016-02-03T10:22:21.377650 #13207] INFO -- : Checking profile in test/unit/mock/profiles/complete-profile.tgz I, [2016-02-03T10:22:21.377745 #13207] INFO -- : Found 1 rules. I, [2016-02-03T10:22:21.377771 #13207] INFO -- : Rule definitions OK.
Note that this adds `ref: some/where/in/tarball/file` to the file contents hash; it wasn't there before but it may be useful for error reporting nonetheless.
# NB if you want to check more than one profile, use one | ||
# Inspec::Profile#from_file per profile | ||
m = metadata.first | ||
@metadata = Metadata.from_ref(m[:ref], m[:content], @profile_id, @logger) |
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.
imho parse metadata beore adding/parsing tests; if anything fails with metadata, we don't jump into parsing tests
3b6c92f
to
81de512
Compare
Thanks @renatus for this great fix |
Use target helpers in Inspec::Profile#from_file
Wait... that order... is... important? ❔ 😕 ❔ Thanks for catching that @chris-rock :) |
Needed this for #409 :-) |
Before: Inspec::Profile was expecting a profile in a filesystem.
After: Inspec::Profile operates on the contents as returned from the target helper
Fixes #408.