Merge pull request #8148 from mikefaille/netfixRHEL
Revert "Fix `service network restart` on RHEL-7 / Fedora"
This commit is contained in:
commit
5004f37a36
|
@ -31,12 +31,8 @@ module VagrantPlugins
|
|||
sed -i'' '1i 127.0.0.1\\t#{name}\\t#{basename}' /etc/hosts
|
||||
}
|
||||
|
||||
# Restart network (through NetworkManager if running)
|
||||
if service NetworkManager status 2>&1 | grep -q running; then
|
||||
service NetworkManager restart
|
||||
else
|
||||
# Restart network
|
||||
service network restart
|
||||
fi
|
||||
EOH
|
||||
end
|
||||
end
|
||||
|
|
|
@ -36,7 +36,7 @@ module VagrantPlugins
|
|||
|
||||
# Add the new interface and bring it back up
|
||||
final_path = "#{network_scripts_dir}/ifcfg-#{network[:device]}"
|
||||
commands << <<-EOH.gsub(/^ {14}/, '')
|
||||
commands << <<-EOH.gsub(/^ */, '')
|
||||
# Down the interface before munging the config file. This might
|
||||
# fail if the interface is not actually set up yet so ignore
|
||||
# errors.
|
||||
|
@ -48,13 +48,9 @@ module VagrantPlugins
|
|||
EOH
|
||||
end
|
||||
|
||||
commands << <<-EOH.gsub(/^ {12}/, '')
|
||||
# Restart network (through NetworkManager if running)
|
||||
if service NetworkManager status 2>&1 | grep -q running; then
|
||||
service NetworkManager restart
|
||||
else
|
||||
commands << <<-EOH.gsub(/^ */, '')
|
||||
# Restart network
|
||||
service network restart
|
||||
fi
|
||||
EOH
|
||||
|
||||
comm.sudo(commands.join("\n"))
|
||||
|
|
Loading…
Reference in New Issue