Adding some logging when the cache files are unable to be removed.

This commit is contained in:
Gareth J. Greenaway 2018-10-19 15:30:05 -07:00
parent 44940d6c23
commit c2ed1d439a
No known key found for this signature in database
GPG key ID: 10B62F8A7CAD7A41
2 changed files with 14 additions and 8 deletions

View file

@ -63,6 +63,9 @@ def running(opts):
def cache_jobs(opts, jid, ret):
'''
Write job information to cache
'''
serial = salt.payload.Serial(opts=opts)
fn_ = os.path.join(
@ -92,7 +95,7 @@ def _read_proc_file(path, opts):
try:
os.remove(path)
except IOError:
pass
log.debug('Unable to remove proc file %s.', path)
return None
if not isinstance(data, dict):
# Invalid serial object
@ -103,7 +106,7 @@ def _read_proc_file(path, opts):
try:
os.remove(path)
except IOError:
pass
log.debug('Unable to remove proc file %s.', path)
return None
if not _check_cmdline(data):
@ -115,7 +118,7 @@ def _read_proc_file(path, opts):
try:
os.remove(path)
except IOError:
pass
log.debug('Unable to remove proc file %s.', path)
return None
return data

View file

@ -42,6 +42,9 @@ def running(opts):
def cache_jobs(opts, jid, ret):
'''
Write job information to cache
'''
serial = salt.payload.Serial(opts=opts)
fn_ = os.path.join(
@ -73,7 +76,7 @@ def _read_proc_file(path, opts):
try:
os.remove(path)
except IOError:
pass
log.debug('Unable to remove proc file %s.', path)
return None
if not isinstance(data, dict):
# Invalid serial object
@ -84,7 +87,7 @@ def _read_proc_file(path, opts):
try:
os.remove(path)
except IOError:
pass
log.debug('Unable to remove proc file %s.', path)
return None
if opts.get('multiprocessing'):
if data.get('pid') == pid:
@ -94,7 +97,7 @@ def _read_proc_file(path, opts):
try:
os.remove(path)
except IOError:
pass
log.debug('Unable to remove proc file %s.', path)
return None
if data.get('jid') == current_thread:
return None
@ -102,7 +105,7 @@ def _read_proc_file(path, opts):
try:
os.remove(path)
except IOError:
pass
log.debug('Unable to remove proc file %s.', path)
return None
if not _check_cmdline(data):
@ -114,7 +117,7 @@ def _read_proc_file(path, opts):
try:
os.remove(path)
except IOError:
pass
log.debug('Unable to remove proc file %s.', path)
return None
return data