You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@vcl.apache.org by fa...@apache.org on 2014/09/25 17:44:24 UTC

svn commit: r1627561 - in /vcl/trunk/managementnode/lib/VCL: DataStructure.pm utils.pm

Author: fapeeler
Date: Thu Sep 25 15:44:24 2014
New Revision: 1627561

URL: http://svn.apache.org/r1627561
Log:
VCL-170

fixed issue with left over references to managementnode.predictivemoduleid


Modified:
    vcl/trunk/managementnode/lib/VCL/DataStructure.pm
    vcl/trunk/managementnode/lib/VCL/utils.pm

Modified: vcl/trunk/managementnode/lib/VCL/DataStructure.pm
URL: http://svn.apache.org/viewvc/vcl/trunk/managementnode/lib/VCL/DataStructure.pm?rev=1627561&r1=1627560&r2=1627561&view=diff
==============================================================================
--- vcl/trunk/managementnode/lib/VCL/DataStructure.pm (original)
+++ vcl/trunk/managementnode/lib/VCL/DataStructure.pm Thu Sep 25 15:44:24 2014
@@ -1287,10 +1287,8 @@ sub get_next_image_dataStructure {
       @current_image = ();
 	}
 	
-	my $computer_predictive_module_id = $self->get_computer_predictive_module_id();
-
 	#collect predictive reload information from database.
-	my $management_predictive_info = get_management_predictive_info();
+	my $computer_predictive_module_id = $self->get_computer_predictive_module_id();
 	if (!$computer_predictive_module_id){
 		notify($ERRORS{'CRITICAL'}, 0, "unable to obtain management node info for this node, returning current reservation image information");
       return @current_image;

Modified: vcl/trunk/managementnode/lib/VCL/utils.pm
URL: http://svn.apache.org/viewvc/vcl/trunk/managementnode/lib/VCL/utils.pm?rev=1627561&r1=1627560&r2=1627561&view=diff
==============================================================================
--- vcl/trunk/managementnode/lib/VCL/utils.pm (original)
+++ vcl/trunk/managementnode/lib/VCL/utils.pm Thu Sep 25 15:44:24 2014
@@ -147,7 +147,6 @@ our @EXPORT = qw(
 	get_management_node_requests
 	get_management_node_vmhost_ids
 	get_management_node_vmhost_info
-	get_management_predictive_info
 	get_module_info
 	get_next_image_default
 	get_os_info
@@ -4412,80 +4411,6 @@ sub write_currentimage_txt {
 
 #/////////////////////////////////////////////////////////////////////////////
 
-=head2 get_management_predictive_info
-
- Parameters  : Either a management node hostname or database ID
- Returns     : Hash containing data contained in the managementnode table
- Description :
-
-=cut
-
-sub get_management_predictive_info {
-	my ($management_node_identifier) = @_;
-
-	my ($package, $filename, $line, $sub) = caller(0);
-
-	# Check the passed parameter
-	if (!(defined($management_node_identifier))) {
-		# If nothing was passed, assume management node is this machine
-		# Try to get the hostname of this machine
-		unless ($management_node_identifier = (hostname())[0]) {
-			notify($ERRORS{'WARNING'}, 0, "management node hostname or ID was not specified and hostname could not be determined");
-			return ();
-		}
-	}
-
-	my $select_statement = "
-   SELECT
-   managementnode.*,
-   predictivemodule.name AS predictive_name,
-   predictivemodule.prettyname AS predictive_prettyname,
-   predictivemodule.description AS predictive_description,
-   predictivemodule.perlpackage  AS predictive_perlpackage,
-	state.name AS statename
-   FROM
-   managementnode,
-   module predictivemodule,
-	state
-   WHERE
-   managementnode.predictivemoduleid = predictivemodule.id
-	AND managementnode.stateid = state.id
-   AND
-   ";
-
-	# Figure out if the ID or hostname was passed as the identifier and complete the SQL statement
-	# Check if it only contains digits
-	chomp $management_node_identifier;
-	if ($management_node_identifier =~ /^\d+$/) {
-		$select_statement .= "managementnode.id = $management_node_identifier";
-	}
-	else {
-		$select_statement .= "managementnode.hostname like \'$management_node_identifier%\'";
-	}
-
-	# Call the database select subroutine
-	# This will return an array of one or more rows based on the select statement
-	my @selected_rows = database_select($select_statement);
-
-	# Check to make sure 1 row was returned
-	if (scalar @selected_rows == 0) {
-		notify($ERRORS{'WARNING'}, 0, "zero rows were returned from database select");
-		return ();
-	}
-	elsif (scalar @selected_rows > 1) {
-		notify($ERRORS{'WARNING'}, 0, "" . scalar @selected_rows . " rows were returned from database select");
-		return ();
-	}
-	# Get the single returned row
-	# It contains a hash
-	my $management_node_info = $selected_rows[0];
-
-	notify($ERRORS{'DEBUG'}, 0, "management node info retrieved from database ");
-	return $management_node_info;
-}
-
-#/////////////////////////////////////////////////////////////////////////////
-
 =head2 get_management_node_info
 
  Parameters  : Either a management node hostname or database ID
@@ -4533,20 +4458,14 @@ sub get_management_node_info {
 SELECT
 managementnode.*,
 resource.id AS resource_id,
-predictivemodule.name AS predictive_name,
-predictivemodule.prettyname AS predictive_prettyname,
-predictivemodule.description AS predictive_description,
-predictivemodule.perlpackage  AS predictive_perlpackage,
 state.name AS statename
 FROM
 managementnode,
-module predictivemodule,
 resource,
 resourcetype,
 state
 WHERE
-managementnode.predictivemoduleid = predictivemodule.id
-AND managementnode.stateid = state.id
+managementnode.stateid = state.id
 AND resource.resourcetypeid = resourcetype.id 
 AND resource.subid =  managementnode.id
 AND resourcetype.name = 'managementnode'