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
@@ -1,162 +0,0 @@
|
|
1
|
-
# HG changeset patch
|
2
|
-
# Parent 52eca9fb4e0ee45e8dd01b28163ac10c5d298015
|
3
|
-
# Parent a99c1ba8768234427f78a5008c331be5604e5a8e
|
4
|
-
ENG-10256 collision repair
|
5
|
-
|
6
|
-
diff -r 52eca9fb4e0e lib/vagrant-skytap/action.rb
|
7
|
-
--- a/lib/vagrant-skytap/action.rb Tue Jan 12 14:34:08 2016 -0800
|
8
|
-
+++ b/lib/vagrant-skytap/action.rb Tue Jan 12 14:38:22 2016 -0800
|
9
|
-
@@ -289,6 +289,9 @@
|
10
|
-
Vagrant::Action::Builder.new.tap do |b|
|
11
|
-
b.use ClearForwardedPorts
|
12
|
-
b.use ReadSSHInfo
|
13
|
-
+ b.use EnvSet, port_collision_repair: true
|
14
|
-
+ b.use PrepareForwardedPortCollisionParams
|
15
|
-
+ b.use HandleForwardedPortCollisions
|
16
|
-
b.use ForwardPorts
|
17
|
-
end
|
18
|
-
end
|
19
|
-
@@ -316,6 +319,7 @@
|
20
|
-
autoload :MessageEnvironmentUrl, action_root.join("message_environment_url")
|
21
|
-
autoload :MessageResuming, action_root.join("message_resuming")
|
22
|
-
autoload :MessageWillNotDestroy, action_root.join("message_will_not_destroy")
|
23
|
-
+ autoload :PrepareForwardedPortCollisionParams, action_root.join("prepare_forwarded_port_collision_params")
|
24
|
-
autoload :PrepareNFSSettings, action_root.join("prepare_nfs_settings")
|
25
|
-
autoload :PrepareNFSValidIds, action_root.join("prepare_nfs_valid_ids")
|
26
|
-
autoload :ReadSSHInfo, action_root.join("read_ssh_info")
|
27
|
-
diff -r 52eca9fb4e0e lib/vagrant-skytap/action/prepare_forwarded_port_collision_params.rb
|
28
|
-
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
|
29
|
-
+++ b/lib/vagrant-skytap/action/prepare_forwarded_port_collision_params.rb Tue Jan 12 14:38:22 2016 -0800
|
30
|
-
@@ -0,0 +1,34 @@
|
31
|
-
+module VagrantPlugins
|
32
|
-
+ module Skytap
|
33
|
-
+ module Action
|
34
|
-
+ class PrepareForwardedPortCollisionParams
|
35
|
-
+ def initialize(app, env)
|
36
|
-
+ @app = app
|
37
|
-
+ end
|
38
|
-
+
|
39
|
-
+ def call(env)
|
40
|
-
+ # Get the forwarded ports used by other virtual machines and
|
41
|
-
+ # consider those in use as well.
|
42
|
-
+ env[:port_collision_extra_in_use] = @env[:host].capability(:read_used_ports, @env)
|
43
|
-
+
|
44
|
-
+ # Build the remap for any existing collision detections
|
45
|
-
+ remap = {}
|
46
|
-
+ env[:port_collision_remap] = remap
|
47
|
-
+ env[:host].capability(:read_forwarded_ports, env).each do |_nic, name, hostport, _guestport|
|
48
|
-
+ env[:machine].config.vm.networks.each do |type, options|
|
49
|
-
+ next if type != :forwarded_port
|
50
|
-
+
|
51
|
-
+ # If the ID matches the name of the forwarded port, then remap.
|
52
|
-
+ if options[:id] == name
|
53
|
-
+ remap[options[:host]] = hostport
|
54
|
-
+ break
|
55
|
-
+ end
|
56
|
-
+ end
|
57
|
-
+ end
|
58
|
-
+
|
59
|
-
+ @app.call(env)
|
60
|
-
+ end
|
61
|
-
+ end
|
62
|
-
+ end
|
63
|
-
+ end
|
64
|
-
+end
|
65
|
-
diff -r 52eca9fb4e0e lib/vagrant-skytap/hosts/common/cap/ssh_tunnel.rb
|
66
|
-
--- a/lib/vagrant-skytap/hosts/common/cap/ssh_tunnel.rb Tue Jan 12 14:34:08 2016 -0800
|
67
|
-
+++ b/lib/vagrant-skytap/hosts/common/cap/ssh_tunnel.rb Tue Jan 12 14:38:22 2016 -0800
|
68
|
-
@@ -51,6 +51,16 @@
|
69
|
-
|
70
|
-
####################################
|
71
|
-
|
72
|
-
+ def self.read_forwarded_ports(env, env_hash, machine = nil)
|
73
|
-
+ logger = create_logger
|
74
|
-
+ machine ||= env_hash[:machine]
|
75
|
-
+ get_pidfiles_for_machine(machine).collect do |pidfile|
|
76
|
-
+ read_pid(File.join(machine.data_dir, pidfile))
|
77
|
-
+ end
|
78
|
-
+ end
|
79
|
-
+
|
80
|
-
+ ####################################
|
81
|
-
+
|
82
|
-
def self.pidfile_name(fp)
|
83
|
-
"#{fp[:host_ip]}.pid"
|
84
|
-
end
|
85
|
-
diff -r 52eca9fb4e0e lib/vagrant-skytap/plugin.rb
|
86
|
-
--- a/lib/vagrant-skytap/plugin.rb Tue Jan 12 14:34:08 2016 -0800
|
87
|
-
+++ b/lib/vagrant-skytap/plugin.rb Tue Jan 12 14:38:22 2016 -0800
|
88
|
-
@@ -64,15 +64,15 @@
|
89
|
-
HostBSD::Cap::SSHTunnel
|
90
|
-
end
|
91
|
-
|
92
|
-
-# host_capability("bsd", "read_used_ports") do
|
93
|
-
-# require_relative "hosts/bsd/cap/ssh_tunnel"
|
94
|
-
-# HostBSD::Cap::SSHTunnel
|
95
|
-
-# end
|
96
|
-
-#
|
97
|
-
-# host_capability("bsd", "read_forwarded_ports") do
|
98
|
-
-# require_relative "hosts/bsd/cap/ssh_tunnel"
|
99
|
-
-# HostBSD::Cap::SSHTunnel
|
100
|
-
-# end
|
101
|
-
+ host_capability("bsd", "read_used_ports") do
|
102
|
-
+ require_relative "hosts/bsd/cap/ssh_tunnel"
|
103
|
-
+ HostBSD::Cap::SSHTunnel
|
104
|
-
+ end
|
105
|
-
+
|
106
|
-
+ host_capability("bsd", "read_forwarded_ports") do
|
107
|
-
+ require_relative "hosts/bsd/cap/ssh_tunnel"
|
108
|
-
+ HostBSD::Cap::SSHTunnel
|
109
|
-
+ end
|
110
|
-
|
111
|
-
host_capability("linux", "start_ssh_tunnel") do
|
112
|
-
require_relative "hosts/linux/cap/ssh_tunnel"
|
113
|
-
@@ -89,15 +89,15 @@
|
114
|
-
HostWindows::Cap::SSHTunnel
|
115
|
-
end
|
116
|
-
|
117
|
-
-# host_capability("linux", "read_used_ports") do
|
118
|
-
-# require_relative "hosts/linux/cap/ssh_tunnel"
|
119
|
-
-# HostLinux::Cap::SSHTunnel
|
120
|
-
-# end
|
121
|
-
-#
|
122
|
-
-# host_capability("linux", "read_forwarded_ports") do
|
123
|
-
-# require_relative "hosts/linux/cap/ssh_tunnel"
|
124
|
-
-# HostLinux::Cap::SSHTunnel
|
125
|
-
-# end
|
126
|
-
+ host_capability("linux", "read_used_ports") do
|
127
|
-
+ require_relative "hosts/linux/cap/ssh_tunnel"
|
128
|
-
+ HostLinux::Cap::SSHTunnel
|
129
|
-
+ end
|
130
|
-
+
|
131
|
-
+ host_capability("linux", "read_forwarded_ports") do
|
132
|
-
+ require_relative "hosts/linux/cap/ssh_tunnel"
|
133
|
-
+ HostLinux::Cap::SSHTunnel
|
134
|
-
+ end
|
135
|
-
|
136
|
-
host_capability("windows", "start_ssh_tunnel") do
|
137
|
-
require_relative "hosts/windows/cap/ssh_tunnel"
|
138
|
-
@@ -114,15 +114,15 @@
|
139
|
-
HostWindows::Cap::SSHTunnel
|
140
|
-
end
|
141
|
-
|
142
|
-
-# host_capability("windows", "read_used_ports") do
|
143
|
-
-# require_relative "hosts/windows/cap/ssh_tunnel"
|
144
|
-
-# HostWindows::Cap::SSHTunnel
|
145
|
-
-# end
|
146
|
-
-#
|
147
|
-
-# host_capability("windows", "read_forwarded_ports") do
|
148
|
-
-# require_relative "hosts/windows/cap/ssh_tunnel"
|
149
|
-
-# HostWindows::Cap::SSHTunnel
|
150
|
-
-# end
|
151
|
-
+ host_capability("windows", "read_used_ports") do
|
152
|
-
+ require_relative "hosts/windows/cap/ssh_tunnel"
|
153
|
-
+ HostWindows::Cap::SSHTunnel
|
154
|
-
+ end
|
155
|
-
+
|
156
|
-
+ host_capability("windows", "read_forwarded_ports") do
|
157
|
-
+ require_relative "hosts/windows/cap/ssh_tunnel"
|
158
|
-
+ HostWindows::Cap::SSHTunnel
|
159
|
-
+ end
|
160
|
-
|
161
|
-
# This initializes the internationalization strings.
|
162
|
-
def self.setup_i18n
|
@@ -1,88 +0,0 @@
|
|
1
|
-
# HG changeset patch
|
2
|
-
# Parent 9b3dc8dd5d19d0effc35672a8e3bbeb50ef381a8
|
3
|
-
DO NOT COMMIT. Vagrantfile for testing on Ubuntu VM.
|
4
|
-
|
5
|
-
diff -r 9b3dc8dd5d19 eng-10256/Vagrantfile
|
6
|
-
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
|
7
|
-
+++ b/eng-10256/Vagrantfile Wed Jan 06 15:54:52 2016 -0800
|
8
|
-
@@ -0,0 +1,44 @@
|
9
|
-
+# Vagrantfile for creating an Ubuntu "master" VM with Vagrant installed
|
10
|
-
+
|
11
|
-
+SKYTAP_PROVIDER_GEM_PATH = "../vagrant-skytap-0.1.13.pre1.gem"
|
12
|
-
+
|
13
|
-
+$script_install_packages = <<SCRIPT
|
14
|
-
+ sudo apt-get update
|
15
|
-
+ sudo apt-get install -y autossh lynx-cur
|
16
|
-
+SCRIPT
|
17
|
-
+
|
18
|
-
+$script_vagrant = <<SCRIPT
|
19
|
-
+ which vagrant
|
20
|
-
+ if [ $? -ne 0 ]; then
|
21
|
-
+ wget https://releases.hashicorp.com/vagrant/1.8.0/vagrant_1.8.0_x86_64.deb -q0
|
22
|
-
+ dpkg -i vagrant_1.8.0_x86_64.deb
|
23
|
-
+ fi
|
24
|
-
+SCRIPT
|
25
|
-
+
|
26
|
-
+Vagrant.configure(2) do |config|
|
27
|
-
+ config.vm.box = "skytap/empty"
|
28
|
-
+ config.vm.synced_folder ".", "/vagrant", disabled: true
|
29
|
-
+
|
30
|
-
+ config.vm.provider :skytap do |skytap, override|
|
31
|
-
+ skytap.username = "username"
|
32
|
-
+ skytap.api_token = "00BADBEE"
|
33
|
-
+ skytap.vpn_url = "/vpns/vpn-711360"
|
34
|
-
+ end
|
35
|
-
+
|
36
|
-
+ config.vm.define "vm1" do |box|
|
37
|
-
+ box.vm.provider :skytap do |box|
|
38
|
-
+ box.vm_url = "/vms/6869434"
|
39
|
-
+ end
|
40
|
-
+
|
41
|
-
+ box.ssh.username = "skytap"
|
42
|
-
+ box.ssh.password = "ChangeMe!"
|
43
|
-
+
|
44
|
-
+ box.vm.provision "shell", inline: "touch this_is_master"
|
45
|
-
+ box.vm.provision "shell", inline: $script_install_packages
|
46
|
-
+ box.vm.provision "shell", inline: $script_vagrant
|
47
|
-
+ box.vm.provision "file", source: "vagrantfile_master", destination: "project/Vagrantfile"
|
48
|
-
+
|
49
|
-
+ box.vm.provision "file", source: SKYTAP_PROVIDER_GEM_PATH, destination: "vagrant-skytap.gem"
|
50
|
-
+ box.vm.provision "shell", inline: "vagrant plugin install vagrant-skytap.gem", privileged: false
|
51
|
-
+ end
|
52
|
-
+end
|
53
|
-
diff -r 9b3dc8dd5d19 eng-10256/vagrantfile_master
|
54
|
-
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
|
55
|
-
+++ b/eng-10256/vagrantfile_master Wed Jan 06 15:54:52 2016 -0800
|
56
|
-
@@ -0,0 +1,32 @@
|
57
|
-
+# Vagrantfile for creating Ubuntu "slave" VM
|
58
|
-
+# This should be run on the "master" VM
|
59
|
-
+
|
60
|
-
+$script_install_packages = <<SCRIPT
|
61
|
-
+ sudo apt-get update
|
62
|
-
+ sudo apt-get install -y apache2 lynx-cur
|
63
|
-
+SCRIPT
|
64
|
-
+
|
65
|
-
+Vagrant.configure(2) do |config|
|
66
|
-
+ config.vm.box = "skytap/empty"
|
67
|
-
+ config.vm.synced_folder ".", "/vagrant", disabled: true
|
68
|
-
+
|
69
|
-
+ config.vm.provider :skytap do |skytap, override|
|
70
|
-
+ skytap.username = "username"
|
71
|
-
+ skytap.api_token = "00BADBEE"
|
72
|
-
+ skytap.vpn_url = "/vpns/vpn-711360"
|
73
|
-
+ end
|
74
|
-
+
|
75
|
-
+ config.vm.define "vm1" do |box|
|
76
|
-
+ box.vm.provider :skytap do |box|
|
77
|
-
+ box.vm_url = "/vms/6869434"
|
78
|
-
+ end
|
79
|
-
+ box.ssh.username = "skytap"
|
80
|
-
+ box.ssh.password = "ChangeMe!"
|
81
|
-
+
|
82
|
-
+ box.vm.provision "shell", inline: "touch this_is_slave"
|
83
|
-
+ box.vm.provision "shell", inline: $script_install_packages
|
84
|
-
+
|
85
|
-
+ box.vm.network :forwarded_port, guest: 80, host: 8080
|
86
|
-
+ end
|
87
|
-
+end
|
88
|
-
+
|
@@ -1,87 +0,0 @@
|
|
1
|
-
# HG changeset patch
|
2
|
-
# Parent 6547dde950c57c1f4694245d8a41ab5a5a8b7d28
|
3
|
-
improvements to tests for ENG-10269. sighhhhhhh. This will not be ready when the main patch is ready, just live with it.
|
4
|
-
|
5
|
-
diff -r 6547dde950c5 lib/vagrant-skytap/action/read_state.rb
|
6
|
-
--- a/lib/vagrant-skytap/action/read_state.rb Wed Nov 25 18:56:41 2015 -0800
|
7
|
-
+++ b/lib/vagrant-skytap/action/read_state.rb Mon Nov 30 11:51:41 2015 -0800
|
8
|
-
@@ -17,6 +17,7 @@
|
9
|
-
end
|
10
|
-
|
11
|
-
def call(env)
|
12
|
-
+ debugger
|
13
|
-
env[:machine_state_id] = read_state(env[:machine])
|
14
|
-
|
15
|
-
@app.call(env)
|
16
|
-
diff -r 6547dde950c5 spec/acceptance/provider/up_spec.rb
|
17
|
-
--- a/spec/acceptance/provider/up_spec.rb Wed Nov 25 18:56:41 2015 -0800
|
18
|
-
+++ b/spec/acceptance/provider/up_spec.rb Mon Nov 30 11:51:41 2015 -0800
|
19
|
-
@@ -19,6 +19,15 @@
|
20
|
-
it 'should bring up the machine and halt it' do
|
21
|
-
status("Test: machine can be brought up, parallel by default")
|
22
|
-
up_result = execute("vagrant", "up")
|
23
|
-
+
|
24
|
-
+ # up_result.stderr =~ /REST API call: PUT .*multiselect.*\[(.*)\]/
|
25
|
-
+ # (byebug) $1
|
26
|
-
+ # "\"7677382\""
|
27
|
-
+ # assert exactly one match with two separate ids
|
28
|
-
+ # could we make rest calls from this test? or get by without?
|
29
|
-
+ #multiselect should occur once
|
30
|
-
+ # vagrant status output?
|
31
|
-
+
|
32
|
-
expect(up_result).to exit_with(0)
|
33
|
-
|
34
|
-
status("Test: machine is running after up")
|
35
|
-
@@ -30,6 +39,10 @@
|
36
|
-
it 'should bring up the machine and halt it' do
|
37
|
-
status("Test: machine can be brought up no parallel")
|
38
|
-
up_result = execute("vagrant", "up", "--no-parallel")
|
39
|
-
+
|
40
|
-
+# up_result.stderr =~ /REST API call: PUT .*multiselect.*\[(.*)\]/
|
41
|
-
+ # assert no match
|
42
|
-
+
|
43
|
-
expect(up_result).to exit_with(0)
|
44
|
-
|
45
|
-
status("Test: machine is running after up")
|
46
|
-
@@ -37,4 +50,10 @@
|
47
|
-
expect(echo_result).to exit_with(0)
|
48
|
-
expect(echo_result.stdout).to match(/foo\n$/)
|
49
|
-
end
|
50
|
-
+
|
51
|
-
+ # what else to test?
|
52
|
-
+ # 2 new vms. Provisioners should run on both.
|
53
|
-
+ # Only one runstate API call should be made by default.
|
54
|
-
+ # 2 vms, one new, one already running.
|
55
|
-
+ # Parallelness should be discernible in the output.
|
56
|
-
end
|
57
|
-
diff -r 6547dde950c5 spec/acceptance/skeletons/generic/Vagrantfile
|
58
|
-
--- a/spec/acceptance/skeletons/generic/Vagrantfile Wed Nov 25 18:56:41 2015 -0800
|
59
|
-
+++ b/spec/acceptance/skeletons/generic/Vagrantfile Mon Nov 30 11:51:41 2015 -0800
|
60
|
-
@@ -2,14 +2,20 @@
|
61
|
-
config.vm.box = "skytap/empty"
|
62
|
-
|
63
|
-
config.vm.provider :skytap do |skytap, override|
|
64
|
-
- skytap.username = "user"
|
65
|
-
- skytap.api_token = "9999999999999999999999"
|
66
|
-
- skytap.base_url = "https://example.com/"
|
67
|
-
+ skytap.vm_url = "/vms/7285844"
|
68
|
-
+ skytap.vpn_url = "/vpns/vpn-711360"
|
69
|
-
+# skytap.vpn_url = "/vpns/vpn-3195669"
|
70
|
-
end
|
71
|
-
|
72
|
-
- config.vm.define "vm1" do |ubuntu|
|
73
|
-
- ubuntu.vm.provider :skytap do |box|
|
74
|
-
- box.vm_url = "https://example.com/vms/1"
|
75
|
-
- end
|
76
|
-
+ config.vm.define "vm1" do |vm1|
|
77
|
-
+ vm1.ssh.username = "skytap"
|
78
|
-
+ vm1.ssh.password = "ChangeMe!"
|
79
|
-
+ vm1.vm.provision "shell", inline: "echo '****** HALLO EVERYONE this is vm1 ******'"
|
80
|
-
+ end
|
81
|
-
+
|
82
|
-
+ config.vm.define "vm2" do |vm2|
|
83
|
-
+ vm2.ssh.username = "skytap"
|
84
|
-
+ vm2.ssh.password = "ChangeMe!"
|
85
|
-
+ vm2.vm.provision "shell", inline: "echo '****** HALLO EVERYONE this is vm2 ******'"
|
86
|
-
end
|
87
|
-
end
|
@@ -1,119 +0,0 @@
|
|
1
|
-
# HG changeset patch
|
2
|
-
# Parent b774dc85ccd962a862c877e9a4c3fe3684c344e5
|
3
|
-
ENG-10269 parallel halt operation
|
4
|
-
|
5
|
-
diff -r b774dc85ccd9 lib/vagrant-skytap/action/fetch_environment.rb
|
6
|
-
--- a/lib/vagrant-skytap/action/fetch_environment.rb Mon Nov 16 15:45:01 2015 -0800
|
7
|
-
+++ b/lib/vagrant-skytap/action/fetch_environment.rb Mon Nov 16 15:45:23 2015 -0800
|
8
|
-
@@ -21,6 +21,7 @@
|
9
|
-
rescue Errors::DoesNotExist => ex
|
10
|
-
@logger.info("Ignoring missing environment '#{props['url']}'.")
|
11
|
-
end
|
12
|
-
+ # env[:environment_fetched] = true # this might be useful, come back to it
|
13
|
-
end
|
14
|
-
end
|
15
|
-
|
16
|
-
diff -r b774dc85ccd9 lib/vagrant-skytap/action/stop_vm.rb
|
17
|
-
--- a/lib/vagrant-skytap/action/stop_vm.rb Mon Nov 16 15:45:01 2015 -0800
|
18
|
-
+++ b/lib/vagrant-skytap/action/stop_vm.rb Mon Nov 16 15:45:23 2015 -0800
|
19
|
-
@@ -24,17 +24,36 @@
|
20
|
-
end
|
21
|
-
|
22
|
-
def call(env)
|
23
|
-
- vm = env[:environment].current_vm
|
24
|
-
- if env[:force_halt]
|
25
|
-
- vm.poweroff!
|
26
|
-
+ # Is this stale, I wonder?
|
27
|
-
+ case state = env[:machine_state_id]
|
28
|
-
+ when :not_created
|
29
|
-
+ env[:ui].info(I18n.t("vagrant_skytap.not_created"))
|
30
|
-
+ when :stopped
|
31
|
-
+ env[:ui].info(I18n.t("vagrant_skytap.already_status", :status => "stopped"))
|
32
|
-
+ when :suspended
|
33
|
-
+ if env[:force_halt]
|
34
|
-
+ stop = true
|
35
|
-
+ else
|
36
|
-
+ env[:ui].info(I18n.t("vagrant_skytap.cannot_halt_if_suspended"))
|
37
|
-
+ end
|
38
|
-
else
|
39
|
-
- begin
|
40
|
-
- vm.stop!
|
41
|
-
- rescue Errors::InstanceReadyTimeout
|
42
|
-
- @logger.info(I18n.t("vagrant_skytap.graceful_halt_vm_failed"))
|
43
|
-
+ stop = true
|
44
|
-
+ end
|
45
|
-
+
|
46
|
-
+ if stop
|
47
|
-
+ vm = env[:environment].current_vm
|
48
|
-
+ if env[:force_halt]
|
49
|
-
vm.poweroff!
|
50
|
-
+ else
|
51
|
-
+ begin
|
52
|
-
+ vm.stop!
|
53
|
-
+ rescue Errors::InstanceReadyTimeout
|
54
|
-
+ @logger.info(I18n.t("vagrant_skytap.graceful_halt_vm_failed"))
|
55
|
-
+ vm.poweroff!
|
56
|
-
+ end
|
57
|
-
end
|
58
|
-
end
|
59
|
-
+
|
60
|
-
@app.call(env)
|
61
|
-
end
|
62
|
-
end
|
63
|
-
diff -r b774dc85ccd9 lib/vagrant-skytap/command/halt.rb
|
64
|
-
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
|
65
|
-
+++ b/lib/vagrant-skytap/command/halt.rb Mon Nov 16 15:45:23 2015 -0800
|
66
|
-
@@ -0,0 +1,41 @@
|
67
|
-
+require 'optparse'
|
68
|
-
+
|
69
|
-
+module VagrantPlugins
|
70
|
-
+ module Skytap
|
71
|
-
+ module Command
|
72
|
-
+ class Halt < Vagrant.plugin("2", :command)
|
73
|
-
+ def self.synopsis
|
74
|
-
+ "stops the vagrant machine (hi mom)"
|
75
|
-
+ end
|
76
|
-
+
|
77
|
-
+ def execute
|
78
|
-
+ options = {}
|
79
|
-
+ options[:force] = false
|
80
|
-
+
|
81
|
-
+ opts = OptionParser.new do |o|
|
82
|
-
+ o.banner = "Usage: vagrant halt [options] [name]"
|
83
|
-
+ o.separator ""
|
84
|
-
+ o.separator "Options:"
|
85
|
-
+ o.separator ""
|
86
|
-
+
|
87
|
-
+ o.on("-f", "--force", "Force shut down (equivalent of pulling power)") do |f|
|
88
|
-
+ options[:force] = f
|
89
|
-
+ end
|
90
|
-
+ end
|
91
|
-
+
|
92
|
-
+ # Parse the options
|
93
|
-
+ argv = parse_options(opts)
|
94
|
-
+ return if !argv
|
95
|
-
+
|
96
|
-
+ @logger.debug("Halt command: #{argv.inspect} #{options.inspect}")
|
97
|
-
+ with_target_vms(argv, reverse: true) do |vm|
|
98
|
-
+ vm.action(:halt, force_halt: options[:force])
|
99
|
-
+ end
|
100
|
-
+
|
101
|
-
+ # Success, exit status 0
|
102
|
-
+ 0
|
103
|
-
+ end
|
104
|
-
+ end
|
105
|
-
+ end
|
106
|
-
+ end
|
107
|
-
+end
|
108
|
-
diff -r b774dc85ccd9 locales/en.yml
|
109
|
-
--- a/locales/en.yml Mon Nov 16 15:45:01 2015 -0800
|
110
|
-
+++ b/locales/en.yml Mon Nov 16 15:45:23 2015 -0800
|
111
|
-
@@ -42,6 +42,8 @@
|
112
|
-
The environment could not be halted gracefully. Forcing halt.
|
113
|
-
graceful_halt_vm_failed: |-
|
114
|
-
The VM could not be halted gracefully. Forcing halt.
|
115
|
-
+ cannot_halt_if_suspended: |-
|
116
|
-
+ A suspended VM cannot be halted without the --force flag.
|
117
|
-
|
118
|
-
config:
|
119
|
-
username_required:
|
data/_patches-20160112/eng-10369
DELETED
@@ -1,143 +0,0 @@
|
|
1
|
-
# HG changeset patch
|
2
|
-
# Parent d55067c6de25d1b7ff712f9a8a934dc122e82e14
|
3
|
-
# Parent d55067c6de25d1b7ff712f9a8a934dc122e82e14
|
4
|
-
ENG-10369 Detect errors in 200 response.
|
5
|
-
|
6
|
-
diff -r d55067c6de25 Vagrantfile
|
7
|
-
--- a/Vagrantfile Mon Nov 09 18:52:55 2015 -0800
|
8
|
-
+++ b/Vagrantfile Tue Nov 10 15:32:33 2015 -0800
|
9
|
-
@@ -3,20 +3,20 @@
|
10
|
-
config.vm.synced_folder ".", "/vagrant", disabled: true
|
11
|
-
|
12
|
-
config.vm.provider :skytap do |skytap, override|
|
13
|
-
- skytap.username = "etrue"
|
14
|
-
- skytap.api_token = "fcb2620b72efddbc8239e25db9d812f510c7e166"
|
15
|
-
- skytap.base_url = "https://cloud.skytap.com/"
|
16
|
-
- #skytap.username = "vagrant_provider_admin"
|
17
|
-
- #skytap.api_token = "7c5718531a32eb90e92c804ce1f73da98be22cdf"
|
18
|
-
- #skytap.base_url = "https://test.skytap.com/"
|
19
|
-
+# skytap.username = "etrue"
|
20
|
-
+# skytap.api_token = "fcb2620b72efddbc8239e25db9d812f510c7e166"
|
21
|
-
+# skytap.base_url = "https://cloud.skytap.com/"
|
22
|
-
+ skytap.username = "vagrant_provider_admin"
|
23
|
-
+ skytap.api_token = "7c5718531a32eb90e92c804ce1f73da98be22cdf"
|
24
|
-
+ skytap.base_url = "https://test.skytap.com/"
|
25
|
-
#skytap.username = "jsmith"
|
26
|
-
#skytap.api_token = "754be5220955f35840498340606b4dfa89f7eb61"
|
27
|
-
#skytap.base_url = "https://cloud.skytap.dev/"
|
28
|
-
end
|
29
|
-
|
30
|
-
- GENERIC_UBUNTU = 'https://cloud.skytap.com/vms/6869434'
|
31
|
-
+# GENERIC_UBUNTU = 'https://cloud.skytap.com/vms/6869434'
|
32
|
-
# for test user
|
33
|
-
- #GENERIC_UBUNTU = 'https://cloud.skytap.com/vms/4840008'
|
34
|
-
+ GENERIC_UBUNTU = 'https://test.skytap.com/vms/4840008'
|
35
|
-
# local user
|
36
|
-
#GENERIC_UBUNTU = 'https://cloud.skytap.dev/vms/374'
|
37
|
-
|
38
|
-
@@ -33,6 +33,8 @@
|
39
|
-
UBUNTU_STOPPED_ENVIRONMENT_SOURCE_VM_A = "https://cloud.skytap.com/vms/7457184"
|
40
|
-
UBUNTU_STOPPED_ENVIRONMENT_SOURCE_VM_B = "https://cloud.skytap.com/vms/7468766"
|
41
|
-
|
42
|
-
+ VAGRANT_CUSTOMER_VPN = "https://cloud.skytap.com/vpns/vpn-3195669"
|
43
|
-
+
|
44
|
-
# separate template
|
45
|
-
# another ubuntu = 'https://cloud.skytap.com/vms/7242466'
|
46
|
-
WINDOWS_WINRM_CONFIGURED = 'https://cloud.skytap.com/vms/7242468'
|
47
|
-
@@ -40,12 +42,13 @@
|
48
|
-
config.vm.define "vm1" do |ubuntu|
|
49
|
-
ubuntu.vm.hostname = "vm1"
|
50
|
-
ubuntu.vm.provider :skytap do |box|
|
51
|
-
- box.vm_url = UBUNTU1#GENERIC_UBUNTU
|
52
|
-
+ box.vm_url = GENERIC_UBUNTU
|
53
|
-
#box.cpus = 1
|
54
|
-
#box.cpuspersocket = 1
|
55
|
-
#box.ram = 1024
|
56
|
-
#box.guestos = "ubuntu"
|
57
|
-
#box.vpn_url = "cloud.skytap.com/vpns/vpn-711360"
|
58
|
-
+ box.vpn_url = VAGRANT_CUSTOMER_VPN
|
59
|
-
end
|
60
|
-
ubuntu.vm.synced_folder "vm1", "/synced", type: :nfs
|
61
|
-
ubuntu.vm.communicator = :ssh
|
62
|
-
diff -r d55067c6de25 lib/vagrant-skytap/api/busyable.rb
|
63
|
-
--- a/lib/vagrant-skytap/api/busyable.rb Mon Nov 09 18:52:55 2015 -0800
|
64
|
-
+++ b/lib/vagrant-skytap/api/busyable.rb Tue Nov 10 15:32:33 2015 -0800
|
65
|
-
@@ -10,6 +10,7 @@
|
66
|
-
def update_with_retry(attrs, path=nil)
|
67
|
-
retry_while_resource_busy do
|
68
|
-
resp = api_client.put(path || url, JSON.dump(attrs))
|
69
|
-
+ raise Errors::OperationFailed, err: err if err = api_client.error_string_from_body(resp)
|
70
|
-
refresh(JSON.load(resp.body))
|
71
|
-
break
|
72
|
-
end
|
73
|
-
diff -r d55067c6de25 lib/vagrant-skytap/api/client.rb
|
74
|
-
--- a/lib/vagrant-skytap/api/client.rb Mon Nov 09 18:52:55 2015 -0800
|
75
|
-
+++ b/lib/vagrant-skytap/api/client.rb Tue Nov 10 15:32:33 2015 -0800
|
76
|
-
@@ -96,7 +96,7 @@
|
77
|
-
def error_string_from_body(resp)
|
78
|
-
resp = resp.body if resp.respond_to?(:body)
|
79
|
-
begin
|
80
|
-
- resp = JSON.load(resp)
|
81
|
-
+ resp = JSON.load(resp) unless resp.is_a?(Hash)
|
82
|
-
errors = resp['error'] || resp['errors']
|
83
|
-
errors = errors.join('; ') if errors.respond_to? :join
|
84
|
-
rescue
|
85
|
-
diff -r d55067c6de25 lib/vagrant-skytap/api/runstate_operations.rb
|
86
|
-
--- a/lib/vagrant-skytap/api/runstate_operations.rb Mon Nov 09 18:52:55 2015 -0800
|
87
|
-
+++ b/lib/vagrant-skytap/api/runstate_operations.rb Tue Nov 10 15:32:33 2015 -0800
|
88
|
-
@@ -36,12 +36,18 @@
|
89
|
-
def wait_for_runstate(expected_runstate)
|
90
|
-
expected_runstate = expected_runstate.to_s
|
91
|
-
retry_while_resource_busy do
|
92
|
-
- unless reload.busy?
|
93
|
-
+ unless reload_with_error_handling.busy?
|
94
|
-
break if runstate == expected_runstate || expected_runstate == 'ready'
|
95
|
-
end
|
96
|
-
end
|
97
|
-
end
|
98
|
-
|
99
|
-
+ def reload_with_error_handling
|
100
|
-
+ reload.tap do |ret|
|
101
|
-
+ raise Errors::OperationFailed, err: err if err = api_client.error_string_from_body(attrs)
|
102
|
-
+ end
|
103
|
-
+ end
|
104
|
-
+
|
105
|
-
def runstate
|
106
|
-
get_api_attribute('runstate')
|
107
|
-
end
|
108
|
-
diff -r d55067c6de25 lib/vagrant-skytap/api/vm.rb
|
109
|
-
--- a/lib/vagrant-skytap/api/vm.rb Mon Nov 09 18:52:55 2015 -0800
|
110
|
-
+++ b/lib/vagrant-skytap/api/vm.rb Tue Nov 10 15:32:33 2015 -0800
|
111
|
-
@@ -20,12 +20,6 @@
|
112
|
-
resp = env[:api_client].get(url)
|
113
|
-
new(JSON.load(resp.body), env[:environment], env)
|
114
|
-
end
|
115
|
-
-
|
116
|
-
- def current_vm(env)
|
117
|
-
- if (environment = env[:environment]) && (machine = env[:machine]) && machine.id
|
118
|
-
- environment.get_vm_by_id(machine.id)
|
119
|
-
- end
|
120
|
-
- end
|
121
|
-
end
|
122
|
-
|
123
|
-
def initialize(attrs, environment, env)
|
124
|
-
@@ -40,6 +34,19 @@
|
125
|
-
super
|
126
|
-
end
|
127
|
-
|
128
|
-
+ def refresh_from_environment
|
129
|
-
+ refresh(environment.get_vm_by_id(id).attrs)
|
130
|
-
+ end
|
131
|
-
+
|
132
|
-
+ def reload_with_error_handling
|
133
|
-
+ environment.reload_with_error_handling
|
134
|
-
+ refresh_from_environment.tap do |ret|
|
135
|
-
+ if err = api_client.error_string_from_body(attrs)
|
136
|
-
+ raise Errors::OperationFailed, err: err
|
137
|
-
+ end
|
138
|
-
+ end
|
139
|
-
+ end
|
140
|
-
+
|
141
|
-
def interfaces
|
142
|
-
@interfaces ||= (get_api_attribute('interfaces') || []).collect do |iface_attrs|
|
143
|
-
Interface.new(iface_attrs, self, env)
|
@@ -1,60 +0,0 @@
|
|
1
|
-
# HG changeset patch
|
2
|
-
# Parent d5f0a5fe77ec4a2935c018a0687deddad1a951c7
|
3
|
-
diff -r d5f0a5fe77ec -r c9b0b1d64a0a lib/vagrant-skytap/api/client.rb
|
4
|
-
--- a/lib/vagrant-skytap/api/client.rb Mon Nov 09 19:28:06 2015 -0800
|
5
|
-
+++ b/lib/vagrant-skytap/api/client.rb Mon Nov 09 19:46:14 2015 -0800
|
6
|
-
@@ -67,11 +67,7 @@
|
7
|
-
tries += 1
|
8
|
-
http.send_request(method, URI.encode(path), body, headers).tap do |ret|
|
9
|
-
@logger.debug("REST API response: #{ret.body}")
|
10
|
-
- if ret.code =~ /^2\d\d/
|
11
|
-
- if options[:raise_on_error_field] && err = error_string_from_body(ret)
|
12
|
-
- raise Errors::OperationSucceededWithErrors, err: err
|
13
|
-
- end
|
14
|
-
- else
|
15
|
-
+ unless ret.code =~ /^2\d\d/
|
16
|
-
raise Errors::DoesNotExist, object_name: "Object '#{path}'" if ret.code == '404'
|
17
|
-
error_class = case ret.code
|
18
|
-
when '403'
|
19
|
-
diff -r d5f0a5fe77ec -r c9b0b1d64a0a lib/vagrant-skytap/api/resource.rb
|
20
|
-
--- a/lib/vagrant-skytap/api/resource.rb Mon Nov 09 19:28:06 2015 -0800
|
21
|
-
+++ b/lib/vagrant-skytap/api/resource.rb Mon Nov 09 19:46:14 2015 -0800
|
22
|
-
@@ -23,8 +23,8 @@
|
23
|
-
"/#{self.class.resource_name.downcase}s/#{id}"
|
24
|
-
end
|
25
|
-
|
26
|
-
- def reload(options={})
|
27
|
-
- resp = api_client.get(url, options)
|
28
|
-
+ def reload
|
29
|
-
+ resp = api_client.get(url)
|
30
|
-
refresh(JSON.load(resp.body))
|
31
|
-
end
|
32
|
-
|
33
|
-
@@ -33,6 +33,14 @@
|
34
|
-
self
|
35
|
-
end
|
36
|
-
|
37
|
-
+ def error?
|
38
|
-
+ error.present?
|
39
|
-
+ end
|
40
|
-
+
|
41
|
-
+ def error
|
42
|
-
+ api_client.error_string_from_body(attrs)
|
43
|
-
+ end
|
44
|
-
+
|
45
|
-
private
|
46
|
-
|
47
|
-
def api_client
|
48
|
-
diff -r d5f0a5fe77ec -r c9b0b1d64a0a lib/vagrant-skytap/api/runstate_operations.rb
|
49
|
-
--- a/lib/vagrant-skytap/api/runstate_operations.rb Mon Nov 09 19:28:06 2015 -0800
|
50
|
-
+++ b/lib/vagrant-skytap/api/runstate_operations.rb Mon Nov 09 19:46:14 2015 -0800
|
51
|
-
@@ -43,7 +43,8 @@
|
52
|
-
end
|
53
|
-
|
54
|
-
def reload_with_error_handling
|
55
|
-
- reload(raise_on_error_field: true)
|
56
|
-
+ reload
|
57
|
-
+ raise Errors::OperationSucceededWithErrors, err: error if error
|
58
|
-
end
|
59
|
-
|
60
|
-
def runstate
|