Skip to content
Browse files

Merge pull request #11015 from mgwilliams/seed

salt.modules.seed: Don't die due to bad symlinks
  • Loading branch information...
2 parents 1e5e9c8 + fe19615 commit 8c93e21dec2cc90dc0f89d18dee52b60e31761e5 @thatch45 thatch45 committed Mar 6, 2014
Showing with 8 additions and 5 deletions.
  1. +8 −5 salt/modules/seed.py
View
13 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

0 comments on commit 8c93e21

Please sign in to comment.
Something went wrong with that request. Please try again.