Merge pull request #44717 from garethgreenaway/44694_at_absent_failing_to_find_jobs

[2017.7] Fixes to at module
This commit is contained in:
Nicole Thomas 2017-12-01 09:37:05 -05:00 committed by GitHub
commit 20f20ad9e1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -169,6 +169,9 @@ def atrm(*args):
if not args:
return {'jobs': {'removed': [], 'tag': None}}
# Convert all to strings
args = [str(arg) for arg in args]
if args[0] == 'all':
if len(args) > 1:
opts = list(list(map(str, [j['job'] for j in atq(args[1])['jobs']])))
@ -178,7 +181,7 @@ def atrm(*args):
ret = {'jobs': {'removed': opts, 'tag': None}}
else:
opts = list(list(map(str, [i['job'] for i in atq()['jobs']
if i['job'] in args])))
if str(i['job']) in args])))
ret = {'jobs': {'removed': opts, 'tag': None}}
# Shim to produce output similar to what __virtual__() should do