diff options
-rw-r--r-- | acceptance/data-collector/.acceptance/data-collector-test/recipes/default.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/acceptance/data-collector/.acceptance/data-collector-test/recipes/default.rb b/acceptance/data-collector/.acceptance/data-collector-test/recipes/default.rb index 2ba4fe81fc..61915c54b7 100644 --- a/acceptance/data-collector/.acceptance/data-collector-test/recipes/default.rb +++ b/acceptance/data-collector/.acceptance/data-collector-test/recipes/default.rb @@ -1,6 +1,5 @@ -oldpath = ENV["PATH"] -ENV["PATH"] = "/opt/chef/embedded/bin:#{ENV["PATH"]}" +embedded_path = "/opt/chef/embedded/bin:#{ENV["PATH"]}" api_root_dir = "/var/opt/data_collector_api" @@ -18,6 +17,7 @@ cookbook_file ::File.join(api_root_dir, "api.rb") execute "bundle install --binstubs" do cwd api_root_dir + environment({ "PATH" => embedded_path }) end pid_file = "/var/run/api.pid" @@ -25,11 +25,13 @@ running_pid = ::File.exist?(pid_file) ? ::File.read(pid_file).strip : nil execute "kill existing API process" do command "kill #{running_pid}" + environment({ "PATH" => embedded_path }) not_if { running_pid.nil? } end execute "start API" do command "bin/rackup -D -P #{pid_file}" + environment({ "PATH" => embedded_path }) cwd api_root_dir end @@ -40,5 +42,3 @@ directory "/etc/chef" source "client-rb-#{config_file}.rb" end end - -ENV["PATH"] = oldpath |