vcl-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fapee...@apache.org
Subject svn commit: r758431 - in /incubator/vcl/trunk/managementnode/lib/VCL: Module/State.pm utils.pm
Date Wed, 25 Mar 2009 20:40:32 GMT
Author: fapeeler
Date: Wed Mar 25 20:40:26 2009
New Revision: 758431

URL: http://svn.apache.org/viewvc?rev=758431&view=rev
Log:
VCL-122

utils:
switch_state - added check for reload state if found ignore logid 
insert_reload_request - set logid variable to zero instead of using the logid of previous
user reservation

Module/State.pm: 
reservation_failed - added check for proper states to update the ending flag on the specified
logid


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

Modified: incubator/vcl/trunk/managementnode/lib/VCL/Module/State.pm
URL: http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/lib/VCL/Module/State.pm?rev=758431&r1=758430&r2=758431&view=diff
==============================================================================
--- incubator/vcl/trunk/managementnode/lib/VCL/Module/State.pm (original)
+++ incubator/vcl/trunk/managementnode/lib/VCL/Module/State.pm Wed Mar 25 20:40:26 2009
@@ -291,13 +291,16 @@
 	else {
 		notify($ERRORS{'WARNING'}, 0, "failed to insert computerloadlog entry");
 	}
-
-	# Update log table ending column to failed for this request
-	if (update_log_ending($request_logid, "failed")) {
-		notify($ERRORS{'OK'}, 0, "updated log ending value to 'failed', logid=$request_logid");
-	}
-	else {
-		notify($ERRORS{'WARNING'}, 0, "failed to update log ending value to 'failed', logid=$request_logid");
+	
+	
+	if($request_state_name =~ /^(new|reserved|inuse|image)/){
+		# Update log table ending column to failed for this request
+		if (update_log_ending($request_logid, "failed")) {
+			notify($ERRORS{'OK'}, 0, "updated log ending value to 'failed', logid=$request_logid");
+		}
+		else {
+			notify($ERRORS{'WARNING'}, 0, "failed to update log ending value to 'failed', logid=$request_logid");
+		}
 	}
 
 	# Update the computer state to failed

Modified: incubator/vcl/trunk/managementnode/lib/VCL/utils.pm
URL: http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/lib/VCL/utils.pm?rev=758431&r1=758430&r2=758431&view=diff
==============================================================================
--- incubator/vcl/trunk/managementnode/lib/VCL/utils.pm (original)
+++ incubator/vcl/trunk/managementnode/lib/VCL/utils.pm Wed Mar 25 20:40:26 2009
@@ -8520,6 +8520,10 @@
 	my $computer_type              = $request_data->{reservation}{$reservation_id}{computer}{type};
 	my $computer_state_name_old    = $request_data->{reservation}{$reservation_id}{computer}{state}{name};
 	my $computer_shortname         = $request_data->{reservation}{$reservation_id}{computer}{SHORTNAME};
+	
+	if($request_state_name_old eq 'reload'){
+		$request_logid = 0;
+	}
 
 	# Figure out if this is the parent reservation
 	my @reservation_ids = sort keys %{$request_data->{reservation}};
@@ -9131,7 +9135,7 @@
 
 	# Attempt to create a new reload request
 	my $request_id_reload;
-	if ($request_id_reload = insert_request($managementnode_id, 'reload', $request_laststate_name,
$request_logid, 'vclreload', $computer_id, $image_id, $imagerevision_id, '0', '30')) {
+	if ($request_id_reload = insert_request($managementnode_id, 'reload', $request_laststate_name,
'0', 'vclreload', $computer_id, $image_id, $imagerevision_id, '0', '30')) {
 		notify($ERRORS{'OK'}, 0, "$notify_prefix inserted new reload request, id=$request_id_reload
nodeid=$computer_id, imageid=$image_id, imagerevision_id=$imagerevision_id");
 		insertloadlog($reservation_id, $computer_id, "info", "$calling_sub: created new reload
request");
 	}



Mime
View raw message