vagrant-parallels 0.1.3 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +6 -5
- data/Rakefile +3 -0
- data/config/i18n-tasks.yml.erb +13 -0
- data/lib/vagrant-parallels/action/import.rb +1 -1
- data/lib/vagrant-parallels/action/{is_saved.rb → is_suspended.rb} +1 -1
- data/lib/vagrant-parallels/action/message_already_running.rb +1 -1
- data/lib/vagrant-parallels/action/resume.rb +1 -4
- data/lib/vagrant-parallels/action.rb +7 -15
- data/lib/vagrant-parallels/config.rb +3 -4
- data/lib/vagrant-parallels/plugin.rb +1 -1
- data/lib/vagrant-parallels/provider.rb +1 -1
- data/lib/vagrant-parallels/version.rb +1 -1
- data/locales/en.yml +12 -1056
- data/test/unit/locales/locales_test.rb +14 -0
- data/vagrant-parallels.gemspec +1 -0
- metadata +22 -5
- data/lib/vagrant-parallels/action/is_paused.rb +0 -21
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Vagrant Parallels Provider
|
2
|
-
[![Build Status](https://travis-ci.org/
|
3
|
-
[![Code Climate](https://codeclimate.com/github/
|
2
|
+
[![Build Status](https://travis-ci.org/Parallels/vagrant-parallels.png?branch=master)](https://travis-ci.org/Parallels/vagrant-parallels)
|
3
|
+
[![Code Climate](https://codeclimate.com/github/Parallels/vagrant-parallels.png)](https://codeclimate.com/github/Parallels/vagrant-parallels)
|
4
4
|
|
5
5
|
This is a [Vagrant](http://www.vagrantup.com) 1.3+ plugin that adds a [Parallels Desktop](http://www.parallels.com/products/desktop/)
|
6
6
|
provider to Vagrant, allowing Vagrant to control and provision machines using Parallels Desktop instead of the default Virtualbox.
|
@@ -59,9 +59,10 @@ That directory also contains instructions on how to build a box.
|
|
59
59
|
Download the box file, then use vagrant to add the downloaded box using this command. Remember to use `bundle exec` before `vagrant` command if you are in development mode
|
60
60
|
|
61
61
|
```
|
62
|
-
$ wget https://s3-eu-west-1.amazonaws.com/vagrant-parallels/devbox.box
|
62
|
+
$ wget https://s3-eu-west-1.amazonaws.com/vagrant-parallels/devbox-201312.box
|
63
63
|
$ vagrant box add devbox devbox.box --provider=parallels
|
64
64
|
```
|
65
|
+
***updated box file to fix mac address regeneration issue #42, devbox is Ubuntu 12.04.3 LTS (GNU/Linux 3.2.0-57-generic x86_64***
|
65
66
|
|
66
67
|
The box format is basically just the required `metadata.json` file
|
67
68
|
along with a `Vagrantfile` that does default settings for the
|
@@ -129,7 +130,7 @@ Provider allows to define directives for `prlctl set` through `Vagrantfile` in s
|
|
129
130
|
To work on the `vagrant-parallels` plugin, clone this repository out
|
130
131
|
|
131
132
|
```
|
132
|
-
$ git clone https://github.com/
|
133
|
+
$ git clone https://github.com/Parallels/vagrant-parallels
|
133
134
|
$ cd vagrant-parallels
|
134
135
|
```
|
135
136
|
|
@@ -166,7 +167,7 @@ After testing you can also build a gem-package by yourself and then install it a
|
|
166
167
|
(if you have 'vagrant-parallels' plugin already installed, delete it first)
|
167
168
|
|
168
169
|
```
|
169
|
-
$ git clone https://github.com/
|
170
|
+
$ git clone https://github.com/Parallels/vagrant-parallels
|
170
171
|
$ cd vagrant-parallels
|
171
172
|
$ rake build
|
172
173
|
...
|
data/Rakefile
CHANGED
@@ -0,0 +1,13 @@
|
|
1
|
+
search:
|
2
|
+
paths:
|
3
|
+
- "lib/"
|
4
|
+
data:
|
5
|
+
adapter: yaml
|
6
|
+
read:
|
7
|
+
- "locales/%{locale}.yml"
|
8
|
+
- "<%= %x[bundle show vagrant].chomp %>/templates/locales/%{locale}.yml"
|
9
|
+
write:
|
10
|
+
- "locales/%{locale}.yml"
|
11
|
+
ignore_unused:
|
12
|
+
- "vagrant_parallels.errors.*"
|
13
|
+
- "vagrant.*"
|
@@ -11,7 +11,7 @@ module VagrantPlugins
|
|
11
11
|
|
12
12
|
#TODO: Clean up registered VM on interupt
|
13
13
|
def call(env)
|
14
|
-
env[:ui].info I18n.t("
|
14
|
+
env[:ui].info I18n.t("vagrant.actions.vm.import.importing",
|
15
15
|
:name => env[:machine].box.name)
|
16
16
|
|
17
17
|
vm_name = generate_name(env[:root_path])
|
@@ -10,11 +10,8 @@ module VagrantPlugins
|
|
10
10
|
current_state = env[:machine].provider.state.id
|
11
11
|
|
12
12
|
if current_state == :suspended
|
13
|
-
env[:ui].info I18n.t("vagrant.actions.vm.resume.unpausing")
|
14
|
-
env[:machine].provider.driver.resume
|
15
|
-
elsif current_state == :stopped
|
16
13
|
env[:ui].info I18n.t("vagrant.actions.vm.resume.resuming")
|
17
|
-
env[:
|
14
|
+
env[:machine].provider.driver.resume
|
18
15
|
end
|
19
16
|
|
20
17
|
@app.call(env)
|
@@ -73,7 +73,7 @@ module VagrantPlugins
|
|
73
73
|
if env[:result]
|
74
74
|
b2.use CheckAccessible
|
75
75
|
|
76
|
-
b2.use Call,
|
76
|
+
b2.use Call, IsSuspended do |env2, b3|
|
77
77
|
next if !env2[:result]
|
78
78
|
b3.use Resume
|
79
79
|
end
|
@@ -208,23 +208,16 @@ module VagrantPlugins
|
|
208
208
|
next
|
209
209
|
end
|
210
210
|
|
211
|
-
b2.use Call,
|
211
|
+
b2.use Call, IsSuspended do |env2, b3|
|
212
212
|
if env2[:result]
|
213
|
-
# The VM is
|
213
|
+
# The VM is suspended, so just resume it
|
214
214
|
b3.use action_resume
|
215
215
|
next
|
216
216
|
end
|
217
217
|
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
next
|
222
|
-
end
|
223
|
-
|
224
|
-
# The VM is not saved, so we must have to boot it up
|
225
|
-
# like normal. Boot!
|
226
|
-
b4.use action_boot
|
227
|
-
end
|
218
|
+
# The VM is not saved, so we must have to boot it up
|
219
|
+
# like normal. Boot!
|
220
|
+
b3.use action_boot
|
228
221
|
end
|
229
222
|
end
|
230
223
|
end
|
@@ -283,9 +276,8 @@ module VagrantPlugins
|
|
283
276
|
autoload :Export, File.expand_path("../action/export", __FILE__)
|
284
277
|
autoload :ForcedHalt, File.expand_path("../action/forced_halt", __FILE__)
|
285
278
|
autoload :Import, File.expand_path("../action/import", __FILE__)
|
286
|
-
autoload :
|
279
|
+
autoload :IsSuspended, File.expand_path("../action/is_suspended", __FILE__)
|
287
280
|
autoload :IsRunning, File.expand_path("../action/is_running", __FILE__)
|
288
|
-
autoload :IsSaved, File.expand_path("../action/is_saved", __FILE__)
|
289
281
|
autoload :MatchMACAddress, File.expand_path("../action/match_mac_address", __FILE__)
|
290
282
|
autoload :MessageAlreadyRunning, File.expand_path("../action/message_already_running", __FILE__)
|
291
283
|
autoload :MessageNotCreated, File.expand_path("../action/message_not_created", __FILE__)
|
@@ -38,10 +38,9 @@ module VagrantPlugins
|
|
38
38
|
valid_events = ["pre-import", "pre-boot", "post-boot"]
|
39
39
|
@customizations.each do |event, _|
|
40
40
|
if !valid_events.include?(event)
|
41
|
-
errors << I18n.t(
|
42
|
-
|
43
|
-
|
44
|
-
valid_events: valid_events.join(", "))
|
41
|
+
errors << I18n.t("vagrant_parallels.config.invalid_event",
|
42
|
+
event: event.to_s,
|
43
|
+
valid_events: valid_events.join(", "))
|
45
44
|
end
|
46
45
|
end
|
47
46
|
@customizations.each do |event, command|
|
@@ -48,7 +48,7 @@ module VagrantPlugins
|
|
48
48
|
|
49
49
|
# Translate into short/long descriptions
|
50
50
|
short = state_id.to_s.gsub("_", " ")
|
51
|
-
long = I18n.t("
|
51
|
+
long = I18n.t("vagrant_parallels.commands.status.#{state_id}")
|
52
52
|
|
53
53
|
# Return the state
|
54
54
|
Vagrant::MachineState.new(state_id, short, long)
|