[DRE-commits] [vagrant-libvirt] 35/104: Use network 'default' if nothing more is specified in `config.vm.network`.
Antonio Terceiro
terceiro at moszumanska.debian.org
Sun Apr 24 13:55:42 UTC 2016
This is an automated email from the git hooks/post-receive script.
terceiro pushed a commit to annotated tag 0.0.11
in repository vagrant-libvirt.
commit 5dea377677c89663b4402f2693b6dfb2e9df23c2
Author: pradels <les.pradels at gmail.com>
Date: Fri May 10 00:01:00 2013 +0200
Use network 'default' if nothing more is specified in `config.vm.network`.
---
lib/vagrant-libvirt/action/create_networks.rb | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/lib/vagrant-libvirt/action/create_networks.rb b/lib/vagrant-libvirt/action/create_networks.rb
index 64b82ce..f35cebf 100644
--- a/lib/vagrant-libvirt/action/create_networks.rb
+++ b/lib/vagrant-libvirt/action/create_networks.rb
@@ -44,7 +44,7 @@ module VagrantPlugins
# (:libvirt__network_name => ...).
@options = scoped_hash_override(options, :libvirt)
@options = {
- :netmask => '255.255.255.0',
+ :netmask => '255.255.255.0',
}.merge(@options)
# Prepare a hash describing network for this specific interface.
@@ -64,6 +64,13 @@ module VagrantPlugins
handle_ip_option(env)
elsif @options[:network_name]
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
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
# addresses after network address.
+ # TODO Detect if this IP is not set on the interface.
start_address = net.to_range.begin.succ.succ
# Stop address must not be broadcast.
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/vagrant-libvirt.git
More information about the Pkg-ruby-extras-commits
mailing list