From f82f4a9993c9b28599daf7a1bc52f947372ebef1 Mon Sep 17 00:00:00 2001 From: chris meyers Date: Fri, 7 Sep 2018 17:40:11 -0400 Subject: [PATCH] deprecate fact endpoints and commands --- awx/api/views.py | 2 ++ awx/main/management/commands/cleanup_facts.py | 2 ++ 2 files changed, 4 insertions(+) diff --git a/awx/api/views.py b/awx/api/views.py index ac5e693527..3492396477 100644 --- a/awx/api/views.py +++ b/awx/api/views.py @@ -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) diff --git a/awx/main/management/commands/cleanup_facts.py b/awx/main/management/commands/cleanup_facts.py index f60dbc0f03..76bc4190fb 100644 --- a/awx/main/management/commands/cleanup_facts.py +++ b/awx/main/management/commands/cleanup_facts.py @@ -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()