def take_action(name=None, call=None, command=None, data=None, method='GET', location=DEFAULT_LOCATION):
 caller = inspect.stack()[1][3]
 if (call != 'action'):
  raise SaltCloudSystemExit('This action must be called with -a or --action.')
 if data:
  data = json.dumps(data)
 ret = []
 try:
  ret = query(command=command, data=data, method=method, location=location)
  log.info('Success {0} for node {1}'.format(caller, name))
 except Exception as exc:
  if ('InvalidState' in str(exc)):
   ret = [200, {}]
  else:
   log.error('Failed to invoke {0} node {1}: {2}'.format(caller, name, exc), exc_info_on_loglevel=logging.DEBUG)
   ret = [100, {}]
 return ret

def take_action ( name = None , call = None , command = None , data = None , method = 'GET' , location = DEFAULT_LOCATION ) : caller = inspect . stack ( ) [ 1 ] [ 3 ] if ( call != 'action' ) : raise SaltCloudSystemExit ( 'This action must be called with -a or --action.' ) if data : data = json . dumps ( data ) ret = [ ] try : ret = query ( command = command , data = data , method = method , location = location ) log . info ( 'Success {0} for node {1}' . format ( caller , name ) ) except Exception as exc : if ( 'InvalidState' in str ( exc ) ) : ret = [ 200 , { } ] else : log . error ( 'Failed to invoke {0} node {1}: {2}' . format ( caller , name , exc ) , exc_info_on_loglevel = logging . DEBUG ) ret = [ 100 , { } ] return ret
take action call used by start .