def register_instances(name, instances, region=None, key=None, keyid=None, profile=None):
 if (isinstance(instances, str) or isinstance(instances, six.text_type)):
  instances = [instances]
 conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)
 try:
  registered_instances = conn.register_instances(name, instances)
 except boto.exception.BotoServerError as error:
  log.warning(error)
  return False
 registered_instance_ids = [instance.id for instance in registered_instances]
 register_failures = set(instances).difference(set(registered_instance_ids))
 if register_failures:
  log.warning('Instance(s): {0} not registered with ELB {1}.'.format(list(register_failures), name))
  register_result = False
 else:
  register_result = True
 return register_result

def register_instances ( name , instances , region = None , key = None , keyid = None , profile = None ) : if ( isinstance ( instances , str ) or isinstance ( instances , six . text_type ) ) : instances = [ instances ] conn = _get_conn ( region = region , key = key , keyid = keyid , profile = profile ) try : registered_instances = conn . register_instances ( name , instances ) except boto . exception . BotoServerError as error : log . warning ( error ) return False registered_instance_ids = [ instance . id for instance in registered_instances ] register_failures = set ( instances ) . difference ( set ( registered_instance_ids ) ) if register_failures : log . warning ( 'Instance(s): {0} not registered with ELB {1}.' . format ( list ( register_failures ) , name ) ) register_result = False else : register_result = True return register_result
register instances with an elb .