Comment 0 for bug 1566250

Revision history for this message
Carlos Novo (cnovo-k) wrote :

Detailed bug description:

On debian based distributions ( tested on Mint 17.2 and Ubuntu 14.04 ), where "curl" program is not installed, the script prepare_nailgun.sh fails silently and the user does not know what was wrong:

/tmp/fuel_web/nailgun/.tox/venv/local/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.py:185: SAWarning: Unicode type received non-unicode bind param value 'Mitaka on Ubuntu+UCA 14.0...'. (this warning may be suppressed after 10 occurrences)
  (util.ellipses_string(value),))
ERROR: InvocationError: '/bin/bash /home/cnn/dev/openstack/fuel/python-fuelclient/tools/prepare_nailgun.sh'
cleanup develop-inst-nodeps: /home/cnn/dev/openstack/fuel/python-fuelclient

This issue is not happening in RH based distributions, and may be others, where "which" command prints a message in the case that the program is not present:

(bug/1518281) ✗ which curl
/usr/bin/which: no curl in (/home/cnn/Envs/fuel-web/bin:/usr/lib64/qt-3.3/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:/home/cnn/bin:/home/cnn/bin)

Steps to reproduce:

- This issue is only present when the "which" command doesn't print any message when "curl" ( or any other ) is not present.
- Remove curl:
  apt-get remove curl
- Run python-fuelclient tests
 ./run_tests.sh

Expected results:

  There should be some information about "curl" is not present.

Actual result:

  The script fails silently and the user doesn't know why. The only message is:

  ERROR: InvocationError: '/bin/bash /home/cnn/dev/openstack/fuel/python-fuelclient/tools/prepare_nailgun.sh'

Reproducibility:

  Allways if "which" command is not printing a message when "curl" ( or any other ) is not present.

Workaround:

  No

Impact:

  The user doesn't know what was wrong.

Description of the environment:

  - Mint 17.2
  - Fuel 8.0.0

Aditional information:

The script prepare_nailgun.sh has -e flag in order to end on any error.
"which curl" fails in the case that curl is not present, and return code is 1, but it doesn't print any information.

Proposed fix:

Disable temporally the -e flag and print a proper message. Something like:

# Wait for server's availability
set +e
which curl > /dev/null
err=$?
if [[ $err != 0 ]]; then
  echo "ERROR: curl command does not exist"
  exit $err
fi
set -e

Ideally, that error should be printed only when the "which" version used is not doing it already.