diff options
| author | Jenkins <jenkins@review.openstack.org> | 2012-02-28 19:17:07 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2012-02-28 19:17:07 +0000 |
| commit | d034c7838e2bb22a9451446e922eb67e78aba7b1 (patch) | |
| tree | 88f091753d5644085eac2f755afe3ba15ef0b142 | |
| parent | 9d6d72deb0b9241b924909e86ec9a54aacda4bf4 (diff) | |
| parent | 6e6ef5589e8898f898b0d986db90e1e2356e889f (diff) | |
| download | nova-d034c7838e2bb22a9451446e922eb67e78aba7b1.tar.gz nova-d034c7838e2bb22a9451446e922eb67e78aba7b1.tar.xz nova-d034c7838e2bb22a9451446e922eb67e78aba7b1.zip | |
Merge "OS X Support fixed, bug 942352"
| -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 ef4932146..2b39b70af 100644 --- a/nova/utils.py +++ b/nova/utils.py @@ -903,10 +903,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: |
