From 2079cadb80f6c7491131140b104c7eba3ae689d9 Mon Sep 17 00:00:00 2001 From: xq2005 Date: Mon, 13 Dec 2010 10:17:24 +0000 Subject: [PATCH] modified for lsevent git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@8391 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/web.pm | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/web.pm b/xCAT-server/lib/xcat/plugins/web.pm index 74b5f2d04..738408094 100644 --- a/xCAT-server/lib/xcat/plugins/web.pm +++ b/xCAT-server/lib/xcat/plugins/web.pm @@ -91,9 +91,9 @@ sub web_lsevent { #print Dumper(\@ret); #please refer the manpage for the output format of "lsevent" - my %data = (); + my $data = []; - my %record = (); + my $record = ''; my $i = 0; my $j = 0; @@ -102,15 +102,19 @@ sub web_lsevent { if ( $item ne "\n" ) { chomp $item; my ( $key, $value ) = split( "=", $item ); - $record{$key} = $value; + if ($j < 2){ + $record .= $value . ';'; + } + else{ + $record .= $value; + } + $j++; if ( $j == 3 ) { $i++; $j = 0; - while ( my ( $k, $v ) = each %record ) { - $data{$i}{$k} = $v; - } - %record = (); + push(@$data, {name=>$i, data=>$record}); + $record = ''; } } @@ -118,9 +122,7 @@ sub web_lsevent { #print Dumper(\%data); - while ( my ( $key, $value ) = each %data ) { - $callback->( { data => $value } ); - } + $callback->( { data => $data } ); } sub web_lsrsrcdef {