Merge "Code cleanup"
This commit is contained in:
commit
e1a14ad1a9
|
@ -17,6 +17,9 @@
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
from keystone.cmd import cli
|
||||||
|
|
||||||
|
|
||||||
# If ../../keystone/__init__.py exists, add ../../ to Python search path, so
|
# If ../../keystone/__init__.py exists, add ../../ to Python search path, so
|
||||||
# that it will override what happens to be installed in
|
# that it will override what happens to be installed in
|
||||||
# /usr/(local/)lib/python...
|
# /usr/(local/)lib/python...
|
||||||
|
@ -29,8 +32,6 @@ if os.path.exists(os.path.join(possible_topdir,
|
||||||
'__init__.py')):
|
'__init__.py')):
|
||||||
sys.path.insert(0, possible_topdir)
|
sys.path.insert(0, possible_topdir)
|
||||||
|
|
||||||
from keystone.cmd import cli
|
|
||||||
|
|
||||||
|
|
||||||
# entry point.
|
# entry point.
|
||||||
def main():
|
def main():
|
||||||
|
|
|
@ -580,7 +580,7 @@ def remove_standard_port(url):
|
||||||
# remove the default ports specified in RFC2616 and 2818
|
# remove the default ports specified in RFC2616 and 2818
|
||||||
o = moves.urllib.parse.urlparse(url)
|
o = moves.urllib.parse.urlparse(url)
|
||||||
separator = ':'
|
separator = ':'
|
||||||
(host, separator, port) = o.netloc.partition(':')
|
(host, separator, port) = o.netloc.partition(separator)
|
||||||
if o.scheme.lower() == 'http' and port == '80':
|
if o.scheme.lower() == 'http' and port == '80':
|
||||||
# NOTE(gyee): _replace() is not a private method. It has
|
# NOTE(gyee): _replace() is not a private method. It has
|
||||||
# an underscore prefix to prevent conflict with field names.
|
# 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")
|
"occurred during string substitution: %(typeerror)s")
|
||||||
LOG.error(msg, {"url": url, "typeerror": e})
|
LOG.error(msg, {"url": url, "typeerror": e})
|
||||||
raise exception.MalformedEndpoint(endpoint=url)
|
raise exception.MalformedEndpoint(endpoint=url)
|
||||||
except ValueError as e:
|
except ValueError:
|
||||||
msg = _LE("Malformed endpoint %s - incomplete format "
|
msg = _LE("Malformed endpoint %s - incomplete format "
|
||||||
"(are you missing a type notifier ?)")
|
"(are you missing a type notifier ?)")
|
||||||
LOG.error(msg, url)
|
LOG.error(msg, url)
|
||||||
|
|
Loading…
Reference in New Issue