summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMasanori Itoh <itoumsn@nttdata.co.jp>2011-04-07 23:48:00 +0900
committerMasanori Itoh <itoumsn@nttdata.co.jp>2011-04-07 23:48:00 +0900
commit8c4fa0f16ac170662e113edfdc0f8d3c8863f082 (patch)
tree42c0073c50f455b26d9ec6507f6346ff1b8e19f0
parent92d710ea738502f0ab4ec69bc6b12042f814be41 (diff)
Blush up a bit.
-rw-r--r--nova/auth/manager.py14
-rw-r--r--nova/utils.py8
2 files changed, 12 insertions, 10 deletions
diff --git a/nova/auth/manager.py b/nova/auth/manager.py
index f1d4a1e39..c8a3a46a2 100644
--- a/nova/auth/manager.py
+++ b/nova/auth/manager.py
@@ -315,15 +315,15 @@ class AuthManager(object):
LOG.debug('expected_signature: %s', expected_signature)
LOG.debug('signature: %s', signature)
if signature != expected_signature:
- secondary = utils.get_secondary_server_string(server_string)
- if secondary is not '':
- secondary_signature = signer.Signer(
+ host_only = utils.get_host_only_server_string(server_string)
+ # If the given server_string contains port num, try without it.
+ if host_only is not '':
+ host_only_signature = signer.Signer(
user.secret.encode()).generate(params, verb,
- secondary, path)
- LOG.debug('secondary_signature: %s', secondary_signature)
- if signature == secondary_signature:
+ host_only, path)
+ LOG.debug('host_only_signature: %s', host_only_signature)
+ if signature == host_only_signature:
return (user, project)
- # NOTE(itoumsn): RightAWS success case.
LOG.audit(_("Invalid signature for user %s"), user.name)
raise exception.NotAuthorized(_('Signature does not match'))
return (user, project)
diff --git a/nova/utils.py b/nova/utils.py
index 3e938247f..8b7cbf30c 100644
--- a/nova/utils.py
+++ b/nova/utils.py
@@ -716,9 +716,11 @@ def check_isinstance(obj, cls):
return cls() # Ugly PyLint hack
-def get_secondary_server_string(str):
- """Returns host part only of the given server_string if it's a combination
- of host part and port. Otherwise, return null string."""
+def get_host_only_server_string(str):
+ """
+ Returns host part only of the given server_string if it's a combination
+ of host part and port. Otherwise, return null string.
+ """
# First of all, exclude pure IPv6 address (w/o port).
if netaddr.valid_ipv6(str):