mirror of
https://github.com/ansible/awx.git
synced 2026-02-16 10:40:01 -03:30
Merge pull request #6489 from wenottingham/that-ain't-right
Don't return different fields for smart vs non-smart inventories Reviewed-by: https://github.com/apps/softwarefactory-project-zuul
This commit is contained in:
@@ -122,7 +122,7 @@ def cred_type_counts(since):
|
|||||||
return counts
|
return counts
|
||||||
|
|
||||||
|
|
||||||
@register('inventory_counts', '1.0')
|
@register('inventory_counts', '1.1')
|
||||||
def inventory_counts(since):
|
def inventory_counts(since):
|
||||||
counts = {}
|
counts = {}
|
||||||
for inv in models.Inventory.objects.filter(kind='').annotate(num_sources=Count('inventory_sources', distinct=True),
|
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'):
|
for smart_inv in models.Inventory.objects.filter(kind='smart'):
|
||||||
counts[smart_inv.id] = {'name': smart_inv.name,
|
counts[smart_inv.id] = {'name': smart_inv.name,
|
||||||
'kind': smart_inv.kind,
|
'kind': smart_inv.kind,
|
||||||
'num_hosts': smart_inv.hosts.count(),
|
'hosts': smart_inv.hosts.count(),
|
||||||
'num_sources': smart_inv.inventory_sources.count()
|
'sources': smart_inv.inventory_sources.count()
|
||||||
}
|
}
|
||||||
return counts
|
return counts
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user