From fc37e3ea2fbbfe34afc32b26628916369518d819 Mon Sep 17 00:00:00 2001 From: cridye Date: Mon, 23 Nov 2009 22:30:09 +0000 Subject: [PATCH] kvm.pm: clean up error handling for programmatic control (i.e. MSM) Client.pm: clean up warnings in logfile git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@4658 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- perl-xCAT/xCAT/Client.pm | 2 +- xCAT-server/lib/xcat/plugins/kvm.pm | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/perl-xCAT/xCAT/Client.pm b/perl-xCAT/xCAT/Client.pm index 8ea5a5d4b..c8eeb3c30 100644 --- a/perl-xCAT/xCAT/Client.pm +++ b/perl-xCAT/xCAT/Client.pm @@ -168,7 +168,7 @@ sub submit_request { #add ESC back foreach my $key (keys %$rsp) { - if (ref($rsp->{$key}) eq 'ARRAY') { foreach my $text (@{$rsp->{$key}}) { $text =~ s/xxxxESCxxxx/\e/g; } } + if (ref($rsp->{$key}) eq 'ARRAY') { foreach my $text (@{$rsp->{$key}}) { next unless defined $text; $text =~ s/xxxxESCxxxx/\e/g; } } else { $rsp->{$key} =~ s/xxxxESCxxxx/\e/g; } } diff --git a/xCAT-server/lib/xcat/plugins/kvm.pm b/xCAT-server/lib/xcat/plugins/kvm.pm index 6c34e2b88..f529f885d 100644 --- a/xCAT-server/lib/xcat/plugins/kvm.pm +++ b/xCAT-server/lib/xcat/plugins/kvm.pm @@ -1425,6 +1425,7 @@ sub dohyp { $output{node}->[0]->{errorcode} = $rc; $output{node}->[0]->{name}->[0]=$node; $output{node}->[0]->{data}->[0]->{contents}->[0]=$text; + $output{node}->[0]->{error} = $text unless $rc == 0; print $out freeze([\%output]); print $out "\nENDOFFREEZE6sK4ci\n"; yield();