vagrant-parallels 2.2.6 → 2.3.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7035cf285af41cc2b66992971c09b3e77f68da5bb33ca3a8ef7586e4eec65334
4
- data.tar.gz: '08a191cd2af6f7a5fbb626a16375be955cae4a386123519fb1db077b16345f9b'
3
+ metadata.gz: 45a092a3894860152f2315793cb2a6ca541bc3488b168e3e08c9ba9637f8c867
4
+ data.tar.gz: 7e6a76e6734bad9691232004722d0cc04f5bc53992798bd6e5074341dce985af
5
5
  SHA512:
6
- metadata.gz: ac10bedbc9ecfd38984e710de98f634dd9c97572e5f6b8bf27f9a5f91f6d6af9cce0ae7152642b4d37ab2a9c49708189ae7ae9cb108b00c6710f44af9ca19921
7
- data.tar.gz: 6fea796a741e76daefb24bd2ebbc86fc5a248c3665c347fb3d004c3f277ec6dc84d6c3bd2b3b4577d4e68e49f76d06abea4cf49fede0d198266dd0fa3cfce781
6
+ metadata.gz: 5ff72d8b55fde7f2d4444048fe9c736e0f312c61f8b5098b0ac5569a1b3415a6c6671b9c54375190cbcd43aebf55b74fbde681ae9ff2c77f0144bd199a525b60
7
+ data.tar.gz: 5181b7a0c84d03f593e7e4102e8289c95c292a5328566802f017851617259911012745707b78799bf113bd96e78200f95a6762abbb85135181883c273439dd6b
data/CHANGELOG.md CHANGED
@@ -1,3 +1,21 @@
1
+ ## 2.3.1 (March 23, 2022)
2
+ BUG FIXES:
3
+ - Fix the detection of VM IP. Wait for the IP to become available to
4
+ avoid connection issues and Vagrant warnings.
5
+ [[GH-440](https://github.com/Parallels/vagrant-parallels/issues/440)]
6
+
7
+ ## 2.3.0 (March 22, 2022)
8
+ IMPROVEMENTS:
9
+ - Support fetching the VM IP using prlctl
10
+ [[GH-434](https://github.com/Parallels/vagrant-parallels/pull/434)].
11
+ - Update gem dependensies and support Ruby 3.0
12
+ [[GH-437](https://github.com/Parallels/vagrant-parallels/pull/437)],
13
+ [[GH-439](https://github.com/Parallels/vagrant-parallels/pull/439)].
14
+
15
+ BUG FIXES:
16
+ - Fixes SSH access to `.macvm` VMs on Macs with Apple M-series chip
17
+ [[GH-435](https://github.com/Parallels/vagrant-parallels/issues/435)]
18
+
1
19
  ## 2.2.6 (December 19, 2022)
2
20
  BUG FIXES:
3
21
  - Fix the macOS VMs support on ARM-based Mac
data/LICENSE.txt CHANGED
@@ -1,5 +1,5 @@
1
1
  Copyright (c) 2013 Youssef Shahin
2
- Copyright (c) 2013-2017 Parallels International GmbH.
2
+ Copyright (c) 2013-2023 Parallels International GmbH.
3
3
 
4
4
  MIT License
5
5
 
data/README.md CHANGED
@@ -53,6 +53,6 @@ please report it on the [Issue Tracker](https://github.com/Parallels/vagrant-par
53
53
 
54
54
  * Author: Youssef Shahin <yshahin@gmail.com>
55
55
  * Author: Mikhail Zholobov <legal90@gmail.com>
56
- * Copyright 2013-2020, Parallels International GmbH.
56
+ * Copyright 2013-2023, Parallels International GmbH.
57
57
 
58
58
  Vagrant Parallels Provider is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).
@@ -37,7 +37,7 @@ module VagrantPlugins
37
37
  # The ! indicates that this method modifies its argument.
38
38
  def add_ips_to_env!(env)
39
39
  host_ip = @machine.provider.driver.read_shared_interface[:ip]
40
- guest_ip = @machine.provider.driver.read_guest_ip
40
+ guest_ip = @machine.provider.driver.ssh_ip
41
41
 
42
42
  # If we couldn't determine either guest's or host's IP, then
43
43
  # it is probably a bug. Display an appropriate error message.
@@ -403,11 +403,13 @@ module VagrantPlugins
403
403
  end
404
404
  end
405
405
 
406
- # Returns an IP of the virtual machine. It requires that Shared network
407
- # adapter is configured for this VM and it obtains an IP via DHCP.
406
+ # Returns an IP of the virtual machine fetched from the DHCP lease file.
407
+ # It requires that Shared network adapter is configured for this VM
408
+ # and it obtains an IP via DHCP.
409
+ # Returns an empty string if the IP coudn't be determined this way.
408
410
  #
409
411
  # @return [String] IP address leased by DHCP server in "Shared" network
410
- def read_guest_ip
412
+ def read_guest_ip_dhcp
411
413
  mac_addr = read_mac_address.downcase
412
414
  leases_file = '/Library/Preferences/Parallels/parallels_dhcp_leases'
413
415
  leases = {}
@@ -430,6 +432,16 @@ module VagrantPlugins
430
432
  leases.max_by { |_ip, lease_time| lease_time }.first
431
433
  end
432
434
 
435
+ # Returns an IP of the virtual machine fetched from prlctl.
436
+ # Returns an empty string if the IP coudn't be determined this way.
437
+ #
438
+ # @return [String] IP address returned by `prlctl list -f` command
439
+ def read_guest_ip_prlctl
440
+ vm_info = json { execute_prlctl('list', @uuid, '--full', '--json') }
441
+ ip = vm_info.first.fetch('ip_configured', '')
442
+ ip == '-' ? '' : ip
443
+ end
444
+
433
445
  # Returns path to the Parallels Tools ISO file.
434
446
  #
435
447
  # @param [String] guest_os Guest os type: "linux", "darwin" or "windows"
@@ -757,11 +769,26 @@ module VagrantPlugins
757
769
  end
758
770
  end
759
771
 
760
- # Reads the SSH IP of this VM.
772
+ # Reads the SSH IP of this VM from DHCP lease file or from `prlctl list`
773
+ # command - whatever returns a non-empty result first.
774
+ # The method with DHCP does not work for *.macvm VMs on Apple M-series Macs,
775
+ # so we try both sources here.
761
776
  #
762
777
  # @return [String] IP address to use for SSH connection to the VM.
763
778
  def ssh_ip
764
- read_guest_ip
779
+ 5.times do
780
+ ip = read_guest_ip_dhcp
781
+ return ip unless ip.empty?
782
+
783
+ ip = read_guest_ip_prlctl
784
+ return ip unless ip.empty?
785
+
786
+ sleep 2
787
+ end
788
+
789
+ # We didn't manage to determine IP - return nil and
790
+ # expect SSH client to do a retry
791
+ return nil
765
792
  end
766
793
 
767
794
  # Reads the SSH port of this VM.
@@ -87,7 +87,8 @@ module VagrantPlugins
87
87
  :read_bridged_interfaces,
88
88
  :read_current_snapshot,
89
89
  :read_forwarded_ports,
90
- :read_guest_ip,
90
+ :read_guest_ip_dhcp,
91
+ :read_guest_ip_prlctl,
91
92
  :read_guest_tools_state,
92
93
  :read_guest_tools_iso_path,
93
94
  :read_host_only_interfaces,
@@ -1,5 +1,5 @@
1
1
  module VagrantPlugins
2
2
  module Parallels
3
- VERSION = '2.2.6'
3
+ VERSION = '2.3.1'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-parallels
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.6
4
+ version: 2.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mikhail Zholobov
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2022-12-19 00:00:00.000000000 Z
12
+ date: 2023-03-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: nokogiri
@@ -45,14 +45,14 @@ dependencies:
45
45
  requirements:
46
46
  - - "~>"
47
47
  - !ruby/object:Gem::Version
48
- version: 3.10.0
48
+ version: '3.11'
49
49
  type: :development
50
50
  prerelease: false
51
51
  version_requirements: !ruby/object:Gem::Requirement
52
52
  requirements:
53
53
  - - "~>"
54
54
  - !ruby/object:Gem::Version
55
- version: 3.10.0
55
+ version: '3.11'
56
56
  - !ruby/object:Gem::Dependency
57
57
  name: rspec-its
58
58
  requirement: !ruby/object:Gem::Requirement
@@ -67,9 +67,23 @@ dependencies:
67
67
  - - "~>"
68
68
  - !ruby/object:Gem::Version
69
69
  version: 1.3.0
70
+ - !ruby/object:Gem::Dependency
71
+ name: webrick
72
+ requirement: !ruby/object:Gem::Requirement
73
+ requirements:
74
+ - - "~>"
75
+ - !ruby/object:Gem::Version
76
+ version: 1.8.0
77
+ type: :development
78
+ prerelease: false
79
+ version_requirements: !ruby/object:Gem::Requirement
80
+ requirements:
81
+ - - "~>"
82
+ - !ruby/object:Gem::Version
83
+ version: 1.8.0
70
84
  description: Enables Vagrant to manage Parallels virtual machines.
71
85
  email:
72
- - mzholobov@parallels.com
86
+ - legal90@gmail.com
73
87
  - yshahin@gmail.com
74
88
  executables: []
75
89
  extensions: []
@@ -152,7 +166,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
152
166
  - !ruby/object:Gem::Version
153
167
  version: 1.3.6
154
168
  requirements: []
155
- rubygems_version: 3.0.3
169
+ rubygems_version: 3.2.33
156
170
  signing_key:
157
171
  specification_version: 4
158
172
  summary: Parallels provider for Vagrant.