Merge pull request #355 from chef/sr/bugfix-scoped-name

bugfix: ignore supports when generating a profile's json representation
This commit is contained in:
Dominik Richter 2016-01-11 15:36:26 +01:00
commit f6e7715ede
2 changed files with 6 additions and 4 deletions

View file

@ -52,8 +52,10 @@ class InspecCLI < Thor # rubocop:disable Metrics/ClassLength
def json(path)
diagnose
profile = Inspec::Profile.from_path(path, opts)
dst = opts[:output].to_s
o = opts.dup
o[:ignore_supports] = true
profile = Inspec::Profile.from_path(path, o)
dst = o[:output].to_s
if dst.empty?
puts JSON.pretty_generate(profile.info)
else
@ -73,7 +75,7 @@ class InspecCLI < Thor # rubocop:disable Metrics/ClassLength
o = opts.dup
o[:logger] = Logger.new(STDOUT)
o[:ignore_supports] = true # we check for integrety only
o[:ignore_supports] = true # we check for integrity only
profile = Inspec::Profile.from_path(path, o)
exit 1 unless profile.check
end

View file

@ -54,7 +54,7 @@ module Inspec
Inspec::Metadata.from_ref(x[:ref], x[:content], @profile_id, @conf[:logger])
end
metas.each do |meta|
return [] if !ignore_supports && !meta.supports_transport?(@backend)
return [] unless ignore_supports || meta.supports_transport?(@backend)
end
assets
end