Author: fapeeler
Date: Mon Jun 7 20:11:49 2010
New Revision: 952402
URL: http://svn.apache.org/viewvc?rev=952402&view=rev
Log:
VCL-163
added get_variable call
renamed global name of $THROTTLE to a local $xcat_throttle
Modified:
incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/xCAT.pm
incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/xCAT2.pm
incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/xCAT21.pm
Modified: incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/xCAT.pm
URL:
http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/xCAT.pm?rev=952402&r1=952401&r2=952402&view=diff
==============================================================================
--- incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/xCAT.pm
(original)
+++ incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/xCAT.pm Mon
Jun 7 20:11:49 2010
@@ -258,23 +258,26 @@ sub load {
my $bootstatus = 0;
my $wait_loops = 0;
my @status;
+ my $xcat_throttle = 0;
#get Throttle value from database if set
my $variable_name = $self->data->get_management_node_hostname() .
"|xcat|throttle";
if($self->data->is_variable_set($variable_name)){
notify($ERRORS{'DEBUG'}, 0, "throttle is set for
$variable_name");
+ #fetch variable
+ $xcat_throttle = $self->data->get_variable($variable_name);
}
else{
notify($ERRORS{'DEBUG'}, 0, "throttle is not set for
$variable_name");
- $THROTTLE = 0;
+ $xcat_throttle = 0;
}
# Check to see if management node throttle is configured
- if ($THROTTLE) {
- notify($ERRORS{'DEBUG'}, 0, "throttle is set to $THROTTLE");
+ if ($xcat_throttle) {
+ notify($ERRORS{'DEBUG'}, 0, "throttle is set to
$xcat_throttle");
my $lckloadfile = "/tmp/nodeloading.lockfile";
notify($ERRORS{'DEBUG'}, 0, "attempting to open node loading
lockfile for throttling: $lckloadfile");
@@ -292,12 +295,12 @@ sub load {
my $ld = @nodesetout;
notify($ERRORS{'DEBUG'}, 0,
"current number of nodes loading: $ld");
- if ($ld < $THROTTLE) {
+ if ($ld < $xcat_throttle) {
notify($ERRORS{'OK'},
0, "current nodes loading is less than throttle, ok to proceed");
$maxload = 0;
}
else {
- notify($ERRORS{'OK'},
0, "current nodes loading=$ld, throttle=$THROTTLE, must wait, sleeping for 10
seconds");
+ notify($ERRORS{'OK'},
0, "current nodes loading=$ld, throttle=$xcat_throttle, must wait, sleeping for
10 seconds");
sleep 10;
}
} ## end if (open(NODESET,
"$XCAT_ROOT/bin/nodeset all stat \| grep install 2>&1 | "...
@@ -318,7 +321,7 @@ sub load {
notify($ERRORS{'WARNING'}, 0, "failed to open node
loading lockfile");
}
- } ## end if ($THROTTLE)
+ } ## end if ($xcat_throttle)
else {
notify($ERRORS{'DEBUG'}, 0, "throttle is NOT set");
}
Modified:
incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/xCAT2.pm
URL:
http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/xCAT2.pm?rev=952402&r1=952401&r2=952402&view=diff
==============================================================================
--- incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/xCAT2.pm
(original)
+++ incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/xCAT2.pm Mon
Jun 7 20:11:49 2010
@@ -240,6 +240,7 @@ sub load {
my $rpower_fixes = 0;
my $bootstatus = 0;
my $wait_loops = 0;
+ my $xcat_throttle = 0;
my @status;
# Check to see if management node throttle is configured
@@ -247,15 +248,17 @@ sub load {
my $variable_name = $self->data->get_management_node_hostname() .
"|xcat|throttle";
if($self->data->is_variable_set($variable_name)){
notify($ERRORS{'DEBUG'}, 0, "throttle is set for
$variable_name");
+ #fetch variable
+ $xcat_throttle = $self->data->get_variable($variable_name);
}
else{
notify($ERRORS{'DEBUG'}, 0, "throttle is not set for
$variable_name");
- $THROTTLE = 0;
+ $xcat_throttle = 0;
}
- if ($THROTTLE) {
- notify($ERRORS{'DEBUG'}, 0, "throttle is set to $THROTTLE");
+ if ($xcat_throttle) {
+ notify($ERRORS{'DEBUG'}, 0, "throttle is set to
$xcat_throttle");
my $lckloadfile = "/tmp/nodeloading.lockfile";
notify($ERRORS{'DEBUG'}, 0, "attempting to open node loading
lockfile for throttling: $lckloadfile");
if (sysopen(SEM, $lckloadfile, O_RDONLY | O_CREAT)) {
@@ -270,12 +273,12 @@ sub load {
close(NODESET);
my $ld = @nodesetout;
notify($ERRORS{'DEBUG'}, 0,
"current number of nodes loading: $ld");
- if ($ld < $THROTTLE) {
+ if ($ld < $xcat_throttle) {
notify($ERRORS{'OK'},
0, "current nodes loading is less than throttle, ok to proceed");
$maxload = 0;
}
else {
- notify($ERRORS{'OK'},
0, "current nodes loading=$ld, throttle=$THROTTLE, must wait, sleeping for 10
seconds");
+ notify($ERRORS{'OK'},
0, "current nodes loading=$ld, throttle=$xcat_throttle, must wait, sleeping for
10 seconds");
sleep 10;
}
} ## end if (open(NODESET,
"$XCAT_ROOT/sbin/nodeset all stat \| grep install 2>&1 | "...
@@ -296,7 +299,7 @@ sub load {
notify($ERRORS{'WARNING'}, 0, "failed to open node
loading lockfile");
}
- } ## end if ($THROTTLE)
+ } ## end if ($xcat_throttle)
else {
notify($ERRORS{'DEBUG'}, 0, "throttle is NOT set");
}
Modified:
incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/xCAT21.pm
URL:
http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/xCAT21.pm?rev=952402&r1=952401&r2=952402&view=diff
==============================================================================
--- incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/xCAT21.pm
(original)
+++ incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/xCAT21.pm
Mon Jun 7 20:11:49 2010
@@ -248,6 +248,7 @@ sub load {
my $rpower_fixes = 0;
my $bootstatus = 0;
my $wait_loops = 0;
+ my $xcat_throttle = 0;
my @status;
# Check to see if management node throttle is configured
@@ -255,15 +256,17 @@ sub load {
my $variable_name = $self->data->get_management_node_hostname() .
"|xcat|throttle";
if($self->data->is_variable_set($variable_name)){
notify($ERRORS{'DEBUG'}, 0, "throttle is set for
$variable_name");
+ #fetch variable
+ $xcat_throttle = $self->data->get_variable($variable_name);
}
else{
notify($ERRORS{'DEBUG'}, 0, "throttle is not set for
$variable_name");
- $THROTTLE = 0;
+ $xcat_throttle = 0;
}
- if ($THROTTLE) {
- notify($ERRORS{'DEBUG'}, 0, "throttle is set to $THROTTLE");
+ if ($xcat_throttle) {
+ notify($ERRORS{'DEBUG'}, 0, "throttle is set to
$xcat_throttle");
my $lckloadfile = "/tmp/nodeloading.lockfile";
notify($ERRORS{'DEBUG'}, 0, "attempting to open node loading
lockfile for throttling: $lckloadfile");
if (sysopen(SEM, $lckloadfile, O_RDONLY | O_CREAT)) {
@@ -278,12 +281,12 @@ sub load {
close(NODESET);
my $ld = @nodesetout;
notify($ERRORS{'DEBUG'}, 0,
"current number of nodes loading: $ld");
- if ($ld < $THROTTLE) {
+ if ($ld < $xcat_throttle) {
notify($ERRORS{'OK'},
0, "current nodes loading is less than throttle, ok to proceed");
$maxload = 0;
}
else {
- notify($ERRORS{'OK'},
0, "current nodes loading=$ld, throttle=$THROTTLE, must wait, sleeping for 10
seconds");
+ notify($ERRORS{'OK'},
0, "current nodes loading=$ld, throttle=$xcat_throttle, must wait, sleeping for
10 seconds");
sleep 10;
}
} ## end if (open(NODESET,
"$XCAT_ROOT/sbin/nodeset all stat \| grep install 2>&1 | "...
@@ -304,7 +307,7 @@ sub load {
notify($ERRORS{'WARNING'}, 0, "failed to open node
loading lockfile");
}
- } ## end if ($THROTTLE)
+ } ## end if ($xcat_throttle)
else {
notify($ERRORS{'DEBUG'}, 0, "throttle is NOT set");
}