Handle ssh problems in get_node_logs.sh

This patch improves the behavior of the helper script, get_node_logs.sh,
when a target VM's ssh server is not unresponsive.

First, it prints a message to inform the user about the problem.

Second, it skips the code for splitting log files if an unresponsive ssh
server prevented the VM's log files from being retrieved.

Change-Id: I56bf7a4e229ca72226bfc308f30a869c8038fe14
This commit is contained in:
Roger Luethi 2016-10-23 13:32:37 +02:00
parent 758297b3f0
commit c0714aa683

View File

@ -35,6 +35,9 @@ for node in $(script_cfg_get_nodenames); do
mkdir "$node_dir"
vm_ssh "$VM_SSH_PORT" "sudo tar cf - -C /var log --exclude=installer" | tar xf - -C "$node_dir"
vm_ssh "$VM_SSH_PORT" "dmesg" > "$node_dir"/dmesg
else
echo "VM $node does not reply."
continue
fi
echo -e "Splitting log files into:\n\t$node_dir/split_logs"
@ -50,4 +53,6 @@ ssh_env_for_node controller
if vm_ssh "$VM_SSH_PORT" 'ls log/test-*.*' >/dev/null 2>&1; then
vm_ssh "$VM_SSH_PORT" 'cd log; tar cf - test-*.*' | tar xf - -C "$RESULTS_DIR/controller"
vm_ssh "$VM_SSH_PORT" 'rm log/test-*.*'
else
echo "VM controller does not reply."
fi