Commit 0e362bc6 authored by Samuel GAIST's avatar Samuel GAIST
Browse files

[dock] Import simplejson as json to make it easy to swap

parent 04484221
......@@ -44,7 +44,7 @@ Docker helper classes
import os
import simplejson
import simplejson as json
import socket
import tempfile
import time
......@@ -78,7 +78,7 @@ class Host(object):
with open(self.images_cache_filename, "r") as f:
Host.images_cache = simplejson.load(f)
Host.images_cache = json.load(f)
# Discover the environments
if discover:
......@@ -90,7 +90,7 @@ class Host(object):
# (If necessary) Save the known infos about the images
if self.images_cache_filename is not None:
with open(self.images_cache_filename, "w") as f:
simplejson.dump(Host.images_cache, f, indent=4)
json.dump(Host.images_cache, f, indent=4)
def __contains__(self, key):
return (key in self.processing_environments) or (key in self.db_environments)
......@@ -180,7 +180,7 @@ class Host(object):
if status == 0:
infos = simplejson.loads(stdout)
infos = json.loads(stdout)
Host.images_cache[image] = infos
return infos
except Exception as e:
......@@ -492,7 +492,7 @@ class Host(object):
return None
return simplejson.loads(stdout)[0]["State"]["Status"]
return json.loads(stdout)[0]["State"]["Status"]
except Exception:
return None
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment