1
0
mirror of https://github.com/ansible/awx.git synced 2024-10-30 13:55:31 +03:00

Don't return different fields for smart vs non-smart inventories

This commit is contained in:
Bill Nottingham 2020-03-30 17:15:13 -04:00
parent e9d11be680
commit 96576b0e3d

View File

@ -122,7 +122,7 @@ def cred_type_counts(since):
return counts
@register('inventory_counts', '1.0')
@register('inventory_counts', '1.1')
def inventory_counts(since):
counts = {}
for inv in models.Inventory.objects.filter(kind='').annotate(num_sources=Count('inventory_sources', distinct=True),
@ -136,8 +136,8 @@ def inventory_counts(since):
for smart_inv in models.Inventory.objects.filter(kind='smart'):
counts[smart_inv.id] = {'name': smart_inv.name,
'kind': smart_inv.kind,
'num_hosts': smart_inv.hosts.count(),
'num_sources': smart_inv.inventory_sources.count()
'hosts': smart_inv.hosts.count(),
'sources': smart_inv.inventory_sources.count()
}
return counts