From 35f3c53a4d068781cf5c397ed7b30ea56b6437a8 Mon Sep 17 00:00:00 2001 From: lissav Date: Tue, 7 Aug 2012 14:57:31 +0000 Subject: [PATCH] use new noderangecontainsMN routine git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@13448 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- perl-xCAT/xCAT/DSHCLI.pm | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/perl-xCAT/xCAT/DSHCLI.pm b/perl-xCAT/xCAT/DSHCLI.pm index 2ce81279f..ae250a582 100644 --- a/perl-xCAT/xCAT/DSHCLI.pm +++ b/perl-xCAT/xCAT/DSHCLI.pm @@ -3805,23 +3805,13 @@ sub parse_and_run_dsh # check if any node in the noderange is the Management Node and exit # with error, if the Management Node is in the Database and in the # noderange - 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/, @nodelist)) { # if MN in the noderange + my $mname = xCAT::Utils->noderangecontainsMn(@nodelist); + if ($mname) { # MN in the nodelist my $rsp = {}; $rsp->{error}->[0] = "You must not run -K option against the Management Node:$mname."; xCAT::MsgUtils->message("E", $rsp, $::CALLBACK, 1); return; - } } # if devicetype=Mellanox, xdsh does not setup ssh, rspconfig does if ($switchtype =~ /Mellanox/i) {