Commit 6fa65588 authored by Julien Muchembled's avatar Julien Muchembled

grid: remove temporary directory if an exception happens while setting its ownership

parent a224be6c
...@@ -260,11 +260,11 @@ class Software(object): ...@@ -260,11 +260,11 @@ class Software(object):
os.chmod(self.software_path, 0o755) os.chmod(self.software_path, 0o755)
self._set_ownership(self.software_path) self._set_ownership(self.software_path)
f = None
extends_cache = tempfile.mkdtemp() extends_cache = tempfile.mkdtemp()
try:
self._set_ownership(extends_cache) self._set_ownership(extends_cache)
f = None
try:
buildout_cfg = os.path.join(self.software_path, 'buildout.cfg') buildout_cfg = os.path.join(self.software_path, 'buildout.cfg')
if not os.path.exists(buildout_cfg): if not os.path.exists(buildout_cfg):
self._create_buildout_profile(buildout_cfg, self.url, self.shared_part_list) self._create_buildout_profile(buildout_cfg, self.url, self.shared_part_list)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment