mirror of
https://github.com/ansible/awx.git
synced 2026-01-12 02:19:58 -03:30
coalesce data without setting
This commit is contained in:
parent
5562e636ea
commit
658f87953e
@ -24,17 +24,6 @@ register(
|
||||
feature_required='activity_streams',
|
||||
)
|
||||
|
||||
register(
|
||||
'ACTIVITY_STREAM_COALESCE_ENTRIES',
|
||||
field_class=fields.BooleanField,
|
||||
label=_('Coalesce Select Activity Stream Entries'),
|
||||
help_text=_('For certain processes, combine multiple entries into one. '
|
||||
'This replaces many similar entries with a single summary entry.'),
|
||||
category=_('System'),
|
||||
category_slug='system',
|
||||
feature_required='activity_streams',
|
||||
)
|
||||
|
||||
register(
|
||||
'ACTIVITY_STREAM_ENABLED_FOR_INVENTORY_SYNC',
|
||||
field_class=fields.BooleanField,
|
||||
|
||||
@ -491,13 +491,12 @@ def activity_stream_delete(sender, instance, **kwargs):
|
||||
if isinstance(instance, Inventory):
|
||||
if not kwargs.get('inventory_delete_flag', False):
|
||||
return
|
||||
if settings.ACTIVITY_STREAM_COALESCE_ENTRIES:
|
||||
# Add additional data about child hosts / groups that will be deleted
|
||||
changes['coalesce_data'] = {
|
||||
'hosts_deleted': instance.hosts.count(),
|
||||
'groups_deleted': instance.groups.count()
|
||||
}
|
||||
elif isinstance(instance, (Host, Group)) and instance.inventory.pending_deletion and settings.ACTIVITY_STREAM_COALESCE_ENTRIES:
|
||||
# Add additional data about child hosts / groups that will be deleted
|
||||
changes['coalesced_data'] = {
|
||||
'hosts_deleted': instance.hosts.count(),
|
||||
'groups_deleted': instance.groups.count()
|
||||
}
|
||||
elif isinstance(instance, (Host, Group)) and instance.inventory.pending_deletion:
|
||||
return # accounted for by inventory entry, above
|
||||
_type = type(instance)
|
||||
if getattr(_type, '_deferred', False):
|
||||
|
||||
@ -919,7 +919,6 @@ SCM_EXCLUDE_EMPTY_GROUPS = True
|
||||
# Defaults for enabling/disabling activity stream.
|
||||
# Note: These settings may be overridden by database settings.
|
||||
ACTIVITY_STREAM_ENABLED = True
|
||||
ACTIVITY_STREAM_COALESCE_ENTRIES = True
|
||||
ACTIVITY_STREAM_ENABLED_FOR_INVENTORY_SYNC = False
|
||||
|
||||
# Internal API URL for use by inventory scripts and callback plugin.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user