mirror of
https://github.com/ansible/awx.git
synced 2024-11-02 18:21:12 +03:00
AC-567 Remove source_tags from API/UI. Modify EC2 inventory to not return instance ID groups.
This commit is contained in:
parent
04824c8477
commit
27ad680f4d
@ -686,6 +686,7 @@ class InventorySource(PrimordialModel):
|
||||
blank=True,
|
||||
default='',
|
||||
)
|
||||
# FIXME: Remove tags field when making other migrations for credential changes!
|
||||
source_tags = models.CharField(
|
||||
max_length=1024,
|
||||
blank=True,
|
||||
|
@ -672,9 +672,9 @@ class InventorySourceSerializer(BaseSerializer):
|
||||
fields = ('id', 'url', 'related', 'summary_fields', 'created',
|
||||
'modified', 'inventory', 'group', 'source', 'source_path',
|
||||
'source_vars', 'source_username', 'source_password',
|
||||
'source_regions', 'source_tags', 'overwrite',
|
||||
'overwrite_vars', 'update_on_launch', 'update_interval',
|
||||
'last_update_failed', 'status', 'last_updated')
|
||||
'source_regions', 'overwrite', 'overwrite_vars',
|
||||
'update_on_launch', 'update_interval', 'last_update_failed',
|
||||
'status', 'last_updated')
|
||||
read_only_fields = ('inventory', 'group')
|
||||
|
||||
def to_native(self, obj):
|
||||
@ -764,10 +764,6 @@ class InventorySourceSerializer(BaseSerializer):
|
||||
# FIXME
|
||||
return attrs
|
||||
|
||||
def validate_source_tags(self, attrs, source):
|
||||
# FIXME
|
||||
return attrs
|
||||
|
||||
class InventoryUpdateSerializer(BaseSerializer):
|
||||
|
||||
class Meta:
|
||||
|
@ -5,6 +5,7 @@
|
||||
import datetime
|
||||
import json
|
||||
import os
|
||||
import re
|
||||
|
||||
# Django
|
||||
from django.conf import settings
|
||||
@ -1021,6 +1022,9 @@ class InventoryUpdatesTest(BaseTransactionTest):
|
||||
source_pks = group.inventory_sources.values_list('pk', flat=True)
|
||||
self.assertTrue(inventory_source.pk in source_pks)
|
||||
self.assertTrue(group.has_inventory_sources)
|
||||
# Make sure EC2 instance ID groups are excluded.
|
||||
self.assertFalse(re.match(r'^i-[0-9a-f]{8}$', group.name, re.I),
|
||||
group.name)
|
||||
|
||||
def test_update_from_ec2(self):
|
||||
source_username = getattr(settings, 'TEST_AWS_ACCESS_KEY_ID', '')
|
||||
|
@ -336,8 +336,9 @@ class Ec2Inventory(object):
|
||||
# Add to index
|
||||
self.index[dest] = [region, instance.id]
|
||||
|
||||
# For AWX: do not output group based on instance ID!!!
|
||||
# Inventory: Group by instance ID (always a group of 1)
|
||||
self.inventory[instance.id] = [dest]
|
||||
# self.inventory[instance.id] = [dest]
|
||||
|
||||
# Inventory: Group by region
|
||||
self.push(self.inventory, region, dest)
|
||||
|
@ -155,19 +155,6 @@ angular.module('GroupFormDefinition', [])
|
||||
"Only hosts associated with the list of regions will be included in the update process.</p>",
|
||||
dataContainer: 'body'
|
||||
},
|
||||
source_tags: {
|
||||
label: 'Tags',
|
||||
excludeModal: true,
|
||||
type: 'text',
|
||||
ngShow: "source.value == 'ec2'",
|
||||
addRequired: false,
|
||||
editRequired: false,
|
||||
dataTitle: 'Source Regions',
|
||||
dataPlacement: 'left',
|
||||
awPopOver: "<p>Comma separated list of tags. Tag names must match those defined at the inventory source." +
|
||||
" Only hosts associated with the list of tags will be included in the update process.</p>",
|
||||
dataContainer: 'body'
|
||||
},
|
||||
source_vars: {
|
||||
label: 'Source Variables',
|
||||
ngShow: "source.value == 'file' || source.value == 'ec2'",
|
||||
|
@ -810,7 +810,6 @@ angular.module('GroupsHelper', [ 'RestServices', 'Utilities', 'ListGenerator', '
|
||||
source_username: scope['source_username'],
|
||||
source_password: scope['source_password'],
|
||||
source_regions: scope['source_regions'],
|
||||
source_tags: scope['source_tags'],
|
||||
overwrite: scope['overwrite'],
|
||||
overwrite_vars: scope['overwrite_vars'],
|
||||
update_on_launch: scope['update_on_launch'],
|
||||
|
Loading…
Reference in New Issue
Block a user