Avoid sudos for redir related stuff

This commit is contained in:
Fabio Rehm 2013-07-28 02:20:16 -03:00
parent d62a053674
commit 14e8c41ee0
2 changed files with 3 additions and 3 deletions

View file

@ -15,7 +15,7 @@ module Vagrant
redir_pids.each do |pid|
next unless is_redir_pid?(pid)
@logger.debug "Killing pid #{pid}"
system "sudo pkill -TERM -P #{pid}"
system "pkill -TERM -P #{pid}"
end
remove_redir_pids

View file

@ -29,7 +29,7 @@ describe Vagrant::LXC::Action::ClearForwardedPorts do
context 'with a valid redir pid' do
it 'kills known processes' do
subject.should have_received(:system).with("sudo pkill -TERM -P #{pid}")
subject.should have_received(:system).with("pkill -TERM -P #{pid}")
end
end
@ -37,7 +37,7 @@ describe Vagrant::LXC::Action::ClearForwardedPorts do
let(:pid_cmd) { 'sudo ls' }
it 'does not kill the process' do
subject.should_not have_received(:system).with("sudo pkill -TERM -P #{pid}")
subject.should_not have_received(:system).with("pkill -TERM -P #{pid}")
end
end
end