fix chdef -m option.

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@2504 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
nott 2008-11-18 18:07:46 +00:00
parent d63ebb8522
commit cd6b419037
2 changed files with 13 additions and 5 deletions

View File

@ -765,6 +765,9 @@ sub setobjdefs
# get the object type decription from Schema.pm
my $datatype = $xCAT::Schema::defspec{$type};
# get the key to look for, for this object type
my $objkey = $datatype->{'objkey'};
# get a list of valid attr names
# for this type object
my %attrlist;
@ -779,6 +782,11 @@ sub setobjdefs
foreach my $attr (keys %{$objhash{$objname}})
{
if ($attr eq $objkey)
{
next;
}
if ($attr eq "objtype")
{
@ -818,6 +826,10 @@ sub setobjdefs
my ($lookup_table, $lookup_attr);
my $attr_name = $this_attr->{attr_name};
if ($attr_name eq $objkey)
{
next;
}
# if we have a value for this attribute then process it
# - otherwise go to the next attr

View File

@ -2456,10 +2456,6 @@ sub defls
{
$attrval = $defhash{$obj}{$showattr};
}
else
{
$attrval = " ";
}
# if an attr list was provided then just display those
if ($::opt_i)
@ -2513,7 +2509,7 @@ sub defls
{
# don't print unless set
if ( (defined $attrval) && ($attrval ne " "))
if ($attrval)
{
my $rsp;
$rsp->{data}->[0] =