diff options
Diffstat (limited to 'src/lib/Bcfg2/Server/Plugins/Probes.py')
-rw-r--r-- | src/lib/Bcfg2/Server/Plugins/Probes.py | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/lib/Bcfg2/Server/Plugins/Probes.py b/src/lib/Bcfg2/Server/Plugins/Probes.py index 9e6b43d7b..58723e392 100644 --- a/src/lib/Bcfg2/Server/Plugins/Probes.py +++ b/src/lib/Bcfg2/Server/Plugins/Probes.py @@ -9,7 +9,6 @@ import operator import lxml.etree import Bcfg2.Server import Bcfg2.Server.Plugin -from Bcfg2.Compat import json # pylint: disable=F0401 try: @@ -32,6 +31,16 @@ except ImportError: pass try: + import json + HAS_JSON = True +except ImportError: + try: + import simplejson as json + HAS_JSON = True + except ImportError: + HAS_JSON = False + +try: import syck as yaml import syck.error as YAMLError HAS_YAML = True @@ -89,7 +98,7 @@ class ProbeData(str): @property def json(self): """ The probe data as a decoded JSON data structure """ - if self._json is None: + if self._json is None and HAS_JSON: try: self._json = json.loads(self.data) except ValueError: |