Skip to content

Commit

Permalink
Merge "squash-package-install to use the correct python"
Browse files Browse the repository at this point in the history
  • Loading branch information
Jenkins authored and openstack-gerrit committed Mar 14, 2017
2 parents a2f910d + fae8004 commit 756923c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 4 additions & 0 deletions diskimage_builder/disk_image_create.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ def main():
# pre-seed some paths for the shell script
environ['_LIB'] = diskimage_builder.paths.get_path('lib')

# export the path to the current python
if not os.environ.get('DIB_PYTHON_EXEC'):
os.environ['DIB_PYTHON_EXEC'] = sys.executable

# we have to handle being called as "disk-image-create" or
# "ramdisk-image-create". ramdisk-iamge-create is just a symlink
# to disk-image-create
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,4 @@ fi
set -eu
set -o pipefail

# Search for python first in case we are in a venv with python3 which
# should take precedence
python_path=$(command -v python || command -v python2 || command -v python3)

sudo -E $python_path $(dirname $0)/../bin/package-installs-squash --elements="$IMAGE_ELEMENT" --path=$ELEMENTS_PATH $TMP_MOUNT_PATH/tmp/package-installs.json
sudo -E $DIB_PYTHON_EXEC $(dirname $0)/../bin/package-installs-squash --elements="$IMAGE_ELEMENT" --path=$ELEMENTS_PATH $TMP_MOUNT_PATH/tmp/package-installs.json

0 comments on commit 756923c

Please sign in to comment.