deprecate fact endpoints and commands

This commit is contained in:
chris meyers 2018-09-07 17:40:11 -04:00
parent 910663764f
commit f82f4a9993
2 changed files with 4 additions and 0 deletions

View File

@ -2358,6 +2358,7 @@ class HostFactVersionsList(SystemTrackingEnforcementMixin, ParentMixin, ListAPIV
serializer_class = FactVersionSerializer
parent_model = Host
search_fields = ('facts',)
deprecated = True
def get_queryset(self):
from_spec = self.request.query_params.get('from', None)
@ -2383,6 +2384,7 @@ class HostFactCompareView(SystemTrackingEnforcementMixin, SubDetailAPIView):
model = Fact
parent_model = Host
serializer_class = FactSerializer
deprecated = True
def retrieve(self, request, *args, **kwargs):
datetime_spec = request.query_params.get('datetime', None)

View File

@ -3,6 +3,7 @@
# Python
import re
import sys
from dateutil.relativedelta import relativedelta
# Django
@ -129,6 +130,7 @@ class Command(BaseCommand):
@transaction.atomic
def handle(self, *args, **options):
sys.stderr.write("This command has been deprecated and will be removed in a future release.\n")
if not feature_enabled('system_tracking'):
raise CommandError("The System Tracking feature is not enabled for your instance")
cleanup_facts = CleanupFacts()