diff options
| author | Joe Gordon <jogo@cloudscaling.com> | 2012-02-27 17:20:21 -0800 |
|---|---|---|
| committer | Joe Gordon <jogo@cloudscaling.com> | 2012-02-27 17:57:33 -0800 |
| commit | 6e6ef5589e8898f898b0d986db90e1e2356e889f (patch) | |
| tree | dc0c9ffc70047d8294efbfa60fbeb50709ca5901 | |
| parent | f01b9b8dd25d763e652259a0f99264d93661b29f (diff) | |
OS X Support fixed, bug 942352
Change-Id: I3aa28ba46b0418310637dfeacbdea60361a7a280
| -rw-r--r-- | nova/tests/test_utils.py | 2 | ||||
| -rw-r--r-- | nova/utils.py | 7 |
2 files changed, 6 insertions, 3 deletions
diff --git a/nova/tests/test_utils.py b/nova/tests/test_utils.py index 843b48dd3..f0c285869 100644 --- a/nova/tests/test_utils.py +++ b/nova/tests/test_utils.py @@ -857,7 +857,7 @@ class TestLockCleanup(test.TestCase): """verify locks for dead processes are cleaned up""" # create sentinels for two processes, us and a 'dead' one - # no actve lock + # no active lock sentinel1 = self._create_sentinel(self.hostname, self.pid) sentinel2 = self._create_sentinel(self.hostname, self.dead_pid) diff --git a/nova/utils.py b/nova/utils.py index 6bb0dd0f2..d631afbfd 100644 --- a/nova/utils.py +++ b/nova/utils.py @@ -901,10 +901,13 @@ def cleanup_file_locks(): pid = match.group(1) LOG.debug(_('Found sentinel %(filename)s for pid %(pid)s' % {'filename': filename, 'pid': pid})) - if not os.path.exists(os.path.join('/proc', pid)): + try: + os.kill(int(pid), 0) + except OSError, e: + # PID wasn't found delete_if_exists(os.path.join(FLAGS.lock_path, filename)) LOG.debug(_('Cleaned sentinel %(filename)s for pid %(pid)s' % - {'filename': filename, 'pid': pid})) + {'filename': filename, 'pid': pid})) # cleanup lock files for filename in files: |
