just some more core config stuff and disabled xmpp logging
This commit is contained in:
parent
a0e76cc80a
commit
67ad6acc20
2 changed files with 3 additions and 3 deletions
|
|
@ -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()
|
||||||
|
|
|
||||||
|
|
@ -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()
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue