vagrant-parallels 1.5.0 → 1.5.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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f733216d1fb00b3fb1b57306e793948845e77c85
|
4
|
+
data.tar.gz: 00a71db6979da474580c398aa1ca4c07c18175c5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7ee1b240e58e12d5f289ce83a6c0e5f3b008281e204450d7bda03078dcbca59a2e76b5de0632daab49cd03e4e2b911ccccb59413251173e3522656f9b19b9637
|
7
|
+
data.tar.gz: 01f7add1fbe46e5e3732fd3e15a2574ce762712c10bd3d1f6f989ccc12de1f2becea53a93089af3126e0443accc997e9b56f45bc19f440730d3fac738bac945e
|
@@ -454,8 +454,8 @@ module VagrantPlugins
|
|
454
454
|
# @return [<String => String>]
|
455
455
|
def read_vms
|
456
456
|
args = %w(list --all --no-header --json -o name,uuid)
|
457
|
-
vms_arr = json
|
458
|
-
templates_arr = json
|
457
|
+
vms_arr = json { execute_prlctl(*args) }
|
458
|
+
templates_arr = json { execute_prlctl(*args, '--template') }
|
459
459
|
|
460
460
|
vms = vms_arr | templates_arr
|
461
461
|
Hash[vms.map { |i| [i.fetch('name'), i.fetch('uuid')] }]
|
@@ -466,8 +466,8 @@ module VagrantPlugins
|
|
466
466
|
# @return [Array <String => String>]
|
467
467
|
def read_vms_info
|
468
468
|
args = %w(list --all --info --no-header --json)
|
469
|
-
vms_arr = json
|
470
|
-
templates_arr = json
|
469
|
+
vms_arr = json { execute_prlctl(*args) }
|
470
|
+
templates_arr = json { execute_prlctl(*args, '--template') }
|
471
471
|
|
472
472
|
vms_arr | templates_arr
|
473
473
|
end
|
@@ -670,14 +670,26 @@ module VagrantPlugins
|
|
670
670
|
end
|
671
671
|
|
672
672
|
# Parses given block (JSON string) to object
|
673
|
-
def json
|
673
|
+
def json
|
674
674
|
data = yield
|
675
|
+
raise_error = false
|
676
|
+
|
675
677
|
begin
|
676
678
|
JSON.parse(data)
|
677
|
-
rescue JSON::
|
678
|
-
#
|
679
|
+
rescue JSON::JSONError
|
680
|
+
# We retried already, raise the issue and be done
|
681
|
+
if raise_error
|
682
|
+
raise VagrantPlugins::Parallels::Errors::JSONParseError, data: data
|
683
|
+
end
|
684
|
+
|
685
|
+
# Remove garbage before/after json string[GH-204]
|
679
686
|
data = data[/(\{.*\}|\[.*\])/m]
|
680
|
-
|
687
|
+
|
688
|
+
# Remove all control characters unsupported by JSON [GH-219]
|
689
|
+
data.tr!("\u0000-\u001f", '')
|
690
|
+
|
691
|
+
raise_error = true
|
692
|
+
retry
|
681
693
|
end
|
682
694
|
end
|
683
695
|
|
@@ -11,6 +11,10 @@ module VagrantPlugins
|
|
11
11
|
error_key(:dhcp_leases_file_not_accessible)
|
12
12
|
end
|
13
13
|
|
14
|
+
class JSONParseError < VagrantParallelsError
|
15
|
+
error_key(:json_parse_error)
|
16
|
+
end
|
17
|
+
|
14
18
|
class LinuxMountFailed < VagrantParallelsError
|
15
19
|
error_key(:linux_mount_failed)
|
16
20
|
end
|
data/locales/en.yml
CHANGED
@@ -20,6 +20,12 @@ en:
|
|
20
20
|
|
21
21
|
Stderr: %{stderr}
|
22
22
|
|
23
|
+
json_parse_error: |-
|
24
|
+
Failed to parse the JSON string! Please report this as a bug of Parallels
|
25
|
+
provider: https://github.com/Parallels/vagrant-parallels/issues
|
26
|
+
JSON string is shown below:
|
27
|
+
|
28
|
+
%{data}
|
23
29
|
linux_mount_failed: |-
|
24
30
|
Failed to mount folders in Linux guest. This is usually because
|
25
31
|
the "prl_fs" file system is not available. Please verify that
|
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: 1.5.
|
4
|
+
version: 1.5.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: 2015-
|
12
|
+
date: 2015-10-25 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|