def key_value(minion_id, pillar, pillar_key='redis_pillar'):
 key_type = __salt__['redis.key_type'](minion_id)
 if (key_type == 'string'):
  return {pillar_key: __salt__['redis.get_key'](minion_id)}
 elif (key_type == 'hash'):
  return {pillar_key: __salt__['redis.hgetall'](minion_id)}
 elif (key_type == 'list'):
  list_size = __salt__['redis.llen'](minion_id)
  if (not list_size):
   return {}
  return {pillar_key: __salt__['redis.lrange'](minion_id, 0, (list_size - 1))}
 elif (key_type == 'set'):
  return {pillar_key: __salt__['redis.smembers'](minion_id)}
 elif (key_type == 'zset'):
  set_size = __salt__['redis.zcard'](minion_id)
  if (not set_size):
   return {}
  return {pillar_key: __salt__['redis.zrange'](minion_id, 0, (set_size - 1))}
 return {}

def key_value ( minion_id , pillar , pillar_key = 'redis_pillar' ) : key_type = __salt__ [ 'redis.key_type' ] ( minion_id ) if ( key_type == 'string' ) : return { pillar_key : __salt__ [ 'redis.get_key' ] ( minion_id ) } elif ( key_type == 'hash' ) : return { pillar_key : __salt__ [ 'redis.hgetall' ] ( minion_id ) } elif ( key_type == 'list' ) : list_size = __salt__ [ 'redis.llen' ] ( minion_id ) if ( not list_size ) : return { } return { pillar_key : __salt__ [ 'redis.lrange' ] ( minion_id , 0 , ( list_size - 1 ) ) } elif ( key_type == 'set' ) : return { pillar_key : __salt__ [ 'redis.smembers' ] ( minion_id ) } elif ( key_type == 'zset' ) : set_size = __salt__ [ 'redis.zcard' ] ( minion_id ) if ( not set_size ) : return { } return { pillar_key : __salt__ [ 'redis.zrange' ] ( minion_id , 0 , ( set_size - 1 ) ) } return { }
looks for key in redis matching minion_id .