From 63e1784354a49ca45bb4ae9465d2cb6dfb31db12 Mon Sep 17 00:00:00 2001 From: Thierry Carrez Date: Fri, 10 Jan 2014 14:23:03 +0100 Subject: [PATCH] Put cinder rootwrap config in separate function Separate out Cinder's rootwrap configuration so that it can be called from Grenade's upgrade scripts. This follows the same model as Nova uses with configure_nova_rootwrap() which can be called from Grenade to refresh rootwrap config. Change-Id: Id808abc2b5754443362b3de4b3453e305d3720f3 --- lib/cinder | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/lib/cinder b/lib/cinder index cbe732e9b0..6f5fb188c9 100644 --- a/lib/cinder +++ b/lib/cinder @@ -163,15 +163,8 @@ function cleanup_cinder() { fi } -# configure_cinder() - Set config files, create data dirs, etc -function configure_cinder() { - if [[ ! -d $CINDER_CONF_DIR ]]; then - sudo mkdir -p $CINDER_CONF_DIR - fi - sudo chown $STACK_USER $CINDER_CONF_DIR - - cp -p $CINDER_DIR/etc/cinder/policy.json $CINDER_CONF_DIR - +# configure_cinder_rootwrap() - configure Cinder's rootwrap +function configure_cinder_rootwrap() { # Set the paths of certain binaries CINDER_ROOTWRAP=$(get_rootwrap_location cinder) if [[ ! -x $CINDER_ROOTWRAP ]]; then @@ -214,6 +207,18 @@ function configure_cinder() { chmod 0440 $TEMPFILE sudo chown root:root $TEMPFILE sudo mv $TEMPFILE /etc/sudoers.d/cinder-rootwrap +} + +# configure_cinder() - Set config files, create data dirs, etc +function configure_cinder() { + if [[ ! -d $CINDER_CONF_DIR ]]; then + sudo mkdir -p $CINDER_CONF_DIR + fi + sudo chown $STACK_USER $CINDER_CONF_DIR + + cp -p $CINDER_DIR/etc/cinder/policy.json $CINDER_CONF_DIR + + configure_cinder_rootwrap cp $CINDER_DIR/etc/cinder/api-paste.ini $CINDER_API_PASTE_INI