]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Only does db handling if asked for it.
authorThomas Goirand <thomas@goirand.fr>
Thu, 8 Jan 2015 16:18:25 +0000 (17:18 +0100)
committerThomas Goirand <thomas@goirand.fr>
Thu, 8 Jan 2015 16:18:25 +0000 (17:18 +0100)
Rewritten-From: e96333b6d1541c93600fef85ac86135bfe36345a

xenial/debian/cinder-common.postinst.in

index 443a20aea98d9f50343b322a67f74bc569aaeaab..42cc495dd3c8c24a0f63a11b07f2ded5bbe61244 100644 (file)
@@ -21,7 +21,10 @@ if [ "$1" = "configure" ] || [ "$1" = "reconfigure" ] ; then
        pkgos_write_new_conf cinder cinder.conf
        pkgos_write_new_conf cinder api-paste.ini
        pkgos_write_new_conf cinder logging.conf
-       pkgos_dbc_postinst ${CINDER_CONF} database connection cinder $@
+       db_get cinder/configure_db
+       if [ "$RET" = "true" ]; then
+               pkgos_dbc_postinst ${CINDER_CONF} database connection cinder $@
+       fi
        pkgos_rabbit_write_conf ${CINDER_CONF} DEFAULT cinder
        pkgos_write_admin_creds ${CINDER_CONF} keystone_authtoken cinder
        db_get cinder/volume_group
@@ -29,11 +32,13 @@ if [ "$1" = "configure" ] || [ "$1" = "reconfigure" ] ; then
                pkgos_inifile set ${CINDER_CONF} DEFAULT volume_group ${RET}
        fi
 
-       db_stop
-
        chmod 0440 /etc/sudoers.d/cinder-common
-       echo "Now calling cinder-manage db sync: this may take a while..."
-       su -s /bin/sh -c 'cinder-manage db sync' cinder
+       db_get cinder/configure_db
+       if [ "$RET" = "true" ]; then
+               echo "Now calling cinder-manage db sync: this may take a while..."
+               su -s /bin/sh -c 'cinder-manage db sync' cinder
+       fi
+       db_stop
 fi
 
 #DEBHELPER#