From 1ec225e052ea546ddbe6e4869e4b4ff35593feb4 Mon Sep 17 00:00:00 2001 From: Dan Carley Date: Fri, 5 Aug 2011 10:52:33 +0100 Subject: [PATCH] Add "short" hostname to "/etc/hosts" mimicking Debian behaviour. [closes GH-456] --- lib/vagrant/systems/redhat.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/vagrant/systems/redhat.rb b/lib/vagrant/systems/redhat.rb index 68bd3678e..15a1f6cb8 100644 --- a/lib/vagrant/systems/redhat.rb +++ b/lib/vagrant/systems/redhat.rb @@ -39,7 +39,7 @@ module Vagrant if !ssh.test?("sudo hostname | grep '#{name}'") ssh.exec!("sudo sed -i 's/\\(HOSTNAME=\\).*/\\1#{name}/' /etc/sysconfig/network") ssh.exec!("sudo hostname #{name}") - ssh.exec!("sudo sed -i 's@^\\(127[.]0[.]0[.]1[[:space:]]\\+\\)@\\1#{name} @' /etc/hosts") + ssh.exec!("sudo sed -i 's@^\\(127[.]0[.]0[.]1[[:space:]]\\+\\)@\\1#{name} #{name.split('.')[0]} @' /etc/hosts") end end end