From 94009a475d13ce05c01cf0fa4a2b4d3ebb2ec6d1 Mon Sep 17 00:00:00 2001 From: ertaozh Date: Mon, 14 Aug 2017 02:22:21 -0400 Subject: [PATCH] return errorcode 1 if failed for xcatprobe switch_macmap --- xCAT-probe/subcmds/switch_macmap | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xCAT-probe/subcmds/switch_macmap b/xCAT-probe/subcmds/switch_macmap index 3a52ca5df..2b4757177 100755 --- a/xCAT-probe/subcmds/switch_macmap +++ b/xCAT-probe/subcmds/switch_macmap @@ -120,6 +120,7 @@ foreach (<$fd>) { } } close($fd); +my $rc = 0; if (-f $normal_file) { unlink($normal_file); } @@ -129,8 +130,10 @@ if (-f $error_file) { if (@error_nodes) { my $error_node = join(",", @error_nodes); probe_utils->send_msg("$output", "d", "[$error_node] : Error, switch-macmap can only be run against xCAT objects that have 'nodetype=switch'"); + $rc = 1; } foreach (@fails) { probe_utils->send_msg("$output", "f", "$_"); + $rc = 1; } -exit 0; +exit $rc;