lib/neutron: read api-paste and rootwrap from $NEUTRON_DIR/etc/neutron

Related patches:
* https://review.opendev.org/c/openstack/devstack/+/961224
* https://review.opendev.org/c/openstack/neutron/+/961130

Signed-off-by: Rodolfo Alonso Hernandez <ralonsoh@redhat.com>
Change-Id: I7cf4483d533f9536d2450088a97e95dfb4f22e3a
This commit is contained in:
Rodolfo Alonso Hernandez
2026-01-02 09:39:25 +01:00
parent a05d26ebc4
commit 0b200dd617

View File

@@ -996,13 +996,7 @@ function _configure_neutron_plugin_agent {
# It is called when q-svc is enabled.
function _configure_neutron_service {
Q_API_PASTE_FILE=$NEUTRON_CONF_DIR/api-paste.ini
if test -r $NEUTRON_DIR/etc/neutron/api-paste.ini; then
cp $NEUTRON_DIR/etc/neutron/api-paste.ini $Q_API_PASTE_FILE
else
# TODO(stephenfin): Remove this branch once [1] merges
# [1] https://review.opendev.org/c/openstack/neutron/+/961130
cp $NEUTRON_DIR/etc/api-paste.ini $Q_API_PASTE_FILE
fi
cp $NEUTRON_DIR/etc/neutron/api-paste.ini $Q_API_PASTE_FILE
# Update either configuration file with plugin
iniset $NEUTRON_CONF DEFAULT core_plugin $Q_PLUGIN_CLASS
@@ -1079,13 +1073,7 @@ function _neutron_setup_rootwrap {
# Set up ``rootwrap.conf``, pointing to ``$NEUTRON_CONF_DIR/rootwrap.d``
# location moved in newer versions, prefer new location
if test -r $NEUTRON_DIR/etc/neutron/rootwrap.conf; then
sudo install -o root -g root -m 644 $NEUTRON_DIR/etc/neutron/rootwrap.conf $Q_RR_CONF_FILE
else
# TODO(stephenfin): Remove this branch once [1] merges
# [1] https://review.opendev.org/c/openstack/neutron/+/961130
sudo install -o root -g root -m 644 $NEUTRON_DIR/etc/rootwrap.conf $Q_RR_CONF_FILE
fi
sudo install -o root -g root -m 644 $NEUTRON_DIR/etc/neutron/rootwrap.conf $Q_RR_CONF_FILE
sudo sed -e "s:^filters_path=.*$:filters_path=$Q_CONF_ROOTWRAP_D:" -i $Q_RR_CONF_FILE
# Rely on $PATH set by devstack to determine what is safe to execute
# by rootwrap rather than use explicit whitelist of paths in