Skip to content

Commit

Permalink
zabbix-vsphere-import: Fix for issue #100
Browse files Browse the repository at this point in the history
  • Loading branch information
dnaeon committed Nov 3, 2014
1 parent d32d4d6 commit 42470df
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/zabbix/vsphere-import/zabbix-vsphere-import
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,13 @@ class ZabbixConnector(object):
name=vm_host
)
host_cluster = data['result'][0]['cluster']
params['groups'].append({'groupid': self.get_host_group_by_name(name=host_cluster)})
cluster_group_id = self.get_host_group_by_name(name=host_cluster)

if not cluster_group_id:
self.create_host_group(name=host_cluster)
cluster_group_id = self.get_host_group_by_name(name=host_cluster)

params['groups'].append({'groupid': cluster_group_id})

try:
result = self.create_host(params)
Expand Down

0 comments on commit 42470df

Please sign in to comment.