vagrant-skytap 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/vagrant-skytap/action/add_vm_to_environment.rb +4 -4
- data/lib/vagrant-skytap/action/compose_environment.rb +131 -0
- data/lib/vagrant-skytap/action/create_environment.rb +3 -1
- data/lib/vagrant-skytap/action/initialize_api_client.rb +6 -5
- data/lib/vagrant-skytap/action/set_up_vm.rb +3 -1
- data/lib/vagrant-skytap/action/store_extra_data.rb +4 -2
- data/lib/vagrant-skytap/action.rb +4 -17
- data/lib/vagrant-skytap/api/environment.rb +53 -25
- data/lib/vagrant-skytap/api/vm.rb +9 -3
- data/lib/vagrant-skytap/command/up.rb +46 -30
- data/lib/vagrant-skytap/errors.rb +4 -0
- data/lib/vagrant-skytap/version.rb +1 -1
- data/locales/en.yml +5 -1
- data/spec/unit/actions/compose_environment_spec.rb +101 -0
- data/spec/unit/environment_spec.rb +26 -45
- data/spec/unit/support/shared/skytap_context.rb +5 -0
- data/vagrant-skytap.gemspec +3 -3
- metadata +9 -311
- data/.byebug_history +0 -256
- data/.project +0 -11
- data/_patches-20160112/0 +0 -388
- data/_patches-20160112/1 +0 -82
- data/_patches-20160112/2 +0 -239
- data/_patches-20160112/COMPLETED-ABOVE-THIS-LINE +0 -4
- data/_patches-20160112/COMPLETED-BELOW-THIS-LINE +0 -4
- data/_patches-20160112/CR-ABOVE-THIS-LINE +0 -4
- data/_patches-20160112/CR-BELOW-THIS-LINE +0 -4
- data/_patches-20160112/WIP-ABOVE-THIS-LINE +0 -4
- data/_patches-20160112/WIP-BELOW-THIS-LINE +0 -4
- data/_patches-20160112/acceptance-test-runner +0 -29
- data/_patches-20160112/ansible-1 +0 -92
- data/_patches-20160112/cache-api-client-in-up +0 -40
- data/_patches-20160112/dead-code-in-actions +0 -44
- data/_patches-20160112/debug-changes +0 -42
- data/_patches-20160112/demo-rails-app +0 -1276
- data/_patches-20160112/eng-10166-halt-spec +0 -40
- data/_patches-20160112/eng-10256 +0 -527
- data/_patches-20160112/eng-10256-2 +0 -162
- data/_patches-20160112/eng-10256-ubuntu-testing +0 -88
- data/_patches-20160112/eng-10269-test-stuff +0 -87
- data/_patches-20160112/eng-10269-wtf +0 -119
- data/_patches-20160112/eng-10369 +0 -143
- data/_patches-20160112/eng-10369-tmp +0 -60
- data/_patches-20160112/eng-10919 +0 -56
- data/_patches-20160112/eng-11177-fix-actions-requires +0 -44
- data/_patches-20160112/eng-11442 +0 -4
- data/_patches-20160112/eng-11616 +0 -403
- data/_patches-20160112/eng-11616-2 +0 -67
- data/_patches-20160112/eng-11616-actual +0 -184
- data/_patches-20160112/eng-11625a +0 -4
- data/_patches-20160112/eng-11711 +0 -85
- data/_patches-20160112/eng-12232-command-spec +0 -236
- data/_patches-20160112/eng-12235 +0 -83
- data/_patches-20160112/eng-12235-override-refactor +0 -140
- data/_patches-20160112/eng-12240 +0 -103
- data/_patches-20160112/eng-12249 +0 -40
- data/_patches-20160112/eng-12301 +0 -50
- data/_patches-20160112/eng-12843 +0 -95
- data/_patches-20160112/env-source +0 -112
- data/_patches-20160112/frickin-vagrant-spec +0 -163
- data/_patches-20160112/gem-pre-version +0 -14
- data/_patches-20160112/gems-old +0 -9
- data/_patches-20160112/googles-specs +0 -713
- data/_patches-20160112/local-configs-ignore +0 -61
- data/_patches-20160112/misc +0 -79
- data/_patches-20160112/network-unreachable +0 -31
- data/_patches-20160112/new-boxfile +0 -288
- data/_patches-20160112/parallelization-maybe +0 -198
- data/_patches-20160112/read-state +0 -23
- data/_patches-20160112/refactor-to-use-public_address-cap +0 -25
- data/_patches-20160112/series +0 -60
- data/_patches-20160112/status +0 -12
- data/_patches-20160112/test-move-env-data +0 -231
- data/_patches-20160112/test-vagrantfile-vm1 +0 -167
- data/_patches-20160112/the_version_in_0.1.13.pre1 +0 -598
- data/_patches-20160112/vagrant-spec-mock-api +0 -137
- data/_patches-20160112/vagrant-vmware-plugin +0 -233
- data/_patches-20160112/vagrantfile +0 -403
- data/_patches-20160112/vagrantfile-for-acceptance-tests +0 -29
- data/_patches-20160112/vagrantfile-for-nick +0 -95
- data/_patches-20160112/vagrantfiles-to-forget-what-they-are-for +0 -134
- data/_patches-20160112/vm-vanished +0 -42
- data/_patches-20160112a/01 +0 -148
- data/_patches-20160112a/2 +0 -239
- data/_patches-20160112a/COMPLETED-ABOVE-THIS-LINE +0 -4
- data/_patches-20160112a/COMPLETED-BELOW-THIS-LINE +0 -4
- data/_patches-20160112a/CR-ABOVE-THIS-LINE +0 -4
- data/_patches-20160112a/CR-BELOW-THIS-LINE +0 -4
- data/_patches-20160112a/WIP-ABOVE-THIS-LINE +0 -4
- data/_patches-20160112a/WIP-BELOW-THIS-LINE +0 -4
- data/_patches-20160112a/acceptance-test-runner +0 -29
- data/_patches-20160112a/ansible-1 +0 -92
- data/_patches-20160112a/cache-api-client-in-up +0 -40
- data/_patches-20160112a/dead-code-in-actions +0 -44
- data/_patches-20160112a/debug-changes +0 -42
- data/_patches-20160112a/demo-rails-app +0 -1276
- data/_patches-20160112a/eng-10166-halt-spec +0 -40
- data/_patches-20160112a/eng-10256-ubuntu-testing +0 -88
- data/_patches-20160112a/eng-10269-test-stuff +0 -87
- data/_patches-20160112a/eng-10269-wtf +0 -119
- data/_patches-20160112a/eng-10369 +0 -143
- data/_patches-20160112a/eng-10369-tmp +0 -60
- data/_patches-20160112a/eng-10919 +0 -56
- data/_patches-20160112a/eng-11177-fix-actions-requires +0 -44
- data/_patches-20160112a/eng-11442 +0 -4
- data/_patches-20160112a/eng-11616 +0 -403
- data/_patches-20160112a/eng-11616-2 +0 -67
- data/_patches-20160112a/eng-11616-actual +0 -184
- data/_patches-20160112a/eng-11625a +0 -4
- data/_patches-20160112a/eng-11711 +0 -85
- data/_patches-20160112a/eng-12232-command-spec +0 -236
- data/_patches-20160112a/eng-12235 +0 -83
- data/_patches-20160112a/eng-12235-override-refactor +0 -140
- data/_patches-20160112a/eng-12240 +0 -103
- data/_patches-20160112a/eng-12249 +0 -40
- data/_patches-20160112a/eng-12301 +0 -50
- data/_patches-20160112a/eng-12843 +0 -95
- data/_patches-20160112a/env-source +0 -112
- data/_patches-20160112a/frickin-vagrant-spec +0 -163
- data/_patches-20160112a/gem-pre-version +0 -14
- data/_patches-20160112a/gems-old +0 -9
- data/_patches-20160112a/googles-specs +0 -713
- data/_patches-20160112a/local-configs-ignore +0 -61
- data/_patches-20160112a/misc +0 -79
- data/_patches-20160112a/network-unreachable +0 -31
- data/_patches-20160112a/new-boxfile +0 -288
- data/_patches-20160112a/parallelization-maybe +0 -198
- data/_patches-20160112a/read-state +0 -23
- data/_patches-20160112a/refactor-to-use-public_address-cap +0 -25
- data/_patches-20160112a/series +0 -58
- data/_patches-20160112a/status +0 -14
- data/_patches-20160112a/test-move-env-data +0 -231
- data/_patches-20160112a/test-vagrantfile-vm1 +0 -167
- data/_patches-20160112a/the_version_in_0.1.13.pre1 +0 -612
- data/_patches-20160112a/then-copy-the-newer-files +0 -632
- data/_patches-20160112a/vagrant-spec-mock-api +0 -137
- data/_patches-20160112a/vagrant-vmware-plugin +0 -233
- data/_patches-20160112a/vagrantfile +0 -403
- data/_patches-20160112a/vagrantfile-for-acceptance-tests +0 -29
- data/_patches-20160112a/vagrantfile-for-nick +0 -95
- data/_patches-20160112a/vagrantfiles-to-forget-what-they-are-for +0 -134
- data/_patches-20160112a/vm-vanished +0 -42
- data/_patches-20160113/COMPLETED-ABOVE-THIS-LINE +0 -4
- data/_patches-20160113/COMPLETED-BELOW-THIS-LINE +0 -4
- data/_patches-20160113/CR-ABOVE-THIS-LINE +0 -4
- data/_patches-20160113/CR-BELOW-THIS-LINE +0 -4
- data/_patches-20160113/WIP-ABOVE-THIS-LINE +0 -4
- data/_patches-20160113/WIP-BELOW-THIS-LINE +0 -4
- data/_patches-20160113/acceptance-test-runner +0 -29
- data/_patches-20160113/ansible-1 +0 -92
- data/_patches-20160113/cache-api-client-in-up +0 -40
- data/_patches-20160113/dead-code-in-actions +0 -44
- data/_patches-20160113/debug-changes +0 -55
- data/_patches-20160113/demo-rails-app +0 -1276
- data/_patches-20160113/eng-10166-halt-spec +0 -40
- data/_patches-20160113/eng-10256 +0 -543
- data/_patches-20160113/eng-10256-ubuntu-testing +0 -88
- data/_patches-20160113/eng-10269-test-stuff +0 -87
- data/_patches-20160113/eng-10269-wtf +0 -119
- data/_patches-20160113/eng-10369 +0 -143
- data/_patches-20160113/eng-10369-tmp +0 -60
- data/_patches-20160113/eng-10919 +0 -56
- data/_patches-20160113/eng-11177-fix-actions-requires +0 -44
- data/_patches-20160113/eng-11442 +0 -4
- data/_patches-20160113/eng-11616 +0 -403
- data/_patches-20160113/eng-11616-2 +0 -67
- data/_patches-20160113/eng-11616-actual +0 -184
- data/_patches-20160113/eng-11625a +0 -4
- data/_patches-20160113/eng-11711 +0 -85
- data/_patches-20160113/eng-12232-command-spec +0 -236
- data/_patches-20160113/eng-12235 +0 -83
- data/_patches-20160113/eng-12235-override-refactor +0 -140
- data/_patches-20160113/eng-12240 +0 -103
- data/_patches-20160113/eng-12249 +0 -40
- data/_patches-20160113/eng-12301 +0 -50
- data/_patches-20160113/eng-12720 +0 -47
- data/_patches-20160113/eng-12843 +0 -95
- data/_patches-20160113/env-source +0 -112
- data/_patches-20160113/frickin-vagrant-spec +0 -163
- data/_patches-20160113/gem-pre-version +0 -14
- data/_patches-20160113/gems-old +0 -9
- data/_patches-20160113/googles-specs +0 -713
- data/_patches-20160113/local-configs-ignore +0 -61
- data/_patches-20160113/misc +0 -79
- data/_patches-20160113/network-unreachable +0 -31
- data/_patches-20160113/new-boxfile +0 -288
- data/_patches-20160113/parallelization-maybe +0 -198
- data/_patches-20160113/read-state +0 -23
- data/_patches-20160113/refactor-to-use-public_address-cap +0 -25
- data/_patches-20160113/series +0 -56
- data/_patches-20160113/status +0 -14
- data/_patches-20160113/test-move-env-data +0 -231
- data/_patches-20160113/test-vagrantfile-vm1 +0 -167
- data/_patches-20160113/vagrant-spec-mock-api +0 -137
- data/_patches-20160113/vagrant-vmware-plugin +0 -233
- data/_patches-20160113/vagrantfile +0 -403
- data/_patches-20160113/vagrantfile-for-acceptance-tests +0 -29
- data/_patches-20160113/vagrantfile-for-nick +0 -95
- data/_patches-20160113/vagrantfiles-to-forget-what-they-are-for +0 -134
- data/_patches-20160113/vm-vanished +0 -42
- data/_patches-20160118/COMPLETED-ABOVE-THIS-LINE +0 -4
- data/_patches-20160118/COMPLETED-BELOW-THIS-LINE +0 -4
- data/_patches-20160118/CR-ABOVE-THIS-LINE +0 -4
- data/_patches-20160118/CR-BELOW-THIS-LINE +0 -4
- data/_patches-20160118/WIP-ABOVE-THIS-LINE +0 -4
- data/_patches-20160118/WIP-BELOW-THIS-LINE +0 -4
- data/_patches-20160118/acceptance-test-runner +0 -29
- data/_patches-20160118/ansible-1 +0 -92
- data/_patches-20160118/cache-api-client-in-up +0 -40
- data/_patches-20160118/dead-code-in-actions +0 -44
- data/_patches-20160118/debug-changes +0 -55
- data/_patches-20160118/demo-rails-app +0 -1276
- data/_patches-20160118/eng-10166-halt-spec +0 -40
- data/_patches-20160118/eng-10256 +0 -554
- data/_patches-20160118/eng-10256-cr +0 -314
- data/_patches-20160118/eng-10256-ubuntu-testing +0 -88
- data/_patches-20160118/eng-10269-test-stuff +0 -87
- data/_patches-20160118/eng-10269-wtf +0 -119
- data/_patches-20160118/eng-10369 +0 -143
- data/_patches-20160118/eng-10369-tmp +0 -60
- data/_patches-20160118/eng-10919 +0 -56
- data/_patches-20160118/eng-11177-fix-actions-requires +0 -44
- data/_patches-20160118/eng-11442 +0 -4
- data/_patches-20160118/eng-11616 +0 -403
- data/_patches-20160118/eng-11616-2 +0 -67
- data/_patches-20160118/eng-11616-actual +0 -184
- data/_patches-20160118/eng-11625a +0 -4
- data/_patches-20160118/eng-11711 +0 -85
- data/_patches-20160118/eng-12232-command-spec +0 -236
- data/_patches-20160118/eng-12235 +0 -83
- data/_patches-20160118/eng-12235-override-refactor +0 -140
- data/_patches-20160118/eng-12240 +0 -103
- data/_patches-20160118/eng-12249 +0 -40
- data/_patches-20160118/eng-12301 +0 -50
- data/_patches-20160118/eng-12720 +0 -74
- data/_patches-20160118/eng-12843 +0 -95
- data/_patches-20160118/eng-13040 +0 -291
- data/_patches-20160118/env-source +0 -112
- data/_patches-20160118/frickin-vagrant-spec +0 -163
- data/_patches-20160118/gem-pre-version +0 -14
- data/_patches-20160118/gems-old +0 -9
- data/_patches-20160118/googles-specs +0 -713
- data/_patches-20160118/local-configs-ignore +0 -61
- data/_patches-20160118/misc +0 -79
- data/_patches-20160118/network-unreachable +0 -31
- data/_patches-20160118/new-boxfile +0 -288
- data/_patches-20160118/parallelization-maybe +0 -198
- data/_patches-20160118/port-forwarding-processes +0 -87
- data/_patches-20160118/read-state +0 -23
- data/_patches-20160118/refactor-to-use-public_address-cap +0 -25
- data/_patches-20160118/series +0 -59
- data/_patches-20160118/status +0 -13
- data/_patches-20160118/test-move-env-data +0 -231
- data/_patches-20160118/test-vagrantfile-vm1 +0 -167
- data/_patches-20160118/vagrant-spec-mock-api +0 -137
- data/_patches-20160118/vagrant-vmware-plugin +0 -233
- data/_patches-20160118/vagrantfile +0 -403
- data/_patches-20160118/vagrantfile-for-acceptance-tests +0 -29
- data/_patches-20160118/vagrantfile-for-nick +0 -95
- data/_patches-20160118/vagrantfiles-to-forget-what-they-are-for +0 -134
- data/_patches-20160118/vm-vanished +0 -42
- data/_patches-20160118a/COMPLETED-ABOVE-THIS-LINE +0 -4
- data/_patches-20160118a/COMPLETED-BELOW-THIS-LINE +0 -4
- data/_patches-20160118a/CR-ABOVE-THIS-LINE +0 -4
- data/_patches-20160118a/CR-BELOW-THIS-LINE +0 -4
- data/_patches-20160118a/WIP-ABOVE-THIS-LINE +0 -4
- data/_patches-20160118a/WIP-BELOW-THIS-LINE +0 -4
- data/_patches-20160118a/acceptance-test-runner +0 -29
- data/_patches-20160118a/ansible-1 +0 -92
- data/_patches-20160118a/bar +0 -189
- data/_patches-20160118a/cache-api-client-in-up +0 -40
- data/_patches-20160118a/dead-code-in-actions +0 -44
- data/_patches-20160118a/debug-changes +0 -55
- data/_patches-20160118a/demo-rails-app +0 -1276
- data/_patches-20160118a/eng-10166-halt-spec +0 -40
- data/_patches-20160118a/eng-10256 +0 -554
- data/_patches-20160118a/eng-10256-cr +0 -314
- data/_patches-20160118a/eng-10256-ubuntu-testing +0 -88
- data/_patches-20160118a/eng-10269-test-stuff +0 -87
- data/_patches-20160118a/eng-10269-wtf +0 -119
- data/_patches-20160118a/eng-10369 +0 -143
- data/_patches-20160118a/eng-10369-tmp +0 -60
- data/_patches-20160118a/eng-10919 +0 -56
- data/_patches-20160118a/eng-11177-fix-actions-requires +0 -44
- data/_patches-20160118a/eng-11442 +0 -4
- data/_patches-20160118a/eng-11616 +0 -403
- data/_patches-20160118a/eng-11616-2 +0 -67
- data/_patches-20160118a/eng-11616-actual +0 -184
- data/_patches-20160118a/eng-11625a +0 -4
- data/_patches-20160118a/eng-11711 +0 -85
- data/_patches-20160118a/eng-12232-command-spec +0 -236
- data/_patches-20160118a/eng-12235 +0 -83
- data/_patches-20160118a/eng-12235-override-refactor +0 -140
- data/_patches-20160118a/eng-12240 +0 -103
- data/_patches-20160118a/eng-12249 +0 -40
- data/_patches-20160118a/eng-12301 +0 -50
- data/_patches-20160118a/eng-12720 +0 -74
- data/_patches-20160118a/eng-12843 +0 -95
- data/_patches-20160118a/eng-13040 +0 -291
- data/_patches-20160118a/env-source +0 -112
- data/_patches-20160118a/foo +0 -169
- data/_patches-20160118a/frickin-vagrant-spec +0 -163
- data/_patches-20160118a/gem-pre-version +0 -14
- data/_patches-20160118a/gems-old +0 -9
- data/_patches-20160118a/googles-specs +0 -713
- data/_patches-20160118a/guestport-madness +0 -59
- data/_patches-20160118a/local-configs-ignore +0 -61
- data/_patches-20160118a/misc +0 -79
- data/_patches-20160118a/network-unreachable +0 -31
- data/_patches-20160118a/new-boxfile +0 -288
- data/_patches-20160118a/parallelization-maybe +0 -198
- data/_patches-20160118a/port-forwarding-processes +0 -87
- data/_patches-20160118a/read-state +0 -23
- data/_patches-20160118a/refactor-to-use-public_address-cap +0 -25
- data/_patches-20160118a/series +0 -62
- data/_patches-20160118a/status +0 -14
- data/_patches-20160118a/test-move-env-data +0 -231
- data/_patches-20160118a/test-vagrantfile-vm1 +0 -167
- data/_patches-20160118a/vagrant-spec-mock-api +0 -137
- data/_patches-20160118a/vagrant-vmware-plugin +0 -233
- data/_patches-20160118a/vagrantfile +0 -403
- data/_patches-20160118a/vagrantfile-for-acceptance-tests +0 -29
- data/_patches-20160118a/vagrantfile-for-nick +0 -95
- data/_patches-20160118a/vagrantfiles-to-forget-what-they-are-for +0 -134
- data/_patches-20160118a/vm-vanished +0 -42
data/_patches-20160118/eng-11616
DELETED
@@ -1,403 +0,0 @@
|
|
1
|
-
# HG changeset patch
|
2
|
-
# Parent c24fb4f0f929782eb6188401fe2bc1066e4dc9b6
|
3
|
-
# Parent c24fb4f0f929782eb6188401fe2bc1066e4dc9b6
|
4
|
-
ENG-11616 refactoring "up"
|
5
|
-
|
6
|
-
diff -r c24fb4f0f929 lib/vagrant-skytap/action.rb
|
7
|
-
--- a/lib/vagrant-skytap/action.rb Mon Nov 16 15:28:30 2015 -0800
|
8
|
-
+++ b/lib/vagrant-skytap/action.rb Tue Nov 17 12:09:41 2015 -0800
|
9
|
-
@@ -9,9 +9,7 @@
|
10
|
-
# This action is called to halt the remote machine.
|
11
|
-
def self.action_halt
|
12
|
-
Vagrant::Action::Builder.new.tap do |b|
|
13
|
-
- b.use ConfigValidate
|
14
|
-
- b.use InitializeAPIClient
|
15
|
-
- b.use FetchEnvironment
|
16
|
-
+ b.use action_initialize
|
17
|
-
b.use Call, ExistenceCheck do |env1, b1|
|
18
|
-
case result = env1[:result]
|
19
|
-
when :missing_environment, :missing_vm, :no_vms
|
20
|
-
@@ -26,9 +24,7 @@
|
21
|
-
# This action is called to suspend the remote machine.
|
22
|
-
def self.action_suspend
|
23
|
-
Vagrant::Action::Builder.new.tap do |b|
|
24
|
-
- b.use ConfigValidate
|
25
|
-
- b.use InitializeAPIClient
|
26
|
-
- b.use FetchEnvironment
|
27
|
-
+ b.use action_initialize
|
28
|
-
b.use Call, ExistenceCheck do |env1, b1|
|
29
|
-
case result = env1[:result]
|
30
|
-
when :missing_environment, :missing_vm, :no_vms
|
31
|
-
@@ -43,9 +39,7 @@
|
32
|
-
# This action is called to terminate the remote machine.
|
33
|
-
def self.action_destroy
|
34
|
-
Vagrant::Action::Builder.new.tap do |b|
|
35
|
-
- b.use ConfigValidate
|
36
|
-
- b.use InitializeAPIClient
|
37
|
-
- b.use FetchEnvironment
|
38
|
-
+ b.use action_initialize
|
39
|
-
b.use Call, ExistenceCheck do |env, b1|
|
40
|
-
case existence_state = env[:result]
|
41
|
-
when :missing_environment, :no_vms
|
42
|
-
@@ -79,9 +73,7 @@
|
43
|
-
# This action is called when `vagrant provision` is called.
|
44
|
-
def self.action_provision
|
45
|
-
Vagrant::Action::Builder.new.tap do |b|
|
46
|
-
- b.use ConfigValidate
|
47
|
-
- b.use InitializeAPIClient
|
48
|
-
- b.use FetchEnvironment
|
49
|
-
+ b.use action_initialize
|
50
|
-
b.use Call, ExistenceCheck do |env, b1|
|
51
|
-
case result = env[:result]
|
52
|
-
when :missing_environment, :missing_vm, :no_vms
|
53
|
-
@@ -115,9 +107,7 @@
|
54
|
-
# key.
|
55
|
-
def self.action_read_ssh_info
|
56
|
-
Vagrant::Action::Builder.new.tap do |b|
|
57
|
-
- b.use ConfigValidate
|
58
|
-
- b.use InitializeAPIClient
|
59
|
-
- b.use FetchEnvironment
|
60
|
-
+ b.use action_initialize
|
61
|
-
b.use ReadSSHInfo
|
62
|
-
end
|
63
|
-
end
|
64
|
-
@@ -127,9 +117,7 @@
|
65
|
-
# key.
|
66
|
-
def self.action_read_state
|
67
|
-
Vagrant::Action::Builder.new.tap do |b|
|
68
|
-
- b.use ConfigValidate
|
69
|
-
- b.use InitializeAPIClient
|
70
|
-
- b.use FetchEnvironment
|
71
|
-
+ b.use action_initialize
|
72
|
-
#TODO:NLA Can this whole action be removed?
|
73
|
-
b.use ReadState
|
74
|
-
end
|
75
|
-
@@ -138,9 +126,7 @@
|
76
|
-
# This action is called to SSH into the machine.
|
77
|
-
def self.action_ssh
|
78
|
-
Vagrant::Action::Builder.new.tap do |b|
|
79
|
-
- b.use ConfigValidate
|
80
|
-
- b.use InitializeAPIClient
|
81
|
-
- b.use FetchEnvironment
|
82
|
-
+ b.use action_initialize
|
83
|
-
b.use Call, ExistenceCheck do |env1, b1|
|
84
|
-
case result = env1[:result]
|
85
|
-
when :missing_environment, :missing_vm, :no_vms
|
86
|
-
@@ -154,9 +140,7 @@
|
87
|
-
|
88
|
-
def self.action_ssh_run
|
89
|
-
Vagrant::Action::Builder.new.tap do |b|
|
90
|
-
- b.use ConfigValidate
|
91
|
-
- b.use InitializeAPIClient
|
92
|
-
- b.use FetchEnvironment
|
93
|
-
+ b.use action_initialize
|
94
|
-
b.use Call, ExistenceCheck do |env1, b1|
|
95
|
-
case result = env1[:result]
|
96
|
-
when :missing_environment, :missing_vm, :no_vms
|
97
|
-
@@ -184,26 +168,37 @@
|
98
|
-
end
|
99
|
-
end
|
100
|
-
|
101
|
-
- # This action is called to bring the box up from nothing.
|
102
|
-
- def self.action_up
|
103
|
-
+ def self.action_create_vm
|
104
|
-
Vagrant::Action::Builder.new.tap do |b|
|
105
|
-
- b.use HandleBox
|
106
|
-
- b.use ConfigValidate
|
107
|
-
- b.use InitializeAPIClient
|
108
|
-
- b.use FetchEnvironment
|
109
|
-
b.use Call, ExistenceCheck do |env, b1|
|
110
|
-
case result = env[:result]
|
111
|
-
when :missing_environment
|
112
|
-
b1.use CreateEnvironment
|
113
|
-
- b1.use MessageEnvironmentUrl
|
114
|
-
when :no_vms, :missing_vm
|
115
|
-
b1.use AddVmToEnvironment
|
116
|
-
else
|
117
|
-
next
|
118
|
-
end
|
119
|
-
+
|
120
|
-
+ # FetchSourceVm
|
121
|
-
+ # FetchTargetEnvironment
|
122
|
-
+ # CheckSuitability
|
123
|
-
+ # if environment exists, checks region mismatch
|
124
|
-
+
|
125
|
-
b1.use StoreExtraData
|
126
|
-
- b1.use SetUpVm
|
127
|
-
+ b1.use SetRouting
|
128
|
-
+ b1.use SetCredentials
|
129
|
-
end
|
130
|
-
+ end
|
131
|
-
+ end
|
132
|
-
+
|
133
|
-
+ # This action is called to bring the box up from nothing.
|
134
|
-
+ def self.action_up
|
135
|
-
+ Vagrant::Action::Builder.new.tap do |b|
|
136
|
-
+ b.use HandleBox
|
137
|
-
+ b.use action_initialize
|
138
|
-
+ b.use action_create_vm
|
139
|
-
+
|
140
|
-
b.use Call, IsRunning do |env, b1|
|
141
|
-
if env[:result]
|
142
|
-
b1.use MessageAlreadyRunning
|
143
|
-
@@ -226,9 +221,7 @@
|
144
|
-
|
145
|
-
def self.action_reload
|
146
|
-
Vagrant::Action::Builder.new.tap do |b|
|
147
|
-
- b.use ConfigValidate
|
148
|
-
- b.use InitializeAPIClient
|
149
|
-
- b.use FetchEnvironment
|
150
|
-
+ b.use action_initialize
|
151
|
-
b.use Call, ExistenceCheck do |env, b2|
|
152
|
-
case env[:result]
|
153
|
-
when :missing_environment, :missing_vm, :no_vms
|
154
|
-
@@ -241,6 +234,17 @@
|
155
|
-
end
|
156
|
-
end
|
157
|
-
|
158
|
-
+ def self.action_initialize
|
159
|
-
+ Vagrant::Action::Builder.new.tap do |b|
|
160
|
-
+ b.use ConfigValidate
|
161
|
-
+ b.use InitializeAPIClient
|
162
|
-
+ b.use FetchEnvironment
|
163
|
-
+ b.use ReadState
|
164
|
-
+ # Can we make this Callable and do ExistenceCheck on the
|
165
|
-
+ # block? It's a logical unit almost everywhere.
|
166
|
-
+ end
|
167
|
-
+ end
|
168
|
-
+
|
169
|
-
# The autoload farm
|
170
|
-
action_root = Pathname.new(File.expand_path("../action", __FILE__))
|
171
|
-
autoload :StoreExtraData, action_root.join("store_extra_data")
|
172
|
-
@@ -265,8 +269,9 @@
|
173
|
-
autoload :ReadState, action_root.join("read_state")
|
174
|
-
autoload :RunEnvironment, action_root.join("run_environment")
|
175
|
-
autoload :RunVm, action_root.join("run_vm")
|
176
|
-
+ autoload :SetCredentials, action_root.join("set_credentials")
|
177
|
-
autoload :SetHostname, action_root.join("set_hostname")
|
178
|
-
- autoload :SetUpVm, action_root.join("set_up_vm")
|
179
|
-
+ autoload :SetRouting, action_root.join("set_routing")
|
180
|
-
autoload :StopVm, action_root.join("stop_vm")
|
181
|
-
autoload :SuspendVm, action_root.join("suspend_vm")
|
182
|
-
autoload :TimedProvision, action_root.join("timed_provision") # some plugins now expect this action to exist
|
183
|
-
diff -r c24fb4f0f929 lib/vagrant-skytap/action/create_environment.rb
|
184
|
-
--- a/lib/vagrant-skytap/action/create_environment.rb Mon Nov 16 15:28:30 2015 -0800
|
185
|
-
+++ b/lib/vagrant-skytap/action/create_environment.rb Tue Nov 17 12:09:41 2015 -0800
|
186
|
-
@@ -30,6 +30,7 @@
|
187
|
-
env[:environment] = environment
|
188
|
-
environment.properties.write('url' => environment.url)
|
189
|
-
env[:machine].id = environment.vms.first.id
|
190
|
-
+ env[:ui].info(I18n.t("vagrant_skytap.environment_url", url: environment.url))
|
191
|
-
environment.wait_until_ready
|
192
|
-
|
193
|
-
@app.call(env)
|
194
|
-
diff -r c24fb4f0f929 lib/vagrant-skytap/action/message_environment_url.rb
|
195
|
-
--- a/lib/vagrant-skytap/action/message_environment_url.rb Mon Nov 16 15:28:30 2015 -0800
|
196
|
-
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
|
197
|
-
@@ -1,16 +0,0 @@
|
198
|
-
-module VagrantPlugins
|
199
|
-
- module Skytap
|
200
|
-
- module Action
|
201
|
-
- class MessageEnvironmentUrl
|
202
|
-
- def initialize(app, env)
|
203
|
-
- @app = app
|
204
|
-
- end
|
205
|
-
-
|
206
|
-
- def call(env)
|
207
|
-
- env[:ui].info(I18n.t("vagrant_skytap.environment_url", url: env[:environment].url))
|
208
|
-
- @app.call(env)
|
209
|
-
- end
|
210
|
-
- end
|
211
|
-
- end
|
212
|
-
- end
|
213
|
-
-end
|
214
|
-
diff -r c24fb4f0f929 lib/vagrant-skytap/action/read_state.rb
|
215
|
-
--- a/lib/vagrant-skytap/action/read_state.rb Mon Nov 16 15:28:30 2015 -0800
|
216
|
-
+++ b/lib/vagrant-skytap/action/read_state.rb Tue Nov 17 12:09:41 2015 -0800
|
217
|
-
@@ -22,14 +22,10 @@
|
218
|
-
@app.call(env)
|
219
|
-
end
|
220
|
-
|
221
|
-
+ # Assumes FetchEnvironment was called to populate env[:environment].
|
222
|
-
def read_state(machine)
|
223
|
-
- if VmProperties.read(machine.data_dir)
|
224
|
-
- if environment = env[:environment]
|
225
|
-
- environment.reload
|
226
|
-
- elsif props = API::Environment.properties(env)
|
227
|
-
- @logger.info("env[:environment] was not set!")
|
228
|
-
- end
|
229
|
-
-
|
230
|
-
+ if environment = env[:environment]
|
231
|
-
+ environment.reload
|
232
|
-
if vm = environment.try(:current_vm)
|
233
|
-
return vm.runstate.to_sym
|
234
|
-
end
|
235
|
-
diff -r c24fb4f0f929 lib/vagrant-skytap/action/set_credentials.rb
|
236
|
-
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
|
237
|
-
+++ b/lib/vagrant-skytap/action/set_credentials.rb Tue Nov 17 12:09:41 2015 -0800
|
238
|
-
@@ -0,0 +1,20 @@
|
239
|
-
+require 'log4r'
|
240
|
-
+require 'vagrant-skytap/setup_helper'
|
241
|
-
+
|
242
|
-
+module VagrantPlugins
|
243
|
-
+ module Skytap
|
244
|
-
+ module Action
|
245
|
-
+ class SetCredentials
|
246
|
-
+ def initialize(app, env)
|
247
|
-
+ @app = app
|
248
|
-
+ @logger = Log4r::Logger.new("vagrant_skytap::action::set_credentials")
|
249
|
-
+ end
|
250
|
-
+
|
251
|
-
+ def call(env)
|
252
|
-
+ SetupHelper.new(env).set_credentials
|
253
|
-
+ @app.call(env)
|
254
|
-
+ end
|
255
|
-
+ end
|
256
|
-
+ end
|
257
|
-
+ end
|
258
|
-
+end
|
259
|
-
diff -r c24fb4f0f929 lib/vagrant-skytap/action/set_routing.rb
|
260
|
-
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
|
261
|
-
+++ b/lib/vagrant-skytap/action/set_routing.rb Tue Nov 17 12:09:41 2015 -0800
|
262
|
-
@@ -0,0 +1,20 @@
|
263
|
-
+require 'log4r'
|
264
|
-
+require 'vagrant-skytap/setup_helper'
|
265
|
-
+
|
266
|
-
+module VagrantPlugins
|
267
|
-
+ module Skytap
|
268
|
-
+ module Action
|
269
|
-
+ class SetRouting
|
270
|
-
+ def initialize(app, env)
|
271
|
-
+ @app = app
|
272
|
-
+ @logger = Log4r::Logger.new("vagrant_skytap::action::set_routing")
|
273
|
-
+ end
|
274
|
-
+
|
275
|
-
+ def call(env)
|
276
|
-
+ SetupHelper.new(env).set_routing
|
277
|
-
+ @app.call(env)
|
278
|
-
+ end
|
279
|
-
+ end
|
280
|
-
+ end
|
281
|
-
+ end
|
282
|
-
+end
|
283
|
-
diff -r c24fb4f0f929 lib/vagrant-skytap/action/set_up_vm.rb
|
284
|
-
--- a/lib/vagrant-skytap/action/set_up_vm.rb Mon Nov 16 15:28:30 2015 -0800
|
285
|
-
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
|
286
|
-
@@ -1,21 +0,0 @@
|
287
|
-
-require 'log4r'
|
288
|
-
-require 'json'
|
289
|
-
-require 'vagrant-skytap/setup_helper'
|
290
|
-
-
|
291
|
-
-module VagrantPlugins
|
292
|
-
- module Skytap
|
293
|
-
- module Action
|
294
|
-
- class SetUpVm
|
295
|
-
- def initialize(app, env)
|
296
|
-
- @app = app
|
297
|
-
- @logger = Log4r::Logger.new("vagrant_skytap::action::set_up_vm")
|
298
|
-
- end
|
299
|
-
-
|
300
|
-
- def call(env)
|
301
|
-
- SetupHelper.run!(env, env[:environment])
|
302
|
-
- @app.call(env)
|
303
|
-
- end
|
304
|
-
- end
|
305
|
-
- end
|
306
|
-
- end
|
307
|
-
-end
|
308
|
-
diff -r c24fb4f0f929 lib/vagrant-skytap/config.rb
|
309
|
-
--- a/lib/vagrant-skytap/config.rb Mon Nov 16 15:28:30 2015 -0800
|
310
|
-
+++ b/lib/vagrant-skytap/config.rb Tue Nov 17 12:09:41 2015 -0800
|
311
|
-
@@ -80,7 +80,9 @@
|
312
|
-
@api_token = ENV['VAGRANT_SKYTAP_API_TOKEN'] if @api_token == UNSET_VALUE
|
313
|
-
|
314
|
-
# Base URL for API calls.
|
315
|
-
- @base_url = "https://cloud.skytap.com/" if @base_url == UNSET_VALUE
|
316
|
-
+ if @base_url == UNSET_VALUE
|
317
|
-
+ @base_url = ENV['VAGRANT_SKYTAP_BASE_URL'].presence || "https://cloud.skytap.com/"
|
318
|
-
+ end
|
319
|
-
|
320
|
-
# Source VM url must be set.
|
321
|
-
@vm_url = nil if @vm_url == UNSET_VALUE
|
322
|
-
diff -r c24fb4f0f929 lib/vagrant-skytap/plugin.rb
|
323
|
-
--- a/lib/vagrant-skytap/plugin.rb Mon Nov 16 15:28:30 2015 -0800
|
324
|
-
+++ b/lib/vagrant-skytap/plugin.rb Tue Nov 17 12:09:41 2015 -0800
|
325
|
-
@@ -24,6 +24,7 @@
|
326
|
-
Config
|
327
|
-
end
|
328
|
-
|
329
|
-
+ #provider(:skytap, parallel: true) do
|
330
|
-
provider(:skytap, parallel: false) do
|
331
|
-
# Setup logging and i18n
|
332
|
-
setup_logging
|
333
|
-
@@ -34,6 +35,11 @@
|
334
|
-
Provider
|
335
|
-
end
|
336
|
-
|
337
|
-
+ command("up", primary: true) do
|
338
|
-
+ require_relative "command/up"
|
339
|
-
+ Command::Up
|
340
|
-
+ end
|
341
|
-
+
|
342
|
-
# This initializes the internationalization strings.
|
343
|
-
def self.setup_i18n
|
344
|
-
I18n.load_path << File.expand_path("locales/en.yml", Skytap.source_root)
|
345
|
-
diff -r c24fb4f0f929 lib/vagrant-skytap/setup_helper.rb
|
346
|
-
--- a/lib/vagrant-skytap/setup_helper.rb Mon Nov 16 15:28:30 2015 -0800
|
347
|
-
+++ b/lib/vagrant-skytap/setup_helper.rb Tue Nov 17 12:09:41 2015 -0800
|
348
|
-
@@ -10,14 +10,10 @@
|
349
|
-
attr_reader :env, :environment, :machine, :provider_config
|
350
|
-
attr_reader :username, :password, :host, :port
|
351
|
-
|
352
|
-
- def self.run!(env, environment)
|
353
|
-
- new(env, environment).run!
|
354
|
-
- end
|
355
|
-
-
|
356
|
-
- def initialize(env, environment)
|
357
|
-
+ def initialize(env)
|
358
|
-
@env = env
|
359
|
-
@logger = Log4r::Logger.new("vagrant_skytap::setup_helper")
|
360
|
-
- @environment = environment
|
361
|
-
+ @environment = env[:environment]
|
362
|
-
@machine = env[:machine]
|
363
|
-
@provider_config = env[:machine].provider_config
|
364
|
-
@username = @machine.config.ssh.username
|
365
|
-
@@ -30,12 +26,20 @@
|
366
|
-
environment.current_vm
|
367
|
-
end
|
368
|
-
|
369
|
-
- def run!
|
370
|
-
+ def set_routing
|
371
|
-
ask_routing
|
372
|
-
- ask_credentials
|
373
|
-
- write_properties
|
374
|
-
+ VmProperties.write(env[:machine].data_dir,
|
375
|
-
+ 'host' => host,
|
376
|
-
+ 'port' => port)
|
377
|
-
+
|
378
|
-
end
|
379
|
-
|
380
|
-
+ def set_credentials
|
381
|
-
+ ask_credentials
|
382
|
-
+ VmProperties.write(env[:machine].data_dir,
|
383
|
-
+ 'username' => username,
|
384
|
-
+ 'password' => password)
|
385
|
-
+ end
|
386
|
-
|
387
|
-
private
|
388
|
-
|
389
|
-
@@ -189,14 +193,6 @@
|
390
|
-
|
391
|
-
env[:ui].ask(prompt, {prefix: false}.merge(options))
|
392
|
-
end
|
393
|
-
-
|
394
|
-
- def write_properties
|
395
|
-
- VmProperties.write(env[:machine].data_dir,
|
396
|
-
- 'username' => username,
|
397
|
-
- 'password' => password,
|
398
|
-
- 'host' => host,
|
399
|
-
- 'port' => port)
|
400
|
-
- end
|
401
|
-
end
|
402
|
-
end
|
403
|
-
end
|
@@ -1,67 +0,0 @@
|
|
1
|
-
# HG changeset patch
|
2
|
-
# Parent 1e2e97f6f44b0e6b126aca3ed3b0d5110ee694e9
|
3
|
-
[mq]: eng-11616-2
|
4
|
-
|
5
|
-
diff -r 1e2e97f6f44b lib/vagrant-skytap/command/up.rb
|
6
|
-
--- a/lib/vagrant-skytap/command/up.rb Mon Nov 16 18:02:44 2015 -0800
|
7
|
-
+++ b/lib/vagrant-skytap/command/up.rb Tue Nov 17 12:08:41 2015 -0800
|
8
|
-
@@ -53,31 +53,43 @@
|
9
|
-
|
10
|
-
# Build up the batch job of what we'll do
|
11
|
-
machines = []
|
12
|
-
- @env.batch(options[:parallel]) do |batch|
|
13
|
-
- names = argv
|
14
|
-
- if names.empty?
|
15
|
-
- autostart = false
|
16
|
-
- @env.vagrantfile.machine_names_and_options.each do |n, o|
|
17
|
-
- autostart = true if o.key?(:autostart)
|
18
|
-
- o[:autostart] = true if !o.key?(:autostart)
|
19
|
-
- names << n.to_s if o[:autostart]
|
20
|
-
+ names = argv
|
21
|
-
+ if names.empty?
|
22
|
-
+ autostart = false
|
23
|
-
+ @env.vagrantfile.machine_names_and_options.each do |n, o|
|
24
|
-
+ autostart = true if o.key?(:autostart)
|
25
|
-
+ o[:autostart] = true if !o.key?(:autostart)
|
26
|
-
+ names << n.to_s if o[:autostart]
|
27
|
-
+ end
|
28
|
-
+
|
29
|
-
+ # If we have an autostart key but no names, it means that
|
30
|
-
+ # all machines are autostart: false and we don't start anything.
|
31
|
-
+ names = nil if autostart && names.empty?
|
32
|
-
+ end
|
33
|
-
+
|
34
|
-
+ if names
|
35
|
-
+ if options[:parallel]
|
36
|
-
+ @env.batch do |batch|
|
37
|
-
+ with_target_vms(names, provider: options[:provider]) do |machine|
|
38
|
-
+ # batch.action(machine, :pre_up, options)
|
39
|
-
+ end
|
40
|
-
end
|
41
|
-
|
42
|
-
- # If we have an autostart key but no names, it means that
|
43
|
-
- # all machines are autostart: false and we don't start anything.
|
44
|
-
- names = nil if autostart && names.empty?
|
45
|
-
- end
|
46
|
-
+ # up
|
47
|
-
|
48
|
-
- if names
|
49
|
-
+ @env.batch do |batch|
|
50
|
-
+ with_target_vms(names, provider: options[:provider]) do |machine|
|
51
|
-
+ # batch.action(machine, :post_up, options)
|
52
|
-
+ end
|
53
|
-
+ end
|
54
|
-
+ else
|
55
|
-
with_target_vms(names, provider: options[:provider]) do |machine|
|
56
|
-
@env.ui.info(I18n.t(
|
57
|
-
"vagrant.commands.up.upping",
|
58
|
-
name: machine.name,
|
59
|
-
provider: machine.provider_name))
|
60
|
-
-
|
61
|
-
machines << machine
|
62
|
-
-
|
63
|
-
- batch.action(machine, :up, options)
|
64
|
-
+ machine.action(:up)
|
65
|
-
end
|
66
|
-
end
|
67
|
-
end
|
@@ -1,184 +0,0 @@
|
|
1
|
-
# HG changeset patch
|
2
|
-
# Parent bc32846888f966e4da20f51175d02f6aea678dd4
|
3
|
-
ENG-11616 actually refactoring up
|
4
|
-
|
5
|
-
diff -r bc32846888f9 lib/vagrant-skytap/action.rb
|
6
|
-
--- a/lib/vagrant-skytap/action.rb Mon Nov 16 15:47:02 2015 -0800
|
7
|
-
+++ b/lib/vagrant-skytap/action.rb Mon Nov 16 18:02:32 2015 -0800
|
8
|
-
@@ -192,33 +192,56 @@
|
9
|
-
end
|
10
|
-
end
|
11
|
-
|
12
|
-
- # This action is called to bring the box up from nothing.
|
13
|
-
+ # This action is called to actually bring the box up.
|
14
|
-
def self.action_up
|
15
|
-
Vagrant::Action::Builder.new.tap do |b|
|
16
|
-
- b.use HandleBox
|
17
|
-
- b.use action_initialize
|
18
|
-
- b.use action_create_vm
|
19
|
-
-
|
20
|
-
+ b.use action_pre_up
|
21
|
-
b.use Call, IsRunning do |env, b1|
|
22
|
-
if env[:result]
|
23
|
-
b1.use MessageAlreadyRunning
|
24
|
-
next
|
25
|
-
end
|
26
|
-
+ b1.use action_actual_up
|
27
|
-
+ b1.use action_post_up
|
28
|
-
+ end
|
29
|
-
+ end
|
30
|
-
+ end
|
31
|
-
|
32
|
-
- b1.use Call, IsStopped do |env2, b2|
|
33
|
-
- if env2[:result]
|
34
|
-
- b2.use UpdateHardware
|
35
|
-
- b2.use SetHostname
|
36
|
-
- b2.use action_prepare_boot
|
37
|
-
- end
|
38
|
-
-
|
39
|
-
- b2.use RunVm
|
40
|
-
- b2.use WaitForCommunicator
|
41
|
-
+ # This action is called to prepare to bring the box up from nothing.
|
42
|
-
+ def self.action_pre_up
|
43
|
-
+ Vagrant::Action::Builder.new.tap do |b|
|
44
|
-
+ b.use HandleBox
|
45
|
-
+ b.use action_initialize
|
46
|
-
+ b.use action_create_vm
|
47
|
-
+ b.use Call, IsStopped do |env2, b2|
|
48
|
-
+ if env2[:result]
|
49
|
-
+ b2.use UpdateHardware
|
50
|
-
+ b2.use SetHostname
|
51
|
-
+ b2.use action_prepare_boot
|
52
|
-
end
|
53
|
-
end
|
54
|
-
end
|
55
|
-
end
|
56
|
-
|
57
|
-
+ # This action is called to actually bring the box up.
|
58
|
-
+ def self.action_actual_up
|
59
|
-
+ Vagrant::Action::Builder.new.tap do |b|
|
60
|
-
+ b.use Call, IsRunning do |env, b1|
|
61
|
-
+ if env[:result]
|
62
|
-
+ b1.use MessageAlreadyRunning
|
63
|
-
+ next
|
64
|
-
+ end
|
65
|
-
+ b2.use RunVm
|
66
|
-
+ end
|
67
|
-
+ end
|
68
|
-
+ end
|
69
|
-
+
|
70
|
-
+ def self.action_post_up
|
71
|
-
+ Vagrant::Action::Builder.new.tap do |b|
|
72
|
-
+ b.use WaitForCommunicator
|
73
|
-
+ end
|
74
|
-
+ end
|
75
|
-
+
|
76
|
-
def self.action_reload
|
77
|
-
Vagrant::Action::Builder.new.tap do |b|
|
78
|
-
b.use action_initialize
|
79
|
-
diff -r bc32846888f9 lib/vagrant-skytap/action/run_environment.rb
|
80
|
-
--- a/lib/vagrant-skytap/action/run_environment.rb Mon Nov 16 15:47:02 2015 -0800
|
81
|
-
+++ b/lib/vagrant-skytap/action/run_environment.rb Mon Nov 16 18:02:32 2015 -0800
|
82
|
-
@@ -17,7 +17,7 @@
|
83
|
-
|
84
|
-
def call(env)
|
85
|
-
env[:ui].info(I18n.t("vagrant_skytap.launching_instance"))
|
86
|
-
- environment.run!
|
87
|
-
+ environment.run_multiple!
|
88
|
-
|
89
|
-
@app.call(env)
|
90
|
-
end
|
91
|
-
diff -r bc32846888f9 lib/vagrant-skytap/api/environment.rb
|
92
|
-
--- a/lib/vagrant-skytap/api/environment.rb Mon Nov 16 15:47:02 2015 -0800
|
93
|
-
+++ b/lib/vagrant-skytap/api/environment.rb Mon Nov 16 18:02:32 2015 -0800
|
94
|
-
@@ -48,6 +48,10 @@
|
95
|
-
@provider_config = env[:machine].provider_config
|
96
|
-
end
|
97
|
-
|
98
|
-
+ def run_multiple!(vm_ids = [])
|
99
|
-
+ run!
|
100
|
-
+ end
|
101
|
-
+
|
102
|
-
def vms
|
103
|
-
@vms ||= (get_api_attribute('vms') || []).collect do |vm_attrs|
|
104
|
-
Vm.new(vm_attrs, self, env)
|
105
|
-
diff -r bc32846888f9 lib/vagrant-skytap/command/up.rb
|
106
|
-
--- a/lib/vagrant-skytap/command/up.rb Mon Nov 16 15:47:02 2015 -0800
|
107
|
-
+++ b/lib/vagrant-skytap/command/up.rb Mon Nov 16 18:02:32 2015 -0800
|
108
|
-
@@ -1,5 +1,6 @@
|
109
|
-
require 'optparse'
|
110
|
-
require_relative 'start_mixins'
|
111
|
-
+require 'byebug'
|
112
|
-
|
113
|
-
module VagrantPlugins
|
114
|
-
module Skytap
|
115
|
-
@@ -53,22 +54,24 @@
|
116
|
-
|
117
|
-
# Build up the batch job of what we'll do
|
118
|
-
machines = []
|
119
|
-
- @env.batch(options[:parallel]) do |batch|
|
120
|
-
- names = argv
|
121
|
-
- if names.empty?
|
122
|
-
- autostart = false
|
123
|
-
- @env.vagrantfile.machine_names_and_options.each do |n, o|
|
124
|
-
- autostart = true if o.key?(:autostart)
|
125
|
-
- o[:autostart] = true if !o.key?(:autostart)
|
126
|
-
- names << n.to_s if o[:autostart]
|
127
|
-
- end
|
128
|
-
-
|
129
|
-
- # If we have an autostart key but no names, it means that
|
130
|
-
- # all machines are autostart: false and we don't start anything.
|
131
|
-
- names = nil if autostart && names.empty?
|
132
|
-
+ names = argv
|
133
|
-
+ if names.empty?
|
134
|
-
+ autostart = false
|
135
|
-
+ @env.vagrantfile.machine_names_and_options.each do |n, o|
|
136
|
-
+ autostart = true if o.key?(:autostart)
|
137
|
-
+ o[:autostart] = true if !o.key?(:autostart)
|
138
|
-
+ names << n.to_s if o[:autostart]
|
139
|
-
end
|
140
|
-
|
141
|
-
- if names
|
142
|
-
+ # If we have an autostart key but no names, it means that
|
143
|
-
+ # all machines are autostart: false and we don't start anything.
|
144
|
-
+ names = nil if autostart && names.empty?
|
145
|
-
+ end
|
146
|
-
+
|
147
|
-
+
|
148
|
-
+
|
149
|
-
+ if names
|
150
|
-
+ @env.batch(options[:parallel]) do |batch|
|
151
|
-
with_target_vms(names, provider: options[:provider]) do |machine|
|
152
|
-
@env.ui.info(I18n.t(
|
153
|
-
"vagrant.commands.up.upping",
|
154
|
-
@@ -77,11 +80,29 @@
|
155
|
-
|
156
|
-
machines << machine
|
157
|
-
|
158
|
-
- batch.action(machine, :up, options)
|
159
|
-
+ batch.action(machine, :pre_up, options)
|
160
|
-
+ if !options[:parallel]
|
161
|
-
+ batch.action(machine, :up, options)
|
162
|
-
+ #batch.action(machine, :post_up, options) # note: this gives success message even if the machine was already running
|
163
|
-
+ end
|
164
|
-
end
|
165
|
-
end
|
166
|
-
end
|
167
|
-
|
168
|
-
+ # Don't use normal Vagrant parallelization to run VMs
|
169
|
-
+ if options[:parallel] && machines
|
170
|
-
+ # do thing, then
|
171
|
-
+
|
172
|
-
+ # WaitForCommunicator
|
173
|
-
+ @env.batch do |batch|
|
174
|
-
+ with_target_vms(names, provider: options[:provider]) do |machine|
|
175
|
-
+ batch.action(machine, :post_up, options)
|
176
|
-
+ end
|
177
|
-
+ end
|
178
|
-
+ end
|
179
|
-
+
|
180
|
-
+
|
181
|
-
+
|
182
|
-
if machines.empty?
|
183
|
-
@env.ui.info(I18n.t("vagrant.up_no_machines"))
|
184
|
-
return 0
|