right_agent 2.1.2 → 2.1.3
Sign up to get free protection for your applications and to get access to all the features.
@@ -124,7 +124,7 @@ module RightScale
|
|
124
124
|
fiber = Fiber.current
|
125
125
|
connection = EM::HttpRequest.new(uri.to_s, connect_options)
|
126
126
|
http = connection.send(verb, request_options)
|
127
|
-
http.errback { fiber.resume(http.error.to_s == "Errno::ETIMEDOUT" ? 504 : 500, http.error) }
|
127
|
+
http.errback { fiber.resume(http.error.to_s == "Errno::ETIMEDOUT" ? 504 : 500, http.error && http.error.to_s) }
|
128
128
|
http.callback { fiber.resume(http.response_header.status, http.response, http.response_header) }
|
129
129
|
response_code, response_body, response_headers = Fiber.yield
|
130
130
|
response_headers = beautify_headers(response_headers) if response_headers
|
@@ -172,7 +172,7 @@ module RightScale
|
|
172
172
|
# @raise [HttpException] HTTP failure with associated status code
|
173
173
|
def poll_again(fiber, connection, request_options, stop_at)
|
174
174
|
http = connection.send(:get, request_options)
|
175
|
-
http.errback { fiber.resume(http.error.to_s == "Errno::ETIMEDOUT" ? 504 : 500, http.error) }
|
175
|
+
http.errback { fiber.resume(http.error.to_s == "Errno::ETIMEDOUT" ? 504 : 500, http.error && http.error.to_s) }
|
176
176
|
http.callback do
|
177
177
|
code, body, headers = http.response_header.status, http.response, http.response_header
|
178
178
|
if code == 200 && (body.nil? || body == "null") && Time.now < stop_at
|
data/right_agent.gemspec
CHANGED
@@ -25,8 +25,8 @@ require 'rbconfig'
|
|
25
25
|
|
26
26
|
Gem::Specification.new do |spec|
|
27
27
|
spec.name = 'right_agent'
|
28
|
-
spec.version = '2.1.
|
29
|
-
spec.date = '2014-04-
|
28
|
+
spec.version = '2.1.3'
|
29
|
+
spec.date = '2014-04-10'
|
30
30
|
spec.authors = ['Lee Kirchhoff', 'Raphael Simon', 'Tony Spataro', 'Scott Messier']
|
31
31
|
spec.email = 'lee@rightscale.com'
|
32
32
|
spec.homepage = 'https://github.com/rightscale/right_agent'
|
@@ -256,7 +256,7 @@ describe RightScale::NonBlockingClient do
|
|
256
256
|
it "converts Errno::ETIMEDOUT error to 504" do
|
257
257
|
@headers.http_status = 504
|
258
258
|
@response.should_receive(:errback).and_yield.once
|
259
|
-
@response.should_receive(:error).and_return(
|
259
|
+
@response.should_receive(:error).and_return(Errno::ETIMEDOUT)
|
260
260
|
@fiber.should_receive(:resume).with(504, "Errno::ETIMEDOUT").once
|
261
261
|
flexmock(Fiber).should_receive(:yield).and_return([504, "Errno::ETIMEDOUT"]).once
|
262
262
|
flexmock(EM::HttpRequest).should_receive(:new).with(@host, @connect_options).and_return(@request).once
|
@@ -340,7 +340,7 @@ describe RightScale::NonBlockingClient do
|
|
340
340
|
end
|
341
341
|
|
342
342
|
it "stops polling if there is an error" do
|
343
|
-
@response.should_receive(:error).and_return("some error").
|
343
|
+
@response.should_receive(:error).and_return("some error").times(3)
|
344
344
|
@response.should_receive(:errback).and_yield.once
|
345
345
|
@fiber.should_receive(:resume).with(500, "some error").once
|
346
346
|
@client.send(:poll_again, @fiber, @request, @request_options, @stop_at).should be true
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: right_agent
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -12,7 +12,7 @@ authors:
|
|
12
12
|
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
|
-
date: 2014-04-
|
15
|
+
date: 2014-04-10 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: right_support
|
@@ -412,7 +412,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
412
412
|
version: '0'
|
413
413
|
segments:
|
414
414
|
- 0
|
415
|
-
hash:
|
415
|
+
hash: -3545944091295491847
|
416
416
|
requirements: []
|
417
417
|
rubyforge_project:
|
418
418
|
rubygems_version: 1.8.26
|