Merge "Support oslo-rootwrap in lib/cinder"

This commit is contained in:
Jenkins 2013-12-17 01:31:53 +00:00 committed by Gerrit Code Review
commit ba3c636404

View File

@ -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