Browse Source

Use correct command for Python virtualenv

Using the virtualenv command will generate a virtualenv with the
default python exec for the entire system, that means that even
if DIB_PYTHON is python3, the virtualenv will use python2.
With this change we use the venv embedded command if the version
of Python is 3.x to generate a virtualenv with the correct
Python 3 version.

Change-Id: I8bec32c5e0dae2dee27615146f946a9649f23fd1
changes/54/704854/2
Riccardo Pittau 3 weeks ago
parent
commit
46c78a10c1
1 changed files with 5 additions and 1 deletions
  1. +5
    -1
      dib/ironic-python-agent-ramdisk/install.d/ironic-python-agent-ramdisk-source-install/60-ironic-python-agent-ramdisk-install

+ 5
- 1
dib/ironic-python-agent-ramdisk/install.d/ironic-python-agent-ramdisk-source-install/60-ironic-python-agent-ramdisk-install View File

@@ -14,7 +14,11 @@ UPPER_CONSTRAINTS=/tmp/requirements/upper-constraints.txt
VENVDIR=/opt/ironic-python-agent

# create the virtual environment using the default python
$DIB_PYTHON -m virtualenv -- $VENVDIR
if [ $DIB_PYTHON_VERSION == 3 ]; then
$DIB_PYTHON -m venv $VENVDIR
else
$DIB_PYTHON -m virtualenv $VENVDIR
fi

# pip might be an older version which does not support the -c option, therefore upgrade first
$VENVDIR/bin/pip install pip --upgrade


Loading…
Cancel
Save