Author: arkurth
Date: Tue Jul 20 14:53:20 2010
New Revision: 965867

URL: http://svn.apache.org/viewvc?rev=965867&view=rev
Log:
VCL-298
Added accessor for the vmprofile.repositorypath value. Added calls to throw an 
exception in _initialize if the computer or image data cannot be retrieved. 
Simply returning null does not cause the DataStructure object construction to 
fail.

Modified:
    incubator/vcl/trunk/managementnode/lib/VCL/DataStructure.pm

Modified: incubator/vcl/trunk/managementnode/lib/VCL/DataStructure.pm
URL: 
http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/lib/VCL/DataStructure.pm?rev=965867&r1=965866&r2=965867&view=diff
==============================================================================
--- incubator/vcl/trunk/managementnode/lib/VCL/DataStructure.pm (original)
+++ incubator/vcl/trunk/managementnode/lib/VCL/DataStructure.pm Tue Jul 20 
14:53:20 2010
@@ -240,6 +240,7 @@ $SUBROUTINE_MAPPINGS{vmhost_profile_id} 
 $SUBROUTINE_MAPPINGS{vmhost_type}       = 
'$self->request_data->{reservation}{RESERVATION_ID}{computer}{vmhost}{type}';
 #$SUBROUTINE_MAPPINGS{vmhost_type_id} = 
'$self->request_data->{reservation}{RESERVATION_ID}{computer}{vmhost}{vmtypeid}';
 
+$SUBROUTINE_MAPPINGS{vmhost_profile_repository_path}    = 
'$self->request_data->{reservation}{RESERVATION_ID}{computer}{vmhost}{vmprofile}{repositorypath}';
 $SUBROUTINE_MAPPINGS{vmhost_profile_datastore_path}     = 
'$self->request_data->{reservation}{RESERVATION_ID}{computer}{vmhost}{vmprofile}{datastorepath}';
 $SUBROUTINE_MAPPINGS{vmhost_profile_datastorepath_4vmx} = 
'$self->request_data->{reservation}{RESERVATION_ID}{computer}{vmhost}{vmprofile}{datastorepath4vmx}';
 #$SUBROUTINE_MAPPINGS{vmhost_profile_id} = 
'$self->request_data->{reservation}{RESERVATION_ID}{computer}{vmhost}{vmprofile}{id}';
@@ -589,6 +590,8 @@ sub _initialize : Init {
                my $computer_info = get_computer_info($self->computer_id);
                if (!$computer_info) {
                        notify($ERRORS{'WARNING'}, 0, "DataStructure object 
could not be initialized, failed to retrieve data for computer ID: " . 
$self->computer_id);
+                       
+                       Exception::Class::Base->throw( error => "DataStructure 
object could not be initialized, failed to retrieve data for computer ID: " . 
$self->computer_id);
                        return;
                }
                
@@ -609,6 +612,8 @@ sub _initialize : Init {
                }
                else {
                        notify($ERRORS{'WARNING'}, 0, "DataStructure object 
could not be initialized, failed to retrieve data for image ID: " . 
$self->image_id);
+                       
+                       Exception::Class::Base->throw( error => "DataStructure 
object could not be initialized, failed to retrieve data for image ID: " . 
$self->image_id);
                        return;
                }
                
@@ -618,6 +623,8 @@ sub _initialize : Init {
                }
                else {
                        notify($ERRORS{'WARNING'}, 0, "DataStructure object 
could not be initialized, failed to retrieve production imagerevision data for 
image ID: " . $self->image_id);
+                       
+                       Exception::Class::Base->throw( error => "DataStructure 
object could not be initialized, failed to retrieve production imagerevision 
data for image ID: " . $self->image_id);
                        return;
                }
        }


Reply via email to