From b74bf88d016027fd5c43c5c23482c4ae6387c3bb Mon Sep 17 00:00:00 2001 From: Mikhail Zholobov Date: Tue, 23 Dec 2014 15:18:23 +0300 Subject: [PATCH 1/3] driver: Ensure that "prlsrvctl" returns info about DHCPv4 server Fixes issue #163 --- lib/vagrant-parallels/driver/pd_10.rb | 12 ++++++------ lib/vagrant-parallels/driver/pd_8.rb | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/lib/vagrant-parallels/driver/pd_10.rb b/lib/vagrant-parallels/driver/pd_10.rb index 4a16400d..2237acff 100644 --- a/lib/vagrant-parallels/driver/pd_10.rb +++ b/lib/vagrant-parallels/driver/pd_10.rb @@ -146,13 +146,13 @@ def read_host_only_interfaces # There may be a fake DHCPv4 parameters # We can trust them only if adapter IP and DHCP IP are in the same subnet - dhcp_ip = net_info['DHCPv4 server']['Server address'] - if network_address(info[:ip], info[:netmask]) == - network_address(dhcp_ip, info[:netmask]) + dhcp_info = net_info['DHCPv4 server'] + if dhcp_info && (network_address(info[:ip], info[:netmask]) == + network_address(dhcp_info['Server address'], info[:netmask])) info[:dhcp] = { - ip: dhcp_ip, - lower: net_info['DHCPv4 server']['IP scope start address'], - upper: net_info['DHCPv4 server']['IP scope end address'] + ip: dhcp_info['Server address'], + lower: dhcp_info['IP scope start address'], + upper: dhcp_info['IP scope end address'] } end hostonly_ifaces << info diff --git a/lib/vagrant-parallels/driver/pd_8.rb b/lib/vagrant-parallels/driver/pd_8.rb index 7df377c3..4a14284c 100644 --- a/lib/vagrant-parallels/driver/pd_8.rb +++ b/lib/vagrant-parallels/driver/pd_8.rb @@ -287,13 +287,13 @@ def read_host_only_interfaces # There may be a fake DHCPv4 parameters # We can trust them only if adapter IP and DHCP IP are in the same subnet - dhcp_ip = net_info['DHCPv4 server']['Server address'] - if network_address(info[:ip], info[:netmask]) == - network_address(dhcp_ip, info[:netmask]) + dhcp_info = net_info['DHCPv4 server'] + if dhcp_info && (network_address(info[:ip], info[:netmask]) == + network_address(dhcp_info['Server address'], info[:netmask])) info[:dhcp] = { - ip: dhcp_ip, - lower: net_info['DHCPv4 server']['IP scope start address'], - upper: net_info['DHCPv4 server']['IP scope end address'] + ip: dhcp_info['Server address'], + lower: dhcp_info['IP scope start address'], + upper: dhcp_info['IP scope end address'] } end hostonly_ifaces << info From a95a3a82f8536fb401abf505b0bb4a498cae8761 Mon Sep 17 00:00:00 2001 From: Mikhail Zholobov Date: Thu, 25 Dec 2014 17:28:33 +0300 Subject: [PATCH 2/3] config: Added 'post-import' customization step [GH-165] --- lib/vagrant-parallels/action.rb | 1 + lib/vagrant-parallels/config.rb | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/vagrant-parallels/action.rb b/lib/vagrant-parallels/action.rb index b9916067..15c26f41 100644 --- a/lib/vagrant-parallels/action.rb +++ b/lib/vagrant-parallels/action.rb @@ -280,6 +280,7 @@ def self.action_up if env1[:result] b1.use Customize, "pre-import" b1.use Import + b1.use Customize, 'post-import' end end b.use action_start diff --git a/lib/vagrant-parallels/config.rb b/lib/vagrant-parallels/config.rb index 75534eae..445408e5 100644 --- a/lib/vagrant-parallels/config.rb +++ b/lib/vagrant-parallels/config.rb @@ -90,7 +90,7 @@ def finalize! def validate(machine) errors = _detected_errors - valid_events = ["pre-import", "pre-boot", "post-boot", "post-comm"] + valid_events = ['pre-import', 'post-import', 'pre-boot', 'post-boot', 'post-comm'] @customizations.each do |event, _| if !valid_events.include?(event) errors << I18n.t("vagrant_parallels.config.invalid_event", From 34a506c9f01a2bb8ab002960272fd9fdb863adf3 Mon Sep 17 00:00:00 2001 From: Mikhail Zholobov Date: Thu, 25 Dec 2014 17:49:32 +0300 Subject: [PATCH 3/3] Version bumped to 1.3.7 --- lib/vagrant-parallels/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/vagrant-parallels/version.rb b/lib/vagrant-parallels/version.rb index 0ec5414b..aeab2fdc 100644 --- a/lib/vagrant-parallels/version.rb +++ b/lib/vagrant-parallels/version.rb @@ -1,5 +1,5 @@ module VagrantPlugins module Parallels - VERSION = '1.3.6' + VERSION = '1.3.7' end end