Permalink
Browse files

salt.modules.seed: Don't die due to bad symlinks

  • Loading branch information...
1 parent 7ddc8de commit fe19615be32a72488479c075b2ca054231606d2b @mgwilliams mgwilliams committed Mar 6, 2014
Showing with 8 additions and 5 deletions.
  1. +8 −5 salt/modules/seed.py
View
@@ -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

0 comments on commit fe19615

Please sign in to comment.