From 8c334f052a9388a5b3973d88e9fc3796780266c9 Mon Sep 17 00:00:00 2001 From: sakolish Date: Thu, 14 Feb 2008 19:47:42 +0000 Subject: [PATCH] Use GlobalDef $::NODETYPE_XXX definitions - Line #341 git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@483 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- perl-xCAT-2.0/xCAT/PPC.pm | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/perl-xCAT-2.0/xCAT/PPC.pm b/perl-xCAT-2.0/xCAT/PPC.pm index 42658e78d..dd9bd69fc 100644 --- a/perl-xCAT-2.0/xCAT/PPC.pm +++ b/perl-xCAT-2.0/xCAT/PPC.pm @@ -10,6 +10,7 @@ use Time::HiRes qw(gettimeofday); use IO::Select; use xCAT::PPCcli; use xCAT::PPCfsp; +use xCAT::GlobalDef; ########################################## @@ -336,8 +337,9 @@ sub resolve { ################################# # Check for valid "type" ################################# - my @types = split /,/, $ent->{nodetype}; - my ($type) = grep( /^fsp|bpa|osi|lpar$/, @types ); + my ($type) = grep( + /^$::NODETYPE_LPAR|$::NODETYPE_OSI|$::NODETYPE_BPA|$::NODETYPE_FSP$/, + split /,/, $ent->{nodetype} ); if ( !defined( $type )) { return( "Invalid node type: $ent->{nodetype}" ); @@ -353,7 +355,7 @@ sub resolve { ################################# # Special lpar processing ################################# - if ( $type =~ /^lpar|osi$/ ) { + if ( $type =~ /^$::NODETYPE_OSI|$::NODETYPE_LPAR$/ ) { $att->{bpa} = 0; $att->{type} = "lpar"; $att->{node} = $att->{parent}; @@ -395,7 +397,7 @@ sub resolve { ################################# # Optional and N/A fields ################################# - elsif ( $type =~ /^fsp$/ ) { + elsif ( $type =~ /^$::NODETYPE_FSP$/ ) { $att->{profile} = 0; $att->{id} = 0; $att->{fsp} = 0; @@ -404,7 +406,7 @@ sub resolve { $att->{parent} = exists($att->{parent}) ? $att->{parent} : 0; $att->{bpa} = $att->{parent}; } - elsif ( $type =~ /^bpa$/ ) { + elsif ( $type =~ /^$NODETYPE::BPA$/ ) { $att->{profile} = 0; $att->{id} = 0; $att->{bpa} = 0; @@ -714,3 +716,4 @@ sub process_request { +