def jsonify(fnc):
    def wrapper(*args, **kwargs):
        ret = fnc(*args, **kwargs)
        try:
            json.loads(ret)
        except __HOLE__:
            # Value should already be JSON-encoded, but some operations
            # may write raw sting values; this will catch those and
            # properly encode them.
            ret = json.dumps(ret)
        return ret
    return wrapper
dataset/ETHPy150Open nii-cloud/dodai-compute/plugins/xenserver/xenapi/etc/xapi.d/plugins/xenstore.py/jsonify