mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Rename async function to asynchronous
This commit is contained in:
parent
35eaebb8a4
commit
7d095e0b26
9 changed files with 17 additions and 17 deletions
|
@ -510,7 +510,7 @@ class AsyncClientMixin(object):
|
|||
tag = salt.utils.event.tagify(jid, prefix=self.tag_prefix)
|
||||
return {'tag': tag, 'jid': jid}
|
||||
|
||||
def async(self, fun, low, user='UNKNOWN', pub=None):
|
||||
def asynchronous(self, fun, low, user='UNKNOWN', pub=None):
|
||||
'''
|
||||
Execute the function in a multiprocess and return the event tag to use
|
||||
to watch for the return
|
||||
|
|
|
@ -1068,9 +1068,9 @@ class LocalFuncs(object):
|
|||
try:
|
||||
fun = load.pop('fun')
|
||||
runner_client = salt.runner.RunnerClient(self.opts)
|
||||
return runner_client.async(fun,
|
||||
load.get('kwarg', {}),
|
||||
username)
|
||||
return runner_client.asynchronous(fun,
|
||||
load.get('kwarg', {}),
|
||||
username)
|
||||
except Exception as exc:
|
||||
log.exception('Exception occurred while introspecting %s')
|
||||
return {'error': {'name': exc.__class__.__name__,
|
||||
|
|
|
@ -814,7 +814,7 @@ class SlackClient(object):
|
|||
log.debug('Command %s will run via runner_functions', cmd)
|
||||
# pylint is tripping
|
||||
# pylint: disable=missing-whitespace-after-comma
|
||||
job_id_dict = runner.async(cmd, {'args': args, 'kwargs': kwargs})
|
||||
job_id_dict = runner.asynchronous(cmd, {'args': args, 'kwargs': kwargs})
|
||||
job_id = job_id_dict['jid']
|
||||
|
||||
# Default to trying to run as a client module.
|
||||
|
|
|
@ -1890,9 +1890,9 @@ class ClearFuncs(object):
|
|||
try:
|
||||
fun = clear_load.pop('fun')
|
||||
runner_client = salt.runner.RunnerClient(self.opts)
|
||||
return runner_client.async(fun,
|
||||
clear_load.get('kwarg', {}),
|
||||
username)
|
||||
return runner_client.asynchronous(fun,
|
||||
clear_load.get('kwarg', {}),
|
||||
username)
|
||||
except Exception as exc:
|
||||
log.error('Exception occurred while introspecting %s: %s', fun, exc)
|
||||
return {'error': {'name': exc.__class__.__name__,
|
||||
|
|
|
@ -180,7 +180,7 @@ class SaltInfo(object):
|
|||
'expr_type': 'list',
|
||||
'mode': 'client',
|
||||
'client': 'local',
|
||||
'async': 'local_async',
|
||||
'asynchronous': 'local_async',
|
||||
'token': token,
|
||||
})
|
||||
|
||||
|
|
|
@ -194,7 +194,7 @@ class SaltInfo(object):
|
|||
'expr_type': 'list',
|
||||
'mode': 'client',
|
||||
'client': 'local',
|
||||
'async': 'local_async',
|
||||
'asynchronous': 'local_async',
|
||||
'token': token,
|
||||
})
|
||||
|
||||
|
|
|
@ -411,7 +411,7 @@ class FormattedEventsHandler(AllEventsHandler): # pylint: disable=W0223,W0232
|
|||
'tgt': '*',
|
||||
'token': self.token,
|
||||
'mode': 'client',
|
||||
'async': 'local_async',
|
||||
'asynchronous': 'local_async',
|
||||
'client': 'local'
|
||||
})
|
||||
while True:
|
||||
|
|
|
@ -236,14 +236,14 @@ class Runner(RunnerClient):
|
|||
low['kwarg']['orchestration_jid'] = async_pub['jid']
|
||||
|
||||
# Run the runner!
|
||||
if self.opts.get('async', False):
|
||||
if self.opts.get('asynchronous', False):
|
||||
if self.opts.get('eauth'):
|
||||
async_pub = self.cmd_async(low)
|
||||
else:
|
||||
async_pub = self.async(self.opts['fun'],
|
||||
low,
|
||||
user=user,
|
||||
pub=async_pub)
|
||||
async_pub = self.asynchronous(self.opts['fun'],
|
||||
low,
|
||||
user=user,
|
||||
pub=async_pub)
|
||||
# by default: info will be not enougth to be printed out !
|
||||
log.warning(
|
||||
'Running in async mode. Results of this execution may '
|
||||
|
|
|
@ -120,7 +120,7 @@ class WheelClient(salt.client.mixins.SyncClientMixin,
|
|||
{'jid': '20131219224744416681', 'tag': 'salt/wheel/20131219224744416681'}
|
||||
'''
|
||||
fun = low.pop('fun')
|
||||
return self.async(fun, low)
|
||||
return self.asynchronous(fun, low)
|
||||
|
||||
def cmd(self, fun, arg=None, pub_data=None, kwarg=None, print_event=True, full_return=False):
|
||||
'''
|
||||
|
|
Loading…
Add table
Reference in a new issue