Skip to content

deploy: Fix system python handling - #506

Merged
dvolodin7 merged 3 commits into
masterfrom
fix-system-python-handling
Sep 4, 2026
Merged

deploy: Fix system python handling#506
dvolodin7 merged 3 commits into
masterfrom
fix-system-python-handling

Conversation

@dvolodin7

@dvolodin7 dvolodin7 commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator

Correct the value assigned to noc_init_python_path in the "use system Python" branch of the NOC virtualenv bootstrap, so the correct system interpreter is used when the host provides one.

Background

system_python3_path (init_venv_python3.yml:27) is the `register:` of a `stat` module call, not a path string. The original bare-scalar form noc_init_python_path: system_python3_path assigned the literal string `"system_python3_path"`; the first fix attempt {{ system_python3_path }} stringifies the entire register dict. Either way the interpreter string fed to virtualenv_command (line 156) is invalid and venv creation fails on systems where the host has a matching system Python3.

Change

  • ansible/noc_roles/noc/tasks/init_venv_python3.yml (+1/−1)
    • noc_init_python_path: "{{ system_python3_path.stat.path }}" — extracts the resolved path from the `stat` register, consistent with .stat / .stdout extraction already used elsewhere in this file.

@dvolodin7 dvolodin7 added this to the 26.0 milestone Sep 4, 2026
@dvolodin7 dvolodin7 self-assigned this Sep 4, 2026
@dvolodin7 dvolodin7 added the backport release-25.1 Backport changes to release-25.1 label Sep 4, 2026
@github-actions github-actions Bot added the deploy Ansible deploy label Sep 4, 2026
@dvolodin7
dvolodin7 merged commit ef67f02 into master Sep 4, 2026
1 check passed
@dvolodin7
dvolodin7 deleted the fix-system-python-handling branch September 4, 2026 12:33
@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown

Successfully created backport PR for release-25.1:

dvolodin7 added a commit that referenced this pull request Sep 4, 2026
(cherry picked from commit ef67f02)

Co-authored-by: Dmitry Volodin <dv@nocproject.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport release-25.1 Backport changes to release-25.1 deploy Ansible deploy

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant