From e1dead42b1c427c9199d71d601d2062604fa62fe Mon Sep 17 00:00:00 2001 From: mellor Date: Mon, 5 Nov 2012 18:54:38 +0000 Subject: [PATCH] fix lskmodules sending back empty xcatresponse structures git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@14253 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/kmodules.pm | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/kmodules.pm b/xCAT-server/lib/xcat/plugins/kmodules.pm index c6a33ffef..7a586cc85 100644 --- a/xCAT-server/lib/xcat/plugins/kmodules.pm +++ b/xCAT-server/lib/xcat/plugins/kmodules.pm @@ -314,7 +314,7 @@ sub lskmodules { } # Return the module list for this rpm/img file - my $rsp={}; + my $rsp; foreach my $mn (@modlist) { if ($::opt_x) { my %data_entry; @@ -326,7 +326,9 @@ sub lskmodules { } } #xCAT::MsgUtils->message( "I", $rsp, $::CALLBACK ); - $::CALLBACK->($rsp); + if ( $rsp ) { + $::CALLBACK->($rsp); + } } @@ -569,7 +571,7 @@ sub mods_in_rpm { my $tmp_path = "/tmp/lskmodules_expanded_rpm"; mkpath($tmp_path); if (-r $krpm) { - if (system ("cd $tmp_path; rpm2cpio $krpm | cpio -idum *.ko")) { + if (system ("cd $tmp_path; rpm2cpio $krpm | cpio -idum *.ko > /dev/null 2>&1 ; cd - > /dev/null 2>&1")) { my $rsp; push @{ $rsp->{data} }, "Unable to extract files from the rpm $krpm."; xCAT::MsgUtils->message( "E", $rsp, $::CALLBACK );