Merge pull request #11015 from mgwilliams/seed

salt.modules.seed: Don't die due to bad symlinks
This commit is contained in:
Thomas S Hatch 2014-03-06 17:25:00 -08:00
commit 8c93e21dec

View File

@ -235,9 +235,12 @@ def _chroot_exec(root, cmd):
def _chroot_pids(chroot):
pids = []
for root in glob.glob('/proc/[0-9]*/root'):
link = os.path.realpath(root)
if link.startswith(chroot):
pids.append(int(os.path.basename(
os.path.dirname(root)
)))
try:
link = os.path.realpath(root)
if link.startswith(chroot):
pids.append(int(os.path.basename(
os.path.dirname(root)
)))
except OSError:
pass
return pids