vagrant-skytap 0.3.4 → 0.3.5

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: 2fc1bc4fb3154bdd71313b6757ed711402fd51ef
4
- data.tar.gz: f6937b4bece80f2a364d73c5490c3824d89fadc4
3
+ metadata.gz: baf5d3c0b7fd0393c8740ccae53bb5f25265b057
4
+ data.tar.gz: fa4d72e87ee859399de360dabb0b81431c789005
5
5
  SHA512:
6
- metadata.gz: 30c59354d60234aeb11b279feb5bd47d51b4f2c1930f41148bce0335ca2da8eda114d8853617af4eadad3012a086b4bb9366246af49c811434b340557468bbc2
7
- data.tar.gz: ea5af2c5734a757f2be1061d806d58532b0595ad1ec11206e37473d539f3dace38489c488df2f93804816e26aa80da83968c1c3d05b9fd1a573f5d37e279d538
6
+ metadata.gz: 92bdf1421b8320b29235963ca160804ab6c0890f0965187c4e7a9cecd50e551d8d7257f754057195b9ee40f1daacd8c12991ee11216a4d2e1ddacf714584e5ab
7
+ data.tar.gz: 7f1d027f8a4909b5da9e3d705f222ec4a2c72f8909f41ae79a3475d74282f106af70a64a95d57b0b9f9f457e9081cf889f05c038451280bd2b3fd2f1e7bc022e
@@ -1,3 +1,8 @@
1
+ # 0.3.5 (January 3, 2017)
2
+
3
+ * Increase metadata service timeout, improve logging, handle still more errors (actually
4
+ rescue all system call errors)
5
+
1
6
  # 0.3.4 (April 27, 2016)
2
7
 
3
8
  * Add handling for additional network errors when fetching Skytap VM metadata.
@@ -22,7 +27,7 @@
22
27
  * New functionality to support running Vagrant from within a Skytap VM. The connection between host and
23
28
  guest will be made over a network tunnel between the two Skytap environments.
24
29
  * `vagrant ssh` now shows the expected error when the machine is not running.
25
- * Support unattended `vagrant up` by automatically choosing the only available connection option.
30
+ * Support unattended `vagrant up` by automatically choosing the only available connection option.
26
31
 
27
32
  # 0.2.10 (March 17, 2016)
28
33
 
@@ -29,8 +29,8 @@ module VagrantPlugins
29
29
  module Cap
30
30
  module HostMetadata
31
31
  METADATA_LINK_LOCAL_ADDRESS = '169.254.169.254'
32
- OPEN_TIMEOUT = 2
33
- READ_TIMEOUT = 5
32
+ OPEN_TIMEOUT = 5
33
+ READ_TIMEOUT = 15
34
34
 
35
35
  # If Vagrant is running in a Skytap VM, returns metadata from which an
36
36
  # [API::Vm] can be constructed. Otherwise returns nil.
@@ -40,10 +40,10 @@ module VagrantPlugins
40
40
  def self.host_metadata(machine)
41
41
  logger = Log4r::Logger.new("vagrant_skytap::cap::host_metadata")
42
42
 
43
- # There are two addresses to try for the metadata service. If using
44
- # the default DNS, 'gw' will resolve to the endpoint address. If
45
- # using custom DNS, be prepared to fall back to the hard-coded IP
46
- # address.
43
+ # A Skytap VM can request information about itself from the metadata
44
+ # service at http://gw/skytap. If the network is set to use custom
45
+ # DNS, 'gw' may resolve to something else, in which case we fall back
46
+ # to the service's link local address.
47
47
  ['gw', METADATA_LINK_LOCAL_ADDRESS].each do |host|
48
48
  begin
49
49
  http = Net::HTTP.new(host)
@@ -52,36 +52,36 @@ module VagrantPlugins
52
52
 
53
53
  # Test for a working web server before actually hitting the
54
54
  # metadata service. The response is expected to be 404.
55
+ logger.debug("Checking for HTTP service on host '#{host}' ...")
55
56
  http.request(Net::HTTP::Get.new("/"))
56
57
 
57
58
  begin
59
+ logger.debug("Fetching VM metadata from http://#{host}/skytap ...")
58
60
  response = http.request(Net::HTTP::Get.new("/skytap"))
59
61
  rescue Timeout::Error => ex
62
+ logger.debug("The request timed out.")
60
63
  raise Errors::MetadataServiceUnavailable
61
64
  end
62
65
 
63
- if response.is_a?(Net::HTTPServerError)
64
- raise Errors::MetadataServiceUnavailable
65
- elsif response.is_a?(Net::HTTPOK)
66
- attrs = JSON.parse(response.body)
67
- return attrs if attrs.key?('configuration_url')
68
- logger.debug("The JSON retrieved was not VM metadata! Ignoring.")
66
+ if response.is_a?(Net::HTTPOK)
67
+ if (attrs = JSON.parse(response.body)) && attrs.key?('configuration_url')
68
+ logger.debug('Metadata retrieved successfully.')
69
+ return attrs
70
+ end
71
+ logger.debug('The response did not contain VM metadata.')
72
+ logger.debug("Response body: #{response.body}")
73
+ else
74
+ logger.debug("The server responded with status #{response.code}.")
75
+ logger.debug("Response body: #{response.body}")
76
+ raise Errors::MetadataServiceUnavailable if response.is_a?(Net::HTTPServerError)
69
77
  end
70
- rescue SocketError => ex
71
- logger.debug("Could not resolve hostname '#{host}'.")
72
- rescue Errno::ENETUNREACH => ex
73
- logger.debug("No route exists for '#{host}'.")
74
- rescue Errno::EHOSTDOWN => ex
75
- logger.debug("The OS reported that '#{host}' is down.")
76
- rescue Errno::ECONNREFUSED => ex
77
- logger.debug("The connection was refused by '#{host}'.")
78
- rescue Timeout::Error => ex
79
- logger.debug("Response timed out for '#{host}'.")
80
- rescue JSON::ParserError
81
- logger.debug("Response from '#{host}' was garbled.")
78
+ rescue SystemCallError, SocketError, Timeout::Error, JSON::ParserError => ex
79
+ logger.debug(ex)
80
+ logger.debug("Response body: #{response.body}") if response.try(:body)
82
81
  end
83
82
  end
84
83
 
84
+ logger.debug("Could not obtain VM metadata. Host is not a Skytap VM.")
85
85
  nil
86
86
  end
87
87
  end
@@ -22,6 +22,6 @@
22
22
 
23
23
  module VagrantPlugins
24
24
  module Skytap
25
- VERSION = "0.3.4"
25
+ VERSION = "0.3.5"
26
26
  end
27
27
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-skytap
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.4
4
+ version: 0.3.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric True
@@ -9,104 +9,104 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-04-27 00:00:00.000000000 Z
12
+ date: 2017-01-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: json_pure
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  requirements:
18
- - - '>='
18
+ - - ">="
19
19
  - !ruby/object:Gem::Version
20
20
  version: '0'
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
- - - '>='
25
+ - - ">="
26
26
  - !ruby/object:Gem::Version
27
27
  version: '0'
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: rake
30
30
  requirement: !ruby/object:Gem::Requirement
31
31
  requirements:
32
- - - '>='
32
+ - - ">="
33
33
  - !ruby/object:Gem::Version
34
34
  version: '0'
35
35
  type: :development
36
36
  prerelease: false
37
37
  version_requirements: !ruby/object:Gem::Requirement
38
38
  requirements:
39
- - - '>='
39
+ - - ">="
40
40
  - !ruby/object:Gem::Version
41
41
  version: '0'
42
42
  - !ruby/object:Gem::Dependency
43
43
  name: rspec-core
44
44
  requirement: !ruby/object:Gem::Requirement
45
45
  requirements:
46
- - - ~>
46
+ - - "~>"
47
47
  - !ruby/object:Gem::Version
48
48
  version: 2.14.0
49
49
  type: :development
50
50
  prerelease: false
51
51
  version_requirements: !ruby/object:Gem::Requirement
52
52
  requirements:
53
- - - ~>
53
+ - - "~>"
54
54
  - !ruby/object:Gem::Version
55
55
  version: 2.14.0
56
56
  - !ruby/object:Gem::Dependency
57
57
  name: rspec-expectations
58
58
  requirement: !ruby/object:Gem::Requirement
59
59
  requirements:
60
- - - ~>
60
+ - - "~>"
61
61
  - !ruby/object:Gem::Version
62
62
  version: 2.14.0
63
63
  type: :development
64
64
  prerelease: false
65
65
  version_requirements: !ruby/object:Gem::Requirement
66
66
  requirements:
67
- - - ~>
67
+ - - "~>"
68
68
  - !ruby/object:Gem::Version
69
69
  version: 2.14.0
70
70
  - !ruby/object:Gem::Dependency
71
71
  name: rspec-mocks
72
72
  requirement: !ruby/object:Gem::Requirement
73
73
  requirements:
74
- - - ~>
74
+ - - "~>"
75
75
  - !ruby/object:Gem::Version
76
76
  version: 2.14.0
77
77
  type: :development
78
78
  prerelease: false
79
79
  version_requirements: !ruby/object:Gem::Requirement
80
80
  requirements:
81
- - - ~>
81
+ - - "~>"
82
82
  - !ruby/object:Gem::Version
83
83
  version: 2.14.0
84
84
  - !ruby/object:Gem::Dependency
85
85
  name: vagrant-spec
86
86
  requirement: !ruby/object:Gem::Requirement
87
87
  requirements:
88
- - - ~>
88
+ - - "~>"
89
89
  - !ruby/object:Gem::Version
90
90
  version: 1.4.0
91
91
  type: :development
92
92
  prerelease: false
93
93
  version_requirements: !ruby/object:Gem::Requirement
94
94
  requirements:
95
- - - ~>
95
+ - - "~>"
96
96
  - !ruby/object:Gem::Version
97
97
  version: 1.4.0
98
98
  - !ruby/object:Gem::Dependency
99
99
  name: webmock
100
100
  requirement: !ruby/object:Gem::Requirement
101
101
  requirements:
102
- - - ~>
102
+ - - "~>"
103
103
  - !ruby/object:Gem::Version
104
104
  version: '1.20'
105
105
  type: :development
106
106
  prerelease: false
107
107
  version_requirements: !ruby/object:Gem::Requirement
108
108
  requirements:
109
- - - ~>
109
+ - - "~>"
110
110
  - !ruby/object:Gem::Version
111
111
  version: '1.20'
112
112
  description: Enables Vagrant to manage Skytap machines.
@@ -117,13 +117,19 @@ executables: []
117
117
  extensions: []
118
118
  extra_rdoc_files: []
119
119
  files:
120
+ - ".gitignore"
121
+ - CHANGELOG.md
122
+ - Gemfile
123
+ - LICENSE
124
+ - README.md
125
+ - Rakefile
126
+ - boxes/README.md
127
+ - boxes/Vagrantfile
120
128
  - boxes/empty.box
121
129
  - boxes/metadata.json
122
- - boxes/README.md
123
130
  - boxes/ubuntu-1204-x64-us-west.box
124
- - boxes/Vagrantfile
125
- - CHANGELOG.md
126
- - Gemfile
131
+ - lib/vagrant-skytap.rb
132
+ - lib/vagrant-skytap/action.rb
127
133
  - lib/vagrant-skytap/action/action_helpers.rb
128
134
  - lib/vagrant-skytap/action/add_vm_to_environment.rb
129
135
  - lib/vagrant-skytap/action/check_created.rb
@@ -167,7 +173,6 @@ files:
167
173
  - lib/vagrant-skytap/action/timed_provision.rb
168
174
  - lib/vagrant-skytap/action/update_hardware.rb
169
175
  - lib/vagrant-skytap/action/wait_for_communicator.rb
170
- - lib/vagrant-skytap/action.rb
171
176
  - lib/vagrant-skytap/api/client.rb
172
177
  - lib/vagrant-skytap/api/connectable.rb
173
178
  - lib/vagrant-skytap/api/credentials.rb
@@ -193,11 +198,11 @@ files:
193
198
  - lib/vagrant-skytap/command/publish_url/show.rb
194
199
  - lib/vagrant-skytap/command/up.rb
195
200
  - lib/vagrant-skytap/config.rb
201
+ - lib/vagrant-skytap/connection.rb
196
202
  - lib/vagrant-skytap/connection/public_ip_choice.rb
197
203
  - lib/vagrant-skytap/connection/published_service_choice.rb
198
204
  - lib/vagrant-skytap/connection/tunnel_choice.rb
199
205
  - lib/vagrant-skytap/connection/vpn_choice.rb
200
- - lib/vagrant-skytap/connection.rb
201
206
  - lib/vagrant-skytap/core_ext/object/blank.rb
202
207
  - lib/vagrant-skytap/core_ext/object/tap.rb
203
208
  - lib/vagrant-skytap/core_ext/try.rb
@@ -218,11 +223,7 @@ files:
218
223
  - lib/vagrant-skytap/util/timer.rb
219
224
  - lib/vagrant-skytap/version.rb
220
225
  - lib/vagrant-skytap/vm_properties.rb
221
- - lib/vagrant-skytap.rb
222
- - LICENSE
223
226
  - locales/en.yml
224
- - Rakefile
225
- - README.md
226
227
  - spec/acceptance/base.rb
227
228
  - spec/acceptance/shared/context_skytap.rb
228
229
  - spec/acceptance/skeletons/generic/Vagrantfile
@@ -273,7 +274,6 @@ files:
273
274
  - tasks/test.rake
274
275
  - vagrant-skytap.gemspec
275
276
  - vagrant-spec.config.rb
276
- - .gitignore
277
277
  homepage: http://www.skytap.com
278
278
  licenses:
279
279
  - MIT
@@ -284,17 +284,17 @@ require_paths:
284
284
  - lib
285
285
  required_ruby_version: !ruby/object:Gem::Requirement
286
286
  requirements:
287
- - - '>='
287
+ - - ">="
288
288
  - !ruby/object:Gem::Version
289
289
  version: '0'
290
290
  required_rubygems_version: !ruby/object:Gem::Requirement
291
291
  requirements:
292
- - - '>='
292
+ - - ">="
293
293
  - !ruby/object:Gem::Version
294
294
  version: 1.3.6
295
295
  requirements: []
296
296
  rubyforge_project: vagrant-skytap
297
- rubygems_version: 2.0.14
297
+ rubygems_version: 2.4.5
298
298
  signing_key:
299
299
  specification_version: 4
300
300
  summary: Vagrant provider plugin for Skytap.