Run chown for egg-info only if the directory exists

9-stream jobs failing since [1] merged as these still use
GLOBAL_VENV=False.
egg-info directory is not created in project source
directory when pyproject.toml is used in the project.
pyproject.toml being added across projects[2] to support pip 23.1.

[1] https://review.opendev.org/c/openstack/nova/+/899753
[2] https://review.opendev.org/q/topic:%22pip-23.1-support%22

Change-Id: I53954a37461aee5dd7f487d6bd205caef4408392
This commit is contained in:
yatinkarel 2024-09-02 17:29:55 +05:30 committed by yatin
parent 5ed2b7c6b2
commit 0ff6272862

View File

@ -474,7 +474,10 @@ function setup_package {
pip_install $flags "$project_dir$extras"
# ensure that further actions can do things like setup.py sdist
if [[ "$flags" == "-e" && "$GLOBAL_VENV" == "False" ]]; then
safe_chown -R $STACK_USER $1/*.egg-info
# egg-info is not created when project have pyproject.toml
if [ -d $1/*.egg-info ]; then
safe_chown -R $STACK_USER $1/*.egg-info
fi
fi
}