summaryrefslogtreecommitdiff
path: root/lib/chef/provider/service/upstart.rb
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2014-08-29 15:47:58 -0700
committerLamont Granquist <lamont@scriptkiddie.org>2014-09-08 11:10:05 -0700
commit342201b4e3ad90a0a5ddc62a1e4db76e95aea7e2 (patch)
treed4a2d6d86df86eab92532d67c732d03e14665bc7 /lib/chef/provider/service/upstart.rb
parentd6f6928fd1097709189cd78689e89032d4c9318d (diff)
downloadchef-342201b4e3ad90a0a5ddc62a1e4db76e95aea7e2.tar.gz
fix shell_out/run_command usage
- run_command is deprecated - shell_out! should be used for internal APIs (enable/disable/status) - shell_out_with_systems_locale! should be used for start/stop/restart/reload cases (users will want their software running in their systems locale not our forced en_US.UTF-8 locale)
Diffstat (limited to 'lib/chef/provider/service/upstart.rb')
-rw-r--r--lib/chef/provider/service/upstart.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/chef/provider/service/upstart.rb b/lib/chef/provider/service/upstart.rb
index c81a8a50dc..5c021e8cb7 100644
--- a/lib/chef/provider/service/upstart.rb
+++ b/lib/chef/provider/service/upstart.rb
@@ -97,7 +97,7 @@ class Chef
Chef::Log.debug("#{@new_resource} you have specified a status command, running..")
begin
- if run_command_with_systems_locale(:command => @new_resource.status_command) == 0
+ if shell_out!(@new_resource.status_command) == 0
@current_resource.running true
end
rescue Chef::Exceptions::Exec
@@ -153,7 +153,7 @@ class Chef
if @new_resource.start_command
super
else
- run_command_with_systems_locale(:command => "/sbin/start #{@job}")
+ shell_out_with_systems_locale!("/sbin/start #{@job}")
end
end
end
@@ -167,7 +167,7 @@ class Chef
if @new_resource.stop_command
super
else
- run_command_with_systems_locale(:command => "/sbin/stop #{@job}")
+ shell_out_with_systems_locale!("/sbin/stop #{@job}")
end
end
end
@@ -179,7 +179,7 @@ class Chef
# Older versions of upstart would fail on restart if the service was currently stopped, check for that. LP:430883
else
if @current_resource.running
- run_command_with_systems_locale(:command => "/sbin/restart #{@job}")
+ shell_out_with_systems_locale!("/sbin/restart #{@job}")
else
start_service
end
@@ -191,7 +191,7 @@ class Chef
super
else
# upstart >= 0.6.3-4 supports reload (HUP)
- run_command_with_systems_locale(:command => "/sbin/reload #{@job}")
+ shell_out_with_systems_locale!("/sbin/reload #{@job}")
end
end