diff --git a/lib/cinder b/lib/cinder index ef3bd81a1f..cbe732e9b0 100644 --- a/lib/cinder +++ b/lib/cinder @@ -174,6 +174,12 @@ function configure_cinder() { # Set the paths of certain binaries CINDER_ROOTWRAP=$(get_rootwrap_location cinder) + if [[ ! -x $CINDER_ROOTWRAP ]]; then + CINDER_ROOTWRAP=$(get_rootwrap_location oslo) + if [[ ! -x $CINDER_ROOTWRAP ]]; then + die $LINENO "No suitable rootwrap found." + fi + fi # If Cinder ships the new rootwrap filters files, deploy them # (owned by root) and add a parameter to $CINDER_ROOTWRAP @@ -189,11 +195,16 @@ function configure_cinder() { sudo chown -R root:root $CINDER_CONF_DIR/rootwrap.d sudo chmod 644 $CINDER_CONF_DIR/rootwrap.d/* # Set up rootwrap.conf, pointing to /etc/cinder/rootwrap.d - sudo cp $CINDER_DIR/etc/cinder/rootwrap.conf $CINDER_CONF_DIR/ + if [[ -f $CINDER_DIR/etc/cinder/rootwrap.conf ]]; then + sudo cp $CINDER_DIR/etc/cinder/rootwrap.conf $CINDER_CONF_DIR/ + else + # rootwrap.conf is no longer shipped in Cinder itself + echo "filters_path=" | sudo tee $CINDER_CONF_DIR/rootwrap.conf > /dev/null + fi sudo sed -e "s:^filters_path=.*$:filters_path=$CINDER_CONF_DIR/rootwrap.d:" -i $CINDER_CONF_DIR/rootwrap.conf sudo chown root:root $CINDER_CONF_DIR/rootwrap.conf sudo chmod 0644 $CINDER_CONF_DIR/rootwrap.conf - # Specify rootwrap.conf as first parameter to cinder-rootwrap + # Specify rootwrap.conf as first parameter to rootwrap CINDER_ROOTWRAP="$CINDER_ROOTWRAP $CINDER_CONF_DIR/rootwrap.conf" ROOTWRAP_CINDER_SUDOER_CMD="$CINDER_ROOTWRAP *" fi