mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Merge pull request #54327 from garethgreenaway/more_test_program_fixes
[2019.2.1] Catch the AccessDenied exception and continue when running under Py3.
This commit is contained in:
commit
490ee69f94
1 changed files with 8 additions and 0 deletions
|
@ -816,6 +816,14 @@ class TestDaemon(TestProgram):
|
|||
# Process exited between when process_iter was invoked and
|
||||
# when we tried to invoke this instance's cmdline() func.
|
||||
continue
|
||||
except psutils.AccessDenied:
|
||||
# We might get access denied if not running as root
|
||||
if not salt.utils.platform.is_windows():
|
||||
pinfo = proc.as_dict(attrs=['pid', 'name', 'username'])
|
||||
log.error('Unable to access process %s, '
|
||||
'running command %s as user %s',
|
||||
pinfo['pid'], pinfo['name'], pinfo['username'])
|
||||
continue
|
||||
else:
|
||||
cmd_len = len(cmdline)
|
||||
for proc in psutils.process_iter():
|
||||
|
|
Loading…
Add table
Reference in a new issue