Module: tools Branch: master Commit: 650414651caddff186c348913ee228b8594abbe0 URL: http://source.winehq.org/git/tools.git/?a=commit;h=650414651caddff186c348913... Author: Francois Gouget <fgouget(a)codeweavers.com> Date: Mon May 19 00:06:17 2014 +0200 testbot/RevertVM: Always pass the current VM to FatalError(). Without this argument it devolves to a two line LogMsg()+exit() combination. --- testbot/bin/RevertVM.pl | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/testbot/bin/RevertVM.pl b/testbot/bin/RevertVM.pl index 60a13f8..b2ae902 100755 --- a/testbot/bin/RevertVM.pl +++ b/testbot/bin/RevertVM.pl @@ -48,16 +48,14 @@ sub FatalError LogMsg $ErrMessage, "\n"; - if ($VM) - { - $VM->Status("offline"); - $VM->ChildPid(undef); - $VM->Save(); - - my $VMKey = $VM->GetKey(); - my $VMSnapshot = $VM->IdleSnapshot; - open (SENDMAIL, "|/usr/sbin/sendmail -oi -t -odq"); - print SENDMAIL <<"EOF"; + $VM->Status("offline"); + $VM->ChildPid(undef); + $VM->Save(); + + my $VMKey = $VM->GetKey(); + my $VMSnapshot = $VM->IdleSnapshot; + open (SENDMAIL, "|/usr/sbin/sendmail -oi -t -odq"); + print SENDMAIL <<"EOF"; From: $RobotEMail To: $AdminEMail Subject: VM $VMKey offline @@ -68,8 +66,7 @@ $ErrMessage The VM has been put offline. EOF - close(SENDMAIL); - } + close(SENDMAIL); exit 1; } @@ -86,7 +83,8 @@ if (! $VMKey) my $VM = CreateVMs()->GetItem($VMKey); if (! defined($VM)) { - FatalError "VM $VMKey doesn't exist"; + LogMsg "VM $VMKey doesn't exist\n"; + exit 1; } LogMsg "Reverting $VMKey to ", $VM->IdleSnapshot, "\n"; @@ -146,4 +144,4 @@ if (defined($ErrMessage)) LogMsg "Revert of $VMKey completed\n"; -exit; +exit 0;