mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-18 16:31:26 -07:00
[PR #8944/a7d1b0fc backport][stable-9] python_runner/django_command: bugfixes (#8946)
python_runner/django_command: bugfixes (#8944)
* python_runner/django_command: bugfixes
* fix indentation
* join path_prefix with : when concatenating with PATH
* add changelog frag
(cherry picked from commit a7d1b0fc52
)
Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
This commit is contained in:
parent
43772cfbbb
commit
55d44975dd
12 changed files with 349 additions and 2 deletions
|
@ -22,10 +22,12 @@ class PythonRunner(CmdRunner):
|
|||
if (os.path.isabs(python) or '/' in python):
|
||||
self.python = python
|
||||
elif self.has_venv:
|
||||
path_prefix = os.path.join(venv, "bin")
|
||||
if path_prefix is None:
|
||||
path_prefix = []
|
||||
path_prefix.append(os.path.join(venv, "bin"))
|
||||
if environ_update is None:
|
||||
environ_update = {}
|
||||
environ_update["PATH"] = "%s:%s" % (path_prefix, os.environ["PATH"])
|
||||
environ_update["PATH"] = "%s:%s" % (":".join(path_prefix), os.environ["PATH"])
|
||||
environ_update["VIRTUAL_ENV"] = venv
|
||||
|
||||
python_cmd = [self.python] + _ensure_list(command)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue