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
diff --git a/inc/python b/inc/python
index 1fd4147..2083b74 100644
--- a/inc/python
+++ b/inc/python
@@ -474,7 +474,10 @@
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
}