Merge pull request #2983 from ansible/deprecated_facts

deprecate fact endpoints
This commit is contained in:
Ryan Petrello 2018-09-11 10:02:25 -04:00 committed by GitHub
commit c88cab7d31
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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()