From f750bf406cb020063b8631f87125ecf79eb6ed3b Mon Sep 17 00:00:00 2001 From: Francisco Soto Date: Mon, 24 Sep 2018 18:18:08 -0700 Subject: [PATCH] Fix redir version fetching. "" || "something" doesn't really work. Have to check for the actual string length to determine if got something or not out of the pipe. --- lib/vagrant-lxc/action/forward_ports.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/vagrant-lxc/action/forward_ports.rb b/lib/vagrant-lxc/action/forward_ports.rb index e45f766..549531a 100644 --- a/lib/vagrant-lxc/action/forward_ports.rb +++ b/lib/vagrant-lxc/action/forward_ports.rb @@ -108,7 +108,7 @@ module Vagrant def 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 = stdout.empty? ? stderr : stdout version.split('.')[0].to_i end