installer/jsonwrapper.py
f4d17450
 #!/usr/bin/python2
 #
 #    Copyright (C) 2015 vmware inc.
 #
 #    Author: Sharath George <sharathg@vmware.com>
 
 
 import json
dc0dfc30
 import collections
f4d17450
 
 class JsonWrapper(object):
 
     def __init__(self,  filename):
         self.filename = filename
 
     def read(self):
         json_data = open(self.filename)
dc0dfc30
         self.data = json.load(json_data, object_pairs_hook=collections.OrderedDict)
f4d17450
         json_data.close()
         return self.data
 
     def write(self,  data):
         self.data = data
         outfile = open(self.filename,  'wb')
         json.dump(data,  outfile)