From 16324885134f2dca700d042759bf0b9ce76a20cd Mon Sep 17 00:00:00 2001 From: Thomas Goirand Date: Thu, 8 Jan 2015 17:18:25 +0100 Subject: [PATCH] Only does db handling if asked for it. Rewritten-From: e96333b6d1541c93600fef85ac86135bfe36345a --- xenial/debian/cinder-common.postinst.in | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/xenial/debian/cinder-common.postinst.in b/xenial/debian/cinder-common.postinst.in index 443a20aea..42cc495dd 100644 --- a/xenial/debian/cinder-common.postinst.in +++ b/xenial/debian/cinder-common.postinst.in @@ -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# -- 2.45.2