From fe19615be32a72488479c075b2ca054231606d2b Mon Sep 17 00:00:00 2001 From: Matthew Williams Date: Thu, 6 Mar 2014 16:34:59 -0500 Subject: [PATCH] salt.modules.seed: Don't die due to bad symlinks --- salt/modules/seed.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/salt/modules/seed.py b/salt/modules/seed.py index dffc924b0a..8a9a04fec4 100644 --- a/salt/modules/seed.py +++ b/salt/modules/seed.py @@ -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