From 8c3b6117e2f7c9efe522c99bf2baadc060d2f96a Mon Sep 17 00:00:00 2001 From: ligc Date: Sun, 13 Jun 2010 08:42:05 +0000 Subject: [PATCH] fix for bug 2974910: check if the entry exists when running with chdef -m git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@6453 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- perl-xCAT/xCAT/DBobjUtils.pm | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/perl-xCAT/xCAT/DBobjUtils.pm b/perl-xCAT/xCAT/DBobjUtils.pm index 2c73a21d7..d9fdef03f 100644 --- a/perl-xCAT/xCAT/DBobjUtils.pm +++ b/perl-xCAT/xCAT/DBobjUtils.pm @@ -1099,6 +1099,22 @@ sub setobjdefs split(/$delim/, $DBattrvals{$objname}{$attr_name}); my @minusList = split(/$delim/, $objhash{$objname}{$attr_name}); + foreach my $em (@minusList) + { + if (!(grep {$_ eq $em} @currentList)) + { + if (($::opt_t eq 'group') && ($DBattrvals{$objname}{'grouptype'} ne 'dynamic')) + { + my $rsp; + $rsp->{data}->[0] = "$objname is not a member of \'$em\'."; + xCAT::MsgUtils->message("W", $rsp, $::callback); + } else { + my $rsp; + $rsp->{data}->[0] = "$em is not in the atrribute of \'$attr_name\' for the \'$objname\' definition."; + xCAT::MsgUtils->message("W", $rsp, $::callback); + } + } + } # make a new list without the one specified my $first = 1; my $newlist;