mirror of
https://github.com/ansible/awx.git
synced 2026-05-07 17:37:37 -02:30
Disable cleanup_facts if the user does not have system tracking enabled
in their license file
This commit is contained in:
@@ -13,6 +13,7 @@ from django.utils.timezone import now
|
|||||||
|
|
||||||
# AWX
|
# AWX
|
||||||
from awx.fact.models.fact import * # noqa
|
from awx.fact.models.fact import * # noqa
|
||||||
|
from awx.api.license import feature_enabled
|
||||||
|
|
||||||
OLDER_THAN = 'older_than'
|
OLDER_THAN = 'older_than'
|
||||||
GRANULARITY = 'granularity'
|
GRANULARITY = 'granularity'
|
||||||
@@ -129,6 +130,8 @@ class Command(BaseCommand):
|
|||||||
|
|
||||||
@transaction.atomic
|
@transaction.atomic
|
||||||
def handle(self, *args, **options):
|
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()
|
cleanup_facts = CleanupFacts()
|
||||||
if not all([options[GRANULARITY], options[OLDER_THAN]]):
|
if not all([options[GRANULARITY], options[OLDER_THAN]]):
|
||||||
raise CommandError('Both --granularity and --older_than are required.')
|
raise CommandError('Both --granularity and --older_than are required.')
|
||||||
|
|||||||
Reference in New Issue
Block a user