From b8088dc328558ffff765daa9f629ea0b0532908e Mon Sep 17 00:00:00 2001 From: jjhua Date: Mon, 2 Aug 2010 08:11:46 +0000 Subject: [PATCH] add the getTypeOfHcp for multipel hcps git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@6935 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- perl-xCAT/xCAT/Utils.pm | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/perl-xCAT/xCAT/Utils.pm b/perl-xCAT/xCAT/Utils.pm index be032cf17..df95807da 100644 --- a/perl-xCAT/xCAT/Utils.pm +++ b/perl-xCAT/xCAT/Utils.pm @@ -5972,4 +5972,25 @@ sub setupAIXconserver return $rc; } +sub getTypeOfHcp +{ + my $class = shift; + my $hcp = shift; + + my $nodetypetab = xCAT::Table->new( 'nodetype'); + + xCAT::MsgUtils->message('E', "Failed to open table 'nodetype'.") if ( ! $nodetypetab); + my $nodetype_hash = $nodetypetab->getNodeAttribs( $hcp,[qw(nodetype)]); + my $nodetype = $nodetype_hash->{nodetype}; + if ( !$nodetype) { + xCAT::MsgUtils->message('E', "Not found the $hcp\'s nodetype"); + return undef; + } + return $nodetype; + +} + + + + 1;