def attach_lb(kwargs=None, call=None):
 if (call != 'function'):
  raise SaltCloudSystemExit('The attach_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()
 node = conn.ex_get_node(kwargs['member'])
 lb_conn = get_lb_conn(conn)
 lb = lb_conn.get_balancer(kwargs['name'])
 __utils__['cloud.fire_event']('event', 'attach load_balancer', 'salt/cloud/loadbalancer/attaching', args=kwargs, sock_dir=__opts__['sock_dir'], transport=__opts__['transport'])
 result = lb_conn.balancer_attach_compute_node(lb, node)
 __utils__['cloud.fire_event']('event', 'attached load_balancer', 'salt/cloud/loadbalancer/attached', args=kwargs, sock_dir=__opts__['sock_dir'], transport=__opts__['transport'])
 return _expand_item(result)

def attach_lb ( kwargs = None , call = None ) : if ( call != 'function' ) : raise SaltCloudSystemExit ( 'The attach_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 ( ) node = conn . ex_get_node ( kwargs [ 'member' ] ) lb_conn = get_lb_conn ( conn ) lb = lb_conn . get_balancer ( kwargs [ 'name' ] ) __utils__ [ 'cloud.fire_event' ] ( 'event' , 'attach load_balancer' , 'salt/cloud/loadbalancer/attaching' , args = kwargs , sock_dir = __opts__ [ 'sock_dir' ] , transport = __opts__ [ 'transport' ] ) result = lb_conn . balancer_attach_compute_node ( lb , node ) __utils__ [ 'cloud.fire_event' ] ( 'event' , 'attached load_balancer' , 'salt/cloud/loadbalancer/attached' , args = kwargs , sock_dir = __opts__ [ 'sock_dir' ] , transport = __opts__ [ 'transport' ] ) return _expand_item ( result )
add an existing node/member to an existing load-balancer configuration .