VirtualBox

Changeset 76330 in vbox for trunk/src/VBox/ValidationKit


Ignore:
Timestamp:
Dec 21, 2018 9:01:04 AM (6 years ago)
Author:
vboxsync
Message:

Get email From and iLOM pasword from config.

Location:
trunk/src/VBox/ValidationKit/testmanager
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ValidationKit/testmanager/batch/virtual_test_sheriff.py

    r76325 r76330  
    4545import subprocess;
    4646import smtplib
     47from email.mime.multipart import MIMEMultipart
     48from email.mime.text import MIMEText
     49from email.utils import COMMASPACE
     50
    4751if sys.version_info[0] >= 3:
    4852    from io       import StringIO as StringIO;      # pylint: disable=import-error,no-name-in-module
     
    5155from optparse import OptionParser;                  # pylint: disable=deprecated-module
    5256from PIL import Image;                              # pylint: disable=import-error
    53 
    54 from email.mime.multipart import MIMEMultipart
    55 from email.mime.text import MIMEText
    56 from email.utils import COMMASPACE
    5757
    5858# Add Test Manager's modules path
     
    7171from testmanager.core.testresultfailures    import TestResultFailureLogic, TestResultFailureData;
    7272from testmanager.core.useraccount           import UserAccountLogic;
    73 from testmanager.config                     import g_ksSmtpHost, g_kcSmtpPort, g_ksAlertSubject, g_asAlertList;
     73from testmanager.config                     import g_ksSmtpHost, g_kcSmtpPort, g_ksAlertFrom, \
     74                                                   g_ksAlertSubject, g_asAlertList, g_ksLomPassword;
    7475
    7576# Python 3 hacks:
     
    375376            sFrom = sFrom[0];
    376377        else:
    377             sFrom = '[email protected]';
     378            sFrom = g_ksAlertFrom;
    378379
    379380        for sUser in g_asAlertList:
     
    517518                    continue;
    518519            ## @todo get iLOM credentials from a table?
    519             sCmd = 'sshpass -pchangeme ssh -oStrictHostKeyChecking=no root@%s show /SP && reset /SYS' % (oTestBox.ipLom,);
     520            sCmd = 'sshpass -p%s ssh -oStrictHostKeyChecking=no root@%s show /SP && reset /SYS' % (g_ksLomPassword, oTestBox.ipLom,);
    520521            try:
    521522                oPs = subprocess.Popen(sCmd, stdout=subprocess.PIPE, shell=True);
     
    528529                sComment = u'Reset testbox #%u (%s) - iRC=%u sStduot=%s' % ( idTestBox, oTestBox.sName, iRC, sStdout);
    529530                self.vprint(sComment);
    530 
    531531                self.emailAlert(self.uidSelf, sComment);
    532532
  • trunk/src/VBox/ValidationKit/testmanager/config.py

    r76325 r76330  
    193193## SMTP server port number.
    194194g_kcSmtpPort            = 25;
     195## Default email 'From' for email alert.
     196g_ksAlertFrom           = '[email protected]';
    195197## Subject for email alert.
    196198g_ksAlertSubject        = 'Virtual Sheriff alert';
    197199## List of users to send alerts.
    198200g_asAlertList           = ['lelik', 'werner'];
    199 
    200 ## @}
     201## iLOM password.
     202g_ksLomPassword         = 'password';
     203
     204## @}
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette