Skip to content

Commit

Permalink
Merge pull request #451 from dtantsur/redfish-listen
Browse files Browse the repository at this point in the history
sushy-tools: make listen interface customizable
  • Loading branch information
metal3-io-bot authored Dec 7, 2023
2 parents bea2325 + d7fbff4 commit fb7e98d
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
5 changes: 3 additions & 2 deletions resources/sushy-tools/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@ RUN apt-get update && \
pip3 install --no-cache-dir \
sushy-tools==${SUSHY_TOOLS_VERSION} libvirt-python

CMD /usr/local/bin/sushy-emulator -i :: \
--config /root/sushy/conf.py --debug
COPY redfish-emulator.sh /usr/local/bin/

CMD /usr/local/bin/redfish-emulator.sh
18 changes: 18 additions & 0 deletions resources/sushy-tools/redfish-emulator.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash

set -eux -o pipefail

CONFIG="${SUSHY_TOOLS_CONFIG:-/root/sushy/conf.py}"
ARGS=

if [[ -f "${CONFIG}" ]]; then
ARGS="${ARGS} --config ${CONFIG}"
fi

if [[ ! -f "${CONFIG}" ]] || ! grep -q "^SUSHY_EMULATOR_LISTEN_IP =" "${CONFIG}"; then
# Listen on all interfaces unless explicitly configured otherwise.
ARGS="${ARGS} --interface ::"
fi

# shellcheck disable=SC2086
exec /usr/local/bin/sushy-emulator --debug $ARGS

0 comments on commit fb7e98d

Please sign in to comment.