From 9964dae9a9880b65cd019741ef630128514b02e9 Mon Sep 17 00:00:00 2001 From: ligc Date: Fri, 6 Nov 2009 06:50:51 +0000 Subject: [PATCH] fix for bug 2881601: should not assign nodes attributes to dynamic node group git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@4495 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/DBobjectdefs.pm | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/xCAT-server/lib/xcat/plugins/DBobjectdefs.pm b/xCAT-server/lib/xcat/plugins/DBobjectdefs.pm index fdf70604c..4dbce91ba 100644 --- a/xCAT-server/lib/xcat/plugins/DBobjectdefs.pm +++ b/xCAT-server/lib/xcat/plugins/DBobjectdefs.pm @@ -1033,6 +1033,7 @@ sub defmk $rsp->{data}->[0] = "Can not assign attributes to dynamic node group \'$obj\'."; xCAT::MsgUtils->message("E", $rsp, $::callback); $error = 1; + delete($::FINALATTRS{$obj}); next; } $::FINALATTRS{$obj}{grouptype} = 'dynamic'; @@ -1579,6 +1580,7 @@ sub defch $rsp->{data}->[0] = "Can not assign attributes to dynamic node group \'$obj\'."; xCAT::MsgUtils->message("E", $rsp, $::callback); $error = 1; + delete($::FINALATTRS{$obj}); next; } } @@ -1596,6 +1598,15 @@ sub defch } $grptype = $grphash{$obj}{grouptype}; + if (($grptype eq "dynamic") && (scalar(keys %{$::FINALATTRS{$obj}}) > 1)) + { + my $rsp; + $rsp->{data}->[0] = "Can not assign attributes to dynamic node group \'$obj\'."; + xCAT::MsgUtils->message("E", $rsp, $::callback); + $error = 1; + delete($::FINALATTRS{$obj}); + next; + } # for now all groups are static #$grptype = 'static'; }