Final fix for obmc_boot_test ValueError.

- gen_robot_ssh.py::execute_ssh_command: sshlib.close_all_connections()
  before raise(execute_exception).  This should help subsequent
  execute_ssh_command calls succeed.

- state.py::wait_for_comm_cycle: Test for blank uptime and report it as
  communication error.  The source of the ValueError was trying to
  interpret a blank as float.

Change-Id: I1ec8dfca43397b0aca9533af55096e370d84af52
Signed-off-by: Michael Walsh <micwalsh@us.ibm.com>
diff --git a/lib/gen_robot_ssh.py b/lib/gen_robot_ssh.py
index 872a2fa..1ccf703 100755
--- a/lib/gen_robot_ssh.py
+++ b/lib/gen_robot_ssh.py
@@ -284,6 +284,7 @@
 
             # We do not handle any other RuntimeErrors so we will raise the
             # exception again.
+            sshlib.close_all_connections()
             raise(execute_exception)
 
         # If we get to this point, the command was executed.
diff --git a/lib/state.py b/lib/state.py
index 4c36ef4..7829fa4 100755
--- a/lib/state.py
+++ b/lib/state.py
@@ -879,6 +879,10 @@
 
     elapsed_boot_time = int(state['epoch_seconds']) - start_boot_seconds
     gp.qprint_var(elapsed_boot_time)
+    if state['uptime'] == "":
+        error_message = "Unable to obtain uptime from the BMC. BMC is not" +\
+            " communicating."
+        BuiltIn().fail(gp.sprint_error(error_message))
     if int(float(state['uptime'])) < elapsed_boot_time:
         uptime = state['uptime']
         gp.qprint_var(uptime)