From 8748b8b37d8ee718c80a79a41d8c369b2f69ee08 Mon Sep 17 00:00:00 2001 From: Stanislaw Pitucha Date: Wed, 30 Jan 2013 11:21:25 +0000 Subject: [PATCH] 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 --- nova/tests/test_api.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/nova/tests/test_api.py b/nova/tests/test_api.py index 11c16d6d..949f5451 100644 --- a/nova/tests/test_api.py +++ b/nova/tests/test_api.py @@ -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