Dmitry Tantsur 8adfcc65c6 Add an element to install python-hardware
Requires returning EPEL support because of some dependencies.

Co-Authored-By: Mark Goddard <mark@stackhpc.com>
Co-Authored-By: Will Szumski <will@stackhpc.com>
Change-Id: I8da33dabda34e626baf6e7895fc450973d0a8fef
2020-09-24 14:39:57 +02:00

22 lines
751 B
Bash
Executable File

#!/bin/bash
if [ "${DIB_DEBUG_TRACE:-0}" -gt 0 ]; then
set -x
fi
set -eu
set -o pipefail
export LC_ALL=C.UTF-8
VENVDIR=/opt/ironic-python-agent
UPPER_CONSTRAINTS=/tmp/requirements/upper-constraints.txt
PACKAGE=${DIB_IPA_HARDWARE_PACKAGE:-hardware${DIB_IPA_HARDWARE_VERSION:+==}${DIB_IPA_HARDWARE_VERSION:-}}
$VENVDIR/bin/pip install -c "$UPPER_CONSTRAINTS" "$PACKAGE"
# Because the ironic-python-agent systemd unit does not activate the virtualenv
# before executing the ironic-python-agent script, the PATH is not updated to
# point to the bin directory in the virtual environment. We add this symlink so
# that ironic-python-agent sees the hardware-detect tool in its PATH.
ln -s $VENVDIR/bin/hardware-detect /usr/local/bin/hardware-detect