print a clear error when RebootNodeWithPCU returns a non-zero status.
authorStephen Soltesz <soltesz@cs.princeton.edu>
Fri, 13 Mar 2009 19:08:58 +0000 (19:08 +0000)
committerStephen Soltesz <soltesz@cs.princeton.edu>
Fri, 13 Mar 2009 19:08:58 +0000 (19:08 +0000)
application/controllers/confirm.php
application/views/stage8_rebootpcu.php

index 2f399f5..83fe71c 100644 (file)
@@ -166,10 +166,11 @@ class Confirm extends Controller {
                $hostname = $data['node_id'];
                $api->UpdateNode( $hostname, array( "boot_state" => 'rins') );
                $ret = $api->RebootNodeWithPCU( $hostname );
                $hostname = $data['node_id'];
                $api->UpdateNode( $hostname, array( "boot_state" => 'rins') );
                $ret = $api->RebootNodeWithPCU( $hostname );
-               if ( $ret != 0 ) {
+               if ( "$ret" != "0" ) {
+                       $data['error'] = $ret;
+               } else {
                        $data['error'] = $api->error();
                }
                        $data['error'] = $api->error();
                }
-               $data['error'] = $api->error();
        }
 }
 ?>
        }
 }
 ?>
index 7998e54..1ef354e 100644 (file)
                        The installation is complete; your machine has reached the final
                        'boot' state.  You can continue to the final stage.</dd>
        <?php endif; ?>
                        The installation is complete; your machine has reached the final
                        'boot' state.  You can continue to the final stage.</dd>
        <?php endif; ?>
+<?php if ( isset($error) && ! empty($error) ): ?>
+               <dt> <span class='error'> Reboot Failure: </span> </dt>
+               <dd> <span class='error'> <?= $error ?> </span> </dd>
+<?php endif; ?>
 </dl>
 
 <table><tbody>
 </dl>
 
 <table><tbody>
        <tr><th>Model: </th><td><?= $node['model'] ?></td></tr>
        <tr><th>Version: </th><td nowrap='1'><?= $node['version'] ?></td></tr>
        <tr><th>Last Contact: </th><td><?= $last_contact_str ?></td></tr>
        <tr><th>Model: </th><td><?= $node['model'] ?></td></tr>
        <tr><th>Version: </th><td nowrap='1'><?= $node['version'] ?></td></tr>
        <tr><th>Last Contact: </th><td><?= $last_contact_str ?></td></tr>
-<?php if ( isset($error) && ! empty($error) ): ?>
-       <tr>
-               <td colspan=2>
-                       <span class='error'> <?= $error ?> </span>
-               </td>
-       </tr>
-<?php endif; ?>
        <tr>
                <td>
                </td>
        <tr>
                <td>
                </td>