mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Fix an issue when the cloudstack installation don't have any instance group
This commit is contained in:
parent
92a25b340b
commit
bfa71054f5
1 changed files with 7 additions and 6 deletions
|
@ -173,12 +173,13 @@ class CloudStackInventory(object):
|
||||||
}
|
}
|
||||||
|
|
||||||
groups = self.cs.listInstanceGroups(projectid=project_id)
|
groups = self.cs.listInstanceGroups(projectid=project_id)
|
||||||
for group in groups['instancegroup']:
|
if groups:
|
||||||
group_name = group['name']
|
for group in groups['instancegroup']:
|
||||||
if group_name and not group_name in data:
|
group_name = group['name']
|
||||||
data[group_name] = {
|
if group_name and not group_name in data:
|
||||||
'hosts': []
|
data[group_name] = {
|
||||||
}
|
'hosts': []
|
||||||
|
}
|
||||||
|
|
||||||
hosts = self.cs.listVirtualMachines(projectid=project_id)
|
hosts = self.cs.listVirtualMachines(projectid=project_id)
|
||||||
for host in hosts['virtualmachine']:
|
for host in hosts['virtualmachine']:
|
||||||
|
|
Loading…
Reference in a new issue