From 2a05ae09bfd0b4d5bfebb4c815f6cc1431867bb4 Mon Sep 17 00:00:00 2001 From: sjing Date: Thu, 9 Sep 2010 02:36:43 +0000 Subject: [PATCH] fix for rmnimimage -s servicenode image git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@7384 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/aixinstall.pm | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/aixinstall.pm b/xCAT-server/lib/xcat/plugins/aixinstall.pm index 95e94a466..b8c5d643e 100644 --- a/xCAT-server/lib/xcat/plugins/aixinstall.pm +++ b/xCAT-server/lib/xcat/plugins/aixinstall.pm @@ -4497,9 +4497,23 @@ sub rmnimimage { # is it allocated? - my $alloc_count = - xCAT::InstUtils->get_nim_attr_val($resname, "alloc_count", + my $alloc_count; + # only change the logic for -s flag, + # keep the original logic for other scenarios + if ($::SERVERLIST) + { + # get local hostname as target + my $hn = `hostname`; + $alloc_count = + xCAT::InstUtils->get_nim_attr_val($resname, "alloc_count", + $callback, $hn, $subreq); + } + else + { + $alloc_count = + xCAT::InstUtils->get_nim_attr_val($resname, "alloc_count", $callback, "", $subreq); + } if (defined($alloc_count) && ($alloc_count != 0)) {