def agent_leave(consul_url=None, node=None):
 ret = {}
 query_params = {}
 if (not consul_url):
  consul_url = _get_config()
  if (not consul_url):
   log.error('No Consul URL found.')
   ret['message'] = 'No Consul URL found.'
   ret['res'] = False
   return ret
 if (not node):
  raise SaltInvocationError('Required argument "node" is missing.')
 function = 'agent/force-leave/{0}'.format(node)
 res = _query(consul_url=consul_url, function=function, method='GET', query_params=query_params)
 if res['res']:
  ret['res'] = True
  ret['message'] = 'Node {0} put in leave state.'.format(node)
 else:
  ret['res'] = False
  ret['message'] = 'Unable to change state for {0}.'.format(node)
 return ret

def agent_leave ( consul_url = None , node = None ) : ret = { } query_params = { } if ( not consul_url ) : consul_url = _get_config ( ) if ( not consul_url ) : log . error ( 'No Consul URL found.' ) ret [ 'message' ] = 'No Consul URL found.' ret [ 'res' ] = False return ret if ( not node ) : raise SaltInvocationError ( 'Required argument "node" is missing.' ) function = 'agent/force-leave/{0}' . format ( node ) res = _query ( consul_url = consul_url , function = function , method = 'GET' , query_params = query_params ) if res [ 'res' ] : ret [ 'res' ] = True ret [ 'message' ] = 'Node {0} put in leave state.' . format ( node ) else : ret [ 'res' ] = False ret [ 'message' ] = 'Unable to change state for {0}.' . format ( node ) return ret
used to instruct the agent to force a node into the left state .