Fix boto capabilities check

In commit 4845fc27 a capability check for the boto library has been
accidentally broken. boto.connection existed in all versions and it
was HTTPResponse class that should cause the ImportError.
Exception will not happen on the import line anymore, so check the
capabilities using hasattr() instead.

Change-Id: Ic9bff71b91de685a958400f12836322c7ca996c4
This commit is contained in:
Stanislaw Pitucha
2013-01-30 11:21:25 +00:00
parent b53b6b030f
commit 8748b8b37d

View File

@@ -22,12 +22,13 @@ import random
import StringIO
import boto
import boto.connection
from boto.ec2 import regioninfo
from boto import exception as boto_exc
# newer versions of boto use their own wrapper on top of httplib.HTTPResponse
try:
import boto.connection as httplib
except ImportError:
if hasattr(boto.connection, 'HTTPResponse'):
httplib = boto.connection
else:
import httplib
import fixtures
import webob