Author: fapeeler
Date: Mon Jul 14 19:37:51 2014
New Revision: 1610496

URL: http://svn.apache.org/r1610496
Log:
VCL-27

moved clear_next_image_id to proper location, it was being called too soon, 
thus next image was always empty.


Modified:
    vcl/trunk/managementnode/lib/VCL/Module/Predictive/Level_0.pm
    vcl/trunk/managementnode/lib/VCL/Module/Predictive/Level_1.pm

Modified: vcl/trunk/managementnode/lib/VCL/Module/Predictive/Level_0.pm
URL: 
http://svn.apache.org/viewvc/vcl/trunk/managementnode/lib/VCL/Module/Predictive/Level_0.pm?rev=1610496&r1=1610495&r2=1610496&view=diff
==============================================================================
--- vcl/trunk/managementnode/lib/VCL/Module/Predictive/Level_0.pm (original)
+++ vcl/trunk/managementnode/lib/VCL/Module/Predictive/Level_0.pm Mon Jul 14 
19:37:51 2014
@@ -172,10 +172,6 @@ sub get_next_image {
        AND computer.id = $computer_id
        ";
 
-       #Clear next_imageid
-       if(!clear_next_image_id($computer_id)){
-          notify($ERRORS{'WARNING'}, 0, "$notify_prefix failed to clear 
next_image_id for computerid $computer_id");
-       }
 
        # Call the database select subroutine
        # This will return an array of one or more rows based on the select 
statement
@@ -192,6 +188,10 @@ sub get_next_image {
        }
        notify($ERRORS{'OK'}, 0, "$notify_prefix returning nextimage 
image=$next_selected_rows[0]{imagename} 
imageid=$next_selected_rows[0]{imageid}");
        push(@ret_array, $next_selected_rows[0]{imagename}, 
$next_selected_rows[0]{imageid}, $next_selected_rows[0]{imagerevisionid});
+       #Clear next_imageid
+       if(!clear_next_image_id($computer_id)){
+          notify($ERRORS{'WARNING'}, 0, "$notify_prefix failed to clear 
next_image_id for computerid $computer_id");
+       }
        return @ret_array;
 
 } ## end sub get_next_image_revision

Modified: vcl/trunk/managementnode/lib/VCL/Module/Predictive/Level_1.pm
URL: 
http://svn.apache.org/viewvc/vcl/trunk/managementnode/lib/VCL/Module/Predictive/Level_1.pm?rev=1610496&r1=1610495&r2=1610496&view=diff
==============================================================================
--- vcl/trunk/managementnode/lib/VCL/Module/Predictive/Level_1.pm (original)
+++ vcl/trunk/managementnode/lib/VCL/Module/Predictive/Level_1.pm Mon Jul 14 
19:37:51 2014
@@ -123,10 +123,6 @@ sub get_next_image {
                AND computer.id = $computer_id
                ";
                
-               #Clear next_imageid
-               if(!clear_next_image_id($computer_id)){
-                       notify($ERRORS{'WARNING'}, 0, "$notify_prefix failed to 
clear next_image_id for computerid $computer_id");
-               }
 
                # Call the database select subroutine
                # This will return an array of one or more rows based on the 
select statement
@@ -141,6 +137,11 @@ sub get_next_image {
                        notify($ERRORS{'OK'}, 0, "$notify_prefix returning 
nextimage image=$next_selected_rows[0]{imagename} 
imageid=$next_selected_rows[0]{imageid}");
                        my @next_image_ret_array;
                        push(@next_image_ret_array, 
$next_selected_rows[0]{imagename}, $next_selected_rows[0]{imageid}, 
$next_selected_rows[0]{imagerevisionid});
+                       
+                       #Clear next_imageid
+                       if(!clear_next_image_id($computer_id)){
+                               notify($ERRORS{'WARNING'}, 0, "$notify_prefix 
failed to clear next_image_id for computerid $computer_id");
+                       }
                        return @next_image_ret_array;
                }
 


Reply via email to