vagrant-parallels 1.6.1 → 1.6.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: 8c838025184a0d6acdfbb7c6434427e3730fe16f
4
- data.tar.gz: 88541ff940262fefdf1602ab2753ad73c5c8ce8e
3
+ metadata.gz: 7d0df49aa2a8f022bfe2918179f34f185e991566
4
+ data.tar.gz: 7e31ce9a5505febbd9d277dd60b50ebbf65cfd46
5
5
  SHA512:
6
- metadata.gz: bd23145472fdfb85da1abbea1d89fdf3d673ad4f74853bdfe9afe52c59a62a89245102ad6b806dd123ef266f293ed3afac4f739985ef0489081890f461223854
7
- data.tar.gz: 272b8cbf4d71909b58f3bce0f33b6a3b3f77f07da3a3c5e355eea2244bd1028ca42310bf7c9db55f3d0491c14875d7517e59f347d6ac997bebe11d7ebdf36e21
6
+ metadata.gz: 2f1178440b0b9a8f81eefe23a6ba557dcc0f74de988716bb35b659746aa7524c84f8f26e497714b10362f2656bed6aedfea4c553d32e86bed1763d3d907252da
7
+ data.tar.gz: 5ff89e1b90270540a21cf0baedab86b11eaac25951e39f96b9a11e4e97fb8a4905d0296009f589eb54de7ac14ad792db2333dcb2ed137a8c1f41a00f36599fd1
@@ -1,3 +1,10 @@
1
+ ## 1.6.2 (March 23, 2016)
2
+ BUG FIXES:
3
+ - Fix unsupported action error for `vagrant snapshot` commands [[GH-254](https://github.com/Parallels/vagrant-parallels/pull/254)]
4
+
5
+ IMPROVEMENTS:
6
+ - action/destroy: Destroy suspended VMs without resuming
7
+
1
8
  ## 1.6.1 (January 13, 2016)
2
9
 
3
10
  BUG FIXES:
data/Gemfile CHANGED
@@ -9,6 +9,6 @@ group :development do
9
9
  # We depend on Vagrant for development, but we don't add it as a
10
10
  # gem dependency because we expect to be installed within the
11
11
  # Vagrant environment itself using `vagrant plugin`.
12
- gem 'vagrant', git: 'git://github.com/mitchellh/vagrant.git'
12
+ gem 'vagrant', git: 'git://github.com/mitchellh/vagrant.git', tag: 'v1.8.1'
13
13
  gem 'vagrant-spec', git: 'git://github.com/mitchellh/vagrant-spec.git'
14
14
  end
data/README.md CHANGED
@@ -49,7 +49,7 @@ Having problems while using the provider? Ask your question on the official foru
49
49
  ["Parallels Provider for Vagrant" forum branch](http://forum.parallels.com/forumdisplay.php?737-Parallels-Provider-for-Vagrant)
50
50
 
51
51
  If you get an error while using the Parallels provider or discover a bug,
52
- please report it on the [IssueTracker](https://github.com/Parallels/vagrant-parallels).
52
+ please report it on the [Issue Tracker](https://github.com/Parallels/vagrant-parallels/issues).
53
53
 
54
54
  ## License and Authors
55
55
 
@@ -51,8 +51,14 @@ module VagrantPlugins
51
51
  next
52
52
  end
53
53
 
54
- b2.use EnvSet, :force_halt => true
55
- b2.use action_halt
54
+ # Do not resume && halt the suspended VM, just delete it
55
+ b2.use Call, IsState, :suspended do |env3, b3|
56
+ if !env3[:result]
57
+ b3.use EnvSet, :force_halt => true
58
+ b3.use action_halt
59
+ end
60
+ end
61
+
56
62
  b2.use Destroy
57
63
  b2.use DestroyUnusedNetworkInterfaces
58
64
  b2.use ProvisionerCleanup
@@ -173,6 +179,50 @@ module VagrantPlugins
173
179
  end
174
180
  end
175
181
 
182
+ def self.action_snapshot_delete
183
+ Vagrant::Action::Builder.new.tap do |b|
184
+ b.use Call, IsState, :not_created do |env1, b1|
185
+ if env1[:result]
186
+ b1.use Message, I18n.t('vagrant.commands.common.vm_not_created')
187
+ else
188
+ b1.use SnapshotDelete
189
+ end
190
+ end
191
+ end
192
+ end
193
+
194
+ # This is the action that is primarily responsible for saving a snapshot
195
+ def self.action_snapshot_restore
196
+ Vagrant::Action::Builder.new.tap do |b|
197
+ b.use Call, IsState, :not_created do |env1, b1|
198
+ if env1[:result]
199
+ b1.use Message, I18n.t('vagrant.commands.common.vm_not_created')
200
+ next
201
+ end
202
+
203
+ b1.use SnapshotRestore
204
+ b1.use Call, IsEnvSet, :snapshot_delete do |env2, b2|
205
+ if env2[:result]
206
+ b2.use action_snapshot_delete
207
+ end
208
+ end
209
+ end
210
+ end
211
+ end
212
+
213
+ # This is the action that is primarily responsible for saving a snapshot
214
+ def self.action_snapshot_save
215
+ Vagrant::Action::Builder.new.tap do |b|
216
+ b.use Call, IsState, :not_created do |env1, b1|
217
+ if env1[:result]
218
+ b1.use Message, I18n.t('vagrant.commands.common.vm_not_created')
219
+ else
220
+ b1.use SnapshotSave
221
+ end
222
+ end
223
+ end
224
+ end
225
+
176
226
  # This is the action that will exec into an SSH shell.
177
227
  def self.action_ssh
178
228
  Vagrant::Action::Builder.new.tap do |b|
@@ -359,6 +409,9 @@ module VagrantPlugins
359
409
  autoload :SaneDefaults, File.expand_path('../action/sane_defaults',__FILE__)
360
410
  autoload :SetupPackageFiles, File.expand_path('../action/setup_package_files', __FILE__)
361
411
  autoload :SetName, File.expand_path('../action/set_name', __FILE__)
412
+ autoload :SnapshotDelete, File.expand_path('../action/snapshot_delete', __FILE__)
413
+ autoload :SnapshotRestore, File.expand_path('../action/snapshot_restore', __FILE__)
414
+ autoload :SnapshotSave, File.expand_path('../action/snapshot_save', __FILE__)
362
415
  autoload :Suspend, File.expand_path('../action/suspend', __FILE__)
363
416
  end
364
417
  end
@@ -1,5 +1,5 @@
1
1
  module VagrantPlugins
2
2
  module Parallels
3
- VERSION = '1.6.1'
3
+ VERSION = '1.6.2'
4
4
  end
5
5
  end
@@ -11,6 +11,7 @@ namespace :acceptance do
11
11
  linked_clone
12
12
  network/forwarded_port
13
13
  network/private_network
14
+ snapshot
14
15
  synced_folder
15
16
  synced_folder/nfs
16
17
  synced_folder/rsync
@@ -0,0 +1,63 @@
1
+ shared_examples 'provider/snapshot' do |provider, options|
2
+ if !options[:box]
3
+ raise ArgumentError,
4
+ "box option must be specified for provider: #{provider}"
5
+ end
6
+
7
+ include_context 'acceptance'
8
+
9
+ before do
10
+ assert_execute('vagrant', 'box', 'add', 'box', options[:box])
11
+ assert_execute('vagrant', 'init', 'box')
12
+ assert_execute('vagrant', 'up', "--provider=#{provider}")
13
+ end
14
+
15
+ after do
16
+ assert_execute('vagrant', 'destroy', '--force')
17
+ end
18
+
19
+ it 'can save, list and delete machine snapshots' do
20
+ status('Test: two snapshots could be created')
21
+ assert_execute('vagrant', 'snapshot', 'save', 'foo')
22
+ assert_execute('vagrant', 'snapshot', 'save', 'bar')
23
+
24
+ status('Test: snapshots show up in list')
25
+ result = execute('vagrant', 'snapshot', 'list')
26
+ expect(result).to exit_with(0)
27
+ expect(result.stdout).to match(/^foo$/)
28
+ expect(result.stdout).to match(/^bar$/)
29
+
30
+ status('Test: snapshots could be restored')
31
+ assert_execute('vagrant', 'snapshot', 'restore', 'foo')
32
+ assert_execute('vagrant', 'snapshot', 'restore', 'bar')
33
+
34
+ status('Test: snapshots could be deleted')
35
+ assert_execute('vagrant', 'snapshot', 'delete', 'foo')
36
+ assert_execute('vagrant', 'snapshot', 'delete', 'bar')
37
+
38
+ result = execute('vagrant', 'snapshot', 'list')
39
+ expect(result).to exit_with(0)
40
+ expect(result.stdout).not_to match(/^foo$/)
41
+ expect(result.stdout).not_to match(/^bar$/)
42
+ end
43
+
44
+ it 'can push and pop snapshots' do
45
+ status('Test: snapshot push')
46
+ result = execute('vagrant', 'snapshot', 'push')
47
+ expect(result).to exit_with(0)
48
+ expect(result.stdout).to match(/push_/)
49
+
50
+ status('Test: pushed snapshot shows up in list')
51
+ result = execute('vagrant', 'snapshot', 'list')
52
+ expect(result).to exit_with(0)
53
+ expect(result.stdout).to match(/^push_/)
54
+
55
+ status('Test: snapshot pop')
56
+ assert_execute('vagrant', 'snapshot', 'pop')
57
+
58
+ status('Test: popped snapshot has been deleted')
59
+ result = execute('vagrant', 'snapshot', 'list')
60
+ expect(result).to exit_with(0)
61
+ expect(result.stdout).not_to match(/push_/)
62
+ end
63
+ 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: 1.6.1
4
+ version: 1.6.2
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: 2016-01-13 00:00:00.000000000 Z
12
+ date: 2016-03-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -142,6 +142,7 @@ files:
142
142
  - tasks/test.rake
143
143
  - test/acceptance/base.rb
144
144
  - test/acceptance/provider/linked_clone_spec.rb
145
+ - test/acceptance/provider/snapshot_spec.rb
145
146
  - test/acceptance/shared/context_parallels.rb
146
147
  - test/acceptance/skeletons/linked_clone/Vagrantfile
147
148
  - test/unit/base.rb