From 2defc9cf5155f21a988855c31049fad3e40ecdd1 Mon Sep 17 00:00:00 2001 From: "Chris St. Pierre" Date: Wed, 29 Jan 2014 07:43:06 -0500 Subject: load correct JSON library on py2.4 --- src/lib/Bcfg2/Server/Plugins/Ohai.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/lib/Bcfg2/Server/Plugins/Ohai.py') diff --git a/src/lib/Bcfg2/Server/Plugins/Ohai.py b/src/lib/Bcfg2/Server/Plugins/Ohai.py index 1ec3cbd60..f5bde1820 100644 --- a/src/lib/Bcfg2/Server/Plugins/Ohai.py +++ b/src/lib/Bcfg2/Server/Plugins/Ohai.py @@ -10,7 +10,8 @@ import Bcfg2.Server.Plugin try: import json -except ImportError: + json.loads # py2.4 json library is structured differently +except (ImportError, AttributeError): import simplejson as json PROBECODE = """#!/bin/sh -- cgit v1.2.3-1-g7c22 From 8ac001a3dffebf8e7d3fa7db20f13e58b90dd5b4 Mon Sep 17 00:00:00 2001 From: "Chris St. Pierre" Date: Thu, 30 Jan 2014 07:30:18 -0500 Subject: fixed pylint tests --- src/lib/Bcfg2/Server/Plugins/Ohai.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/lib/Bcfg2/Server/Plugins/Ohai.py') diff --git a/src/lib/Bcfg2/Server/Plugins/Ohai.py b/src/lib/Bcfg2/Server/Plugins/Ohai.py index f5bde1820..0853ea993 100644 --- a/src/lib/Bcfg2/Server/Plugins/Ohai.py +++ b/src/lib/Bcfg2/Server/Plugins/Ohai.py @@ -10,7 +10,8 @@ import Bcfg2.Server.Plugin try: import json - json.loads # py2.4 json library is structured differently + # py2.4 json library is structured differently + json.loads # pylint: disable=W0104 except (ImportError, AttributeError): import simplejson as json -- cgit v1.2.3-1-g7c22