From b6d19b4c8ede4ce90ec4342052c47cecda08d49a Mon Sep 17 00:00:00 2001 From: lissav Date: Thu, 28 Feb 2013 21:16:30 +0000 Subject: [PATCH] fix defect 3380, add support for NoErrorPrefix, NoWarnPrefix git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.8@15311 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- perl-xCAT/xCAT/Client.pm | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/perl-xCAT/xCAT/Client.pm b/perl-xCAT/xCAT/Client.pm index c3293ccf1..85d091fee 100644 --- a/perl-xCAT/xCAT/Client.pm +++ b/perl-xCAT/xCAT/Client.pm @@ -433,7 +433,7 @@ sub plugin_command { $usesiteglobal = 1; } foreach (@nodes) { #Specified a specific plugin, not a table lookup - $handler_hash{$sent->{value}}->{$_} = 1; + $handler_hash{$::XCATSITEVALS{$sitekey}}->{$_} = 1; } } } elsif ($hdlspec =~ /:/) { #Specificed a table lookup path for plugin name @@ -998,7 +998,7 @@ sub handle_response { } #print "in handle_response\n"; # Handle errors - if ($rsp->{errorcode}) { + if (defined($rsp->{errorcode})) { if (ref($rsp->{errorcode}) eq 'ARRAY') { foreach my $ecode (@{$rsp->{errorcode}}) { $xCAT::Client::EXITCODE |= $ecode; @@ -1012,22 +1012,38 @@ sub handle_response { #print "printing error\n"; if (ref($rsp->{error}) eq 'ARRAY') { foreach my $text (@{$rsp->{error}}) { - print STDERR "Error: $text\n"; + if ($rsp->{NoErrorPrefix}) { + print STDERR "$text\n"; + } else { + print STDERR "Error: $text\n"; + } } } else { - print ("Error: ".$rsp->{error}."\n"); + if ($rsp->{NoErrorPrefix}) { + print STDERR ($rsp->{error}."\n"); + } else { + print STDERR ("Error: ".$rsp->{error}."\n"); + } } } if ($rsp->{warning}) { #print "printing warning\n"; if (ref($rsp->{warning}) eq 'ARRAY') { foreach my $text (@{$rsp->{warning}}) { - print STDERR "Warning: $text\n"; + if ($rsp->{NoWarnPrefix}) { + print STDERR "$text\n"; + } else { + print STDERR "Warning: $text\n"; + } } } else { - print ("Warning: ".$rsp->{warning}."\n"); + if ($rsp->{NoWarnPrefix}) { + print STDERR ($rsp->{warning}."\n"); + } else { + print STDERR ("Warning: ".$rsp->{warning}."\n"); + } } } if ($rsp->{info}) {