From 430511e226315de5c857a736e8cab87ea6925626 Mon Sep 17 00:00:00 2001 From: daniceexi Date: Wed, 8 Sep 2010 10:38:25 +0000 Subject: [PATCH] The code drop for the changing object name by chdef command git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@7376 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- perl-xCAT/xCAT/DBobjUtils.pm | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/perl-xCAT/xCAT/DBobjUtils.pm b/perl-xCAT/xCAT/DBobjUtils.pm index 1616516b7..bda616455 100644 --- a/perl-xCAT/xCAT/DBobjUtils.pm +++ b/perl-xCAT/xCAT/DBobjUtils.pm @@ -239,6 +239,7 @@ sub getobjattrs $verbose: optional $attrs_ref: only get the specific attributes, this can be useful especially for performance considerations + $chname_ref: used to get the table entries for changing the object name Arguments: Returns: undef - error @@ -260,7 +261,7 @@ sub getobjattrs #----------------------------------------------------------------------------- sub getobjdefs { - my ($class, $hash_ref, $verbose, $attrs_ref) = @_; + my ($class, $hash_ref, $verbose, $attrs_ref, $chname_ref) = @_; my %objhash; my %typehash = %$hash_ref; my %tabhash; @@ -473,6 +474,9 @@ sub getobjdefs { $objhash{$objname}{$attr} = $tabhash{$lookup_table}{$objname}{$tabattr}; } + if (defined $chname_ref) { + push @{$chname_ref->{$lookup_table}}, ($tabentry{'lookup_attrs'}, $lookup_attr); + } $intabhash = 1; last; } elsif (! defined($tabhash{$lookup_table}{$objname}{"$tabattr"."_hassearched"})) { @@ -515,6 +519,9 @@ sub getobjdefs { $objhash{$objname}{$attr} = $rowent->{$tabattr}; } + if (defined $chname_ref) { + push @{$chname_ref->{$lookup_table}}, ($tabentry{'lookup_attrs'}, (keys %{$tabentry{'lookup_attrs'}}) [0]); + } } #end if ($match... } #end foreach } # end if (defined...