From ef8ea1349585aba406395aaa0897afc3f6d110f5 Mon Sep 17 00:00:00 2001 From: Jeremy Katz Date: Thu, 23 Feb 2012 20:51:29 -0500 Subject: [PATCH] Fall back to standalone simplejson module CentOS5 has python 2.4 which doesn't have a built-in json module --- library/command | 5 ++++- library/ping | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/library/command b/library/command index 53a8d6ffff..c11cfebd25 100755 --- a/library/command +++ b/library/command @@ -1,6 +1,9 @@ #!/usr/bin/python -import json +try: + import json +except ImportError: + import simplejson as json import subprocess import sys import datetime diff --git a/library/ping b/library/ping index fe0b394825..e40be68a2f 100644 --- a/library/ping +++ b/library/ping @@ -1,5 +1,8 @@ #!/usr/bin/python -import json +try: + import json +except ImportError: + import simplejson as json print json.dumps(1)