blob: 6958575b6b51e772876f8185b828babe1e5eb008 [file] [log] [blame]
#!/usr/bin/perl -w
###############################################################################
# $Id$
###############################################################################
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
###############################################################################
=head1 NAME
VCL::Module::OS::Windows::Version_6::2008.pm - VCL module to support Windows Server 2008 operating system
=head1 SYNOPSIS
Needs to be written
=head1 DESCRIPTION
This module provides VCL support for Windows Server 2008.
=cut
###############################################################################
package VCL::Module::OS::Windows::Version_6::2008;
# Specify the lib path using FindBin
use FindBin;
use lib "$FindBin::Bin/../../../../..";
# Configure inheritance
use base qw(VCL::Module::OS::Windows::Version_6);
# Specify the version of this module
our $VERSION = '2.5.1';
# Specify the version of Perl to use
use 5.008000;
use strict;
use warnings;
use diagnostics;
use VCL::utils;
use File::Basename;
###############################################################################
=head1 CLASS VARIABLES
=cut
=head2 $SOURCE_CONFIGURATION_DIRECTORY
Data type : Scalar
Description : Location on management node of script/utilty/configuration
files needed to configure the OS. This is normally the
directory under the 'tools' directory specific to this OS.
=cut
our $SOURCE_CONFIGURATION_DIRECTORY = "$TOOLS/Windows_Server_2008";
###############################################################################
=head1 OBJECT METHODS
=cut
#//////////////////////////////////////////////////////////////////////////////
=head2 pre_capture
Parameters :
Returns :
Description :
=cut
sub pre_capture {
my $self = shift;
my $args = shift;
if (ref($self) !~ /windows/i) {
notify($ERRORS{'CRITICAL'}, 0, "subroutine was called as a function, it must be called as a class method");
return;
}
# Get required data
my $imagemeta_sysprep = $self->data->get_imagemeta_sysprep();
# Call parent class's pre_capture() subroutine
notify($ERRORS{'OK'}, 0, "calling parent class pre_capture() subroutine");
if ($self->SUPER::pre_capture($args)) {
notify($ERRORS{'OK'}, 0, "successfully executed parent class pre_capture() subroutine");
}
else {
notify($ERRORS{'WARNING'}, 0, "failed to execute parent class pre_capture() subroutine");
return 0;
}
notify($ERRORS{'OK'}, 0, "beginning Windows Server 2008 image capture preparation tasks");
# Check if Sysprep is to be used
if ($imagemeta_sysprep) {
# Run sysprep.exe and shut down the computer
if (!$self->run_sysprep()) {
notify($ERRORS{'WARNING'}, 0, "failed to Sysprep the computer");
return 0;
}
}
else {
# Prepare the computer for post_load.cmd to be run and shut down the computer
if (!$self->prepare_post_load()) {
notify($ERRORS{'WARNING'}, 0, "failed to prepare the computer for post_load.cmd to be run");
return 0;
}
}
notify($ERRORS{'OK'}, 0, "returning 1");
return 1;
} ## end sub pre_capture
#//////////////////////////////////////////////////////////////////////////////
1;
__END__
=head1 SEE ALSO
L<http://cwiki.apache.org/VCL/>
=cut