just some more core config stuff and disabled xmpp logging

This commit is contained in:
Johannes Findeisen 2013-09-20 02:39:23 +02:00
commit 67ad6acc20
2 changed files with 3 additions and 3 deletions

View file

@ -19,7 +19,7 @@ class JabberTask(Task):
def execute(self, msg, core): def execute(self, msg, core):
#TODO: totally unstable just to use values from core. make checks before...! #TODO: totally unstable just to use values from core. make checks before...!
client = xmpp.Client(core["tasks"]["jabber"]["host"]) client = xmpp.Client(core["tasks"]["jabber"]["host"], core["tasks"]["jabber"]["port"], None)
client.connect(server=(core["tasks"]["jabber"]["host"], core["tasks"]["jabber"]["port"])) client.connect(server=(core["tasks"]["jabber"]["host"], core["tasks"]["jabber"]["port"]))
client.auth(core["tasks"]["jabber"]["username"], core["tasks"]["jabber"]["password"], 'alert') client.auth(core["tasks"]["jabber"]["username"], core["tasks"]["jabber"]["password"], 'alert')
client.sendInitPresence() client.sendInitPresence()

View file

@ -15,7 +15,7 @@ class MailTask(Task):
if not "type" in kwargs: if not "type" in kwargs:
raise Exception("'type' not in typeDict " + str(kwargs)) raise Exception("'type' not in typeDict " + str(kwargs))
if not "args" in kwargs: if not "args" in kwargs:
raise Exception("typeDict " + str(kwargs) + " has nor arguments!") raise Exception("typeDict " + str(kwargs) + " has no arguments!")
self.set_task_type(kwargs["type"]) self.set_task_type(kwargs["type"])
self.recipient = kwargs["args"]["rcpt"] self.recipient = kwargs["args"]["rcpt"]
@ -27,7 +27,7 @@ class MailTask(Task):
message['From'] = core["tasks"]["mail"]["from"] message['From'] = core["tasks"]["mail"]["from"]
message['To'] = self.recipient message['To'] = self.recipient
s = smtplib.SMTP(core["tasks"]["mail"]["host"], core["tasks"]["mail"]["port"]) s = smtplib.SMTP(core["tasks"]["mail"]["host"], core["tasks"]["mail"]["port"])
s.sendmail("warning@linspector.org", self.recipient, message.as_string()) s.sendmail(core["tasks"]["mail"]["from"], self.recipient, message.as_string())
s.quit() s.quit()