nephos.mail_notifier
index
/media/hdd/Essentials/Chapter_Kgp_WOrk/GSoC/projectnephos_gsoc18/GSoC18Nephos/nephos/mail_notifier.py

Contains functions for sending reports and critical log entries to the system administrator

 
Modules
       
os
subprocess

 
Functions
       
add_to_report(msg)
Append string to the EOF of report file.
 
Parameters
----------
msg
    type: str
    message to be appended to the report's file.
 
Returns
-------
send_mail(msg, msg_type)
Sends mail to the email addresses present in CRITICAL_MAIL_ADDRS_PATH
 
Parameters
-------
msg
    type: str
    str to be send as message
msg_type
    type: str
    defines the type and decides the subject for the mail
 
Returns
-------
type: bool
true if sending was successful, false otherwise
send_report()
Reads data from report file, converts it to str message and calls send mail on it.
 
Returns
-------

 
Data
        LOG = <logging.Logger object>
REPORT_FILE = '/home/thealpha/Nephos/.report'
__nephos_dir__ = '/home/thealpha/Nephos'