summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEugene Kirpichov <ekirpichov@gmail.com>2012-07-21 23:17:55 +0000
committerEugene Kirpichov <ekirpichov@gmail.com>2012-07-23 18:11:29 +0000
commit974417b75f5f839ce4daaf080147ad154d727f10 (patch)
treea036a5baae0eb042692884bb57b14c3d24ec77d6
parent563ed09b9a35e50e24ca10c9a588df119e9a7725 (diff)
Fix wrong regex in cleanup_file_locks.
The sentinel filename actually has form hostname-threadid.pid, not hostname.threadid-pid. Launchpad bug 1018586. Change-Id: I09c01e0e63ee704b1485c196dc0b396ee03b2e5c
-rw-r--r--nova/tests/test_utils.py2
-rw-r--r--nova/utils.py2
2 files changed, 2 insertions, 2 deletions
diff --git a/nova/tests/test_utils.py b/nova/tests/test_utils.py
index 6506bde1c..3cee908d6 100644
--- a/nova/tests/test_utils.py
+++ b/nova/tests/test_utils.py
@@ -606,7 +606,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)
diff --git a/nova/utils.py b/nova/utils.py
index 9cfb6d06d..7b49fb5fc 100644
--- a/nova/utils.py
+++ b/nova/utils.py
@@ -720,7 +720,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)