From 7e9120d10db671b65df70f8433064756a34517e4 Mon Sep 17 00:00:00 2001 From: Herry Huang Date: Mon, 12 Sep 2016 19:03:40 +0800 Subject: Add ip and mac valid check functionality Add function check_input_para in /deploy/launch.sh to check whether there is invalid address in DHA and NETWORK file after function process_input_para is called. Check_input_para is defined in /deploy/deploy_parameter.sh and calls check_valid.py in /util. Exit installation when invalid address or format error is found. JIRA:COMPASS-480 Change-Id: Ib01c368db6b48cbded0045a2819d895c980c2b1b Signed-off-by: Herry Huang --- deploy/deploy_parameter.sh | 9 +++++++++ deploy/launch.sh | 3 ++- 2 files changed, 11 insertions(+), 1 deletion(-) (limited to 'deploy') diff --git a/deploy/deploy_parameter.sh b/deploy/deploy_parameter.sh index d8696ce8..92e3467d 100755 --- a/deploy/deploy_parameter.sh +++ b/deploy/deploy_parameter.sh @@ -111,3 +111,12 @@ function process_input_para() echo $input_file } + +function check_input_para() +{ + python ${COMPASS_DIR}/util/check_valid.py "$DHA" "$NETWORK" + if [ $? -ne 0 ];then + exit 1 + fi +} + diff --git a/deploy/launch.sh b/deploy/launch.sh index 488e0fd7..f73b400a 100755 --- a/deploy/launch.sh +++ b/deploy/launch.sh @@ -18,7 +18,8 @@ source ${COMPASS_DIR}/deploy/prepare.sh prepare_python_env source ${COMPASS_DIR}/util/log.sh source ${COMPASS_DIR}/deploy/deploy_parameter.sh -source $(process_input_para $*) || exit 1 +source $(process_input_para $* ) || exit 1 +check_input_para source $(process_default_para $*) || exit 1 source ${COMPASS_DIR}/deploy/conf/${FLAVOR}.conf source ${COMPASS_DIR}/deploy/conf/${TYPE}.conf -- cgit 1.2.3-korg