def atrm(*args):
 if (not salt.utils.which('at')):
  return "'at.atrm' is not available."
 if (not args):
  return {'jobs': {'removed': [], 'tag': None}}
 if (args[0] == 'all'):
  if (len(args) > 1):
   opts = list(list(map(str, [j['job'] for j in atq(args[1])['jobs']])))
   ret = {'jobs': {'removed': opts, 'tag': args[1]}}
  else:
   opts = list(list(map(str, [j['job'] for j in atq()['jobs']])))
   ret = {'jobs': {'removed': opts, 'tag': None}}
 else:
  opts = list(list(map(str, [i['job'] for i in atq()['jobs'] if (i['job'] in args)])))
  ret = {'jobs': {'removed': opts, 'tag': None}}
 output = _cmd('at', '-d', ' '.join(opts))
 if (output is None):
  return "'at.atrm' is not available."
 return ret

def atrm ( * args ) : if ( not salt . utils . which ( 'at' ) ) : return "'at.atrm' is not available." if ( not args ) : return { 'jobs' : { 'removed' : [ ] , 'tag' : None } } if ( args [ 0 ] == 'all' ) : if ( len ( args ) > 1 ) : opts = list ( list ( map ( str , [ j [ 'job' ] for j in atq ( args [ 1 ] ) [ 'jobs' ] ] ) ) ) ret = { 'jobs' : { 'removed' : opts , 'tag' : args [ 1 ] } } else : opts = list ( list ( map ( str , [ j [ 'job' ] for j in atq ( ) [ 'jobs' ] ] ) ) ) ret = { 'jobs' : { 'removed' : opts , 'tag' : None } } else : opts = list ( list ( map ( str , [ i [ 'job' ] for i in atq ( ) [ 'jobs' ] if ( i [ 'job' ] in args ) ] ) ) ) ret = { 'jobs' : { 'removed' : opts , 'tag' : None } } output = _cmd ( 'at' , '-d' , ' ' . join ( opts ) ) if ( output is None ) : return "'at.atrm' is not available." return ret
remove jobs from the queue .