[PATCH 4/4] testbot/CheckWineTestBot: Use NotifyAdministrator() to send admin notifications.

Francois Gouget fgouget at codeweavers.com
Tue Sep 10 04:08:03 CDT 2019


Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
---
 testbot/scripts/CheckWineTestBot.pl | 17 ++++++-----------
 1 file changed, 6 insertions(+), 11 deletions(-)

diff --git a/testbot/scripts/CheckWineTestBot.pl b/testbot/scripts/CheckWineTestBot.pl
index 3ca4fde9..aa271db2 100755
--- a/testbot/scripts/CheckWineTestBot.pl
+++ b/testbot/scripts/CheckWineTestBot.pl
@@ -36,6 +36,7 @@ sub BEGIN
 }
 
 use WineTestBot::Config;
+use WineTestBot::Utils;
 use WineTestBot::Engine::Notify;
 
 my $rc = 0;
@@ -47,27 +48,21 @@ if (! PingEngine())
     sleep 5;
   }
 
-  open (SENDMAIL, "|/usr/sbin/sendmail -oi -t -odq");
-  print SENDMAIL <<"EOF";
-From: $RobotEMail
-To: $AdminEMail
-Subject: WineTestBot engine died
-
-EOF
+  my $Body;
   if ($> != 0)
   {
-    print SENDMAIL "Insufficient permissions to restart the engine\n";
+    $Body = "Insufficient permissions to restart the engine\n";
     $rc = 1;
   }
   elsif (PingEngine())
   {
-    print SENDMAIL "The engine was restarted successfully\n";
+    $Body = "The engine was restarted successfully\n";
   }
   else
   {
-    print SENDMAIL "Unable to restart the engine\n";
+    $Body = "Unable to restart the engine\n";
     $rc = 1;
   }
-  close(SENDMAIL);
+  NotifyAdministrator("WineTestBot engine died", $Body);
 }
 exit($rc);
-- 
2.20.1



More information about the wine-devel mailing list