Merge lp:~gandelman-a/ubuntu/natty/facter/732953_fixregress into lp:ubuntu/natty-proposed/facter

Proposed by Adam Gandelman
Status: Merged
Merged at revision: 17
Proposed branch: lp:~gandelman-a/ubuntu/natty/facter/732953_fixregress
Merge into: lp:ubuntu/natty-proposed/facter
Diff against target: 58 lines (+20/-5)
3 files modified
debian/changelog (+8/-0)
debian/patches/fix_ec2_metadata_facts.patch (+9/-4)
lib/facter/ec2.rb (+3/-1)
To merge this branch: bzr merge lp:~gandelman-a/ubuntu/natty/facter/732953_fixregress
Reviewer Review Type Date Requested Status
Ubuntu Development Team Pending
Review via email: mp+81487@code.launchpad.net

Description of the change

Fixes a regression introduced in last SRU where timeouts are not being properly rescued.

To post a comment you must log in.
17. By Adam Gandelman

debian/changelog: Update bug reference.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2011-10-20 10:40:35 +0000
3+++ debian/changelog 2011-11-07 20:30:29 +0000
4@@ -1,3 +1,11 @@
5+facter (1.5.8-2ubuntu2.2) natty-proposed; urgency=low
6+
7+ * debian/patches/fix_ec2_metadata_facts.patch: Refreshed to rescue condition
8+ in can_connect() when timeout() actually has a chance to timeout.
9+ (LP: #885998)
10+
11+ -- Adam Gandelman <adamg@canonical.com> Mon, 07 Nov 2011 10:47:01 -0800
12+
13 facter (1.5.8-2ubuntu2.1) natty-proposed; urgency=low
14
15 * debian/patches/reload_all_facts.patch: Reload all facts if the
16
17=== modified file 'debian/patches/fix_ec2_metadata_facts.patch'
18--- debian/patches/fix_ec2_metadata_facts.patch 2011-10-20 10:40:35 +0000
19+++ debian/patches/fix_ec2_metadata_facts.patch 2011-11-07 20:30:29 +0000
20@@ -8,9 +8,9 @@
21
22 Index: facter/lib/facter/ec2.rb
23 ===================================================================
24---- facter.orig/lib/facter/ec2.rb 2011-10-18 18:47:15.469068474 -0700
25-+++ facter/lib/facter/ec2.rb 2011-10-18 18:49:57.797076713 -0700
26-@@ -6,7 +6,8 @@
27+--- facter.orig/lib/facter/ec2.rb 2011-11-07 10:41:18.347998025 -0800
28++++ facter/lib/facter/ec2.rb 2011-11-07 10:41:50.335999406 -0800
29+@@ -6,9 +6,12 @@
30 require 'timeout'
31
32 def can_connect?(ip,port,wait_sec=2)
33@@ -18,5 +18,10 @@
34 + url = "http://#{ip}:#{port}"
35 + Timeout::timeout(wait_sec) {open(url)}
36 return true
37- rescue
38+-rescue
39++ rescue Timeout::Error
40++ return false
41++ rescue
42 return false
43+ end
44+
45
46=== modified file 'lib/facter/ec2.rb'
47--- lib/facter/ec2.rb 2011-10-20 10:40:35 +0000
48+++ lib/facter/ec2.rb 2011-11-07 20:30:29 +0000
49@@ -9,7 +9,9 @@
50 url = "http://#{ip}:#{port}"
51 Timeout::timeout(wait_sec) {open(url)}
52 return true
53-rescue
54+ rescue Timeout::Error
55+ return false
56+ rescue
57 return false
58 end
59

Subscribers

People subscribed via source and target branches