You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@vcl.apache.org by ar...@apache.org on 2009/07/21 00:06:06 UTC

svn commit: r796042 - /incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Windows.pm

Author: arkurth
Date: Mon Jul 20 22:06:06 2009
New Revision: 796042

URL: http://svn.apache.org/viewvc?rev=796042&view=rev
Log:
VCL-186
Windows.pm: Added call to set_public_default_route() in post_load(). This causes a persistent default route to be added to the routing table. This is done to prevent loaded computers from losing their default gateways.

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=796042&r1=796041&r2=796042&view=diff
==============================================================================
--- incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Windows.pm (original)
+++ incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Windows.pm Mon Jul 20 22:06:06 2009
@@ -476,6 +476,17 @@
 	
 =item *
 
+ Set persistent public default route
+
+=cut
+
+	if (!$self->set_public_default_route()) {
+		notify($ERRORS{'WARNING'}, 0, "unable to set persistent public default route");
+		return 0;
+	}
+
+=item *
+
  Set the "My Computer" description to the image pretty name
 
 =cut
@@ -7384,12 +7395,24 @@
 		notify($ERRORS{'CRITICAL'}, 0, "subroutine can only be called as a VCL::Module module object method");
 		return;	
 	}
-
+	
+	# Check the management node's DHCP IP configuration mode
 	# Get the default gateway address
-	my $default_gateway = $self->data->get_management_node_public_default_gateway();
+	my $default_gateway;
+	my $ip_configuration = $self->data->get_management_node_public_ip_configuration();
+	if ($ip_configuration && $ip_configuration =~ /static/i) {
+		# Static addresses used, get default gateway address configured for management node
+		$default_gateway = $self->data->get_management_node_public_default_gateway();
+	}
+	else {
+		# Dynamic addresses used, get default gateway address assigned to computer
+		$default_gateway = $self->get_public_default_gateway();
+	}
+	
+	# Make sure default gateway was retrieved
 	if (!$default_gateway) {
 		notify($ERRORS{'WARNING'}, 0, "unable to retrieve default gateway address");
-		return;	
+		return;
 	}
 	
 	# Delete all default routes before adding