From 262b50bc02057116ef28c15db27fe36a6df3f5bf Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Sun, 5 Jul 2015 17:14:48 -0700 Subject: [PATCH] guests/linux: fix exception when printf is empty [GH-5846] --- CHANGELOG.md | 2 ++ plugins/guests/linux/cap/shell_expand_guest_path.rb | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1b833b8a1..4ef8516e9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -61,6 +61,8 @@ BUG FIXES: - guests/fedora: do not use biosdevname if it is not installed [GH-5707] - guests/freebsd: provide an argument to the backup file [GH-5516, GH-5517] - guests/funtoo: fix incorrect path in configure networks [GH-4812] + - guests/linux: fix edge case exception where no home directory + is available on guest [GH-5846] - guests/openbsd: output newline after inserted public key [GH-5881] - guests/tinycore: fix change hostname functionality [GH-5623] - guests/windows: Create rsync folder prior to rsync-ing. [GH-5282] diff --git a/plugins/guests/linux/cap/shell_expand_guest_path.rb b/plugins/guests/linux/cap/shell_expand_guest_path.rb index 341c0a1a8..cc32d7f7c 100644 --- a/plugins/guests/linux/cap/shell_expand_guest_path.rb +++ b/plugins/guests/linux/cap/shell_expand_guest_path.rb @@ -11,8 +11,10 @@ module VagrantPlugins end end - # The last line is the path we care about - real_path = real_path.split("\n").last.chomp + if real_path + # The last line is the path we care about + real_path = real_path.split("\n").last.chomp + end if !real_path # If no real guest path was detected, this is really strange