diff --git a/keystone/cmd/manage.py b/keystone/cmd/manage.py index 383892207c..bcae3dfce1 100644 --- a/keystone/cmd/manage.py +++ b/keystone/cmd/manage.py @@ -17,6 +17,9 @@ import os import sys +from keystone.cmd import cli + + # If ../../keystone/__init__.py exists, add ../../ to Python search path, so # that it will override what happens to be installed in # /usr/(local/)lib/python... @@ -29,8 +32,6 @@ if os.path.exists(os.path.join(possible_topdir, '__init__.py')): sys.path.insert(0, possible_topdir) -from keystone.cmd import cli - # entry point. def main(): diff --git a/keystone/common/utils.py b/keystone/common/utils.py index 096e077b57..16f44e19ce 100644 --- a/keystone/common/utils.py +++ b/keystone/common/utils.py @@ -580,7 +580,7 @@ def remove_standard_port(url): # remove the default ports specified in RFC2616 and 2818 o = moves.urllib.parse.urlparse(url) separator = ':' - (host, separator, port) = o.netloc.partition(':') + (host, separator, port) = o.netloc.partition(separator) if o.scheme.lower() == 'http' and port == '80': # NOTE(gyee): _replace() is not a private method. It has # an underscore prefix to prevent conflict with field names. @@ -626,7 +626,7 @@ def format_url(url, substitutions, silent_keyerror_failures=None): "occurred during string substitution: %(typeerror)s") LOG.error(msg, {"url": url, "typeerror": e}) raise exception.MalformedEndpoint(endpoint=url) - except ValueError as e: + except ValueError: msg = _LE("Malformed endpoint %s - incomplete format " "(are you missing a type notifier ?)") LOG.error(msg, url)