From 14506161570344d1480b90957aa99bfc8b889f7a Mon Sep 17 00:00:00 2001 From: ligc Date: Fri, 7 Aug 2009 04:26:25 +0000 Subject: [PATCH] fix for bug 2833494 git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@3964 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/DBobjectdefs.pm | 46 ++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/xCAT-server/lib/xcat/plugins/DBobjectdefs.pm b/xCAT-server/lib/xcat/plugins/DBobjectdefs.pm index 7c9f0b0f3..7b9aa7fda 100644 --- a/xCAT-server/lib/xcat/plugins/DBobjectdefs.pm +++ b/xCAT-server/lib/xcat/plugins/DBobjectdefs.pm @@ -2264,6 +2264,52 @@ sub defls return 0; } + + # need a special case for the node postscripts attribute, + # The 'xcatdefaults' postscript should be added to the postscript attribute + my $getnodes = 0; + foreach my $objtype (@::clobjtypes) + { + if ($objtype eq 'node') + { + $getnodes = 1; + last; + } + } + if ($getnodes) + { + my $xcatdefaultsps; + my @TableRowArray = xCAT::DBobjUtils->getDBtable('postscripts'); + if (defined(@TableRowArray)) + { + foreach my $tablerow (@TableRowArray) + { + if(($tablerow->{node} eq 'xcatdefaults') && !($tablerow->{disable})) + { + $xcatdefaultsps = $tablerow->{postscripts}; + last; + } + } + } + foreach my $obj (keys %myhash) + { + if ($myhash{$obj}{objtype} eq 'node') + { + if($xcatdefaultsps) + { + if ($myhash{$obj}{postscripts}) + { + $myhash{$obj}{postscripts} = $xcatdefaultsps . ',' . $myhash{$obj}{postscripts}; + } + else + { + $myhash{$obj}{postscripts} = $xcatdefaultsps; + } + } + } + } + } + # the list of objects may be limited by the "-w" option # see which objects have attr/val that match the where values # - if provided