summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIonuț Arțăriși <iartarisi@suse.cz>2014-10-08 16:04:11 +0200
committerIonuț Arțăriși <iartarisi@suse.cz>2014-10-08 16:04:11 +0200
commit95e1182b41aaf083b099d0fb251552f9f4691cf0 (patch)
treeceee45ab71f3c69e03a1670b8e926e3fec607df8
parent1343bdfff0d54e20b923211f6697d42c484c1627 (diff)
downloadchef-95e1182b41aaf083b099d0fb251552f9f4691cf0.tar.gz
change default group mapping for SLES to gpasswd
gpasswd is the new default starting with SLES12, the groupmod command does not support the -A/-R commands for adding and removing users respectively
-rw-r--r--lib/chef/platform/provider_mapping.rb3
-rw-r--r--spec/unit/platform_spec.rb11
2 files changed, 14 insertions, 0 deletions
diff --git a/lib/chef/platform/provider_mapping.rb b/lib/chef/platform/provider_mapping.rb
index 0766ccffa7..a812dcd7ad 100644
--- a/lib/chef/platform/provider_mapping.rb
+++ b/lib/chef/platform/provider_mapping.rb
@@ -200,6 +200,9 @@ class Chef
:service => Chef::Provider::Service::Redhat,
:cron => Chef::Provider::Cron,
:package => Chef::Provider::Package::Zypper,
+ :group => Chef::Provider::Group::Gpasswd
+ },
+ "< 12.0" => {
:group => Chef::Provider::Group::Suse
}
},
diff --git a/spec/unit/platform_spec.rb b/spec/unit/platform_spec.rb
index 029fc29aae..e8c41cdd77 100644
--- a/spec/unit/platform_spec.rb
+++ b/spec/unit/platform_spec.rb
@@ -278,6 +278,17 @@ describe Chef::Platform do
pmap[:package].should eql(Chef::Provider::Package::Ips)
end
+ it "should use the SUSE group provider on SLES11" do
+ 1.upto(3) do |sp|
+ pmap = Chef::Platform.find("SUSE", "11.#{sp}")
+ pmap[:group].should eql(Chef::Provider::Group::Suse)
+ end
+ end
+
+ it "should use the Gpasswd group provider on SLES12" do
+ pmap = Chef::Platform.find("SUSE", "12.0")
+ pmap[:group].should eql(Chef::Provider::Group::Gpasswd)
+ end
end
end