From d023df6e25fc264acd6f85368d70e44ac72b18a4 Mon Sep 17 00:00:00 2001 From: Martin Krizek Date: Mon, 20 Jan 2020 17:05:04 +0100 Subject: [PATCH] More converting --- lib/ansible/cli/arguments/option_helpers.py | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/lib/ansible/cli/arguments/option_helpers.py b/lib/ansible/cli/arguments/option_helpers.py index db7e3a2adac846..0e7371024344ac 100644 --- a/lib/ansible/cli/arguments/option_helpers.py +++ b/lib/ansible/cli/arguments/option_helpers.py @@ -163,24 +163,31 @@ def _gitinfo(): def version(prog=None): """ return ansible version """ + u_version = to_text(__version__) if prog: - result = u" ".join((prog, __version__)) + result = u" ".join((prog, u_version)) else: - result = __version__ + result = u_version gitinfo = _gitinfo() if gitinfo: result = result + u" {0}".format(gitinfo) result += u"\n config file = %s" % to_text(C.CONFIG_FILE) + if C.DEFAULT_MODULE_PATH is None: cpath = u"Default w/o overrides" else: cpath = u":".join(C.DEFAULT_MODULE_PATH) - python_module_location = u":".join(map(to_text, ansible.__path__)) result = result + u"\n configured module search path = %s" % cpath + + python_module_location = u":".join(map(to_text, ansible.__path__)) result = result + u"\n ansible python module location = %s" % python_module_location - result = result + u"\n executable location = %s" % to_text(sys.argv[0]) - result = result + u"\n python version = %s" % ''.join(sys.version.splitlines()) + + executable_location = to_text(sys.argv[0]) + result = result + u"\n executable location = %s" % executable_location + + python_version = u"".join(map(to_text, sys.version.splitlines())) + result = result + u"\n python version = %s" % python_version return result