From 4cd1236e9ab4f2be75779d40927d3b44486e3dd8 Mon Sep 17 00:00:00 2001 From: Dmitry Vasilets Date: Thu, 7 May 2015 12:38:32 +0200 Subject: [PATCH] simplify --- lib/vagrant-libvirt/action/create_networks.rb | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/lib/vagrant-libvirt/action/create_networks.rb b/lib/vagrant-libvirt/action/create_networks.rb index 90dd48e..1da5996 100644 --- a/lib/vagrant-libvirt/action/create_networks.rb +++ b/lib/vagrant-libvirt/action/create_networks.rb @@ -121,12 +121,8 @@ module VagrantPlugins # Set IP address of network (actually bridge). It will be used as # gateway address for machines connected to this network. net = IPAddr.new(net_address) - if @options[:host_ip].nil? - # Default to first address (after network name) - @interface_network[:ip_address] = net.to_range.begin.succ - else - @interface_network[:ip_address] = IPAddr.new @options[:host_ip] - end + # Default to first address (after network name) + @interface_network[:ip_address] = @options[:host_ip].nil? ? net.to_range.begin.succ : IPAddr.new @options[:host_ip] # Is there an available network matching to configured ip # address?