Author: fapeeler
Date: Mon Sep 30 17:28:19 2013
New Revision: 1527673

URL: http://svn.apache.org/r1527673
Log:
VCL-16

Added check to determine if request has been deleted by the user before trying 
to update the state. 
This reduces the number of unnecessary critical emails.


Modified:
    vcl/trunk/managementnode/lib/VCL/Module/State.pm

Modified: vcl/trunk/managementnode/lib/VCL/Module/State.pm
URL: 
http://svn.apache.org/viewvc/vcl/trunk/managementnode/lib/VCL/Module/State.pm?rev=1527673&r1=1527672&r2=1527673&view=diff
==============================================================================
--- vcl/trunk/managementnode/lib/VCL/Module/State.pm (original)
+++ vcl/trunk/managementnode/lib/VCL/Module/State.pm Mon Sep 30 17:28:19 2013
@@ -548,10 +548,13 @@ sub state_exit {
                }
                
                # Update the request state
-               if (!update_request_state($request_id, $request_state_name_new, 
$request_state_name_old)) {
-                       notify($ERRORS{'CRITICAL'}, 0, "failed to change 
request state: $request_state_name_old/$request_laststate_name_old --> 
$request_state_name_new/$request_state_name_old");
+               if (!is_request_deleted($request_id)) {
+                       notify($ERRORS{'OK'}, 0, "request has been deleted, NOT 
updating new state: $request_state_name_new old state: 
$request_state_name_old");
+                       if (!update_request_state($request_id, 
$request_state_name_new, $request_state_name_old)) {
+                               notify($ERRORS{'CRITICAL'}, 0, "failed to 
change request state: $request_state_name_old/$request_laststate_name_old --> 
$request_state_name_new/$request_state_name_old");
+                       }
                }
-               
+
                # Update log.ending if this is the parent reservation and 
argument was supplied
                if ($request_log_ending && !update_log_ending($request_logid, 
$request_log_ending)) {
                        notify($ERRORS{'CRITICAL'}, 0, "failed to set log 
ending to $request_log_ending, log ID: $request_logid");


Reply via email to