From d2afaf90d7f5e4a439f674e310efcda4dad3f918 Mon Sep 17 00:00:00 2001 From: Manuel Montecelo Date: Mon, 9 Jul 2018 16:20:02 +0200 Subject: [PATCH] TT#37257 Combine the detection of "edition" in a single logic block Change-Id: Ib12a8fca74ee5368ed456561ba59a9230bf5619d --- templates/scripts/includes/deployment.sh | 25 ++++++++++++------------ 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/templates/scripts/includes/deployment.sh b/templates/scripts/includes/deployment.sh index 2c0bb63..9f7454a 100755 --- a/templates/scripts/includes/deployment.sh +++ b/templates/scripts/includes/deployment.sh @@ -372,18 +372,22 @@ fi if checkBootParam ngcpce ; then CE_EDITION=true -fi - -if checkBootParam ngcppro || checkBootParam ngcpsp1 || checkBootParam ngcpsp2 ; then +elif checkBootParam ngcppro || checkBootParam ngcpsp1 || checkBootParam ngcpsp2 ; then PRO_EDITION=true -fi - -if "$PRO_EDITION" ; then - ROLE=sp1 - if checkBootParam ngcpsp2 ; then ROLE=sp2 + else + ROLE=sp1 fi +elif checkBootParam 'ngcpcrole=' ; then + CROLE=$(getBootParam ngcpcrole) + CARRIER_EDITION=true +elif checkBootParam "puppetenv=" ; then + # will be determined later + : +else + echo "Error: Could not determine 'edition' (spce, sppro, carrier)." + exit 1 fi if checkBootParam "puppetenv=" ; then @@ -466,11 +470,6 @@ if checkBootParam 'ngcpmcast=' ; then MCASTADDR=$(getBootParam ngcpmcast) fi -if checkBootParam 'ngcpcrole=' ; then - CROLE=$(getBootParam ngcpcrole) - CARRIER_EDITION=true -fi - if checkBootParam ngcphalt ; then HALT=true fi