dont warn on command not existing on mock backend

This commit is contained in:
Dominik Richter 2015-11-03 00:35:41 +01:00
parent 6e8c4f02a1
commit ea66947b36

View file

@ -41,8 +41,11 @@ class Cmd < Inspec.resource(1)
res = inspec.backend.run_command("where.exe \"#{@command}\"")
elsif inspec.os.unix?
res = inspec.backend.run_command("type \"#{@command}\"")
elsif inspec.os[:family].to_s == 'unknown'
# silent for mock resources
return false
else
warn "`command(#{@command}).exist?` is not suported on you OS: #{inspec.os['family']}"
warn "`command(#{@command}).exist?` is not suported on you OS: #{inspec.os[:family]}"
return false
end
res.exit_status.to_i == 0