Fix an issue when the cloudstack installation don't have any instance group

pull/9835/head
Milamber 10 years ago committed by Rene Moser
parent 92a25b340b
commit bfa71054f5

@ -173,12 +173,13 @@ class CloudStackInventory(object):
}
groups = self.cs.listInstanceGroups(projectid=project_id)
for group in groups['instancegroup']:
group_name = group['name']
if group_name and not group_name in data:
data[group_name] = {
'hosts': []
}
if groups:
for group in groups['instancegroup']:
group_name = group['name']
if group_name and not group_name in data:
data[group_name] = {
'hosts': []
}
hosts = self.cs.listVirtualMachines(projectid=project_id)
for host in hosts['virtualmachine']:

Loading…
Cancel
Save