From fb28b71c716bbc5929f94c9a4d7e47d91ce970dc Mon Sep 17 00:00:00 2001 From: nott Date: Mon, 28 Jan 2008 13:03:58 +0000 Subject: [PATCH] Make sure the same attr isn't displayed more then once. git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@334 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server-2.0/lib/xcat/plugins/DBobjectdefs.pm | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/xCAT-server-2.0/lib/xcat/plugins/DBobjectdefs.pm b/xCAT-server-2.0/lib/xcat/plugins/DBobjectdefs.pm index de29fafda..2efdccfc7 100644 --- a/xCAT-server-2.0/lib/xcat/plugins/DBobjectdefs.pm +++ b/xCAT-server-2.0/lib/xcat/plugins/DBobjectdefs.pm @@ -843,8 +843,6 @@ sub defmk next; } - # ndebug mk - # if object already exists if (grep(/$obj/, @{$objTypeLists{$type}})) { @@ -2159,9 +2157,13 @@ sub defls # get the data type definition from Schema.pm my $datatype = $xCAT::Schema::defspec{$defhash{$obj}{'objtype'}}; + my @alreadydone; foreach $this_attr (@{$datatype->{'attrs'}}) { - push(@attrlist, $this_attr->{attr_name}); + if (!grep(/^$this_attr->{attr_name}$/, @alreadydone)) { + push(@attrlist, $this_attr->{attr_name}); + } + push(@alreadydone, $this_attr->{attr_name}); } }