Merge "Reuse code to save remote ssh calls"

This commit is contained in:
Jenkins 2016-08-16 16:08:39 +00:00 committed by Gerrit Code Review
commit 23bd5cba22

View File

@ -134,8 +134,7 @@ function is_device_online() {
# string as a result of the following command.
cmd="systool -c fc_host -v"
OUTPUT=$(ssh -i $PROVIDER_KEY $PROVIDER_USER@$HYPERVISOR "systool -c fc_host -v")
test_fc_online="systool -c fc_host -v | grep -B12 'Online' | grep 'Class Device path' | grep '$fc_device'"
ONLINE=$(ssh -i $PROVIDER_KEY $PROVIDER_USER@$HYPERVISOR "$test_fc_online")
ONLINE=`echo "$OUTPUT" | grep -B12 'Online' | grep 'Class Device path' | grep $fc_device`
echo "online result='$ONLINE'"
if [ -z "$ONLINE" ]; then
return 0;