diff options
author | Brian Coca <bcoca@users.noreply.github.com> | 2022-04-26 11:44:29 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-26 11:44:29 -0400 |
commit | af9f628ab5af116899c884c5a514c9a9bce44e01 (patch) | |
tree | 7e6515c90ee1c43f924f4afed1685b4b8d8bb8a2 | |
parent | 3980eb8c09d170a861351f8aff4a1aa1a8cbb626 (diff) | |
download | ansible-af9f628ab5af116899c884c5a514c9a9bce44e01.tar.gz |
Add python path to version output (#77631)
To further disambiguate 'which' python is the correct python
-rw-r--r-- | changelogs/fragments/python_version_path.yml | 2 | ||||
-rw-r--r-- | lib/ansible/cli/arguments/option_helpers.py | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/changelogs/fragments/python_version_path.yml b/changelogs/fragments/python_version_path.yml new file mode 100644 index 0000000000..129b15fb78 --- /dev/null +++ b/changelogs/fragments/python_version_path.yml @@ -0,0 +1,2 @@ +minor_changes: + - version output now includes the path to the python executable that Ansible is running under diff --git a/lib/ansible/cli/arguments/option_helpers.py b/lib/ansible/cli/arguments/option_helpers.py index ad7cb24011..bd4297edbb 100644 --- a/lib/ansible/cli/arguments/option_helpers.py +++ b/lib/ansible/cli/arguments/option_helpers.py @@ -177,7 +177,7 @@ def version(prog=None): result.append(" ansible python module location = %s" % ':'.join(ansible.__path__)) result.append(" ansible collection location = %s" % ':'.join(C.COLLECTIONS_PATHS)) result.append(" executable location = %s" % sys.argv[0]) - result.append(" python version = %s" % ''.join(sys.version.splitlines())) + result.append(" python version = %s (%s)" % (''.join(sys.version.splitlines()), to_native(sys.executable))) result.append(" jinja version = %s" % j2_version) result.append(" libyaml = %s" % HAS_LIBYAML) return "\n".join(result) |