Skip to content

Commit a31518f

Browse files
authored
Merge pull request #34 from cityofships/fix-ipa-extra-hardware
Fix adding ipa-extra-hardware
2 parents 514d51f + 0f68d48 commit a31518f

2 files changed

Lines changed: 19 additions & 4 deletions

File tree

elements/ipa-extra-hardware/README.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,6 @@ The following environment variables may be set to configure the element:
2121
version will be installed.
2222
* ``DIB_IPA_EXTRA_HARDWARE_PACKAGES`` a space-separated list of additional
2323
system packages to install.
24+
25+
For Wallaby and later releases, it is recommended to use an upstream version
26+
of the `element <https://opendev.org/openstack/ironic-python-agent-builder/src/branch/master/dib/extra-hardware>`_.

elements/ipa-extra-hardware/install.d/61-ipa-extra-hardware

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,29 @@ fi
66
set -eu
77
set -o pipefail
88

9-
IPADIR=/usr/share/ironic-python-agent
109
PACKAGE=${DIB_IPA_HARDWARE_PACKAGE:-hardware${DIB_IPA_HARDWARE_VERSION:+==}${DIB_IPA_HARDWARE_VERSION:-}}
1110

12-
# Install the python hardware package inside the virtual environment.
13-
$IPADIR/venv/bin/pip install -c $IPADIR/upper-constraints.txt $PACKAGE
11+
if [[ -d /usr/share/ironic-python-agent ]]; then
12+
IPADIR=/usr/share/ironic-python-agent
13+
else
14+
IPADIR=/opt/ironic-python-agent
15+
fi
16+
17+
if [[ -d "$IPADIR/venv" ]]; then
18+
$IPADIR/venv/bin/pip install -c $IPADIR/upper-constraints.txt $PACKAGE
19+
else
20+
$IPADIR/bin/pip install -c /tmp/requirements/upper-constraints.txt $PACKAGE
21+
fi
1422

1523
# Because the ironic-python-agent systemd unit does not activate the virtualenv
1624
# before executing the ironic-python-agent script, the PATH is not updated to
1725
# point to the bin directory in the virtual environment. We add this symlink so
1826
# that ironic-python-agent sees the hardware-detect tool in its PATH.
19-
ln -s $IPADIR/venv/bin/hardware-detect /usr/local/bin/hardware-detect
27+
if [[ -d "$IPADIR/venv" ]]; then
28+
ln -s $IPADIR/venv/bin/hardware-detect /usr/local/bin/hardware-detect
29+
else
30+
ln -s $IPADIR/bin/hardware-detect /usr/local/bin/hardware-detect
31+
fi
2032

2133
# Install additional packages as requested.
2234
if [[ -n ${DIB_IPA_EXTRA_HARDWARE_PACKAGES:-} ]]; then

0 commit comments

Comments
 (0)