Author: arkurth
Date: Fri Jul 17 19:08:08 2009
New Revision: 795199

URL: http://svn.apache.org/viewvc?rev=795199&view=rev
Log:
VCL-23
Removed legacy Windows code from xCAT21.pm::load(). These tasks are now handled 
by the Windows OS modules.

Modified:
    incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/xCAT21.pm

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=795199&r1=795198&r2=795199&view=diff
==============================================================================
--- incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/xCAT21.pm 
(original)
+++ incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/xCAT21.pm 
Fri Jul 17 19:08:08 2009
@@ -1043,181 +1043,9 @@
                notify($ERRORS{'OK'}, 0, "post_load() has been implemented by 
the OS module, skipping these tasks in xCAT.pm, returning 1");
                return 1;
        }
-       elsif ($image_os_name =~ /winxp|wxp|win2003|winvista/) {
-
-               insertloadlog($reservation_id, $computer_id, "info", 
"randomizing system level passwords");
-               #change passwords for root and administrator account
-               #skip changing root password for imageprep loads
-               if (changewindowspasswd($computer_node_name, "root")) {
-                       notify($ERRORS{'OK'}, 0, "Successfully changed 
password, account $computer_node_name,root");
-               }
-
-               if (changewindowspasswd($computer_node_name, "administrator")) {
-                       notify($ERRORS{'OK'}, 0, "Successfully changed 
password, account $computer_node_name,administrator");
-               }
-               #disable remote desktop port
-               if (remotedesktopport($computer_node_name, "DISABLE")) {
-                       notify($ERRORS{'OK'}, 0, "remote desktop disabled on 
$computer_node_name");
-               }
-               else {
-                       notify($ERRORS{'OK'}, 0, "remote desktop not disable on 
$computer_node_name");
-               }
-
-               #due to sysprep sshd is set to manual start
-               if (_set_sshd_startmode($computer_node_name, "auto")) {
-                       notify($ERRORS{'OK'}, 0, "successfully set sshd service 
on $computer_node_name to start auto");
-               }
-               else {
-                       notify($ERRORS{'WARNING'}, 0, "failed to set sshd 
service on $computer_node_name to start auto");
-               }
-
-
-               #check for root logged in on console and then logoff
-               notify($ERRORS{'OK'}, 0, "checking for any console users 
$computer_node_name");
-
-               my @QA = run_ssh_command($computer_node_name, $IDENTITY_wxp, 
"cmd /c qwinsta.exe", "root");
-               foreach my $r (@{$QA[1]}) {
-                       if ($r =~ /([>]?)([-a-zA-Z0-9]*)\s+([a-zA-Z0-9]*)\s+ 
([0-9]*)\s+([a-zA-Z]*)/) {
-                               my $state   = $5;
-                               my $session = $2;
-                               my $user    = $3;
-                               if ($5 =~ /Active/) {
-                                       notify($ERRORS{'OK'}, 0, "detected 
$user on $session still logged on $computer_node_name $r, sleeping 7 before 
logging off");
-                                       sleep 7;
-                                       my @LF = 
run_ssh_command($computer_node_name, $IDENTITY_wxp, "cmd /c logoff.exe 
$session");
-                                       foreach my $l (@{$LF[1]}) {
-                                               notify($ERRORS{'OK'}, 0, 
"output from attempt to logoff $user on $session");
-                                       }
-
-                               }
-                       } ## end if ($r =~ 
/([>]?)([-a-zA-Z0-9]*)\s+([a-zA-Z0-9]*)\s+ ([0-9]*)\s+([a-zA-Z]*)/)
-               } ## end foreach my $r (@{$QA[1]})
-
-               #reboot the box  based on options
-               if ($imagemeta_postoption =~ /reboot/i) {
-                       my $rebooted          = 1;
-                       my $reboot_wait_count = 0;
-                       my @retarray;
-                       while ($rebooted) {
-                               if ($reboot_wait_count > 55) {
-                                       notify($ERRORS{'CRITICAL'}, 0, "waited 
$reboot_wait_count on reboot after auto_create_image on $computer_node_name");
-                                       $retarray[1] = "waited 
$reboot_wait_count on reboot after netdom on $computer_node_name";
-                                       return @retarray;
-                               }
-                               notify($ERRORS{'OK'}, 0, "$computer_node_name 
not completed reboot sleeping for 25");
-                               sleep 25;
-                               if (_pping($computer_node_name)) {
-                                       #it pingable check if sshd is open
-                                       notify($ERRORS{'OK'}, 0, 
"$computer_node_name is pingable, checking sshd port");
-                                       my $sshd = 
_sshd_status($computer_node_name, $image_name);
-                                       if ($sshd =~ /on/) {
-                                               $rebooted = 0;
-                                               notify($ERRORS{'OK'}, 0, 
"$computer_node_name sshd is open");
-                                       }
-                                       else {
-                                               notify($ERRORS{'OK'}, 0, 
"$computer_node_name sshd NOT open yet,sleep 5");
-                                               sleep 5;
-                                       }
-                               }    #_pping
-                               $reboot_wait_count++;
-
-                       }    #while
-               }    #reboot
-
-               #win2003 only - need to set private adapter to static without a 
gateway
-               # win2003 and probably vista zero out one gateway and we only 
need a gateway on the public adapter
-               # so we need to remove the one on the private side
-               # downside - we need to reset it to dhcp before making an 
image.....
-
-               if ($image_os_name =~ /^(win2003)/) {
-                       insertloadlog($reservation_id, $computer_id, "info", 
"detected OS which requires network gateway modification");
-                       notify($ERRORS{'OK'}, 0, "detected win2003 OS, 
proceeding to change private adapter to static from dhcp on  
$computer_node_name");
-                       my %ip;
-                       my $myadapter;
-                       my @ipconfig = run_ssh_command($computer_node_name, 
$IDENTITY_wxp, "ipconfig -all", "root");
-
-                       # build hash of needed info and set the correct private 
adapter.
-                       foreach my $a (@{$ipconfig[1]}) {
-                               $myadapter = $1 if ($a =~ /Ethernet adapter 
(.*):/);
-                               $ip{$myadapter}{"private"} = 1
-                                 if ($a =~ /IP Address([\s.]*): $privateIP/);
-                               $ip{$myadapter}{"subnetmask"} = $2
-                                 if ($a =~ /Subnet Mask([\s.]*): ([.0-9]*)/);
-                       }
-
-                       my $privateadapter;
-                       my $subnetmask;
-
-                       foreach my $key (keys %ip) {
-                               if (defined($ip{$key}{private})) {
-                                       if ($ip{$key}{private}) {
-                                               $privateadapter = "\"$key\"";
-                                               $subnetmask     = 
$ip{$key}{subnetmask};
-                                       }
-                               }
-                       }
-
-                       notify($ERRORS{'OK'}, 0, "attempted to convert private 
adapter on $computer_node_name to static with no gateway");
-                       #not using run_ssh_command here
-                       if (open(NETSH, "/usr/bin/ssh -x -i $IDENTITY_wxp 
$computer_node_name \"netsh interface ip set address 
name=\\\"$privateadapter\\\" source=static addr=$privateIP mask=$subnetmask\" & 
2>&1 |")) {
-                               #losing connection
-                               my $go = 1;
-                               while ($go) {
-                                       #print "hi\n";
-                                       sleep 4;
-                                       if (open(PS, "ps -ef |")) {
-                                               my @ps = <PS>;
-                                               close(PS);
-                                               sleep 4;
-                                               foreach my $p (@ps) {
-                                                       if ($p =~ 
/$computer_node_name netsh interface/) {
-                                                               if ($p =~ 
/(root)\s+([0-9]*)/) {
-                                                                       if 
(open(KILLIT, "kill -9 $2 |")) {
-                                                                               
close(KILLIT);
-                                                                               
close(NETSH);
-                                                                               
notify($ERRORS{'OK'}, 0, "killing ssh $computer_node_name netsh process");
-                                                                       }
-                                                               }
-                                                       }
-                                               } ## end foreach my $p (@ps)
-                                       } ## end if (open(PS, "ps -ef |"))
-
-                                       $go = 0;
-                               } ## end while ($go)
-                       } ## end if (open(NETSH, "/usr/bin/ssh -x -i 
$IDENTITY_wxp $computer_node_name \"netsh interface ip set address 
name=\\\"$privateadapter\\\" source=static addr=$privateIP mask=$subnetmask\" & 
2>&1 |"...
-
-                       #make sure it came back
-                       if (_sshd_status($computer_node_name, $image_name)) {
-                               notify($ERRORS{'OK'}, 0, "successful 
$computer_node_name is accessible after static assignment");
-                               insertloadlog($reservation_id, $computer_id, 
"info", "SUCCESS network gateway modification successful");
-                       }
-                       else {
-
-                       }
-
-                       #disable NetBios
-                       notify($ERRORS{'OK'}, 0, "attempted to convert private 
adapter on $computer_node_name to static with no gateway");
-                       my $path1 = "$TOOLS/disablenetbios.vbs";
-                       my $path2 = "$computer_node_name:disablenetbios.vbs";
-                       if (run_scp_command($path1, $path2, $IDENTITY_wxp)) {
-                               notify($ERRORS{'DEBUG'}, 0, "copied $path1 to 
$path2");
-                               my @DNBIOS = 
run_ssh_command($computer_node_name, $IDENTITY_wxp, "cscript.exe //Nologo 
disablenetbios.vbs", "root");
-                               foreach my $l (@{$DNBIOS[1]}) {
-                                       if ($l =~ /denied|socket/) {
-                                               notify($ERRORS{'WARNING'}, 0, 
"failed to disablenetbios.vbs @{ $DNBIOS[1] }");
-                                       }
-                               }
-
-                       } ## end if (run_scp_command($path1, $path2, 
$IDENTITY_wxp...
-                       else {
-                               notify($ERRORS{'WARNING'}, 0, "run_scp_command 
failed to copy  $path1 to $path2");
-                       }
-
-               } ## end if ($image_os_name =~ /^(win2003)/)
-       } ## end elsif ($image_os_name =~ /winxp|wxp|win2003|winvista/) [ if 
($self->os->can('post_load'))
-
-
+       
        # Linux post-load tasks
+       # TODO: The following should be removed once Linux.pm post_load() has 
been implemented
        elsif ($image_os_type =~ /linux/i) {
                #linux specfic routines
                #FIXME move to generic post options on per image basis


Reply via email to