From a0e4e2499b250f180f9c1fbafa3da59b0b891875 Mon Sep 17 00:00:00 2001 From: ligc Date: Thu, 14 May 2009 09:35:08 +0000 Subject: [PATCH] bug 2791570 Node will not be created without 'group' attribute via mkdef. Specifying groups to be empty if not specified with mkdef git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@3379 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/DBobjectdefs.pm | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/xCAT-server/lib/xcat/plugins/DBobjectdefs.pm b/xCAT-server/lib/xcat/plugins/DBobjectdefs.pm index 2cb05752f..da4e887f1 100644 --- a/xCAT-server/lib/xcat/plugins/DBobjectdefs.pm +++ b/xCAT-server/lib/xcat/plugins/DBobjectdefs.pm @@ -1197,6 +1197,15 @@ 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