mirror of
https://github.com/ansible/awx.git
synced 2026-01-14 19:30:39 -03:30
Disable cleanup_facts if the user does not have system tracking enabled
in their license file
This commit is contained in:
parent
9c7943039c
commit
8006066609
@ -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.')
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user