From 325792d9b9238f9a8b8b493ba50572add99b9d82 Mon Sep 17 00:00:00 2001 From: Ghanshyam Mann Date: Fri, 15 Oct 2021 15:55:54 -0500 Subject: [PATCH] Clarify error message for ERROR_ON_CLONE=True If ERROR_ON_CLONE is set to True which is case for all the devstack based job, devstack does not clone the repo instead raise error. From current error message, it is difficult to know that ERROR_ON_CLONE is True until we traceback the code or check devstack-base job set ERROR_ON_CLONE to True. Current error message is like: ------- + functions-common:git_clone:560 : echo 'The /opt/stack/oslo.limit project was not found; if this is a gate job, add' The /opt/stack/oslo.limit project was not found; if this is a gate job, add + functions-common:git_clone:561 : echo 'the project to the $PROJECTS variable in the job definition.' the project to the $PROJECTS variable in the job definition. + functions-common:git_clone:562 : die 562 'Cloning not allowed in this configuration' -------- Adding ERROR_ON_CLONE info in error message will help to know the reason of devstack not cloning the repo. Change-Id: I9e9852f046fefb299b4ef4446323e9c86437212f --- functions-common | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/functions-common b/functions-common index 11679e4aa3..7a628db737 100644 --- a/functions-common +++ b/functions-common @@ -547,7 +547,7 @@ function git_clone { if [[ "$ERROR_ON_CLONE" = "True" ]]; then echo "The $git_dest project was not found; if this is a gate job, add" echo "the project to 'required-projects' in the job definition." - die $LINENO "Cloning not allowed in this configuration" + die $LINENO "ERROR_ON_CLONE is set to True so cloning not allowed in this configuration" fi git_timed clone $git_clone_flags $git_remote $git_dest fi @@ -559,7 +559,7 @@ function git_clone { if [[ "$ERROR_ON_CLONE" = "True" ]]; then echo "The $git_dest project was not found; if this is a gate job, add" echo "the project to the \$PROJECTS variable in the job definition." - die $LINENO "Cloning not allowed in this configuration" + die $LINENO "ERROR_ON_CLONE is set to True so cloning not allowed in this configuration" fi # '--branch' can also take tags git_timed clone $git_clone_flags $git_remote $git_dest --branch $git_ref