def run_task(task_name, args=None, kwargs=None, broker=None, backend=None, wait_for_result=False, timeout=None, propagate=True, interval=0.5, no_ack=True, raise_timeout=True, config=None):
 if (not broker):
  raise SaltInvocationError('broker parameter is required')
 with Celery(broker=broker, backend=backend, set_as_current=False) as app:
  if config:
   app.conf.update(config)
  with app.connection():
   args = (args or [])
   kwargs = (kwargs or {})
   async_result = app.send_task(task_name, args=args, kwargs=kwargs)
   if wait_for_result:
    try:
     return async_result.get(timeout=timeout, propagate=propagate, interval=interval, no_ack=no_ack)
    except TimeoutError as ex:
     log.error('Waiting for the result of a celery task execution timed out.')
     if raise_timeout:
      raise ex
     return False

def run_task ( task_name , args = None , kwargs = None , broker = None , backend = None , wait_for_result = False , timeout = None , propagate = True , interval = 0.5 , no_ack = True , raise_timeout = True , config = None ) : if ( not broker ) : raise SaltInvocationError ( 'broker parameter is required' ) with Celery ( broker = broker , backend = backend , set_as_current = False ) as app : if config : app . conf . update ( config ) with app . connection ( ) : args = ( args or [ ] ) kwargs = ( kwargs or { } ) async_result = app . send_task ( task_name , args = args , kwargs = kwargs ) if wait_for_result : try : return async_result . get ( timeout = timeout , propagate = propagate , interval = interval , no_ack = no_ack ) except TimeoutError as ex : log . error ( 'Waiting for the result of a celery task execution timed out.' ) if raise_timeout : raise ex return False
execute celery tasks .