From 2e14c974d76480c8c98849a43b415db0ec2b1b2d Mon Sep 17 00:00:00 2001 From: Fabio Rehm Date: Wed, 10 Apr 2013 02:22:19 -0300 Subject: [PATCH] Redirect `redir` stderr to /dev/null Closes #51 --- lib/vagrant-lxc/action/forward_ports.rb | 2 +- spec/unit/action/forward_ports_spec.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/vagrant-lxc/action/forward_ports.rb b/lib/vagrant-lxc/action/forward_ports.rb index 9dff4aa..9df40f8 100644 --- a/lib/vagrant-lxc/action/forward_ports.rb +++ b/lib/vagrant-lxc/action/forward_ports.rb @@ -63,7 +63,7 @@ module Vagrant end def redirect_port(host, guest) - redir_cmd = "sudo redir --laddr=127.0.0.1 --lport=#{host} --cport=#{guest} --caddr=#{@container_ip}" + redir_cmd = "sudo redir --laddr=127.0.0.1 --lport=#{host} --cport=#{guest} --caddr=#{@container_ip} 2>/dev/null" @logger.debug "Forwarding port with `#{redir_cmd}`" fork { exec redir_cmd } diff --git a/spec/unit/action/forward_ports_spec.rb b/spec/unit/action/forward_ports_spec.rb index 06b74bd..ed2ab7b 100644 --- a/spec/unit/action/forward_ports_spec.rb +++ b/spec/unit/action/forward_ports_spec.rb @@ -30,7 +30,7 @@ describe Vagrant::LXC::Action::ForwardPorts do it 'forwards ports using redir' do subject.should have_received(:exec).with( - "sudo redir --laddr=127.0.0.1 --lport=#{host_port} --cport=#{guest_port} --caddr=#{container_ip}" + "sudo redir --laddr=127.0.0.1 --lport=#{host_port} --cport=#{guest_port} --caddr=#{container_ip} 2>/dev/null" ) end