# # Copyright (c) 2009-2011 NetApp Inc. # All rights reserved. # ## ## @author dl-nacldev@netapp.com ## @status Shared ## @pod here =head1 NAME NACL::Exceptions::SetupFailure::VserverSetupFailure =head1 DESCRIPTION This exception is thrown when vserver setup failed and we have to return the object. =head1 ATTRIBUTES =head2 setup_object In addition to the attributes that exception objects generally contain, this exception also contains C attribute. This is a object of NACL::MTask::VserverSetup Task. =head1 EXAMPLE use NACL::Exceptions::SetupFailure::VserverSetupFailure qw(:try); use NACL::MTask::VserverSetup; try { $Setup_obj = NACL::MTask::VserverSetup->setup( command_interface => $Node, vserver_params => $Vserver_params, aggregate_params => $Aggregate_params, network_interface_params => $Network_interface_params, nfs_params => $Nfs_params, export_policy_params => $Export_policy_params, export_policy_rule_params => $Export_policy_rule_params, ); } catch NACL::Exceptions::VserverSetup with { my $exception = shift; $Log->comment("Vserver setup failed " . $exception->text()); my $failed_setup_obj = $exception->setup_object(); }; This object can be used for cleanup purpose to remove configuration created by the setup(). $Setup_obj->vserver_obj()->purge() if ( defined $Setup_obj->vserver_obj() ); $Setup_obj->aggr_obj()->purge() if ( defined $Setup_obj->aggr_obj() ); $Setup_obj->cleanup() will be available in future sprints. =cut package NACL::Exceptions::SetupFailure::VserverSetupFailure; use base qw(NATE::BaseException); use Class::MethodMaker [ scalar => [ { -type => 'NACL::MTask::VserverSetup' }, 'setup_object' ], ]; 1;