def as_json(*args, **kwargs):
 arg = (args or kwargs)
 return jsonutils.dumps(arg)

def as_json ( * args , ** kwargs ) : arg = ( args or kwargs ) return jsonutils . dumps ( arg )
helper function for simulating xenapi plugin responses for those that are returning json .