From c01096db7991c6297cb299a3550e3cb6b44bff93 Mon Sep 17 00:00:00 2001 From: lissav Date: Tue, 26 Jun 2012 15:15:19 +0000 Subject: [PATCH] Do not allow updatenode -k to the Management Node git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@13169 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/updatenode.pm | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/xCAT-server/lib/xcat/plugins/updatenode.pm b/xCAT-server/lib/xcat/plugins/updatenode.pm index c6407795b..453474a14 100644 --- a/xCAT-server/lib/xcat/plugins/updatenode.pm +++ b/xCAT-server/lib/xcat/plugins/updatenode.pm @@ -971,6 +971,26 @@ $AIXnodes_nd, $subreq ) != 0 ) { # if ($request->{security} && $request->{security}->[0] eq "yes") { + # check to see if the Management Node is in the noderange and + # if it is abort + my $mname; + my $tab = xCAT::Table->new('nodetype'); + my @nodelist2=$tab->getAllNodeAttribs(['node','nodetype']); + foreach my $n (@nodelist2) { + if ($n->{'nodetype'} eq "mn") { # this is the MN + $mname=$n->{'node'}; + last; + } + } + if ($mname) { # MN in the database + if (grep(/$mname/, @$nodes)) { # if MN in the noderange + my $rsp = {}; + $rsp->{error}->[0] = + "You must not run -K option against the Management Node:$mname."; + xCAT::MsgUtils->message("E", $rsp, $::CALLBACK, 1); + return; + } + } # generate the arguments my @args = ("-K");