Merge "Reuse code to save remote ssh calls"
This commit is contained in:
commit
23bd5cba22
@ -134,8 +134,7 @@ function is_device_online() {
|
|||||||
# string as a result of the following command.
|
# string as a result of the following command.
|
||||||
cmd="systool -c fc_host -v"
|
cmd="systool -c fc_host -v"
|
||||||
OUTPUT=$(ssh -i $PROVIDER_KEY $PROVIDER_USER@$HYPERVISOR "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=`echo "$OUTPUT" | grep -B12 'Online' | grep 'Class Device path' | grep $fc_device`
|
||||||
ONLINE=$(ssh -i $PROVIDER_KEY $PROVIDER_USER@$HYPERVISOR "$test_fc_online")
|
|
||||||
echo "online result='$ONLINE'"
|
echo "online result='$ONLINE'"
|
||||||
if [ -z "$ONLINE" ]; then
|
if [ -z "$ONLINE" ]; then
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user