mirror of
https://github.com/ansible/awx.git
synced 2026-05-06 00:47:37 -02:30
Merge pull request #6117 from jangsutsr/dynamic_inv_src_dependency_update
Dependency updates
This commit is contained in:
@@ -89,7 +89,7 @@ class Metadata(metadata.SimpleMetadata):
|
||||
# Special handling of inventory source_region choices that vary based on
|
||||
# selected inventory source.
|
||||
if field.field_name == 'source_regions':
|
||||
for cp in ('azure', 'ec2', 'gce', 'rax'):
|
||||
for cp in ('azure', 'ec2', 'gce'):
|
||||
get_regions = getattr(InventorySource, 'get_%s_region_choices' % cp)
|
||||
field_info['%s_region_choices' % cp] = get_regions()
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ from rest_framework import validators
|
||||
from rest_framework.utils.serializer_helpers import ReturnList
|
||||
|
||||
# Django-Polymorphic
|
||||
from polymorphic import PolymorphicModel
|
||||
from polymorphic.models import PolymorphicModel
|
||||
|
||||
# AWX
|
||||
from awx.main.constants import SCHEDULEABLE_PROVIDERS
|
||||
|
||||
@@ -361,16 +361,9 @@ class DashboardView(APIView):
|
||||
'job_failed': inventory_with_failed_hosts.count(),
|
||||
'inventory_failed': failed_inventory}
|
||||
user_inventory_sources = get_user_queryset(request.user, InventorySource)
|
||||
rax_inventory_sources = user_inventory_sources.filter(source='rax')
|
||||
rax_inventory_failed = rax_inventory_sources.filter(status='failed')
|
||||
ec2_inventory_sources = user_inventory_sources.filter(source='ec2')
|
||||
ec2_inventory_failed = ec2_inventory_sources.filter(status='failed')
|
||||
data['inventory_sources'] = {}
|
||||
data['inventory_sources']['rax'] = {'url': reverse('api:inventory_source_list', request=request) + "?source=rax",
|
||||
'label': 'Rackspace',
|
||||
'failures_url': reverse('api:inventory_source_list', request=request) + "?source=rax&status=failed",
|
||||
'total': rax_inventory_sources.count(),
|
||||
'failed': rax_inventory_failed.count()}
|
||||
data['inventory_sources']['ec2'] = {'url': reverse('api:inventory_source_list', request=request) + "?source=ec2",
|
||||
'failures_url': reverse('api:inventory_source_list', request=request) + "?source=ec2&status=failed",
|
||||
'label': 'Amazon EC2',
|
||||
|
||||
Reference in New Issue
Block a user