summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorskippy <jonathan.yates.jones@gmail.com>2019-11-18 01:00:23 +0000
committerskippy <jonathan.yates.jones@gmail.com>2019-11-18 01:00:23 +0000
commit5d67a3dca1c4f601ac65de0a75867afd1e0af2c4 (patch)
treeae60bec3a98cbf7f96e4f8810978c93f95833ab1
parentb2a69fa7f4461ccf2000bfeea05ed98ab995fa7d (diff)
downloadchef-5d67a3dca1c4f601ac65de0a75867afd1e0af2c4.tar.gz
Replaced 'test' shellout with `Dir.exist?`
Signed-off-by: Jonathan Jones <gitmaster@thespooky.house>
-rw-r--r--lib/chef/provider/user/linux.rb5
1 files changed, 1 insertions, 4 deletions
diff --git a/lib/chef/provider/user/linux.rb b/lib/chef/provider/user/linux.rb
index 0f68074c9f..3f54cc480d 100644
--- a/lib/chef/provider/user/linux.rb
+++ b/lib/chef/provider/user/linux.rb
@@ -60,10 +60,7 @@ class Chef
ret_codes = [0]
if updating_home?
if new_resource.manage_home
- home_dir_not_exist = shell_out("test", "-d", new_resource.home, returns: [1])
- if home_dir_not_exist.error?
- ret_codes << 12
- end
+ ret_codes << 12 if Dir.exist?(new_resource.home)
end
end
ret_codes