Skip to content

Commit 7af8a1b

Browse files
committed
only soft enforce requirements not in projects.txt
We're adding the ability to have devstack plugins, which should be much more free to require new things not in global requirements. Our old thinking of locking down all the requirements doesn't really work in a plugin model. Instead, if the project is in projects.txt, continue with the old behavior. If it is not, do a soft update (update all the requirements we know about, leave the ones we don't). This was previously the SOFT requirements update mode, but now it will just be the default. Change-Id: Ic0c6e01a6d7613d712ac9e7e4a378cc3a8ce75e6
1 parent c4067a3 commit 7af8a1b

File tree

2 files changed

+6
-21
lines changed

2 files changed

+6
-21
lines changed

inc/python

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -216,18 +216,14 @@ function setup_package_with_req_sync {
216216
local update_requirements=$(cd $project_dir && git diff --exit-code >/dev/null || echo "changed")
217217

218218
if [[ $update_requirements != "changed" ]]; then
219-
if [[ "$REQUIREMENTS_MODE" == "soft" ]]; then
220-
if is_in_projects_txt $project_dir; then
221-
(cd $REQUIREMENTS_DIR; \
222-
./.venv/bin/python update.py $project_dir)
223-
else
224-
# soft update projects not found in requirements project.txt
225-
(cd $REQUIREMENTS_DIR; \
226-
./.venv/bin/python update.py -s $project_dir)
227-
fi
228-
else
219+
if is_in_projects_txt $project_dir; then
229220
(cd $REQUIREMENTS_DIR; \
230221
./.venv/bin/python update.py $project_dir)
222+
else
223+
# soft update projects not found in requirements project.txt
224+
echo "$project_dir not a constrained repository, soft enforcing requirements"
225+
(cd $REQUIREMENTS_DIR; \
226+
./.venv/bin/python update.py -s $project_dir)
231227
fi
232228
fi
233229

stackrc

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -149,17 +149,6 @@ DATABASE_QUERY_LOGGING=$(trueorfalse False DATABASE_QUERY_LOGGING)
149149
# Zero disables timeouts
150150
GIT_TIMEOUT=${GIT_TIMEOUT:-0}
151151

152-
# Requirements enforcing mode
153-
#
154-
# - strict (default) : ensure all project requirements files match
155-
# what's in global requirements.
156-
#
157-
# - soft : enforce requirements on everything in
158-
# requirements/projects.txt, but do soft updates on all other
159-
# repositories (i.e. sync versions for requirements that are in g-r,
160-
# but pass through any extras)
161-
REQUIREMENTS_MODE=${REQUIREMENTS_MODE:-strict}
162-
163152

164153
# Repositories
165154
# ------------

0 commit comments

Comments
 (0)