From f2bc403879234aaaeeb61e1dca1affe18192cfa1 Mon Sep 17 00:00:00 2001 From: Eugene Kirpichov Date: Sat, 21 Jul 2012 23:17:55 +0000 Subject: [PATCH] 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 974417b75f5f839ce4daaf080147ad154d727f10) --- Authors | 1 + nova/tests/test_utils.py | 2 +- nova/utils.py | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Authors b/Authors index 591c4497a67..a903742753d 100644 --- a/Authors +++ b/Authors @@ -62,6 +62,7 @@ Eldar Nugaev Eoghan Glynn Eric Day Eric Windisch +Eugene Kirpichov Evan Callicoat Ewan Mellor François Charlier diff --git a/nova/tests/test_utils.py b/nova/tests/test_utils.py index 501ff91d0cb..5babf4c275e 100644 --- a/nova/tests/test_utils.py +++ b/nova/tests/test_utils.py @@ -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) diff --git a/nova/utils.py b/nova/utils.py index de2da9f6b13..01a52b52ae3 100644 --- a/nova/utils.py +++ b/nova/utils.py @@ -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)