Skip to content

Commit

Permalink
zabbix-vsphere-import: Load the JSON object before returning data
Browse files Browse the repository at this point in the history
  • Loading branch information
dnaeon committed Sep 12, 2014
1 parent d13057a commit 2123800
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/zabbix/vsphere-import/zabbix-vsphere-import
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ into a Zabbix server as regular Zabbix hosts
"""

import json
from copy import deepcopy

import yaml
Expand Down Expand Up @@ -587,11 +588,13 @@ class ZabbixConnector(object):

result = client.run(msg)

if result['success']:
data = json.loads(result)

if data['success']:
logging.warning('Failed to get vSphere objects: %s', result)
raise ZabbixException, 'Failed to get vSphere objects: %s' % result

return result
return data

def main():
usage="""
Expand Down

0 comments on commit 2123800

Please sign in to comment.