summaryrefslogtreecommitdiffstats
path: root/storage/formats/__init__.py
diff options
context:
space:
mode:
authorJoel Granados Moreno <jgranado@redhat.com>2009-04-09 12:05:12 +0200
committerJoel Granados Moreno <jgranado@redhat.com>2009-04-10 12:57:57 +0200
commitf4ce3c99b316ce9f927786bd6df8594c53a12f0a (patch)
tree6acc836c30377004ff71655ddb6fa3c4e5fd6318 /storage/formats/__init__.py
parentb44b4fd62394eebfdc0bdb86532210426593b7cd (diff)
downloadanaconda-f4ce3c99b316ce9f927786bd6df8594c53a12f0a.tar.gz
anaconda-f4ce3c99b316ce9f927786bd6df8594c53a12f0a.tar.xz
anaconda-f4ce3c99b316ce9f927786bd6df8594c53a12f0a.zip
Close file descriptors when an error occurs.
Diffstat (limited to 'storage/formats/__init__.py')
-rw-r--r--storage/formats/__init__.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/storage/formats/__init__.py b/storage/formats/__init__.py
index 784bb1c79..e68684c31 100644
--- a/storage/formats/__init__.py
+++ b/storage/formats/__init__.py
@@ -258,8 +258,10 @@ class DeviceFormat(object):
pass
else:
log.error("error zeroing out %s: %s" % (self.device, e))
+ os.close(fd)
except Exception as e:
log.error("error zeroing out %s: %s" % (self.device, e))
+ os.close(fd)
self.exists = False