Merge lp:~fwereade/pyjuju/old-twisted-test-fix into lp:pyjuju
Proposed by
William Reade
Status: | Merged |
---|---|
Approved by: | William Reade |
Approved revision: | 522 |
Merged at revision: | 522 |
Proposed branch: | lp:~fwereade/pyjuju/old-twisted-test-fix |
Merge into: | lp:pyjuju |
Diff against target: |
36 lines (+7/-4) 2 files modified
juju/providers/ec2/tests/test_utils.py (+5/-3) juju/providers/ec2/utils.py (+2/-1) |
To merge this branch: | bzr merge lp:~fwereade/pyjuju/old-twisted-test-fix |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Kapil Thangavelu (community) | Approve | ||
Review via email: mp+101508@code.launchpad.net |
Description of the change
Tests were not expecting to run against pre-VerifyingCo
To post a comment you must log in.
Reviewers: mp+101508_ code.launchpad. net,
Message:
Please take a look.
Description: ntextFactory
Tests were not expecting to run against pre-VerifyingCo
twisted
https:/ /code.launchpad .net/~fwereade/ juju/old- twisted- test-fix/ +merge/ 101508
(do not edit description out of merge proposal)
Please review this at https:/ /codereview. appspot. com/5970089/
Affected files: ec2/tests/ test_utils. py ec2/utils. py
A [revision details]
M juju/providers/
M juju/providers/
Index: [revision details]
=== added file '[revision details]'
--- [revision details] 2012-01-01 00:00:00 +0000
+++ [revision details] 2012-01-01 00:00:00 +0000
@@ -0,0 +1,2 @@
+Old revision: <email address hidden>
+New revision: <email address hidden>
Index: juju/providers/ ec2/utils. py /ec2/utils. py' ec2/utils. py 2012-04-11 00:09:41 +0000 ec2/utils. py 2012-04-11 08:36:43 +0000
return tokens[7] (series, arch, region))
=== modified file 'juju/providers
--- juju/providers/
+++ juju/providers/
@@ -97,11 +97,12 @@
raise LookupError(
+ uri = _CURRENT_ IMAGE_URI_ TEMPLATE % (_CURRENT_ IMAGE_HOST, series)
contextFacto ry=VerifyingCon textFactory( _CURRENT_ IMAGE_HOST)
contextFacto ry=None _CURRENT_ IMAGE_URI_ TEMPLATE % (_CURRENT_ IMAGE_HOST, contextFactory) contextFactory) addErrback( handle_ 404) addCallback( extract_ ami)
if ssl and ssl_verify:
else:
- d = getPage(
series), contextFactory=
+ d = getPage(uri, contextFactory=
d.
d.
return d
Index: juju/providers/ ec2/tests/ test_utils. py /ec2/tests/ test_utils. py' ec2/tests/ test_utils. py 2012-04-11 00:09:41 +0000 ec2/tests/ test_utils. py 2012-04-11 08:19:44 +0000
=== modified file 'juju/providers
--- juju/providers/
+++ juju/providers/
@@ -116,9 +116,11 @@
"""
def match_context( value): tFactory) : tFactory is None: tFactory)
- if isinstance(value, VerifyingContex
- return True
- return False
+ if VerifyingContex
+ # We're running against an older twisted version without
+ # certificate verification.
+ return value is None
+ return isinstance(value, VerifyingContex
page = self.mocker. replace( "twisted. web.client. getPage" )
page( IMAGE_URI_ TEMPLATE % "lucid",