mirror of
https://github.com/inspec/inspec
synced 2024-11-23 05:03:07 +00:00
simplify result value from profile check
This commit is contained in:
parent
7e19c5eec6
commit
14a3100e41
2 changed files with 6 additions and 3 deletions
|
@ -82,7 +82,7 @@ class InspecCLI < Thor # rubocop:disable Metrics/ClassLength
|
|||
|
||||
# run check
|
||||
profile = Inspec::Profile.from_path(path, o)
|
||||
success, result = profile.check
|
||||
result = profile.check
|
||||
|
||||
if opts['format'] == 'json'
|
||||
puts JSON.generate(result)
|
||||
|
@ -101,7 +101,7 @@ class InspecCLI < Thor # rubocop:disable Metrics/ClassLength
|
|||
newline
|
||||
}
|
||||
end
|
||||
exit 1 unless success
|
||||
exit 1 unless result[:summary][:valid]
|
||||
end
|
||||
|
||||
desc 'archive PATH', 'archive a profile to tar.gz (default) or zip'
|
||||
|
|
|
@ -162,8 +162,11 @@ module Inspec
|
|||
}
|
||||
}
|
||||
|
||||
# profile is valid if we could not find any error
|
||||
result[:summary][:valid] = result[:errors].empty?
|
||||
|
||||
@logger.info 'Control definitions OK.' if result[:warnings].empty?
|
||||
[result[:errors].empty?, result]
|
||||
result
|
||||
end
|
||||
|
||||
def rules_count
|
||||
|
|
Loading…
Reference in a new issue