vcl-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fapee...@apache.org
Subject svn commit: r757522 - in /incubator/vcl/trunk/managementnode: etc/vcl/vcld.conf lib/VCL/utils.pm
Date Mon, 23 Mar 2009 20:00:00 GMT
Author: fapeeler
Date: Mon Mar 23 19:59:59 2009
New Revision: 757522

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

Left hardcoded value for the return-path sendmail -f option in the
utils:mail routine

created a global value that gets set in the vcld.conf file RETURNPATH


Modified:
    incubator/vcl/trunk/managementnode/etc/vcl/vcld.conf
    incubator/vcl/trunk/managementnode/lib/VCL/utils.pm

Modified: incubator/vcl/trunk/managementnode/etc/vcl/vcld.conf
URL: http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/etc/vcl/vcld.conf?rev=757522&r1=757521&r2=757522&view=diff
==============================================================================
--- incubator/vcl/trunk/managementnode/etc/vcl/vcld.conf (original)
+++ incubator/vcl/trunk/managementnode/etc/vcl/vcld.conf Mon Mar 23 19:59:59 2009
@@ -98,6 +98,11 @@
 # Example: john_doe@ncsu.edu,sysadmins@vcl.ncsu.edu
 sysadmin=
 
+#Sendmail envelope sender -- Return-path
+#The return-path should be set if you want email delivery failures to go
+#to a common place
+#set this to a known working address that would recieve mail like blah@yourdomain.com
+RETURNPATH=
 
 # shared mailbox - 
 #   address of a shared mailbox for copies of all notices sent to users

Modified: incubator/vcl/trunk/managementnode/lib/VCL/utils.pm
URL: http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/lib/VCL/utils.pm?rev=757522&r1=757521&r2=757522&view=diff
==============================================================================
--- incubator/vcl/trunk/managementnode/lib/VCL/utils.pm (original)
+++ incubator/vcl/trunk/managementnode/lib/VCL/utils.pm Mon Mar 23 19:59:59 2009
@@ -7158,15 +7158,21 @@
    predictivemodule.prettyname AS predictive_prettyname,
    predictivemodule.description AS predictive_description,
    predictivemodule.perlpackage  AS predictive_perlpackage,
-	state.name AS statename
+	state.name AS statename,
+	resource.id AS resource_id
    FROM
    managementnode,
    module predictivemodule,
-	state
+	state,
+	resource,
+	resourcetype
    WHERE
    managementnode.predictivemoduleid = predictivemodule.id
 	AND managementnode.stateid = state.id
-   AND
+	AND resource.resourcetypeid = resourcetype.id
+	AND resource.subid = managementnode.id
+	AND resourcetype.name = \'managementnode\'
+	AND
    ";
 
 	# Figure out if the ID or hostname was passed as the identifier and complete the SQL statement
@@ -7262,6 +7268,100 @@
 
 #/////////////////////////////////////////////////////////////////////////////
 
+=head2 get_management_node_resource_groups
+
+ Parameters  : mangement node resource id 
+ Returns     : Hash containing data contained in the managementnode table
+ Description :
+
+=cut
+
+sub get_management_node_resource_groups {
+	my ($management_resource_id) = @_;
+   my ($package, $filename, $line, $sub) = caller(0);
+
+   if (!(defined($management_resource_id))) {
+      notify($ERRORS{'WARNING'}, 0, "management resource ID was not specified");
+      return ();
+   }
+
+   my $select_statement = "
+   SELECT DISTINCT
+	resourcegroupid AS resourcegroupid
+	FROM
+	resourcegroupmembers
+	WHERE resourceid = $management_resource_id
+	 ";
+
+   # 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 or more rows were returned
+   if (scalar @selected_rows == 0) {
+      return ();
+   }
+
+	#Build the list
+	my %ret_grouplist;
+
+	for (@selected_rows) {
+	 	 my %resroucegroupids = %{$_};
+		 $ret_grouplist{$resroucegroupids{resourcegroupid}}= $resroucegroupids{resourcegroupid};
+	}
+
+	return %ret_grouplist;
+	
+}
+
+#/////////////////////////////////////////////////////////////////////////////
+
+=head2 get_managementnode_computer_groups
+
+ Parameters  : mangement node resource group id 
+ Returns     : Hash containing computer groups controlled by resource group
+ Description :
+
+=cut
+
+sub get_managementnode_computer_groups {
+	my $manging_resource_grp_id = @_;
+   my ($package, $filename, $line, $sub) = caller(0);
+
+   if (!(defined($manging_resource_grp_id))) {
+      notify($ERRORS{'WARNING'}, 0, "management resource group ID was not specified");
+      return ();
+   }
+
+   my $select_statement = "
+   SELECT DISTINCT
+	resourcemap.resourcegroupid2
+	FROM
+	resourcemap,
+	resourcetype
+	WHERE 
+	resourcemap.resourcetypeid2 = resourcetype.id 
+	AND resourcemap.resourcegroupid1 = $manging_resource_grp_id
+	AND resourcetype.name = 'computer'
+	 ";
+
+   # 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 or more rows were returned
+   if (scalar @selected_rows == 0) {
+      return ();
+   }
+
+	#Build the list
+
+}
+
+#/////////////////////////////////////////////////////////////////////////////
+
 =head2 update_currentimage
 
  Parameters  : $computerid, $imageid, $imagerevisionid, $preferredimagid(optional)



Mime
View raw message