call which from virtualbox scripts

Bug #1415685 reported by Vasiliy Pleshakov
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Fuel for OpenStack
Fix Committed
Low
Serhii Ovsianikov

Bug Description

Despite of commentary at actions/prepare-environment.sh virtualbox script calls which in several places:
# grep -rn which *
actions/prepare-environment.sh:22:# We are avoiding using 'which' because of http://stackoverflow.com/questions/592620/check-if-a-program-exists-from-a-bash-script
actions/prepare-environment.sh:70:sshs=`which ssh | wc -l`
actions/prepare-environment.sh:89: ipconfigs=`which ipconfig | wc -l`
functions/memory.sh:25: if [ "$(which free)" != "" ]; then
functions/memory.sh:28: elif [ "$(which top)" != "" ]; then
functions/memory.sh:36: if [ "$(which sysctl)" != "" ]; then
functions/memory.sh:45: if [ "$(which free)" != "" ]; then
functions/memory.sh:48: elif [ "$(which top)" != "" ]; then

In all places we should use type instead of which:
type foo >/dev/null 2>&1

Changed in fuel:
assignee: nobody → Bartlomiej Piotrowski (bpiotrowski)
importance: Undecided → Low
milestone: none → 6.1
Changed in fuel:
assignee: Bartlomiej Piotrowski (bpiotrowski) → nobody
Changed in fuel:
assignee: nobody → Fuel Library Team (fuel-library)
status: New → Triaged
Changed in fuel:
assignee: Fuel Library Team (fuel-library) → Serhiy Ovsianikov (sovsianikov)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to fuel-main (master)

Fix proposed to branch: master
Review: https://review.openstack.org/151676

Changed in fuel:
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to fuel-main (master)

Reviewed: https://review.openstack.org/151676
Committed: https://git.openstack.org/cgit/stackforge/fuel-main/commit/?id=5ac64a8c007eafd2001e7f529f1152587e0955a0
Submitter: Jenkins
Branch: master

commit 5ac64a8c007eafd2001e7f529f1152587e0955a0
Author: Serhiy Ovsianikov <email address hidden>
Date: Fri Jan 30 17:08:04 2015 +0200

    Call which from virtualbox scripts

    The "which" command is replaced with the "type" command. The free
    memory check error on the host has been fixed.

    Change-Id: I2cb8d143616372b649d51b9543160d40e5f2f510
    Closes-Bug: #1415685

Changed in fuel:
status: In Progress → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.