summaryrefslogtreecommitdiffstats
path: root/partedUtils.py
diff options
context:
space:
mode:
authorMike Fulbright <msf@redhat.com>2002-12-18 00:59:51 +0000
committerMike Fulbright <msf@redhat.com>2002-12-18 00:59:51 +0000
commite62748e9f974cee60a2b3f547c57dbdac9c89cbd (patch)
tree2779caca528f101b2c5d4f901a3a26fbfa8ab5c2 /partedUtils.py
parent8c4d6aaeebcdbb0c27d08ede620a48349331d259 (diff)
downloadanaconda-e62748e9f974cee60a2b3f547c57dbdac9c89cbd.tar.gz
anaconda-e62748e9f974cee60a2b3f547c57dbdac9c89cbd.tar.xz
anaconda-e62748e9f974cee60a2b3f547c57dbdac9c89cbd.zip
make relstr nicer
Diffstat (limited to 'partedUtils.py')
-rw-r--r--partedUtils.py24
1 files changed, 23 insertions, 1 deletions
diff --git a/partedUtils.py b/partedUtils.py
index 391106b03..026296fbd 100644
--- a/partedUtils.py
+++ b/partedUtils.py
@@ -340,7 +340,29 @@ def getRedHatReleaseString(mountpoint):
lines = f.readlines()
f.close()
# return the first line with the newline at the end stripped
- return lines[0][:-1]
+ relstr = string.strip(lines[0][:-1])
+
+ # clean it up some
+ #
+ # see if it fits expected form:
+ #
+ # 'Red Hat Linux release 6.2 (Zoot)'
+ #
+ #
+
+ if relstr[:13] == 'Red Hat Linux':
+ try:
+ # look for version string
+ vers = string.split(relstr[14:])[1]
+ for a in string.split(vers, '.'):
+ anum = string.atof(a)
+
+ relstr = "Red Hat Linux " + vers
+ except:
+ # didnt pass test dont change relstr
+ pass
+
+ return relstr
return ""
class DiskSet: