summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2021-02-15 10:28:13 -0800
committerGitHub <noreply@github.com>2021-02-15 10:28:13 -0800
commit54715bdd0b423c9bb3ac5cf6d882627e5db95d3b (patch)
tree0b5fa9b9c5c1fc29cd7ad752120be6bdb726a9d1
parent23673431874d172825e71ba82c7fac176676932e (diff)
parentc90b1c881bcbba19f5a45a675557f6566b137935 (diff)
downloadchef-54715bdd0b423c9bb3ac5cf6d882627e5db95d3b.tar.gz
Merge pull request #11038 from chef/legacy_upstart
Remove an Upstart check for Ubuntu 8.04-9.04
-rw-r--r--lib/chef/provider/service/upstart.rb11
-rw-r--r--spec/unit/provider/service/upstart_service_spec.rb29
2 files changed, 2 insertions, 38 deletions
diff --git a/lib/chef/provider/service/upstart.rb b/lib/chef/provider/service/upstart.rb
index 181aa82fe7..7c2b82dc3a 100644
--- a/lib/chef/provider/service/upstart.rb
+++ b/lib/chef/provider/service/upstart.rb
@@ -61,15 +61,8 @@ class Chef
end
end
- platform, version = Chef::Platform.find_platform_and_version(run_context.node)
- if platform == "ubuntu" && (8.04..9.04).cover?(version.to_f)
- @upstart_job_dir = "/etc/event.d"
- @upstart_conf_suffix = ""
- else
- @upstart_job_dir = "/etc/init"
- @upstart_conf_suffix = ".conf"
- end
-
+ @upstart_job_dir = "/etc/init"
+ @upstart_conf_suffix = ".conf"
@command_success = true # new_resource.status_command= false, means upstart used
@config_file_found = true
@upstart_command_success = true
diff --git a/spec/unit/provider/service/upstart_service_spec.rb b/spec/unit/provider/service/upstart_service_spec.rb
index 20cbef11ce..924ac58551 100644
--- a/spec/unit/provider/service/upstart_service_spec.rb
+++ b/spec/unit/provider/service/upstart_service_spec.rb
@@ -27,7 +27,6 @@ describe Chef::Provider::Service::Upstart do
@node = Chef::Node.new
@node.name("upstarter")
@node.automatic_attrs[:platform] = "ubuntu"
- @node.automatic_attrs[:platform_version] = "9.10"
@events = Chef::EventDispatch::Dispatcher.new
@run_context = Chef::RunContext.new(@node, {}, @events)
@@ -36,34 +35,6 @@ describe Chef::Provider::Service::Upstart do
@provider = Chef::Provider::Service::Upstart.new(@new_resource, @run_context)
end
- describe "when first created" do
- before do
- @platform = nil
- end
-
- it "should return /etc/event.d as the upstart job directory when running on Ubuntu 9.04" do
- @node.automatic_attrs[:platform_version] = "9.04"
- # Chef::Platform.stub(:find_platform_and_version).and_return([ "ubuntu", "9.04" ])
- @provider = Chef::Provider::Service::Upstart.new(@new_resource, @run_context)
- expect(@provider.instance_variable_get(:@upstart_job_dir)).to eq("/etc/event.d")
- expect(@provider.instance_variable_get(:@upstart_conf_suffix)).to eq("")
- end
-
- it "should return /etc/init as the upstart job directory when running on Ubuntu 9.10" do
- @node.automatic_attrs[:platform_version] = "9.10"
- @provider = Chef::Provider::Service::Upstart.new(@new_resource, @run_context)
- expect(@provider.instance_variable_get(:@upstart_job_dir)).to eq("/etc/init")
- expect(@provider.instance_variable_get(:@upstart_conf_suffix)).to eq(".conf")
- end
-
- it "should return /etc/init as the upstart job directory by default" do
- @node.automatic_attrs[:platform_version] = "9000"
- @provider = Chef::Provider::Service::Upstart.new(@new_resource, @run_context)
- expect(@provider.instance_variable_get(:@upstart_job_dir)).to eq("/etc/init")
- expect(@provider.instance_variable_get(:@upstart_conf_suffix)).to eq(".conf")
- end
- end
-
describe "load_current_resource" do
before(:each) do
@node.automatic_attrs[:command] = { ps: "ps -ax" }