Merge "Further harden boto version checking in EC2 tests" into stable/havana

This commit is contained in:
Jenkins 2014-03-27 21:28:51 +00:00 committed by Gerrit Code Review
commit 1a2f40c8ea

View File

@ -18,6 +18,7 @@
"""Unit tests for the API endpoint."""
import pkg_resources
import random
import re
import StringIO
@ -272,10 +273,11 @@ class ApiEc2TestCase(test.TestCase):
self.http = FakeHttplibConnection(
self.app, '%s:8773' % (self.host), False)
# pylint: disable=E1103
if boto.Version >= '2.14':
boto_version = pkg_resources.parse_version(boto.Version)
if boto_version >= pkg_resources.parse_version('2.14'):
self.ec2.new_http_connection(host or self.host, 8773,
is_secure).AndReturn(self.http)
elif boto.Version >= '2':
elif boto_version >= pkg_resources.parse_version('2'):
self.ec2.new_http_connection(host or '%s:8773' % (self.host),
is_secure).AndReturn(self.http)
else: