From 4d47c1ed046527767eecc093ac775b6f3cf9b419 Mon Sep 17 00:00:00 2001 From: Jonathan Rosser Date: Mon, 9 Sep 2019 11:25:13 +0100 Subject: [PATCH] Do not symlink the __pycache__ directory into the venv If a service is already started it will create files in the venv __pycache__ directory. This role will then try to symlink the non empty directory to the host, which will fail. "the directory /openstack/venvs/nova-19.1.0.dev272/lib/python3.6/ site-packages/__pycache__ is not empty, refusing to convert it" This patch stops any __pycache__ files from being symlinked to the venv, these appear to be present in suse packages [1]. [1] http://paste.openstack.org/show/773974/ Change-Id: Ib718f5de4e5ae5b401858dea6437e0039b7082e0 --- tasks/python_venv_install.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/tasks/python_venv_install.yml b/tasks/python_venv_install.yml index e72f4d0..041c38e 100644 --- a/tasks/python_venv_install.yml +++ b/tasks/python_venv_install.yml @@ -178,6 +178,7 @@ shell: >- {{ (ansible_pkg_mgr == 'apt') | ternary('dpkg -L ' ~ (venv_packages_to_symlink | join(' ')), 'rpm -ql ' ~ (venv_packages_to_symlink | join(' ')) ) }} | egrep '^.*{{ venv_python_major_version }}.*/(site|dist)-packages/.*' + | egrep -v "__pycache__" args: warn: no changed_when: false