def detach_lb(kwargs=None, call=None):
 if (call != 'function'):
  raise SaltCloudSystemExit('The detach_lb function must be called with -f or --function.')
 if ((not kwargs) or ('name' not in kwargs)):
  log.error('A load-balancer name must be specified.')
  return False
 if ('member' not in kwargs):
  log.error('A node name name must be specified.')
  return False
 conn = get_conn()
 lb_conn = get_lb_conn(conn)
 lb = lb_conn.get_balancer(kwargs['name'])
 member_list = lb_conn.balancer_list_members(lb)
 remove_member = None
 for member in member_list:
  if (member.id == kwargs['member']):
   remove_member = member
   break
 if (not remove_member):
  log.error('The specified member {0} was not a member of LB {1}.'.format(kwargs['member'], kwargs['name']))
  return False
 __utils__['cloud.fire_event']('event', 'detach load_balancer', 'salt/cloud/loadbalancer/detaching', args=kwargs, sock_dir=__opts__['sock_dir'], transport=__opts__['transport'])
 result = lb_conn.balancer_detach_member(lb, remove_member)
 __utils__['cloud.fire_event']('event', 'detached load_balancer', 'salt/cloud/loadbalancer/detached', args=kwargs, sock_dir=__opts__['sock_dir'], transport=__opts__['transport'])
 return result

def detach_lb ( kwargs = None , call = None ) : if ( call != 'function' ) : raise SaltCloudSystemExit ( 'The detach_lb function must be called with -f or --function.' ) if ( ( not kwargs ) or ( 'name' not in kwargs ) ) : log . error ( 'A load-balancer name must be specified.' ) return False if ( 'member' not in kwargs ) : log . error ( 'A node name name must be specified.' ) return False conn = get_conn ( ) lb_conn = get_lb_conn ( conn ) lb = lb_conn . get_balancer ( kwargs [ 'name' ] ) member_list = lb_conn . balancer_list_members ( lb ) remove_member = None for member in member_list : if ( member . id == kwargs [ 'member' ] ) : remove_member = member break if ( not remove_member ) : log . error ( 'The specified member {0} was not a member of LB {1}.' . format ( kwargs [ 'member' ] , kwargs [ 'name' ] ) ) return False __utils__ [ 'cloud.fire_event' ] ( 'event' , 'detach load_balancer' , 'salt/cloud/loadbalancer/detaching' , args = kwargs , sock_dir = __opts__ [ 'sock_dir' ] , transport = __opts__ [ 'transport' ] ) result = lb_conn . balancer_detach_member ( lb , remove_member ) __utils__ [ 'cloud.fire_event' ] ( 'event' , 'detached load_balancer' , 'salt/cloud/loadbalancer/detached' , args = kwargs , sock_dir = __opts__ [ 'sock_dir' ] , transport = __opts__ [ 'transport' ] ) return result
remove an existing node/member from an existing load-balancer configuration .