Author: arkurth Date: Thu Feb 26 15:53:15 2009 New Revision: 748188 URL: http://svn.apache.org/viewvc?rev=748188&view=rev Log: VCL-23 Added a block in new.pm::reserve_computer() to call the OS module's reserve() subroutine if it has been implemented. Otherwise, flow continues exactly as it did before. Existing OS modules do not have reserve() subroutines so they aren't affected.
Modified: incubator/vcl/trunk/managementnode/lib/VCL/new.pm Modified: incubator/vcl/trunk/managementnode/lib/VCL/new.pm URL: http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/lib/VCL/new.pm?rev=748188&r1=748187&r2=748188&view=diff ============================================================================== --- incubator/vcl/trunk/managementnode/lib/VCL/new.pm (original) +++ incubator/vcl/trunk/managementnode/lib/VCL/new.pm Thu Feb 26 15:53:15 2009 @@ -1060,9 +1060,22 @@ # Set the password in the DataStructure object $self->data->set_reservation_password($reservation_password); + # Check if OS module had implemented a reserve() subroutine + # This is only true for modularized OS modules + if ($self->os->can('reserve')) { + # Call the OS module's reserve() subroutine + notify($ERRORS{'DEBUG'}, 0, "calling OS module's reserve() subroutine"); + if ($self->os->reserve()) { + notify($ERRORS{'DEBUG'}, 0, "OS module successfully reserved resources for this reservation"); + } + else { + $self->reservation_failed("OS module failed to reserve resources for this reservation"); + } + } + # Windows Vista reservation tasks # Much of this subroutine will be rearranged once other OS's are modularized - if ($image_os_name =~ /winvista/) { + elsif ($image_os_name =~ /winvista/) { if ($request_forimaging) { # Set the Administrator password notify($ERRORS{'OK'}, 0, "attempting to set Administrator password to $reservation_password on $computer_short_name");