diff --git a/awx/main/management/commands/cleanup_facts.py b/awx/main/management/commands/cleanup_facts.py index d340f94b66..0ff743b15e 100644 --- a/awx/main/management/commands/cleanup_facts.py +++ b/awx/main/management/commands/cleanup_facts.py @@ -13,6 +13,7 @@ from django.utils.timezone import now # AWX from awx.fact.models.fact import * # noqa +from awx.api.license import feature_enabled OLDER_THAN = 'older_than' GRANULARITY = 'granularity' @@ -129,6 +130,8 @@ class Command(BaseCommand): @transaction.atomic def handle(self, *args, **options): + if not feature_enabled('system_tracking'): + raise CommandError("The System Tracking feature is not enabled for your Tower instance") cleanup_facts = CleanupFacts() if not all([options[GRANULARITY], options[OLDER_THAN]]): raise CommandError('Both --granularity and --older_than are required.')