Commit 092ee25b authored by Jürgen Haas's avatar Jürgen Haas

Fix Python 3 compatibility

parent 0119b22f
......@@ -95,7 +95,7 @@ class ActionModule(ActionBase):
raise ae('No result from JiffyBox API')
decoder = json.JSONDecoder()
content = decoder.decode(request_result.content)
content = decoder.decode(request_result.content.decode('utf8'))
if not content['result']:
msg = content['messages']
raise ae('%s' % msg)
......@@ -104,7 +104,7 @@ class ActionModule(ActionBase):
def _load_objects(self, type, path):
display.vv("Reading %s from JiffyBox" % type)
changed = False
if not self.vars.has_key('_jiffybox_' + type):
if '_jiffybox_' + type not in self.vars:
changed = True
self.vars.__setitem__('_jiffybox_' + type, self._request(path))
return changed, self.vars.get('_jiffybox_' + type)
......@@ -128,7 +128,7 @@ class ActionModule(ActionBase):
for block in self.ips:
if self.ips[block].has_key(str(ip.get('id'))):
if str(ip.get('id')) in self.ips[block]:
return self.devices[block]
return False
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment