Author: arkurth
Date: Tue May  9 22:31:30 2017
New Revision: 1794653

URL: http://svn.apache.org/viewvc?rev=1794653&view=rev
Log:
VCL-1038
Added check in Module.pm::create_nathost_os_object. If the NAT host OS object 
would have been a non-Linux.pm-based module or UnixLab.pm, 
'VCL::Module::OS::Linux' is used.

Modified:
    vcl/trunk/managementnode/lib/VCL/Module.pm

Modified: vcl/trunk/managementnode/lib/VCL/Module.pm
URL: 
http://svn.apache.org/viewvc/vcl/trunk/managementnode/lib/VCL/Module.pm?rev=1794653&r1=1794652&r2=1794653&view=diff
==============================================================================
--- vcl/trunk/managementnode/lib/VCL/Module.pm (original)
+++ vcl/trunk/managementnode/lib/VCL/Module.pm Tue May  9 22:31:30 2017
@@ -750,7 +750,15 @@ my $self = shift;
                }
                my $computer_os_package = 
$computer_info->{currentimagerevision}{image}{OS}{module}{perlpackage};
                
-               notify($ERRORS{'DEBUG'}, 0, "NAT host resource type is 
$nathost_resource_type, creating $computer_os_package OS object to control 
$nathost_hostname");
+               # Make sure the OS module for NAT host 
computer.currentimagerevision is Linux and not UnixLab
+               # UnixLab.pm overrides the firewall initialization step and 
will have a generic VCL::Module::OS::Linux::firewall object which doesn't 
implement nat_configure_reservation
+               if ($computer_os_package !~ /VCL::Module::OS::Linux/ || 
$computer_os_package =~ /UnixLab/) {
+                       notify($ERRORS{'DEBUG'}, 0, "NAT host resource type is 
$nathost_resource_type, OS module that controls $nathost_hostname\'s current 
computer.currentimagerevision value is $computer_os_package, overriding to 
VCL::Module::OS::Linux");
+                       $computer_os_package = 'VCL::Module::OS::Linux';
+               }
+               else {
+                       notify($ERRORS{'DEBUG'}, 0, "NAT host resource type is 
$nathost_resource_type, creating $computer_os_package OS object to control 
$nathost_hostname based its current computer.currentimagerevision value");
+               }
                
                my $nathost_os = $self->create_object($computer_os_package, {
                        #request_data => $request_data,


Reply via email to