From 4ec4e586c5cab4c5c3b83b46293af07d899f2b73 Mon Sep 17 00:00:00 2001 From: yinle Date: Fri, 25 Mar 2011 09:42:56 +0000 Subject: [PATCH] Fix bug 3219114: If delete CEC/Frmae, FSP/BPA should also be deleted from tab git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@9152 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/tabutils.pm | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/xCAT-server/lib/xcat/plugins/tabutils.pm b/xCAT-server/lib/xcat/plugins/tabutils.pm index c68c90e1b..fe72abbe0 100644 --- a/xCAT-server/lib/xcat/plugins/tabutils.pm +++ b/xCAT-server/lib/xcat/plugins/tabutils.pm @@ -14,6 +14,8 @@ use Data::Dumper; use xCAT::NodeRange qw/noderange abbreviate_noderange/; use xCAT::Schema; use xCAT::Utils; +use xCAT::MsgUtils; +use xCAT::DBobjUtils; use Getopt::Long; my $requestcommand; @@ -278,6 +280,22 @@ sub noderm push @tablist, $_; } } + if (scalar(@$nodes)) { + for my $nn ( @$nodes ) { + my $nt = xCAT::DBobjUtils->getnodetype($nn); + if ( $nt =~ /^(cec|frame)$/ ) { + my $cnodep = xCAT::DBobjUtils->getchildren($nn); + if ($cnodep) { + my $cnode = join ',', @$cnodep; + my $rsp; + $rsp->{data}->[0] = + "Removed a $nt node, please remove these nodes belongs to it manually: $cnode \n"; + xCAT::MsgUtils->message("I", $rsp, $cb); + } + } + } + } + nodech($nodes, \@tablist, $cb, 0); }