diff options
author | Ionuț Arțăriși <ionut@artarisi.eu> | 2014-09-15 10:56:50 +0200 |
---|---|---|
committer | Ionuț Arțăriși <iartarisi@suse.cz> | 2014-10-02 13:42:24 +0200 |
commit | b7fff7dbcf4f6afd8ffd8d463093c68a114afa22 (patch) | |
tree | 8c08a7877a63ef23890f1f45fd50ba947a2b98fd | |
parent | cb61daebfb0d255cae928ca1a92db29b055755cf (diff) | |
download | chef-b7fff7dbcf4f6afd8ffd8d463093c68a114afa22.tar.gz |
change default service mapping for SLES to systemd
Systemd is the new default starting with SLES12, the old versions should
still use the "Redhat" provider.
-rw-r--r-- | lib/chef/platform/provider_mapping.rb | 5 | ||||
-rw-r--r-- | spec/unit/platform_spec.rb | 11 |
2 files changed, 15 insertions, 1 deletions
diff --git a/lib/chef/platform/provider_mapping.rb b/lib/chef/platform/provider_mapping.rb index 7f79c38a6a..d4dbbc3bc1 100644 --- a/lib/chef/platform/provider_mapping.rb +++ b/lib/chef/platform/provider_mapping.rb @@ -197,10 +197,13 @@ class Chef }, :suse => { :default => { - :service => Chef::Provider::Service::Redhat, + :service => Chef::Provider::Service::Systemd, :cron => Chef::Provider::Cron, :package => Chef::Provider::Package::Zypper, :group => Chef::Provider::Group::Suse + }, + "< 12.0" => { + :service => Chef::Provider::Service::Redhat } }, :oracle => { diff --git a/spec/unit/platform_spec.rb b/spec/unit/platform_spec.rb index 029fc29aae..5b880dc0cf 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 Redhat service provider on SLES11" do + 1.upto(3) do |sp| + pmap = Chef::Platform.find("SUSE", "11.#{sp}") + pmap[:service].should eql(Chef::Provider::Service::Redhat) + end + end + + it "should use the Systemd service provider on SLES12" do + pmap = Chef::Platform.find("SUSE", "12.0") + pmap[:service].should eql(Chef::Provider::Service::Systemd) + end end end |