def create_listeners(name, listeners, region=None, key=None, keyid=None, profile=None):
 conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)
 if isinstance(listeners, string_types):
  listeners = json.loads(listeners)
 _complex_listeners = []
 for listener in listeners:
  _complex_listeners.append(listener_dict_to_tuple(listener))
 try:
  conn.create_load_balancer_listeners(name, [], _complex_listeners)
  msg = 'Created ELB listeners on {0}'.format(name)
  log.info(msg)
  return True
 except boto.exception.BotoServerError as error:
  log.debug(error)
  msg = 'Failed to create ELB listeners on {0}: {1}'.format(name, error)
  log.error(msg)
  return False

def create_listeners ( name , listeners , region = None , key = None , keyid = None , profile = None ) : conn = _get_conn ( region = region , key = key , keyid = keyid , profile = profile ) if isinstance ( listeners , string_types ) : listeners = json . loads ( listeners ) _complex_listeners = [ ] for listener in listeners : _complex_listeners . append ( listener_dict_to_tuple ( listener ) ) try : conn . create_load_balancer_listeners ( name , [ ] , _complex_listeners ) msg = 'Created ELB listeners on {0}' . format ( name ) log . info ( msg ) return True except boto . exception . BotoServerError as error : log . debug ( error ) msg = 'Failed to create ELB listeners on {0}: {1}' . format ( name , error ) log . error ( msg ) return False
create listeners on an elb .