[DRE-commits] [vagrant-libvirt] 129/163: Allow the situation where DHCP is not requested but where it is enabled on the virtual network

Antonio Terceiro terceiro at moszumanska.debian.org
Sun Apr 24 13:57:15 UTC 2016


This is an automated email from the git hooks/post-receive script.

terceiro pushed a commit to annotated tag 0.0.26
in repository vagrant-libvirt.

commit ce75b9a02e99e15c0c59903caca94d4aa03523f4
Author: Erik van Pienbroek <erik.vanpienbroek at prorail.nl>
Date:   Wed Apr 1 14:49:35 2015 +0200

    Allow the situation where DHCP is not requested but where it is enabled on the virtual network
---
 README.md                                     | 6 ++++++
 lib/vagrant-libvirt/action/create_networks.rb | 4 +++-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/README.md b/README.md
index a26b4c8..cbe643b 100644
--- a/README.md
+++ b/README.md
@@ -249,6 +249,12 @@ starts with 'libvirt__' string. Here is a list of those options:
 * `:mac` - MAC address for the interface.
 * `model_type` - parameter specifies the model of the network adapter when you create a domain value by default virtio KVM believe possible values, see the documentation for libvirt
 
+When the option `:libvirt__dhcp_enabled` is to to 'false' it shouldn't matter
+whether the virtual network contains a DHCP server or not and vagrant-libvirt
+should not fail on it. The only situation where vagrant-libvirt should fail
+is when DHCP is requested but isn't configured on a matching already existing
+virtual network.
+
 ### Public Network Options
 * `:dev` - Physical device that the public interface should use. Default is 'eth0'.
 * `:mode` - The mode in which the public interface should operate in. Supported
diff --git a/lib/vagrant-libvirt/action/create_networks.rb b/lib/vagrant-libvirt/action/create_networks.rb
index 298b5c4..7ef4643 100644
--- a/lib/vagrant-libvirt/action/create_networks.rb
+++ b/lib/vagrant-libvirt/action/create_networks.rb
@@ -100,8 +100,10 @@ module VagrantPlugins
         # match what was configured in the vagrantfile
         # since we always enable dhcp for the management network
         # this ensures we wont start a vm vagrant cant reach
+        # Allow the situation where DHCP is not requested (:libvirt__dhcp_enabled == false)
+        # but where it is enabled on the virtual network
         def verify_dhcp
-          unless @options[:dhcp_enabled] == @interface_network[:dhcp_enabled]
+          if @interface_network[:dhcp_enabled] == true && @options[:dhcp_enabled] == false
             raise Errors::DHCPMismatch,
                   network_name: @interface_network[:name],
                   requested: @options[:dhcp_enabled] ? 'enabled' : 'disabled'

-- 
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