From fac0b2fd8fcf5871ee78bc0468dd46ef203719bc Mon Sep 17 00:00:00 2001 From: Isaac Beckman Date: Wed, 27 Jul 2016 16:39:42 +0300 Subject: [PATCH] Reuse code to save remote ssh calls There were 2 identical remote calls to systool. The output of the first call can be used to save the second one. Change-Id: Ia6bb75a2606aa47d9a759738452326010ab856dd --- provisioning_scripts/fibre_channel/invoke_fc_passthrough.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/provisioning_scripts/fibre_channel/invoke_fc_passthrough.sh b/provisioning_scripts/fibre_channel/invoke_fc_passthrough.sh index 5a532af..f2fa507 100644 --- a/provisioning_scripts/fibre_channel/invoke_fc_passthrough.sh +++ b/provisioning_scripts/fibre_channel/invoke_fc_passthrough.sh @@ -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;