mirror of
https://github.com/vagrant-libvirt/vagrant-libvirt.git
synced 2025-02-25 18:55:27 -06:00
Use network 'default' if nothing more is specified in config.vm.network.
This commit is contained in:
@@ -44,7 +44,7 @@ module VagrantPlugins
|
|||||||
# (:libvirt__network_name => ...).
|
# (:libvirt__network_name => ...).
|
||||||
@options = scoped_hash_override(options, :libvirt)
|
@options = scoped_hash_override(options, :libvirt)
|
||||||
@options = {
|
@options = {
|
||||||
:netmask => '255.255.255.0',
|
:netmask => '255.255.255.0',
|
||||||
}.merge(@options)
|
}.merge(@options)
|
||||||
|
|
||||||
# Prepare a hash describing network for this specific interface.
|
# Prepare a hash describing network for this specific interface.
|
||||||
@@ -64,6 +64,13 @@ module VagrantPlugins
|
|||||||
handle_ip_option(env)
|
handle_ip_option(env)
|
||||||
elsif @options[:network_name]
|
elsif @options[:network_name]
|
||||||
handle_network_name_option
|
handle_network_name_option
|
||||||
|
else
|
||||||
|
# TODO Should be smarter than just using fixed 'default' string.
|
||||||
|
@interface_network = lookup_network_by_name('default')
|
||||||
|
if not @interface_network
|
||||||
|
raise Errors::NetworkNotAvailableError,
|
||||||
|
:network_name => 'default'
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
autostart_network if not @interface_network[:autostart]
|
autostart_network if not @interface_network[:autostart]
|
||||||
@@ -212,6 +219,7 @@ module VagrantPlugins
|
|||||||
|
|
||||||
# First is address of network, second is gateway. Start the range two
|
# First is address of network, second is gateway. Start the range two
|
||||||
# addresses after network address.
|
# addresses after network address.
|
||||||
|
# TODO Detect if this IP is not set on the interface.
|
||||||
start_address = net.to_range.begin.succ.succ
|
start_address = net.to_range.begin.succ.succ
|
||||||
|
|
||||||
# Stop address must not be broadcast.
|
# Stop address must not be broadcast.
|
||||||
|
|||||||
Reference in New Issue
Block a user