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

This commit is contained in:
Vincent Le Gallic 2013-07-26 12:05:28 +02:00
parent e3c78848db
commit b332845431

View file

@ -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="")