summaryrefslogtreecommitdiffstats
path: root/lcm/docker/instance_config.sh
diff options
context:
space:
mode:
authorfujinhua <fu.jinhua@zte.com.cn>2019-04-02 10:38:20 +0800
committerfujinhua <fu.jinhua@zte.com.cn>2019-04-02 10:38:20 +0800
commitec6cbe7e2f8561e481d4d6a92d459ea6a5d5afa2 (patch)
tree41a4b428b128d25eb871f4ad55890754abbfeec6 /lcm/docker/instance_config.sh
parenteef1769b34efad6f59224213618719356bf0f35c (diff)
Fix docker init and config file
Change-Id: Idebc9c03cd050c3d14cdb7eaa7832258ba97e8cd Issue-ID: VFC-1306 Signed-off-by: fujinhua <fu.jinhua@zte.com.cn>
Diffstat (limited to 'lcm/docker/instance_config.sh')
-rwxr-xr-xlcm/docker/instance_config.sh12
1 files changed, 5 insertions, 7 deletions
diff --git a/lcm/docker/instance_config.sh b/lcm/docker/instance_config.sh
index 359dc438..c7cc7504 100755
--- a/lcm/docker/instance_config.sh
+++ b/lcm/docker/instance_config.sh
@@ -21,17 +21,15 @@ sed -i "s/127.0.0.1:80/$MSB_IP:$MSB_PORT/" vfc/gvnfm/vnflcm/lcm/lcm/pub/config/c
MYSQL_IP=`echo $MYSQL_ADDR | cut -d: -f 1`
MYSQL_PORT=`echo $MYSQL_ADDR | cut -d: -f 2`
echo "MYSQL_ADDR=$MYSQL_ADDR"
-MYSQL_USER=`echo $MYSQL_AUTH | cut -d: -f 1`
-MYSQL_ROOT_PASSWORD=`echo $MYSQL_AUTH | cut -d: -f 2`
-REDIS_IP=`echo $REDIS_ADDR | cut -d: -f 1`
-REDIS_PORT=`echo $REDIS_ADDR | cut -d: -f 2`
+if [ $REDIS_ADDR ]; then
+ REDIS_IP=`echo $REDIS_ADDR | cut -d: -f 1`
+else
+ REDIS_IP="$MYSQL_ADDR"
+fi
sed -i "s|DB_IP.*|DB_IP = '$MYSQL_IP'|" vfc/gvnfm/vnflcm/lcm/lcm/pub/config/config.py
sed -i "s|DB_PORT.*|DB_PORT = $MYSQL_PORT|" vfc/gvnfm/vnflcm/lcm/lcm/pub/config/config.py
sed -i "s|REDIS_HOST.*|REDIS_HOST = '$REDIS_IP'|" vfc/gvnfm/vnflcm/lcm/lcm/pub/config/config.py
-sed -i "s|REDIS_HOST.*|REDIS_HOST = '$REDIS_PORT'|" vfc/gvnfm/vnflcm/lcm/lcm/pub/config/config.py
-sed -i "s|DB_USER.*|DB_USER = '$MYSQL_USER'|" vfc/gvnfm/vnflcm/lcm/lcm/pub/config/config.py
-sed -i "s|DB_PASSWD.*|DB_PASSWD = '$MYSQL_ROOT_PASSWORD'|" vfc/gvnfm/vnflcm/lcm/lcm/pub/config/config.py
cat vfc/gvnfm/vnflcm/lcm/lcm/pub/config/config.py