summaryrefslogtreecommitdiff
path: root/sleekxmpp/plugins
diff options
context:
space:
mode:
authorNathan Fritz <nathan@andyet.net>2010-08-19 16:09:00 -0700
committerNathan Fritz <nathan@andyet.net>2010-08-19 16:09:00 -0700
commit21b7109c06695955632692814fed11b3717e0fc7 (patch)
tree7a981487dcdae1b0ca79b92c9733698aaa97f56b /sleekxmpp/plugins
parenta38735cb2adabb75f110669d5425bf389cfc7ab7 (diff)
downloadslixmpp-21b7109c06695955632692814fed11b3717e0fc7.tar.gz
slixmpp-21b7109c06695955632692814fed11b3717e0fc7.tar.bz2
slixmpp-21b7109c06695955632692814fed11b3717e0fc7.tar.xz
slixmpp-21b7109c06695955632692814fed11b3717e0fc7.zip
fixed jobs
Diffstat (limited to 'sleekxmpp/plugins')
-rw-r--r--sleekxmpp/plugins/jobs.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/sleekxmpp/plugins/jobs.py b/sleekxmpp/plugins/jobs.py
index bb2e2554..30a76989 100644
--- a/sleekxmpp/plugins/jobs.py
+++ b/sleekxmpp/plugins/jobs.py
@@ -1,6 +1,7 @@
from . import base
import logging
from xml.etree import cElementTree as ET
+import types
class jobs(base.base_plugin):
def plugin_init(self):
@@ -20,7 +21,7 @@ class jobs(base.base_plugin):
def claimJob(self, host, node, jobid, ifrom=None):
return self._setState(host, node, jobid, ET.Element('{http://andyet.net/protocol/pubsubjob}claimed'))
- def unclaimJob(self, jobid):
+ def unclaimJob(self, host, node, jobid):
return self._setState(host, node, jobid, ET.Element('{http://andyet.net/protocol/pubsubjob}unclaimed'))
def finishJob(self, host, node, jobid, payload=None):
@@ -38,7 +39,8 @@ class jobs(base.base_plugin):
iq['psstate']['item'] = jobid
iq['psstate']['payload'] = state
result = iq.send()
- if result is None or result['type'] != 'result':
+ if result is None or type(result) == types.BooleanType or result['type'] != 'result':
+ logging.error("Unable to change %s:%s to %s" % (node, jobid, state))
return False
return True