Fix wrong regex in cleanup_file_locks.

The sentinel filename actually has form hostname-threadid.pid,
not hostname.threadid-pid.

Launchpad bug 1018586.

Update: Add Eugene to Authors for stable/essex.

Change-Id: I09c01e0e63ee704b1485c196dc0b396ee03b2e5c
(cherry picked from commit 974417b75f)
This commit is contained in:
Eugene Kirpichov 2012-07-21 23:17:55 +00:00 committed by Adam Gandelman
parent bb89acc2b0
commit f2bc403879
3 changed files with 3 additions and 2 deletions

View File

@ -62,6 +62,7 @@ Eldar Nugaev <reldan@oscloud.ru>
Eoghan Glynn <eglynn@redhat.com>
Eric Day <eday@oddments.org>
Eric Windisch <eric@cloudscaling.com>
Eugene Kirpichov <ekirpichov@gmail.com>
Evan Callicoat <diopter@gmail.com>
Ewan Mellor <ewan.mellor@citrix.com>
François Charlier <francois.charlier@enovance.com>

View File

@ -908,7 +908,7 @@ class TestLockCleanup(test.TestCase):
def _get_sentinel_name(self, hostname, pid, thread='MainThread'):
return os.path.join(FLAGS.lock_path,
'%s.%s-%d' % (hostname, thread, pid))
'%s-%s.%d' % (hostname, thread, pid))
def _create_sentinel(self, hostname, pid, thread='MainThread'):
name = self._get_sentinel_name(hostname, pid, thread)

View File

@ -986,7 +986,7 @@ def cleanup_file_locks():
return
hostname = socket.gethostname()
sentinel_re = hostname + r'\..*-(\d+$)'
sentinel_re = hostname + r'-.*\.(\d+$)'
lockfile_re = r'nova-.*\.lock'
files = os.listdir(FLAGS.lock_path)