From 3428eab79ab21d1ecee6d2f8edff083a2cccdf79 Mon Sep 17 00:00:00 2001 From: "Chris St. Pierre" Date: Mon, 24 Sep 2012 13:25:01 -0400 Subject: made json optional again --- src/lib/Bcfg2/Server/Plugins/Packages/Yum.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/lib/Bcfg2/Server/Plugins/Packages/Yum.py') diff --git a/src/lib/Bcfg2/Server/Plugins/Packages/Yum.py b/src/lib/Bcfg2/Server/Plugins/Packages/Yum.py index 4224798a8..04d4e9f74 100644 --- a/src/lib/Bcfg2/Server/Plugins/Packages/Yum.py +++ b/src/lib/Bcfg2/Server/Plugins/Packages/Yum.py @@ -61,7 +61,7 @@ from subprocess import Popen, PIPE import Bcfg2.Server.Plugin # pylint: disable=W0622 from Bcfg2.Compat import StringIO, cPickle, HTTPError, URLError, \ - ConfigParser, json, any + ConfigParser, any # pylint: enable=W0622 from Bcfg2.Server.Plugins.Packages.Collection import Collection from Bcfg2.Server.Plugins.Packages.Source import SourceInitError, Source, \ @@ -81,11 +81,16 @@ except ImportError: try: import yum + try: + import json + except ImportError: + import simplejson as json HAS_YUM = True except ImportError: HAS_YUM = False LOGGER.info("Packages: No yum libraries found; forcing use of internal " "dependency resolver") + # pylint: enable=E0611,F0401 XP = '{http://linux.duke.edu/metadata/common}' -- cgit v1.2.3-1-g7c22