From 5978106a18ef57167de50ab92a71a9f6a62d7aa6 Mon Sep 17 00:00:00 2001 From: sakolish Date: Tue, 11 Dec 2007 20:35:07 +0000 Subject: [PATCH] Enabled "FSP" method to "clear" eventlog - Line #451 git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@157 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- perl-xCAT-2.0/xCAT/PPCfsp.pm | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/perl-xCAT-2.0/xCAT/PPCfsp.pm b/perl-xCAT-2.0/xCAT/PPCfsp.pm index 4cf998fee..b6df5caa0 100644 --- a/perl-xCAT-2.0/xCAT/PPCfsp.pm +++ b/perl-xCAT-2.0/xCAT/PPCfsp.pm @@ -4,6 +4,7 @@ package xCAT::PPCfsp; use strict; use LWP; use HTTP::Cookies; +use HTML::Form; ########################################## @@ -457,16 +458,30 @@ sub clear { my $server = @$exp[1]; ################################## - # Send Clear command + # Get Error/Event Logs URL ################################## - my $url = "https://$server/cgi-bin/cgi"; - my $res = $ua->post( $url, - [form => $form, - submit => "Clear all error/event log entries" ] - ); + my $res = $ua->get( "https://$server/cgi-bin/cgi?form=$form" ); + ################################## # Return error ################################## + if ( !$res->is_success() ) { + return( $res->status_line ); + } + my $form = HTML::Form->parse( $res ); + + ################################## + # Return error + ################################## + if ( !defined( $form )) { + return( "No Error/Event Logs form found" ); + } + ################################## + # Send Clear to JavaScript + ################################## + my $request = $form->click( 'clear' ); + $res = $ua->request( $request ); + if ( !$res->is_success() ) { return( $res->status_line ); } @@ -550,3 +565,4 @@ sub all_clear { 1; +