Comment 10 for bug 1018586

Revision history for this message
Adam Gandelman (gandelman-a) wrote :

Hey Eugene-

I'm not sure where you and the other guy got a more up-to-date version of lockfile. python-lockfile has remained at 0.8 in Ubuntu since the package was introduced in Lucid. That said, AFACIS I'm not sure any of this is lockfile related as nova.utils.GreenLockFile overrides lockfile's naming scheme for sentinel files, anyway, and the sentinel regexp is dependent on that, not lockfile.

Did a quick test locally, and found that system named 'warhead.home.base' leaves a sentinel file as 'warhead.home.base-2ae619-2a025a0.24791', for which your newer regexp works, and the original does not:

#!/usr/bin/python
import re

hostname = 'warhead.home.base'
file="warhead.home.base-2ae619-2a025a0.24791"
orig_sentinel_re = hostname + r'\..*-(\d+$)'
new_sentinel_re = hostname + r'-.*\.(\d+$)'
print re.match(orig_sentinel_re, file)
print re.match(new_sentinel_re, file)

output:
None
<_sre.SRE_Match object at 0x7f69e74ad558>