!= 0 vs !foo.zero?

Signed-off-by: Miah Johnson <miah@chia-pet.org>
This commit is contained in:
Miah Johnson 2019-05-31 13:29:18 -07:00 committed by Ryan Davis
parent a5309ea392
commit c458897ad1
2 changed files with 3 additions and 2 deletions

View file

@ -95,7 +95,8 @@ module Inspec::Resources
class LinuxFileSystemResource < FsManagement
def info(partition)
cmd = inspec.command("df #{partition} -T")
raise Inspec::Exceptions::ResourceFailed, "Unable to get available space for partition #{partition}" if cmd.stdout.nil? || cmd.stdout.empty? || !cmd.exit_status.zero?
raise Inspec::Exceptions::ResourceFailed,
"Unable to get available space for partition #{partition}" if cmd.stdout.nil? || cmd.stdout.empty? || cmd.exit_status != 0
value = cmd.stdout.split(/\n/)[1].strip.split(" ")
{
name: partition,

View file

@ -25,7 +25,7 @@ module Inspec::Resources
return skip_resource "The `nginx` binary not found in the path provided." unless inspec.command(nginx_path).exist?
cmd = inspec.command("#{nginx_path} -V 2>&1")
if !cmd.exit_status.zero?
if cmd.exit_status != 0
return skip_resource "Error using the command nginx -V"
end
@data = cmd.stdout