summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2016-12-20 15:49:47 -0800
committerLamont Granquist <lamont@scriptkiddie.org>2016-12-20 15:49:47 -0800
commit2628f2dd6232856af02b25c680d9a3e3e1220be5 (patch)
tree93b149c804f34e217136086fc5d60c10724a5696
parent13fe34683ae307e563be4acce004b2681b302ce4 (diff)
downloadchef-2628f2dd6232856af02b25c680d9a3e3e1220be5.tar.gz
remove run_command from groupadd
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
-rw-r--r--lib/chef/mixin/shell_out.rb9
-rw-r--r--lib/chef/provider/group/groupadd.rb6
2 files changed, 12 insertions, 3 deletions
diff --git a/lib/chef/mixin/shell_out.rb b/lib/chef/mixin/shell_out.rb
index cc2bf085e9..d341e3d1ec 100644
--- a/lib/chef/mixin/shell_out.rb
+++ b/lib/chef/mixin/shell_out.rb
@@ -85,6 +85,7 @@ class Chef
# @param args [String] variable number of string arguments
# @return [String] nicely concatenated string or empty string
def a_to_s(*args)
+ # FIXME: this should be cleaned up and deprecated
clean_array(*args).join(" ")
end
@@ -108,6 +109,14 @@ class Chef
args.flatten.reject { |i| i.nil? || i == "" }.map(&:to_s)
end
+ def shell_out_compact(*args)
+ shell_out(*clean_array(*args))
+ end
+
+ def shell_out_compact!(*args)
+ shell_out!(*clean_array(*args))
+ end
+
private
def shell_out_command(*command_args)
diff --git a/lib/chef/provider/group/groupadd.rb b/lib/chef/provider/group/groupadd.rb
index 162875f9f1..d7a41fb4a7 100644
--- a/lib/chef/provider/group/groupadd.rb
+++ b/lib/chef/provider/group/groupadd.rb
@@ -47,7 +47,7 @@ class Chef
command = "groupadd"
command << set_options
command << groupadd_options
- run_command(:command => command)
+ shell_out_compact!("groupadd", set_options, groupadd_options)
modify_group_members
end
@@ -55,13 +55,13 @@ class Chef
def manage_group
command = "groupmod"
command << set_options
- run_command(:command => command)
+ shell_out_compact!("groupmod", set_options)
modify_group_members
end
# Remove the group
def remove_group
- run_command(:command => "groupdel #{@new_resource.group_name}")
+ shell_out!("groupdel", new_resource.group_name)
end
def modify_group_members