Merge lp:~lamont/maas/bug-1504971 into lp:maas/1.8

Proposed by LaMont Jones
Status: Merged
Approved by: LaMont Jones
Approved revision: no longer in the source branch.
Merged at revision: 4052
Proposed branch: lp:~lamont/maas/bug-1504971
Merge into: lp:maas/1.8
Diff against target: 40 lines (+14/-2)
1 file modified
src/provisioningserver/rpc/clusterservice.py (+14/-2)
To merge this branch: bzr merge lp:~lamont/maas/bug-1504971
Reviewer Review Type Date Requested Status
Blake Rouse (community) Approve
Review via email: mp+274290@code.launchpad.net

Commit message

[bug=1504971] Fix bug 1372767 regression.

Description of the change

Fix bug 1372767 regression. Closes bug 1504971. Bug 1505748 filed against twisted.

To post a comment you must log in.
Revision history for this message
Ricardo Bánffy (rbanffy) wrote :

One very minor suggestion

Revision history for this message
Blake Rouse (blake-rouse) wrote :

Approved. Following ricardo's suggestion.

review: Approve
Revision history for this message
Andres Rodriguez (andreserl) wrote :

Lamont, shouldn't this have landed in 1.9 too?

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/provisioningserver/rpc/clusterservice.py'
2--- src/provisioningserver/rpc/clusterservice.py 2015-08-03 18:04:27 +0000
3+++ src/provisioningserver/rpc/clusterservice.py 2015-10-13 20:29:29 +0000
4@@ -109,6 +109,15 @@
5 from twisted.web.client import getPage
6 from zope.interface import implementer
7
8+# XXX lamont 2015-10-13 LP:1504971 aka 1372767 revisited aka 1505748.
9+# Twisted 15+ changes the name of web.client._URI class to web.client.URI.
10+# Once we can require a new enough twisted to have the fix for 1505748, we
11+# can drop the entire patch to twisted.
12+try:
13+ from twisted.web.client import _URI as URI
14+except ImportError:
15+ from twisted.web.client import URI
16+
17
18 maaslog = get_maas_logger("rpc.cluster")
19
20@@ -638,7 +647,7 @@
21 log.msg("Peer certificate: %r" % self.peerCertificate)
22
23
24-class PatchedURI(twisted.web.client._URI):
25+class PatchedURI(URI):
26
27 @classmethod
28 def fromBytes(cls, uri, defaultPort=None):
29@@ -713,7 +722,10 @@
30 # URL with an IPv6 address, at the point where `_makeGetterFactory`
31 # calls `fromBytes`. That last function assumes that a colon can only
32 # occur in the URL's netloc portion as part of a port specification.
33- twisted.web.client._URI = PatchedURI
34+ if hasattr(twisted.web.client, "_URI"):
35+ twisted.web.client._URI = PatchedURI
36+ else:
37+ twisted.web.client.URI = PatchedURI
38
39 def startService(self):
40 self.time_started = self.clock.seconds()

Subscribers

People subscribed via source and target branches

to all changes: