Merge "Code cleanup"

This commit is contained in:
Jenkins 2016-10-17 15:47:20 +00:00 committed by Gerrit Code Review
commit e1a14ad1a9
2 changed files with 5 additions and 4 deletions

View File

@ -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():

View File

@ -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)