summaryrefslogtreecommitdiffstats
path: root/partedUtils.py
diff options
context:
space:
mode:
authorJeremy Katz <katzj@redhat.com>2004-08-02 22:43:35 +0000
committerJeremy Katz <katzj@redhat.com>2004-08-02 22:43:35 +0000
commit102b0922c8c7597635681795de48052af560f505 (patch)
tree5b9a35285e1bb55f95dab90cca1148e5e1baa2bb /partedUtils.py
parent867da203da8603a93065ee40eecd0ef83c9cab46 (diff)
downloadanaconda-102b0922c8c7597635681795de48052af560f505.tar.gz
anaconda-102b0922c8c7597635681795de48052af560f505.tar.xz
anaconda-102b0922c8c7597635681795de48052af560f505.zip
don't traceback if we get a read error on /etc/redhat-release (this was
reported in bugzilla, but I don't remember the bug #)
Diffstat (limited to 'partedUtils.py')
-rw-r--r--partedUtils.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/partedUtils.py b/partedUtils.py
index 85aaa7a2e..44f9c8266 100644
--- a/partedUtils.py
+++ b/partedUtils.py
@@ -447,7 +447,14 @@ def sniffFilesystemType(device):
def getRedHatReleaseString(mountpoint):
if os.access(mountpoint + "/etc/redhat-release", os.R_OK):
f = open(mountpoint + "/etc/redhat-release", "r")
- lines = f.readlines()
+ try:
+ lines = f.readlines()
+ except IOError:
+ try:
+ f.close()
+ except:
+ pass
+ return ""
f.close()
# return the first line with the newline at the end stripped
if len(lines) == 0: