Skip to content

Commit 8ef47d1

Browse files
Jenkinsopenstack-gerrit
authored andcommitted
Merge "Adjust support for upcoming rootwrap changes"
2 parents 67787e6 + be5d3f2 commit 8ef47d1

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
@@ -1229,19 +1229,26 @@ sudo chown `whoami` $NOVA_CONF_DIR
12291229

12301230
cp -p $NOVA_DIR/etc/nova/policy.json $NOVA_CONF_DIR
12311231

1232-
# If Nova ships the new rootwrap.d config files, deploy them
1232+
# If Nova ships the new rootwrap filters files, deploy them
12331233
# (owned by root) and add a parameter to $NOVA_ROOTWRAP
12341234
ROOTWRAP_SUDOER_CMD="$NOVA_ROOTWRAP"
1235-
if [[ -d $NOVA_DIR/etc/nova/rootwrap.d ]]; then
1235+
if [[ -d $NOVA_DIR/etc/nova/rootwrap ]]; then
12361236
# Wipe any existing rootwrap.d files first
12371237
if [[ -d $NOVA_CONF_DIR/rootwrap.d ]]; then
12381238
sudo rm -rf $NOVA_CONF_DIR/rootwrap.d
12391239
fi
1240+
# Deploy filters to /etc/nova/rootwrap.d
12401241
sudo mkdir -m 755 $NOVA_CONF_DIR/rootwrap.d
1241-
sudo cp $NOVA_DIR/etc/nova/rootwrap.d/* $NOVA_CONF_DIR/rootwrap.d
1242+
sudo cp $NOVA_DIR/etc/nova/rootwrap/*.filters $NOVA_CONF_DIR/rootwrap.d
12421243
sudo chown -R root:root $NOVA_CONF_DIR/rootwrap.d
12431244
sudo chmod 644 $NOVA_CONF_DIR/rootwrap.d/*
1244-
NOVA_ROOTWRAP="$NOVA_ROOTWRAP $NOVA_CONF_DIR/rootwrap.d"
1245+
# Set up rootwrap.conf, pointing to /etc/nova/rootwrap.d
1246+
sudo cp $NOVA_DIR/etc/nova/rootwrap.conf $NOVA_CONF_DIR/
1247+
sudo sed -e "s:^path=.*$:path=$NOVA_CONF_DIR/rootwrap.d:" -i $NOVA_CONF_DIR/rootwrap.conf
1248+
sudo chown root:root $NOVA_CONF_DIR/rootwrap.conf
1249+
sudo chmod 0644 $NOVA_CONF_DIR/rootwrap.conf
1250+
# Specify rootwrap.conf as first parameter to nova-rootwrap
1251+
NOVA_ROOTWRAP="$NOVA_ROOTWRAP $NOVA_CONF_DIR/rootwrap.conf"
12451252
ROOTWRAP_SUDOER_CMD="$NOVA_ROOTWRAP *"
12461253
fi
12471254

0 commit comments

Comments
 (0)