vagrant-vmware-desktop 3.0.0 → 3.0.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: bdcfbbb304726e177ac071a8842c567ca35ebac76acb944b8b787b4a3c8b95d6
4
- data.tar.gz: b871eaf2ccfdf8fb33384feb5c050e8b4e45daf61557158af7c23f7b57b9bf80
3
+ metadata.gz: b510c2fb41294efb8735cd97794a2076b57136b18882ea9c82e529886febdece
4
+ data.tar.gz: 56f7fb51de33325f5fa7bca40b2fc0807e62aec3812dbda556ec9f726874915e
5
5
  SHA512:
6
- metadata.gz: 6efa97edc063503dfa6d858160a23d57e0ff73f66cf4f09b9bc16027b9f2fc1000c41536ab9dd16c24e69b417cc9d17c1fec26d6dec6e3ecb37e94af701c64c7
7
- data.tar.gz: ae05d94217266dedfb30bdbc392c05ec67a97f1604c17c51810b2cc8df1ae71af1b2e39246b9dcb41373826147b4ef2b286d8d28c4ad00d111ab7ecff588e6b8
6
+ metadata.gz: a3665a4e29273abad6a60a5bacf80925d5a6ec8d655622105207f6be96a8d1dee0880991a911a8036a3053ad03375cc655301e85bbba638e9287a705d7b3de38
7
+ data.tar.gz: 07b2c44807eb5fb4cc2ce6fbf5020d0a0b6581bae1394e1245dbee5029af21c1c112b9a73584585aba4f5e9db90fd744afc8c1ce52b1461deb8cc84e677676cf
@@ -237,6 +237,13 @@ module HashiCorp
237
237
  h_port = fwd[:port]
238
238
  f_proto = fwd[:protocol].downcase.to_sym
239
239
  result[g_ip] ||= {:tcp => {}, :udp => {}}
240
+ if f_proto != :tcp && f_proto != :udp
241
+ raise Errors::PortForwardInvalidProtocol,
242
+ guest_ip: g_ip,
243
+ guest_port: g_port,
244
+ host_port: h_port,
245
+ protocol: f_proto
246
+ end
240
247
  result[g_ip][f_proto][g_port] = h_port
241
248
  end
242
249
  if ip
@@ -398,7 +405,11 @@ module HashiCorp
398
405
  # This deletes the VM.
399
406
  def delete
400
407
  @logger.info("Deleting VM: #{@vm_dir}")
401
- @vm_dir.rmtree
408
+ begin
409
+ @vm_dir.rmtree
410
+ rescue Errno::ENOTEMPTY
411
+ FileUtils.rm_rf(@vm_dir.to_s)
412
+ end
402
413
  end
403
414
 
404
415
  # This discards the suspended state of the machine.
@@ -835,12 +846,28 @@ module HashiCorp
835
846
 
836
847
  def snapshot_tree
837
848
  snapshots = []
849
+ snap_level = 0
838
850
  vmrun("listSnapshots", host_vmx_path, "showTree").stdout.split("\n").each do |line|
839
851
  if !line.include?("Total snapshot")
840
852
  # if the line starts with white space then it is a child
841
853
  # of the previous line
842
854
  if line.start_with?(/\s/)
843
- name = "#{snapshots.last}/#{line.gsub(/\s/, "")}"
855
+ current_level = line.count("\t")
856
+ if current_level > snap_level
857
+ name = "#{snapshots.last}/#{line.gsub(/\s/, "")}"
858
+ elsif current_level == snap_level
859
+ path = snapshots.last.split("/")
860
+ path.pop
861
+ path << line.gsub(/\s/, "")
862
+ name = path.join("/")
863
+ else
864
+ path = snapshots.last.split("/")
865
+ diff = snap_level - current_level
866
+ (0..diff).to_a.each { |i| path.pop }
867
+ path << line.gsub(/\s/, "")
868
+ name = path.join("/")
869
+ end
870
+ snap_level = current_level
844
871
  snapshots << name
845
872
  else
846
873
  snapshots << line
@@ -206,6 +206,10 @@ module HashiCorp
206
206
  error_key(:package_not_supported)
207
207
  end
208
208
 
209
+ class PortForwardInvalidProtocol < Base
210
+ error_key(:port_forward_invalid_protocol)
211
+ end
212
+
209
213
  class RoutingTableError < Base; end
210
214
 
211
215
  class RoutingTableCommandNotFound < RoutingTableError
@@ -54,7 +54,7 @@ module HashiCorp
54
54
  machine.ui.info I18n.t("hashicorp.vagrant_vmware_desktop.sharing_folders")
55
55
  machine.provider.driver.enable_shared_folders
56
56
  shared_folders.each do |id, data|
57
- id = id.gsub('/', machine.provider_config.shared_folder_special_char)
57
+ id = id.gsub(%r{[:\\/]}, machine.provider_config.shared_folder_special_char)
58
58
  path = data[:hostpath]
59
59
  guestpath = data[:guestpath]
60
60
 
data/locales/en.yml CHANGED
@@ -383,6 +383,20 @@ en:
383
383
  The "package" command is not supported with VMware. We recommend
384
384
  taking a look at Packer (www.packer.io) as an option for creating
385
385
  VMware images.
386
+ port_forward_invalid_protocol: |-
387
+ An invalid protocol type has been provided for a port forward
388
+ configuration. Vagrant supports port forwarding protocols values:
389
+
390
+ * udp
391
+ * tcp
392
+
393
+ Please update your port forward configuration and run the command
394
+ again. Below is the invalid port forward entry:
395
+
396
+ Guest IP: %{guest_ip}
397
+ Guest Port: %{guest_port}
398
+ Host Port: %{host_port}
399
+ Protocol: %{protocol}
386
400
  routing_table_command_not_found: |-
387
401
  The external program used to read TCP/IP routing tables in order
388
402
  to protect you against creating network collisions could not be
@@ -627,8 +641,7 @@ en:
627
641
  Device: %{device}
628
642
  MAC: %{mac}
629
643
  Reason: %{message}
630
- disks:
644
+ disks:
631
645
  cap:
632
646
  disks:
633
647
  floppy_not_supported: "Floppy disk configuration not yet supported. Skipping disk '%{name}'..."
634
-
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-vmware-desktop
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0
4
+ version: 3.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vagrant Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-06-09 00:00:00.000000000 Z
11
+ date: 2021-09-28 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Enables Vagrant to power VMware Workstation/Fusion machines.
14
14
  email: vagrant@hashicorp.com