From 3cbf22bdc265a2debf7ad86af30b291bc0e1b01a Mon Sep 17 00:00:00 2001 From: jjhua Date: Mon, 2 Aug 2010 08:25:23 +0000 Subject: [PATCH] move getTypeOfHcp from Utils.pm to FSPUtils.pm git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@6937 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- perl-xCAT/xCAT/FSPUtils.pm | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/perl-xCAT/xCAT/FSPUtils.pm b/perl-xCAT/xCAT/FSPUtils.pm index c5a29bb08..12ce37e37 100644 --- a/perl-xCAT/xCAT/FSPUtils.pm +++ b/perl-xCAT/xCAT/FSPUtils.pm @@ -248,6 +248,26 @@ sub fsp_state_action { return( [$Rc,@res] ); } +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;