Skip to content

Commit

Permalink
Fix wrong regex in cleanup_file_locks.
Browse files Browse the repository at this point in the history
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 974417b)
  • Loading branch information
jkff authored and Adam Gandelman committed Jul 26, 2012
1 parent bb89acc commit f2bc403
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions Authors
Expand Up @@ -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>
Expand Down
2 changes: 1 addition & 1 deletion nova/tests/test_utils.py
Expand Up @@ -908,7 +908,7 @@ def _get_dead_pid(self):

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)
Expand Down
2 changes: 1 addition & 1 deletion nova/utils.py
Expand Up @@ -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)

Expand Down

0 comments on commit f2bc403

Please sign in to comment.