From a5cac970ce87e1aecf268c61f9c37a5a3862ca93 Mon Sep 17 00:00:00 2001 From: chenxing Date: Thu, 21 Dec 2017 19:55:19 +0800 Subject: Check whether the source file exists before configuring the dashboard Change-Id: If96f8d8b4f4c87724b73ed866c9ec6007b70371c Closes-Bug: #1699083 --- docker/horizon/extend_start.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'docker') diff --git a/docker/horizon/extend_start.sh b/docker/horizon/extend_start.sh index 454e1fa49..39302b9a0 100644 --- a/docker/horizon/extend_start.sh +++ b/docker/horizon/extend_start.sh @@ -30,7 +30,9 @@ function config_dashboard { ENABLE=$1 SRC=$2 DEST=$3 - if [[ "${ENABLE}" == "yes" ]] && [[ ! -f "${DEST}" ]]; then + if [[ ! -f ${SRC} ]]; then + echo "WARNING: ${SRC} is required" + elif [[ "${ENABLE}" == "yes" ]] && [[ ! -f "${DEST}" ]]; then cp -a "${SRC}" "${DEST}" FORCE_GENERATE="yes" elif [[ "${ENABLE}" != "yes" ]] && [[ -f "${DEST}" ]]; then -- cgit v1.2.3