From fbc8875c41bac2a76dd5ad0e96943c8bf19ad44e Mon Sep 17 00:00:00 2001 From: daniceexi Date: Fri, 18 Sep 2009 11:21:12 +0000 Subject: [PATCH] add verbose message for the updatenode command git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@4165 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/updatenode.pm | 29 +++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/updatenode.pm b/xCAT-server/lib/xcat/plugins/updatenode.pm index 94b595125..3ebe398be 100644 --- a/xCAT-server/lib/xcat/plugins/updatenode.pm +++ b/xCAT-server/lib/xcat/plugins/updatenode.pm @@ -318,12 +318,17 @@ sub updatenode { # Sync files to the target nodes foreach my $synclist (keys %syncfile_node) { + if (defined($::VERBOSE)) { + my $rsp={}; + $rsp->{data}->[0]= " Internal call command: xdcp -F $synclist"; + $callback->($rsp); + } my $args = ["-F", "$synclist"]; my $env = ["DSH_RSYNC_FILE=$synclist"]; $subreq->({command=>['xdcp'], node=>$syncfile_node{$synclist}, arg=>$args, env=>$env}, $callback); } my $rsp={}; - $rsp->{data}->[0]= "Complete the File Syncing"; + $rsp->{data}->[0]= "Running of File Syncing has completed."; $callback->($rsp); } @@ -338,6 +343,13 @@ sub updatenode { $rsp->{data}->[0]= "Dose not support Software Maintenance for AIX nodes"; $callback->($rsp); } + + if (defined($::VERBOSE)) { + my $rsp={}; + $rsp->{data}->[0]= " Internal call command: $cmd"; + $callback->($rsp); + } + if ($cmd && ! open (CMD, "$cmd |")) { my $rsp={}; $rsp->{data}->[0]= "Cannot run command $cmd"; @@ -346,8 +358,10 @@ sub updatenode { while () { my $rsp={}; my $output = $_; + chomp($output); + $output =~ s/\\cM//; if ($output =~ /returned from postscript/) { - $output =~ s/returned from postscript/Complete the Software Maintenance/; + $output =~ s/returned from postscript/Running of Software Maintenance has completed./; } $rsp->{data}->[0]= "$output"; $callback->($rsp); @@ -371,6 +385,13 @@ sub updatenode { else { $cmd="XCATBYPASS=Y $::XCATROOT/bin/xdsh $nodestring -s -e /install/postscripts/xcataixpost -c 1 $postscripts 2>&1"; } + + if (defined($::VERBOSE)) { + my $rsp={}; + $rsp->{data}->[0]= " Internal call command: $cmd"; + $callback->($rsp); + } + if (! open (CMD, "$cmd |")) { my $rsp={}; $rsp->{data}->[0]= "Cannot run command $cmd"; @@ -379,8 +400,10 @@ sub updatenode { while () { my $rsp={}; my $output = $_; + chomp($output); + $output =~ s/\\cM//; if ($output =~ /returned from postscript/) { - $output =~ s/returned from postscript/Complete the Running Postscripts/; + $output =~ s/returned from postscript/Running of postscripts has completed./; } $rsp->{data}->[0]= "$output"; $callback->($rsp);