From 8fe47b79c249e26e73b4f5fdbb9e13daf2613637 Mon Sep 17 00:00:00 2001 From: Seth Vargo Date: Sun, 26 Jun 2016 11:40:41 -0400 Subject: [PATCH] guests/gentoo: Exit on hostname error --- plugins/guests/gentoo/cap/change_host_name.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/guests/gentoo/cap/change_host_name.rb b/plugins/guests/gentoo/cap/change_host_name.rb index f1f08a55c..7d8ca3ac5 100644 --- a/plugins/guests/gentoo/cap/change_host_name.rb +++ b/plugins/guests/gentoo/cap/change_host_name.rb @@ -8,6 +8,8 @@ module VagrantPlugins if !comm.test("hostname -f | grep '^#{name}$'", sudo: false) basename = name.split(".", 2)[0] comm.sudo <<-EOH.gsub(/^ {14}/, "") + set -e + # Set the hostname hostname '#{basename}' echo "hostname=#{basename}" > /etc/conf.d/hostname