def key_json(minion_id, pillar, pillar_key=None):
 key_data = __salt__['redis.get_key'](minion_id)
 if (not key_data):
  return {}
 data = json.loads(key_data)
 if (isinstance(data, dict) and (not pillar_key)):
  return data
 elif (not pillar_key):
  return {'redis_pillar': data}
 else:
  return {pillar_key: data}

def key_json ( minion_id , pillar , pillar_key = None ) : key_data = __salt__ [ 'redis.get_key' ] ( minion_id ) if ( not key_data ) : return { } data = json . loads ( key_data ) if ( isinstance ( data , dict ) and ( not pillar_key ) ) : return data elif ( not pillar_key ) : return { 'redis_pillar' : data } else : return { pillar_key : data }
pulls a string from redis and deserializes it from json .