From 6af973aee6a7bcb8229ffb1a66a2b1da61866d2c Mon Sep 17 00:00:00 2001 From: cid Date: Thu, 6 Mar 2025 10:40:04 +0100 Subject: [PATCH] Install and run sushy-tools within a virtualenv This ensures gunicorn can find all required packages at runtime. Closes-Bug: #2098542 Change-Id: I10279575fc1c060dd439d31ae1c07c1267b04342 --- devstack/lib/ironic | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/devstack/lib/ironic b/devstack/lib/ironic index f37c1fb48f..ec821543ce 100644 --- a/devstack/lib/ironic +++ b/devstack/lib/ironic @@ -1169,6 +1169,8 @@ function cleanup_redfish { function install_redfish { # TODO(lucasagomes): Use Apache WSGI instead of gunicorn + . /opt/stack/data/venv/bin/activate + if is_fedora; then install_package python3-gunicorn else @@ -1196,8 +1198,15 @@ function install_redfish { # NOTE(dtantsur): log all accesses to stdout cmd+=" --access-logfile=- --error-logfile=-" + # Exit virtualenv once installation is complete + deactivate + write_user_unit_file $IRONIC_REDFISH_EMULATOR_SYSTEMD_SERVICE "$cmd" "" "$STACK_USER" + # update unit file reference + local unitfile="$SYSTEMD_DIR/$IRONIC_REDFISH_EMULATOR_SYSTEMD_SERVICE" + iniset -sudo $unitfile "Service" "Environment" "PATH=/opt/stack/data/venv/bin:$PATH" + enable_service $IRONIC_REDFISH_EMULATOR_SYSTEMD_SERVICE }