From e7f3446bd4b5266acc232f2551149ac631a4d116 Mon Sep 17 00:00:00 2001 From: immarvin Date: Thu, 23 Jun 2016 02:09:24 -0400 Subject: [PATCH] fix issue [FVT]lsdef/mkdef commands on rh6.8 ppc64 #1369 @github --- xCAT-server/lib/xcat/plugins/DBobjectdefs.pm | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/DBobjectdefs.pm b/xCAT-server/lib/xcat/plugins/DBobjectdefs.pm index 915ffb9f2..554c9ea5f 100755 --- a/xCAT-server/lib/xcat/plugins/DBobjectdefs.pm +++ b/xCAT-server/lib/xcat/plugins/DBobjectdefs.pm @@ -669,8 +669,7 @@ sub processArgs #if "-a" is not specified, read the template files content #under "/opt/xcat/share/xcat/templates/objects/" my $objfiledata; - find(\&wanted,@tmpldirlist); - sub wanted{ + my $wanted= sub { if (-f $_){ my $line; open(FH,$_); @@ -679,7 +678,9 @@ sub processArgs } close(FH) } - } + }; + find($wanted,@tmpldirlist); + #save the template definitions in global variable $::filedata #for the later parse @@ -3183,7 +3184,8 @@ sub defls } else{ #push the unique object types from @::fileobjtypes to @::clobjtypes - push @::clobjtypes, keys { map { $_ => 1 } @::fileobjtypes }; + my %objtypehash=map { $_ => 1 } @::fileobjtypes; + push @::clobjtypes, keys(%objtypehash); } } # end - if specify all