Merge branch 'fix_fact_caching' into devel

* fix_fact_caching:
  Convert the fact data structure to the right type
  Fixing up fact cachine related unit tests
  Port fact caching system to rabbitmq
This commit is contained in:
Matthew Jones
2016-11-21 23:15:13 -05:00
7 changed files with 64 additions and 115 deletions

View File

@@ -5,6 +5,7 @@
import copy
import json
import re
import six
import logging
from collections import OrderedDict
from dateutil import rrule
@@ -3041,3 +3042,11 @@ class FactSerializer(BaseFactSerializer):
res = super(FactSerializer, self).get_related(obj)
res['host'] = obj.host.get_absolute_url()
return res
def to_representation(self, obj):
ret = super(FactSerializer, self).to_representation(obj)
if obj is None:
return ret
if 'facts' in ret and isinstance(ret['facts'], six.string_types):
ret['facts'] = json.loads(ret['facts'])
return ret