do not allow pcu-add if model is unspecified
authorStephen Soltesz <soltesz@cs.princeton.edu>
Fri, 13 Mar 2009 19:53:56 +0000 (19:53 +0000)
committerStephen Soltesz <soltesz@cs.princeton.edu>
Fri, 13 Mar 2009 19:53:56 +0000 (19:53 +0000)
only display success messages for pcu success on stage8

application/controllers/register.php
application/views/stage8_rebootpcu.php

index f7f330d..847eefe 100644 (file)
@@ -36,6 +36,7 @@ class Register extends Controller {
                
                $this->validation->set_error_delimiters('<span class="error">', '</span>');
 
+               $rules['model']         = "trim|required";
                $rules['hostname']  = "trim|required";
                $rules['ip']            = "trim|required|valid_ip";
                $rules['username']  = "trim";
@@ -43,6 +44,7 @@ class Register extends Controller {
                $rules['notes']         = "trim";
                $this->validation->set_rules($rules);
 
+               $fields['model']  = "Model";
                $fields['hostname']  = "Hostname";
                $fields['ip']           = "IP Address";
                $fields['username']  = "Username";
@@ -53,8 +55,11 @@ class Register extends Controller {
                $data = array();
                if ($this->validation->run() == TRUE)
                {
-                       /* b/c the submit is valid, it doesn't matter if pcu_register is set */
-                       $this->pcu_id = $this->add_pcu($data);
+                   if ($this->validation->model != "none-selected" )
+                       {
+                               /* b/c the submit is valid, it doesn't matter if pcu_register is set */
+                               $this->pcu_id = $this->add_pcu($data);
+                       }
                }
                $data = $this->get_stage1_data($person, $data);
                $data['stage'] = 1;
index 1ef354e..79981a8 100644 (file)
                        </span>
                </dd>
        <?php elseif ( $node['boot_state'] == "rins" || $node['boot_state'] == "reinstall" ): ?>
-       <dt>If Reboot succeeds,</dt><dd>
-                       your machine will reboot, install the bootstrap image, and 
-                       contacted PLC.  Finally, the boot state will be updated to 'boot'.
-                       <br>
-                       Continue using the 'Reload' button to check whether the node has
-                       completed its installation.
-       </dd>
+<?php if ( isset($error) && ! empty($error) ): ?>
        <dt>If Reboot fails,</dt><dd>
                        there will be an error displayed that will assist you in
                        diagnosing the error.  Otherwise, please double check the
                        PCU manually (using it's web or ssh interface).
                        <br>
                        To try the test again, use 'Test Reboot'.<br>
+                       If you need help diagnosing the problem, please contact 
+                       <a href="mailto:support@planet-lab.org?subject=Reboot Failed: <?= $error ?>">PlanetLab Support</a>.
+       </dd>
+               <dt> <span class='error'> Reboot Failure: </span> </dt>
+               <dd> <span class='error'> <?= $error ?> </span> </dd>
+       <?php else: ?>
+       <dt>If Reboot succeeds,</dt><dd>
+                       your machine will reboot, install the bootstrap image, and 
+                       contacted PLC.  Finally, the boot state will be updated to 'boot'.
+                       <br>
+                       Continue using the 'Reload' button to check whether the node has
+                       completed its installation.
        </dd>
+               <dt> Reboot without error: </dt>
+               <dd> No errors were reported for your reboot.  Please double check by
+               confirming at the console.  If the reboot failed, please report this
+               to <a href="mailto:support@planet-lab.org?subject=No error for failed PCU reboot">PlanetLab Feedback</a>.
+               </dd>
+<?php endif; ?>
        <?php else: ?>
        <dt><b>Success!!</b></dt><dd>
                        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>