From 76bb8c08368825acddf7d909ac1207066cf07dfd Mon Sep 17 00:00:00 2001 From: nott Date: Mon, 10 Jan 2011 19:00:39 +0000 Subject: [PATCH] add error msg for bad monserver attr git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@8598 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/snmove.pm | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/snmove.pm b/xCAT-server/lib/xcat/plugins/snmove.pm index 81fcd52ef..5ab5a6e04 100644 --- a/xCAT-server/lib/xcat/plugins/snmove.pm +++ b/xCAT-server/lib/xcat/plugins/snmove.pm @@ -386,13 +386,21 @@ sub process_request } #set monserver ( = "servicenode,xcatmaster" ) - if ($nhash{$node}{'monserver'}) + if ($nhash{$node}{'monserver'}) # if it is currently set { my @tmp_a = split(',', $nhash{$node}{'monserver'}); - if ((@tmp_a > 1) && ($tmp_a[1] eq $sn1n)) + if (scalar(@tmp_a) < 2) # it must have two values { - $sn_hash{$node}{'monserver'} = "$newsn{$node},$newxcatmaster{$node}"; - } + my $rsp; + push @{$rsp->{data}}, "The current value of the monserver attribute is not valid. It will not be reset.\n"; + xCAT::MsgUtils->message("E", $rsp, $callback); + } else { + # if the first value is the current service node then change it + if ($tmp_a[0] eq $sn1) + { + $sn_hash{$node}{'monserver'} = "$newsn{$node},$newxcatmaster{$node}"; + } + } } }