Stop lock decorator from leaving tempdirs in tests
In some versions of python 2.7, we must use the nonlocal keyword to
give an inline function access to a variable in the enclosing scope.
This leads to a tempdir not beaing cleaned up because a boolean in
the synchronized decorator doesn't get set properly. Since we are
still supporting python 2.6, this patch removes the method call
completely so we don't have to worry about locality.
The patch also moves acquiring the lock inside the try, except to
make sure the tempdir is still cleaned even if there is some issue
with getting the lock.
Reviewed: https:/ /review. openstack. org/12586 github. com/openstack/ nova/commit/ 67f74991f73fa2c 8350c434a7f67c8 5bf50e4934
Committed: http://
Submitter: Jenkins
Branch: master
commit 67f74991f73fa2c 8350c434a7f67c8 5bf50e4934
Author: Vishvananda Ishaya <email address hidden>
Date: Fri Sep 7 17:17:00 2012 +0000
Stop lock decorator from leaving tempdirs in tests
In some versions of python 2.7, we must use the nonlocal keyword to
give an inline function access to a variable in the enclosing scope.
This leads to a tempdir not beaing cleaned up because a boolean in
the synchronized decorator doesn't get set properly. Since we are
still supporting python 2.6, this patch removes the method call
completely so we don't have to worry about locality.
The patch also moves acquiring the lock inside the try, except to
make sure the tempdir is still cleaned even if there is some issue
with getting the lock.
Fixes bug 1047530
Change-Id: Ie3da18262e67de 076b1e474c24edd 2e4e5208646