From ea639a4479971eaea157d3b0483f86b80744df2c Mon Sep 17 00:00:00 2001 From: wanghuaz Date: Wed, 8 Jul 2009 07:41:43 +0000 Subject: [PATCH] fixed defect:2792126. revitals should output some error message if bpa is not defined git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@3727 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/perl/xCAT/PPC.pm | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/xCAT-server/lib/perl/xCAT/PPC.pm b/xCAT-server/lib/perl/xCAT/PPC.pm index 899e4e1ad..3a9963127 100644 --- a/xCAT-server/lib/perl/xCAT/PPC.pm +++ b/xCAT-server/lib/perl/xCAT/PPC.pm @@ -46,6 +46,7 @@ my %modules = ( my %errmsg = ( NODE_UNDEF =>"Node not defined in '%s' database", NO_ATTR =>"'%s' not defined in '%s' database", + NO_UNDEF =>"'%s' not defined in '%s' database for '%s'", DB_UNDEF =>"'%s' database not defined" ); @@ -823,15 +824,12 @@ sub resolve { my @attrs = qw(mtm serial); my ($vpd) = $tabs->{vpd}->getNodeAttribs($ent->{parent},\@attrs); - if ( !defined( $vpd )) { - return( sprintf( $errmsg{NO_UNDEF}, "vpd" )); - } ######################## # Verify attributes ######################## foreach ( @attrs ) { - if ( !exists( $vpd->{$_} )) { - return( sprintf( $errmsg{NO_ATTR}, $_, "vpd" )); + if ( !defined( $vpd ) || !exists( $vpd->{$_} )) { + return( sprintf( $errmsg{NO_UNDEF}, $_, "vpd", $ent->{parent} )); } } $att->{bpa} = "$vpd->{mtm}*$vpd->{serial}";