qat, initcontainer: Improve the logic of config check

The check_config function previously only considered the
ServicesEnabled variable. Improve the logic of the function so
that other variables can also be set through the qat.conf file.

Signed-off-by: Hyeongju Johannes Lee <hyeongju.lee@intel.com>
This commit is contained in:
Hyeongju Johannes Lee 2024-09-26 12:40:30 -07:00
parent b505897d8c
commit 4d26e9517c

View File

@ -12,8 +12,8 @@ SERVICES_ENABLED="NONE"
SERVICES_ENABLED_FOUND="FALSE"
check_config() {
[ -f "conf/qat.conf" ] && SERVICES_ENABLED=$(cut -d= -f 2 conf/qat.conf | grep '\S')
[ -f "conf/qat-$NODE_NAME.conf" ] && SERVICES_ENABLED=$(cut -d= -f 2 conf/qat-$NODE_NAME.conf | grep '\S')
[ -f "conf/qat.conf" ] && SERVICES_ENABLED=$(grep "^ServicesEnabled=" conf/qat.conf | cut -d= -f 2 | grep '\S')
[ -f "conf/qat-$NODE_NAME.conf" ] && SERVICES_ENABLED=$(grep "^ServicesEnabled=" conf/qat-"$NODE_NAME".conf | cut -d= -f 2 | grep '\S')
if [ "$SERVICES_ENABLED" != "NONE" ]; then
SERVICES_ENABLED_FOUND="FALSE"