Skip to content

Commit be5d3f2

Browse files
committed
Adjust support for upcoming rootwrap changes
Adjust the recently-added support for upcoming nova-rootwrap changes to match the latest proposed implementation. We now have a rootwrap.conf configuration files that must point to the directory where the filters are actually defined. See https://review.openstack.org/#/c/8747/1 for the Nova change that justifies this. Change-Id: I20f2bff0f9e87cb11d58f083a326656c4a124bf1
1 parent 1c620df commit be5d3f2

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

stack.sh

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1194,19 +1194,26 @@ sudo chown `whoami` $NOVA_CONF_DIR
11941194

11951195
cp -p $NOVA_DIR/etc/nova/policy.json $NOVA_CONF_DIR
11961196

1197-
# If Nova ships the new rootwrap.d config files, deploy them
1197+
# If Nova ships the new rootwrap filters files, deploy them
11981198
# (owned by root) and add a parameter to $NOVA_ROOTWRAP
11991199
ROOTWRAP_SUDOER_CMD="$NOVA_ROOTWRAP"
1200-
if [[ -d $NOVA_DIR/etc/nova/rootwrap.d ]]; then
1200+
if [[ -d $NOVA_DIR/etc/nova/rootwrap ]]; then
12011201
# Wipe any existing rootwrap.d files first
12021202
if [[ -d $NOVA_CONF_DIR/rootwrap.d ]]; then
12031203
sudo rm -rf $NOVA_CONF_DIR/rootwrap.d
12041204
fi
1205+
# Deploy filters to /etc/nova/rootwrap.d
12051206
sudo mkdir -m 755 $NOVA_CONF_DIR/rootwrap.d
1206-
sudo cp $NOVA_DIR/etc/nova/rootwrap.d/* $NOVA_CONF_DIR/rootwrap.d
1207+
sudo cp $NOVA_DIR/etc/nova/rootwrap/*.filters $NOVA_CONF_DIR/rootwrap.d
12071208
sudo chown -R root:root $NOVA_CONF_DIR/rootwrap.d
12081209
sudo chmod 644 $NOVA_CONF_DIR/rootwrap.d/*
1209-
NOVA_ROOTWRAP="$NOVA_ROOTWRAP $NOVA_CONF_DIR/rootwrap.d"
1210+
# Set up rootwrap.conf, pointing to /etc/nova/rootwrap.d
1211+
sudo cp $NOVA_DIR/etc/nova/rootwrap.conf $NOVA_CONF_DIR/
1212+
sudo sed -e "s:^path=.*$:path=$NOVA_CONF_DIR/rootwrap.d:" -i $NOVA_CONF_DIR/rootwrap.conf
1213+
sudo chown root:root $NOVA_CONF_DIR/rootwrap.conf
1214+
sudo chmod 0644 $NOVA_CONF_DIR/rootwrap.conf
1215+
# Specify rootwrap.conf as first parameter to nova-rootwrap
1216+
NOVA_ROOTWRAP="$NOVA_ROOTWRAP $NOVA_CONF_DIR/rootwrap.conf"
12101217
ROOTWRAP_SUDOER_CMD="$NOVA_ROOTWRAP *"
12111218
fi
12121219

0 commit comments

Comments
 (0)