Skip to content

Commit

Permalink
Change the python_exec path to /usr/bin/python3 (#1587)
Browse files Browse the repository at this point in the history
  • Loading branch information
shatakshiiii authored Jul 27, 2023
1 parent 7868044 commit c5a8056
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/ansible_navigator/actions/collections.py
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ def _run_runner(self) -> None:

if self._args.execution_environment:
self._logger.debug("running collections command with execution environment enabled")
python_exec_path = "python3"
python_exec_path = "/usr/bin/python3"
utils_lib = os.path.join(
os.path.dirname(__file__),
"..",
Expand Down
2 changes: 1 addition & 1 deletion src/ansible_navigator/actions/images.py
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,7 @@ def _run_runner(self, image_name: str) -> tuple[str, str, int]:
"""
cache_path = self._args.internals.cache_path
container_volume_mounts = [f"{cache_path}:{cache_path}"]
python_exec_path = "python3"
python_exec_path = "/usr/bin/python3"

kwargs = {
"cmdline": [f"{cache_path}/image_introspect.py"],
Expand Down
10 changes: 8 additions & 2 deletions src/ansible_navigator/data/image_introspect.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,12 +280,18 @@ def commands(self) -> list[Command]:
:returns: The defined command
"""
pre = Command(id_="pip_freeze", command="python3 -m pip freeze", parse=self.parse_freeze)
pre = Command(
id_="pip_freeze", command="/usr/bin/python3 -m pip freeze", parse=self.parse_freeze
)
run_command(pre)
pre.parse(pre)
pkgs = " ".join(pkg for pkg in pre.details[0]) if pre.details else ""
return [
Command(id_="python_packages", command=f"python3 -m pip show {pkgs}", parse=self.parse),
Command(
id_="python_packages",
command=f"/usr/bin/python3 -m pip show {pkgs}",
parse=self.parse,
),
]

def parse(self, command):
Expand Down

0 comments on commit c5a8056

Please sign in to comment.