Exemple #1
0
import os
import sys
from report_html_loader import ReportHTML

send_data = ReportHTML()
data = {'report': 'Today', 'cell': 'test'}

send_data.templateLoader(data)
Exemple #2
0
import os
import sys
from report_html_loader import ReportHTML


send_data = ReportHTML()
data = {"report": "Today", "cell": "test"}


send_data.templateLoader(data)
Exemple #3
0
    u_mem += i.get('num')
    f_cores += nfc
    f_mem += nfm
    t_s += i.get('t_s')
    t_m += i.get('t_m')
    t_l += i.get('t_l')
    t_xl += i.get('t_xl')
    t_xxl += i.get('t_xxl')
    oth += i.get('oth')


dict_final = {'total_nodes': t_nodes, 'total_cores': t_cores,
              'total_mem': t_mem, 'used_cores': u_cores,
              'used_mem': u_mem, 'free_cores': f_cores,
              'free_mem': f_mem, 'total_small': t_s,
              'total_medium': t_m, 'total_large': t_l,
              'total_xl': t_xl, 'total_xxl': t_xxl,
              'oth': oth
              }

pass_report = ReportHTML()
send_email = SendEmail()
write_to_csv = ResourceWriteCSV()
html_file = "/tmp/" + now.strftime("%d_%m_%Y_%H_%M") + ".html"
attach = "/tmp/allocation_report.csv"
pass_report.templateLoader(html_array, dict_final, report_date, html_file)
send_email.email_user(html_file, attach)
write_to_csv.createCSVFileNode('/tmp', html_array)
write_to_csv.createCSVFileCloud('/tmp', dict_final)
os.remove(attach)