From 619c7a5b26ade0e8671c30ced09d36746bcd2c27 Mon Sep 17 00:00:00 2001 From: Seth Vargo Date: Sat, 25 Jun 2016 15:22:58 -0400 Subject: [PATCH] guests/darwin: Exit on error setting hostname --- plugins/guests/darwin/cap/change_host_name.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugins/guests/darwin/cap/change_host_name.rb b/plugins/guests/darwin/cap/change_host_name.rb index 5ef6d9c08..5d5902d9e 100644 --- a/plugins/guests/darwin/cap/change_host_name.rb +++ b/plugins/guests/darwin/cap/change_host_name.rb @@ -9,6 +9,9 @@ module VagrantPlugins basename = name.split(".", 2)[0] comm.sudo <<-EOH.gsub(/^ {14}/, '') + set -e + + # Set hostname scutil --set ComputerName '#{name}' scutil --set HostName '#{name}'