[bcfg2_report] On n'envoie pas de mail si tout est clean.
This commit is contained in:
parent
e3c78848db
commit
b332845431
1 changed files with 7 additions and 4 deletions
|
@ -42,8 +42,11 @@ if __name__ == "__main__":
|
||||||
exit(1)
|
exit(1)
|
||||||
debug = "--debug" in sys.argv
|
debug = "--debug" in sys.argv
|
||||||
if "--mail" in sys.argv:
|
if "--mail" in sys.argv:
|
||||||
sys.path.append("/usr/scripts/")
|
if hosts != "":
|
||||||
import utils.sendmail
|
sys.path.append("/usr/scripts/")
|
||||||
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)
|
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:
|
else:
|
||||||
print(hosts)
|
print(hosts, end="")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue