From 8a1e1863a7737ec2a7fe21a699f87c1c30dbe52c Mon Sep 17 00:00:00 2001 From: Virgil Dupras Date: Wed, 4 Jul 2018 14:33:51 -0400 Subject: [PATCH] redir: fix version parsing At some point in v 3.x, it outputted version in stderr, then went back to stdout... --- lib/vagrant-lxc/action/forward_ports.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/vagrant-lxc/action/forward_ports.rb b/lib/vagrant-lxc/action/forward_ports.rb index 074fc79..d3eb2a7 100644 --- a/lib/vagrant-lxc/action/forward_ports.rb +++ b/lib/vagrant-lxc/action/forward_ports.rb @@ -107,8 +107,9 @@ module Vagrant end def redir_version - # For some weird reason redir prints version information in STDERR - _, version, _ = Open3.capture3 "redir --version" + stdout, stderr, _ = Open3.capture3 "redir --version" + # For some weird reason redir printed version information in STDERR prior to 3.2 + version = stdout || stderr version.split('.')[0].to_i end