summaryrefslogtreecommitdiffstats
path: root/nova/auth
diff options
context:
space:
mode:
authorChris Behrens <cbehrens@codestud.com>2012-03-07 22:43:12 -0800
committerChris Behrens <cbehrens@codestud.com>2012-03-07 22:45:55 -0800
commit1e551c06bc549b43daa8aa19282c68614ef86c97 (patch)
tree88f47f5a5d227be6d3af0ebdf78470759469864b /nova/auth
parent0193d1253c48c719b7f10bb19505ebb4b52defd3 (diff)
downloadnova-1e551c06bc549b43daa8aa19282c68614ef86c97.tar.gz
nova-1e551c06bc549b43daa8aa19282c68614ef86c97.tar.xz
nova-1e551c06bc549b43daa8aa19282c68614ef86c97.zip
boto shouldn't be required for production deploys
... if you're not using ec2/s3. Fixes bug 949631 bin/nova-manage imports auth.manager which imports auth.signer which tries to import boto... but nova-manage doesn't try to authenticate. This patch allows bin/nova-manage to work if you don't have boto installed. Change-Id: I9b7929a15b991498ab0491821521ec20ed0da65c
Diffstat (limited to 'nova/auth')
-rw-r--r--nova/auth/signer.py17
1 files changed, 11 insertions, 6 deletions
diff --git a/nova/auth/signer.py b/nova/auth/signer.py
index cd4c7e253..1b351457b 100644
--- a/nova/auth/signer.py
+++ b/nova/auth/signer.py
@@ -48,12 +48,15 @@ import hashlib
import hmac
import urllib
-# NOTE(vish): for new boto
-import boto
-# for boto.utils
-import boto.provider
-# NOTE(vish): for old boto
-import boto.utils
+try:
+ # NOTE(vish): for new boto
+ import boto
+ # for boto.utils
+ import boto.provider
+ # NOTE(vish): for old boto
+ import boto.utils
+except ImportError:
+ boto = None
from nova import exception
from nova import log as logging
@@ -74,6 +77,8 @@ class Signer(object):
def s3_authorization(self, headers, verb, path):
"""Generate S3 authorization string."""
+ if not boto:
+ raise exception.Error('boto is not installed')
c_string = boto.utils.canonical_string(verb, path, headers)
hmac_copy = self.hmac.copy()
hmac_copy.update(c_string)