Merge lp:~bigkevmcd/landscape-client/522688-turn-off-curl-dns-cache into lp:~landscape/landscape-client/trunk

Proposed by Kevin McDermott
Status: Merged
Merged at revision: not available
Proposed branch: lp:~bigkevmcd/landscape-client/522688-turn-off-curl-dns-cache
Merge into: lp:~landscape/landscape-client/trunk
Diff against target: 84 lines (+15/-7)
2 files modified
landscape/lib/fetch.py (+1/-0)
landscape/lib/tests/test_fetch.py (+14/-7)
To merge this branch: bzr merge lp:~bigkevmcd/landscape-client/522688-turn-off-curl-dns-cache
Reviewer Review Type Date Requested Status
Free Ekanayaka (community) Approve
Sidnei da Silva (community) Approve
Review via email: mp+19485@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Sidnei da Silva (sidnei) wrote :

The change looks sane. I tested this on my local machine for 3 days before upgrading to Lucid and had no errors related to DNS. +1!!

review: Approve
Revision history for this message
Free Ekanayaka (free.ekanayaka) wrote :

Great fix! +1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'landscape/lib/fetch.py'
2--- landscape/lib/fetch.py 2009-10-22 15:40:25 +0000
3+++ landscape/lib/fetch.py 2010-02-17 13:54:16 +0000
4@@ -84,6 +84,7 @@
5 curl.setopt(pycurl.LOW_SPEED_TIME, total_timeout)
6 curl.setopt(pycurl.NOSIGNAL, 1)
7 curl.setopt(pycurl.WRITEFUNCTION, input.write)
8+ curl.setopt(pycurl.DNS_CACHE_TIMEOUT, 0)
9
10 try:
11 curl.perform()
12
13=== modified file 'landscape/lib/tests/test_fetch.py'
14--- landscape/lib/tests/test_fetch.py 2010-02-03 09:54:43 +0000
15+++ landscape/lib/tests/test_fetch.py 2010-02-17 13:54:16 +0000
16@@ -93,7 +93,8 @@
17 pycurl.LOW_SPEED_LIMIT: 1,
18 pycurl.LOW_SPEED_TIME: 600,
19 pycurl.NOSIGNAL: 1,
20- pycurl.WRITEFUNCTION: Any()})
21+ pycurl.WRITEFUNCTION: Any(),
22+ pycurl.DNS_CACHE_TIMEOUT: 0})
23
24 def test_post(self):
25 curl = CurlStub("result")
26@@ -108,7 +109,8 @@
27 pycurl.LOW_SPEED_TIME: 600,
28 pycurl.NOSIGNAL: 1,
29 pycurl.WRITEFUNCTION: Any(),
30- pycurl.POST: True})
31+ pycurl.POST: True,
32+ pycurl.DNS_CACHE_TIMEOUT: 0})
33
34 def test_post_data(self):
35 curl = CurlStub("result")
36@@ -126,7 +128,8 @@
37 pycurl.WRITEFUNCTION: Any(),
38 pycurl.POST: True,
39 pycurl.POSTFIELDSIZE: 4,
40- pycurl.READFUNCTION: Any()})
41+ pycurl.READFUNCTION: Any(),
42+ pycurl.DNS_CACHE_TIMEOUT: 0})
43
44 def test_cainfo(self):
45 curl = CurlStub("result")
46@@ -141,7 +144,8 @@
47 pycurl.LOW_SPEED_TIME: 600,
48 pycurl.NOSIGNAL: 1,
49 pycurl.WRITEFUNCTION: Any(),
50- pycurl.CAINFO: "cainfo"})
51+ pycurl.CAINFO: "cainfo",
52+ pycurl.DNS_CACHE_TIMEOUT: 0})
53
54 def test_cainfo_on_http(self):
55 curl = CurlStub("result")
56@@ -163,7 +167,8 @@
57 pycurl.LOW_SPEED_TIME: 600,
58 pycurl.NOSIGNAL: 1,
59 pycurl.WRITEFUNCTION: Any(),
60- pycurl.HTTPHEADER: ["a: 1", "b: 2"]})
61+ pycurl.HTTPHEADER: ["a: 1", "b: 2"],
62+ pycurl.DNS_CACHE_TIMEOUT: 0})
63
64 def test_timeouts(self):
65 curl = CurlStub("result")
66@@ -178,7 +183,8 @@
67 pycurl.LOW_SPEED_LIMIT: 1,
68 pycurl.LOW_SPEED_TIME: 30,
69 pycurl.NOSIGNAL: 1,
70- pycurl.WRITEFUNCTION: Any()})
71+ pycurl.WRITEFUNCTION: Any(),
72+ pycurl.DNS_CACHE_TIMEOUT: 0})
73
74 def test_unicode(self):
75 """
76@@ -247,7 +253,8 @@
77 pycurl.LOW_SPEED_LIMIT: 1,
78 pycurl.LOW_SPEED_TIME: 600,
79 pycurl.NOSIGNAL: 1,
80- pycurl.WRITEFUNCTION: Any()})
81+ pycurl.WRITEFUNCTION: Any(),
82+ pycurl.DNS_CACHE_TIMEOUT: 0})
83 finally:
84 pycurl.Curl = Curl
85

Subscribers

People subscribed via source and target branches

to all changes: