summaryrefslogtreecommitdiffstats
path: root/lcm/docker
diff options
context:
space:
mode:
authorfujinhua <fu.jinhua@zte.com.cn>2019-04-03 09:18:28 +0800
committerfujinhua <fu.jinhua@zte.com.cn>2019-04-03 09:18:28 +0800
commitd832753cefc69cb5813316c789319b1aaff2aba8 (patch)
tree0582965fbfbea0cb7fe10c8e9c73fa9202092c4d /lcm/docker
parente7891e6a0d35b2d427305fdfdc63aba6ea79a0cb (diff)
Fix docker init db file
Change-Id: I8b4a04768d4816775606861cd2d598acc8939100 Issue-ID: VFC-1306 Signed-off-by: fujinhua <fu.jinhua@zte.com.cn>
Diffstat (limited to 'lcm/docker')
-rwxr-xr-xlcm/docker/instance_init.sh6
1 files changed, 3 insertions, 3 deletions
diff --git a/lcm/docker/instance_init.sh b/lcm/docker/instance_init.sh
index e7951192..b2c82cbb 100755
--- a/lcm/docker/instance_init.sh
+++ b/lcm/docker/instance_init.sh
@@ -22,9 +22,9 @@ function migrate_database {
python manage.py migrate
}
-cd /service
-if [ ! -f dbexist.txt ]; then
- echo 1 > dbexist.txt
+GET_VNFM_DB="show databases like 'gvnfm';"
+VNFM_DB=`mysql -u$MYSQL_ROOT_USER -p$MYSQL_ROOT_PASSWORD -P$MYSQL_PORT -h$MYSQL_IP -e "$GET_VNFM_DB"`
+if [[ "$VNFM_DB" != "" ]]; then
create_database
migrate_database
fi