From 0d390087cf47f8abe7b58f440ab23ef5ccca42da Mon Sep 17 00:00:00 2001 From: ligc Date: Tue, 1 Dec 2009 03:30:18 +0000 Subject: [PATCH] fix for bug 208749: the groups is a required attribute with mkdef to create node definitions git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@4697 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/DBobjectdefs.pm | 22 ++++++++++++-------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/DBobjectdefs.pm b/xCAT-server/lib/xcat/plugins/DBobjectdefs.pm index b620afc9d..1b3d400a1 100644 --- a/xCAT-server/lib/xcat/plugins/DBobjectdefs.pm +++ b/xCAT-server/lib/xcat/plugins/DBobjectdefs.pm @@ -1213,6 +1213,19 @@ sub defmk } } # end - if group type + # If none of the attributes in nodelist is defined: groups,status,appstatus,primarysn,comments,disable + # the nodelist table will not be updated, caused mkdef failed. + # We give a restriction that the "groups" must be specified with mkdef. + if (($type eq "node") && !defined($::FINALATTRS{$obj}{groups})) + { + my $rsp; + $rsp->{data}->[0] = + "Attribute \'groups\' is not specified for node \'$obj\', skipping to the next node."; + xCAT::MsgUtils->message("E", $rsp, $::callback); + $error = 1; + next; + } + # # Need special handling for node objects that have the # groups attr set - may need to create group defs @@ -1282,15 +1295,6 @@ sub defmk } } # end - if type = node - # If none of the attributes in nodelist is defined: groups,status,appstatus,primarysn,comments,disable - # the nodelist table will not be updated, caused mkdef failed. - # We can give a restriction that the "groups" must be specified with mkdef, - # but it is not so reasonable especially when the dynamic node group feature is implemented. - # fixing this issue with specifying an empty "groups" if the "groups" is not specified with the command line or stanza file - if (($type eq "node") && !defined($::FINALATTRS{$obj}{groups})) - { - $::FINALATTRS{$obj}{groups} = ''; - } } # end of each obj