Skip to content

Commit

Permalink
Zabbix helper should return None if we don't have the requested property
Browse files Browse the repository at this point in the history
in the result
  • Loading branch information
dnaeon committed Apr 6, 2014
1 parent ab5314c commit 25e9fce
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/vpoller/helpers/zabbix.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,9 @@ def zabbix_item_value(self):
"""
property_name = self.msg['properties'][0]

return self.data['result'][0][property_name]
result = self.data['result'][0]

return result.get(property_name)

def zabbix_vm_disk_get(self):
"""
Expand All @@ -116,8 +117,9 @@ def zabbix_vm_disk_get(self):
"""
property_name = self.msg['properties'][0]
result = self.data['result']0['disk']

return self.data['result'][0]['disk'][property_name]
return result.get(property_name)

def zabbix_vm_disk_discover(self):
"""
Expand Down

0 comments on commit 25e9fce

Please sign in to comment.