Author: fapeeler
Date: Wed May  9 18:45:24 2012
New Revision: 1336342

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

code to pull time_source variable from database



Modified:
    incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Windows.pm

Modified: incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Windows.pm
URL: 
http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Windows.pm?rev=1336342&r1=1336341&r2=1336342&view=diff
==============================================================================
--- incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Windows.pm (original)
+++ incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Windows.pm Wed May  9 
18:45:24 2012
@@ -8369,8 +8369,29 @@ sub configure_time_synchronization {
        my $computer_node_name   = $self->data->get_computer_node_name();
        my $system32_path        = $self->get_system32_path() || return;
        
-       my $time_source = "time.nist.gov time-a.nist.gov time-b.nist.gov 
time.windows.com";
+
+       #get Throttle source value from database if set
+       my $time_source;
+   my $variable_name = "timesource|" . 
$self->data->get_management_node_hostname();
+   my $variable_name_global = "timesource|global";
+   if($self->data->is_variable_set($variable_name)){
+       #fetch variable
+       $time_source = $self->data->get_variable($variable_name);
+       notify($ERRORS{'DEBUG'}, 0, "time_source is $time_source  set for 
$variable_name");
+    }
+    elsif($self->data->is_variable_set($variable_name_global) ) {
+       #fetch variable
+       $time_source = $self->data->get_variable($variable_name_global);
+       notify($ERRORS{'DEBUG'}, 0, "time_source is $time_source  set for 
$variable_name");
+    }
+        else {
+       $time_source = "time.nist.gov time-a.nist.gov time-b.nist.gov 
time.windows.com";
+       notify($ERRORS{'DEBUG'}, 0, "time_source is not set for $variable_name 
using hardcoded values of $time_source");
+       }       
        
+       # Replace commas with single whitespace 
+       $time_source =~ s/,/ /g;
+
        # Assemble the time command
        my $time_command;
        


Reply via email to