From 41ddceaa85e72498df5176f333ed5a93f58607c0 Mon Sep 17 00:00:00 2001 From: Sonu Saha Date: Thu, 10 Mar 2022 12:45:10 +0530 Subject: [PATCH] CFINSPEC-79: RuboCop linting for lxc.rb Signed-off-by: Sonu Saha --- lib/inspec/resources/lxc.rb | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/inspec/resources/lxc.rb b/lib/inspec/resources/lxc.rb index cdfafc7c3..25e9185e9 100644 --- a/lib/inspec/resources/lxc.rb +++ b/lib/inspec/resources/lxc.rb @@ -14,10 +14,9 @@ module Inspec::Resources # Resource initialization. def initialize(container_name) - skip_resource "The `lxc` resource is not yet available on your OS." unless inspec.os.linux? @container_name = container_name - @lxc_info_cmd = lxc_info_cmd + @lxc_info_cmd = lxc_info_cmd @container_info = [] end @@ -30,13 +29,13 @@ module Inspec::Resources end def exists? - return @lxc_info_cmd.exit_status.to_i == 0 + @lxc_info_cmd.exit_status.to_i == 0 end def running? exists? @container_info = @lxc_info_cmd.stdout.split(":").map(&:strip) - return @container_info[0] == "Status" && @container_info[1] == "Running" + @container_info[0] == "Status" && @container_info[1] == "Running" end private @@ -54,7 +53,7 @@ module Inspec::Resources bin = find_lxc_or_error info_cmd = "info #{@container_name} | grep -i Status" lxc_cmd = format("%s %s", bin, info_cmd).strip - cmd = inspec.command(lxc_cmd) + inspec.command(lxc_cmd) end end end