Commit b3328454 authored by Vincent Le gallic's avatar Vincent Le gallic

[bcfg2_report] On n'envoie pas de mail si tout est clean.

parent e3c78848
......@@ -42,8 +42,11 @@ if __name__ == "__main__":
exit(1)
debug = "--debug" in sys.argv
if "--mail" in sys.argv:
sys.path.append("/usr/scripts/")
import utils.sendmail
utils.sendmail.sendmail("root@crans.org", "roots@crans.org", u"Serveurs non synchronisés avec bcfg2", hosts, more_headers={"X-Mailer" : "bcfg2-reports"}, debug=debug)
if hosts != "":
sys.path.append("/usr/scripts/")
import utils.sendmail
utils.sendmail.sendmail("root@crans.org", "roots@crans.org", u"Serveurs non synchronisés avec bcfg2", hosts, more_headers={"X-Mailer" : "bcfg2-reports"}, debug=debug)
elif debug:
print("Empty content, no mail sent")
else:
print(hosts)
print(hosts, end="")
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment