vagrant-lxd 0.3.1 → 0.3.2

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: 654ad77a94d17f40d4f528b4e3b3c9240e6da694
4
- data.tar.gz: f61890ef2aaa6f42d2df0c50c17d8d3e4aa6a976
3
+ metadata.gz: 1f0c237e8739d6719e33f8029c849927f5650a47
4
+ data.tar.gz: 3eb61ce7502ba73752e2e6eb5c86eba965dc5b42
5
5
  SHA512:
6
- metadata.gz: 88d1f8cf94ebbdc2f06746ea8125339cad299de715b757fa8204ebebe1f72606d2e7ad9860f24a5e12f96a2a97a43696c77fa1594e0f05ec7804f746b0e784d7
7
- data.tar.gz: 53ffb9cb0d78df23a42d2f5a10915f7a919609dc75ec39569b69b71f62f05e69739a5abca8049ee9ebe101f4612edc58e85a40494f57dfa0eb43fb1427f903bb
6
+ metadata.gz: 6a5a7434615e6a4b6928f3601c2277987ac0e24516b18da7102723059929908b72c30695f21cb4e411877a920bb929cca70744178f5cae0921081dec9689cc49
7
+ data.tar.gz: 8ebaad06c6a85d84c5da97d44196558f651a321acc26e049642785a757c0d3f66599d009a82b89ee2aaddbb11752034a45e72f07185d0ffa5d5ec286f397494c
@@ -1,8 +1,8 @@
1
1
  GIT
2
2
  remote: https://github.com/mitchellh/vagrant.git
3
- revision: 45766ad00e5567fe6706a84fe07ba922b442dc34
3
+ revision: 7927c39da90dae3f5be79e36ad9df3b4ad834ac1
4
4
  specs:
5
- vagrant (2.2.2.dev)
5
+ vagrant (2.2.4.dev)
6
6
  bcrypt_pbkdf (~> 1.0.0)
7
7
  childprocess (~> 0.6.0)
8
8
  ed25519 (~> 1.2.4)
@@ -13,12 +13,12 @@ GIT
13
13
  log4r (~> 1.1.9, < 1.1.11)
14
14
  net-scp (~> 1.2.0)
15
15
  net-sftp (~> 2.1)
16
- net-ssh (~> 5.0.0)
16
+ net-ssh (~> 5.1.0)
17
17
  rb-kqueue (~> 0.2.0)
18
18
  rest-client (>= 1.6.0, < 3.0)
19
19
  ruby_dep (<= 1.3.1)
20
20
  rubyzip (~> 1.2.2)
21
- vagrant_cloud (~> 2.0.0)
21
+ vagrant_cloud (~> 2.0.2)
22
22
  wdm (~> 0.1.0)
23
23
  winrm (~> 2.1)
24
24
  winrm-elevated (~> 1.1)
@@ -27,13 +27,13 @@ GIT
27
27
  PATH
28
28
  remote: .
29
29
  specs:
30
- vagrant-lxd (0.3.1)
30
+ vagrant-lxd (0.3.2)
31
31
  hyperkit (~> 1.2.0)
32
32
 
33
33
  GEM
34
34
  remote: https://rubygems.org/
35
35
  specs:
36
- activesupport (5.2.1)
36
+ activesupport (5.2.2)
37
37
  concurrent-ruby (~> 1.0, >= 1.0.2)
38
38
  i18n (>= 0.7, < 2)
39
39
  minitest (~> 5.1)
@@ -44,16 +44,16 @@ GEM
44
44
  builder (3.2.3)
45
45
  childprocess (0.6.3)
46
46
  ffi (~> 1.0, >= 1.0.11)
47
- concurrent-ruby (1.1.3)
47
+ concurrent-ruby (1.1.4)
48
48
  diff-lcs (1.3)
49
49
  domain_name (0.5.20180417)
50
50
  unf (>= 0.0.5, < 1.0.0)
51
51
  ed25519 (1.2.4)
52
52
  erubis (2.7.0)
53
53
  fakefs (0.18.0)
54
- faraday (0.15.3)
54
+ faraday (0.15.4)
55
55
  multipart-post (>= 1.2, < 3)
56
- ffi (1.9.25)
56
+ ffi (1.10.0)
57
57
  gssapi (1.2.0)
58
58
  ffi (>= 1.0.1)
59
59
  gyoku (1.3.1)
@@ -86,14 +86,14 @@ GEM
86
86
  net-ssh (>= 2.6.5)
87
87
  net-sftp (2.1.2)
88
88
  net-ssh (>= 2.6.5)
89
- net-ssh (5.0.2)
89
+ net-ssh (5.1.0)
90
90
  netrc (0.11.0)
91
91
  nori (2.6.0)
92
92
  public_suffix (3.0.3)
93
- rake (12.3.1)
93
+ rake (12.3.2)
94
94
  rb-fsevent (0.10.3)
95
- rb-inotify (0.9.10)
96
- ffi (>= 0.5.0, < 2)
95
+ rb-inotify (0.10.0)
96
+ ffi (~> 1.0)
97
97
  rb-kqueue (0.2.5)
98
98
  ffi (>= 0.5.0)
99
99
  rest-client (2.0.2)
@@ -128,10 +128,10 @@ GEM
128
128
  unf (0.1.4)
129
129
  unf_ext
130
130
  unf_ext (0.0.7.5)
131
- vagrant_cloud (2.0.1)
131
+ vagrant_cloud (2.0.2)
132
132
  rest-client (~> 2.0.2)
133
133
  wdm (0.1.1)
134
- winrm (2.3.0)
134
+ winrm (2.3.1)
135
135
  builder (>= 2.1.2)
136
136
  erubis (~> 2.7)
137
137
  gssapi (~> 1.2)
@@ -140,10 +140,10 @@ GEM
140
140
  logging (>= 1.6.1, < 3.0)
141
141
  nori (~> 2.0)
142
142
  rubyntlm (~> 0.6.0, >= 0.6.1)
143
- winrm-elevated (1.1.0)
143
+ winrm-elevated (1.1.1)
144
144
  winrm (~> 2.0)
145
145
  winrm-fs (~> 1.0)
146
- winrm-fs (1.3.1)
146
+ winrm-fs (1.3.2)
147
147
  erubis (~> 2.7)
148
148
  logging (>= 1.6.1, < 3.0)
149
149
  rubyzip (~> 1.1)
@@ -162,4 +162,4 @@ DEPENDENCIES
162
162
  vagrant-lxd!
163
163
 
164
164
  BUNDLED WITH
165
- 1.16.4
165
+ 2.0.1
@@ -22,6 +22,7 @@ require 'hyperkit'
22
22
  require 'securerandom'
23
23
  require 'tempfile'
24
24
  require 'timeout'
25
+ require 'monitor'
25
26
  require 'vagrant/machine_state'
26
27
  require 'vagrant-lxd/config'
27
28
 
@@ -29,6 +30,8 @@ module VagrantLXD
29
30
  class Driver
30
31
  include Vagrant::Util
31
32
 
33
+ extend MonitorMixin
34
+
32
35
  USER_AGENT = "#{Version::DESCRIPTION} #{Version::VERSION} (#{Hyperkit::Default.user_agent})"
33
36
 
34
37
  IMAGE_PROPERTIES = { description: "#{Version::DESCRIPTION} #{Version::VERSION}" }
@@ -57,6 +60,10 @@ module VagrantLXD
57
60
  error_key 'lxd_container_configuration_failure'
58
61
  end
59
62
 
63
+ class ContainerDeletionFailure < Vagrant::Errors::VagrantError
64
+ error_key 'lxd_container_deletion_failure'
65
+ end
66
+
60
67
  class ImageCreationFailure < ContainerCreationFailure
61
68
  error_key 'lxd_image_creation_failure'
62
69
  end
@@ -224,19 +231,21 @@ module VagrantLXD
224
231
  def create
225
232
  if in_state? NOT_CREATED
226
233
  machine_id = generate_machine_id
227
- file, fingerprint = prepare_image_file
228
-
229
- begin
230
- image = @lxd.image(fingerprint)
231
- @logger.debug 'Using image: ' << image.inspect
232
- rescue Hyperkit::NotFound
233
- image = @lxd.create_image_from_file(file)
234
- @logger.debug 'Created image: ' << image.inspect
234
+ file, fingerprint = Driver.synchronize { prepare_image_file }
235
+
236
+ Driver.synchronize do
235
237
  begin
236
- @lxd.update_image(fingerprint, properties: IMAGE_PROPERTIES)
237
- @lxd.create_image_alias(fingerprint, machine_id, IMAGE_PROPERTIES)
238
- rescue Hyperkit::Error
239
- @logger.error 'Failed to set description for image: ' << e.reason
238
+ image = @lxd.image(fingerprint)
239
+ @logger.debug 'Using image: ' << image.inspect
240
+ rescue Hyperkit::NotFound
241
+ image = @lxd.create_image_from_file(file)
242
+ @logger.debug 'Created image: ' << image.inspect
243
+ begin
244
+ @lxd.update_image(fingerprint, properties: IMAGE_PROPERTIES)
245
+ @lxd.create_image_alias(fingerprint, machine_id, IMAGE_PROPERTIES)
246
+ rescue Hyperkit::Error
247
+ @logger.error 'Failed to set description for image: ' << e.reason
248
+ end
240
249
  end
241
250
  end
242
251
 
@@ -333,6 +342,15 @@ module VagrantLXD
333
342
  @lxd.delete_container(machine_id)
334
343
  rescue Hyperkit::NotFound
335
344
  @logger.warn "Container '#{machine_id}' not found, unable to destroy"
345
+ rescue Hyperkit::Error => e
346
+ @machine.ui.error 'Failed to delete container'
347
+ @logger.warn "Could not delete container '#{machine_id}': " << e.reason
348
+ fail ContainerDeletionFailure, machine_name: @machine.name, reason:
349
+ if e.reason =~ /(Error cleaning up [^:]+:) (.+)/m
350
+ "#{$1}\n#{$2}"
351
+ else
352
+ e.reason
353
+ end
336
354
  end
337
355
 
338
356
  def delete_image
@@ -476,7 +494,7 @@ module VagrantLXD
476
494
  rescue Exception => e
477
495
  @machine.ui.error 'Failed to create LXD image for container'
478
496
  @logger.error 'Error preparing LXD image: ' << e.message << "\n" << e.backtrace.join("\n")
479
- fail ImageCreationFailure, machine_name: @machine.name, error_message: e.message
497
+ fail ImageCreationFailure, machine_name: @machine.name, reason: e.message
480
498
  ensure
481
499
  FileUtils.rm_rf(tmpdir)
482
500
  end
@@ -24,7 +24,7 @@ module VagrantLXD
24
24
  name Version::NAME
25
25
  description Version::DESCRIPTION
26
26
 
27
- provider(:lxd, box_format: 'lxc', priority: 1) do
27
+ provider(:lxd, box_format: 'lxc', priority: 1, parallel: true) do
28
28
  require_relative 'provider'
29
29
  Provider
30
30
  end
@@ -20,7 +20,7 @@
20
20
  module VagrantLXD
21
21
  module Version
22
22
  NAME = 'vagrant-lxd'
23
- VERSION = '0.3.1'
23
+ VERSION = '0.3.2'
24
24
  DESCRIPTION = 'Vagrant LXD provider'
25
25
  end
26
26
  end
@@ -92,23 +92,28 @@ en:
92
92
  lxd_container_creation_failure: |-
93
93
  The provider was unable to create a container for the '%{machine_name}' VM.
94
94
 
95
- %{reason}.
95
+ The underlying error message was: %{reason}
96
96
 
97
97
  The LXD logs may contain more information about the cause of this failure.
98
98
 
99
99
  lxd_container_configuration_failure: |-
100
100
  The provider was unable to configure the container for the '%{machine_name}' VM.
101
101
 
102
- %{reason}.
102
+ The underlying error message was: %{reason}
103
+
104
+ The LXD logs may contain more information about the cause of this failure.
105
+
106
+ lxd_container_deletion_failure: |-
107
+ The provider was unable to delete the container for the '%{machine_name}' VM.
108
+
109
+ The underlying error message was: %{reason}
103
110
 
104
111
  The LXD logs may contain more information about the cause of this failure.
105
112
 
106
113
  lxd_image_creation_failure: |-
107
114
  The provider was unable to create an LXD image for the '%{machine_name}' VM.
108
115
 
109
- The underlying error message was:
110
-
111
- %{error_message}
116
+ The underlying error message was: %{reason}
112
117
 
113
118
  This may be a bug in the LXD provider. If you think this is the case,
114
119
  please submit an issue at:
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-lxd
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Evan Hanson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-12-13 00:00:00.000000000 Z
11
+ date: 2019-02-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: hyperkit