summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSerdar Sutay <serdar@opscode.com>2014-10-10 15:16:05 -0700
committerSerdar Sutay <serdar@opscode.com>2014-10-10 15:16:05 -0700
commit6a9aab14f1b6ee3c654ec947ef4484aa3a507dbc (patch)
tree5c27a2abc6becc0ef1dc8f432954bdff2b424d9a
parente25a7e4af2752d79041bd469a1daf4c9347e8cb6 (diff)
parentb7fff7dbcf4f6afd8ffd8d463093c68a114afa22 (diff)
downloadchef-6a9aab14f1b6ee3c654ec947ef4484aa3a507dbc.tar.gz
Merge pull request #2052 from mapleoin/suse-systemd
change default service mapping for SLES to systemd
-rw-r--r--lib/chef/platform/provider_mapping.rb5
-rw-r--r--spec/unit/platform_spec.rb11
2 files changed, 15 insertions, 1 deletions
diff --git a/lib/chef/platform/provider_mapping.rb b/lib/chef/platform/provider_mapping.rb
index 0766ccffa7..6f5cde87ca 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