diff options
| author | Masanori Itoh <itoumsn@nttdata.co.jp> | 2011-04-13 02:11:36 +0900 |
|---|---|---|
| committer | Masanori Itoh <itoumsn@nttdata.co.jp> | 2011-04-13 02:11:36 +0900 |
| commit | 32d081f8f0a50b87f7b5d3f5bab4cf4ba92b1b4d (patch) | |
| tree | 7975120d233b9836e84ef93307cc22ddbc333c76 | |
| parent | 4893fae4854a9b39c151a806cd7b22c319c87160 (diff) | |
| download | nova-32d081f8f0a50b87f7b5d3f5bab4cf4ba92b1b4d.tar.gz nova-32d081f8f0a50b87f7b5d3f5bab4cf4ba92b1b4d.tar.xz nova-32d081f8f0a50b87f7b5d3f5bab4cf4ba92b1b4d.zip | |
Blushed up a little bit.
| -rw-r--r-- | nova/auth/manager.py | 2 | ||||
| -rw-r--r-- | nova/utils.py | 12 |
2 files changed, 7 insertions, 7 deletions
diff --git a/nova/auth/manager.py b/nova/auth/manager.py index c8a3a46a2..01aa87e31 100644 --- a/nova/auth/manager.py +++ b/nova/auth/manager.py @@ -317,7 +317,7 @@ class AuthManager(object): if signature != expected_signature: 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 '': + if host_only != '': host_only_signature = signer.Signer( user.secret.encode()).generate(params, verb, host_only, path) diff --git a/nova/utils.py b/nova/utils.py index 8b7cbf30c..369b5265c 100644 --- a/nova/utils.py +++ b/nova/utils.py @@ -716,25 +716,25 @@ def check_isinstance(obj, cls): return cls() # Ugly PyLint hack -def get_host_only_server_string(str): +def get_host_only_server_string(server_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): + if netaddr.valid_ipv6(server_str): return '' # Next, check if this is IPv6 address with port number combination. - if str.find("]:") != -1: - [address, sep, port] = str.replace('[', '', 1).partition(']:') + if server_str.find("]:") != -1: + [address, sep, port] = server_str.replace('[', '', 1).partition(']:') return address # Third, check if this is a combination of general address and port - if str.find(':') == -1: + if server_str.find(':') == -1: return '' # This must be a combination of host part and port - [address, sep, port] = str.partition(':') + [address, sep, port] = server_str.partition(':') return address |
