Deprecate a bunch of inventory computed fields.

Cribbed from https://github.com/ansible/awx/pull/3281/
This commit is contained in:
Bill Nottingham
2019-04-18 12:12:50 -04:00
parent 87d55b13bc
commit 6adf4ca2c1

View File

@@ -100,32 +100,38 @@ class Inventory(CommonModelNameNotUnique, ResourceMixin, RelatedJobsMixin):
has_active_failures = models.BooleanField( has_active_failures = models.BooleanField(
default=False, default=False,
editable=False, editable=False,
help_text=_('Flag indicating whether any hosts in this inventory have failed.'), help_text=_('This field is deprecated and will be removed in a future release. '
'Flag indicating whether any hosts in this inventory have failed.'),
) )
total_hosts = models.PositiveIntegerField( total_hosts = models.PositiveIntegerField(
default=0, default=0,
editable=False, editable=False,
help_text=_('Total number of hosts in this inventory.'), help_text=_('This field is deprecated and will be removed in a future release. '
'Total number of hosts in this inventory.'),
) )
hosts_with_active_failures = models.PositiveIntegerField( hosts_with_active_failures = models.PositiveIntegerField(
default=0, default=0,
editable=False, editable=False,
help_text=_('Number of hosts in this inventory with active failures.'), help_text=_('This field is deprecated and will be removed in a future release. '
'Number of hosts in this inventory with active failures.'),
) )
total_groups = models.PositiveIntegerField( total_groups = models.PositiveIntegerField(
default=0, default=0,
editable=False, editable=False,
help_text=_('Total number of groups in this inventory.'), help_text=_('This field is deprecated and will be removed in a future release. '
'Total number of groups in this inventory.'),
) )
groups_with_active_failures = models.PositiveIntegerField( groups_with_active_failures = models.PositiveIntegerField(
default=0, default=0,
editable=False, editable=False,
help_text=_('Number of groups in this inventory with active failures.'), help_text=_('This field is deprecated and will be removed in a future release. '
'Number of groups in this inventory with active failures.'),
) )
has_inventory_sources = models.BooleanField( has_inventory_sources = models.BooleanField(
default=False, default=False,
editable=False, editable=False,
help_text=_('Flag indicating whether this inventory has any external inventory sources.'), help_text=_('This field is deprecated and will be removed in a future release. '
'Flag indicating whether this inventory has any external inventory sources.'),
) )
total_inventory_sources = models.PositiveIntegerField( total_inventory_sources = models.PositiveIntegerField(
default=0, default=0,
@@ -625,12 +631,14 @@ class Host(CommonModelNameNotUnique, RelatedJobsMixin):
has_active_failures = models.BooleanField( has_active_failures = models.BooleanField(
default=False, default=False,
editable=False, editable=False,
help_text=_('Flag indicating whether the last job failed for this host.'), help_text=_('This field is deprecated and will be removed in a future release. '
'Flag indicating whether the last job failed for this host.'),
) )
has_inventory_sources = models.BooleanField( has_inventory_sources = models.BooleanField(
default=False, default=False,
editable=False, editable=False,
help_text=_('Flag indicating whether this host was created/updated from any external inventory sources.'), help_text=_('This field is deprecated and will be removed in a future release. '
'Flag indicating whether this host was created/updated from any external inventory sources.'),
) )
inventory_sources = models.ManyToManyField( inventory_sources = models.ManyToManyField(
'InventorySource', 'InventorySource',
@@ -800,32 +808,38 @@ class Group(CommonModelNameNotUnique, RelatedJobsMixin):
total_hosts = models.PositiveIntegerField( total_hosts = models.PositiveIntegerField(
default=0, default=0,
editable=False, editable=False,
help_text=_('Total number of hosts directly or indirectly in this group.'), help_text=_('This field is deprecated and will be removed in a future release. '
'Total number of hosts directly or indirectly in this group.'),
) )
has_active_failures = models.BooleanField( has_active_failures = models.BooleanField(
default=False, default=False,
editable=False, editable=False,
help_text=_('Flag indicating whether this group has any hosts with active failures.'), help_text=_('This field is deprecated and will be removed in a future release. '
'Flag indicating whether this group has any hosts with active failures.'),
) )
hosts_with_active_failures = models.PositiveIntegerField( hosts_with_active_failures = models.PositiveIntegerField(
default=0, default=0,
editable=False, editable=False,
help_text=_('Number of hosts in this group with active failures.'), help_text=_('This field is deprecated and will be removed in a future release. '
'Number of hosts in this group with active failures.'),
) )
total_groups = models.PositiveIntegerField( total_groups = models.PositiveIntegerField(
default=0, default=0,
editable=False, editable=False,
help_text=_('Total number of child groups contained within this group.'), help_text=_('This field is deprecated and will be removed in a future release. '
'Total number of child groups contained within this group.'),
) )
groups_with_active_failures = models.PositiveIntegerField( groups_with_active_failures = models.PositiveIntegerField(
default=0, default=0,
editable=False, editable=False,
help_text=_('Number of child groups within this group that have active failures.'), help_text=_('This field is deprecated and will be removed in a future release. '
'Number of child groups within this group that have active failures.'),
) )
has_inventory_sources = models.BooleanField( has_inventory_sources = models.BooleanField(
default=False, default=False,
editable=False, editable=False,
help_text=_('Flag indicating whether this group was created/updated from any external inventory sources.'), help_text=_('This field is deprecated and will be removed in a future release. '
'Flag indicating whether this group was created/updated from any external inventory sources.'),
) )
inventory_sources = models.ManyToManyField( inventory_sources = models.ManyToManyField(
'InventorySource', 'InventorySource',