From 9fc5540841aa874543f40f84326915f8d4468668 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Thu, 20 Mar 2014 17:52:31 -0700 Subject: [PATCH] guests/debian: don't return from block [GH-3283] --- CHANGELOG.md | 1 + plugins/guests/debian/cap/change_host_name.rb | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 63905652c..125c78ccb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ BUG FIXES: - core: Vagrant won't collide with newer versions of Bundler [GH-3193] - core: Allow provisioner plugins to not have a config class. [GH-3272] - commands/status: Machine readable output contains the target. [GH-3218] + - guests/debian: Changing host name works properly. [GH-3283] - synced\_folders/smb: IDs of synced folders are hashed to work better with VMware. [GH-3219] - synced\_folders/smb: Passwords with symbols now work. [GH-3242] diff --git a/plugins/guests/debian/cap/change_host_name.rb b/plugins/guests/debian/cap/change_host_name.rb index 09ca83d8e..53d0c38c4 100644 --- a/plugins/guests/debian/cap/change_host_name.rb +++ b/plugins/guests/debian/cap/change_host_name.rb @@ -32,10 +32,12 @@ module VagrantPlugins end def get_current_hostname + hostname = "" sudo "hostname -f" do |type, data| - return data.chomp if type == :stdout + hostname = data.chomp if type == :stdout && hostname.empty? end - '' + + hostname end def update_etc_hostname