summaryrefslogtreecommitdiffstats
path: root/storage
diff options
context:
space:
mode:
authorChris Lumens <clumens@redhat.com>2009-10-27 15:27:54 -0400
committerChris Lumens <clumens@redhat.com>2009-11-04 10:23:41 -0500
commit6c58ec3b2883541a9fc4e4bfed480091a3412ce7 (patch)
treec51c1ebe853ff419d27f9a3ffd606608958663b5 /storage
parentbad99f6a86148105341dca62582fc214607b309d (diff)
downloadanaconda-6c58ec3b2883541a9fc4e4bfed480091a3412ce7.tar.gz
anaconda-6c58ec3b2883541a9fc4e4bfed480091a3412ce7.tar.xz
anaconda-6c58ec3b2883541a9fc4e4bfed480091a3412ce7.zip
Trim the inital / off the mountpoint before making an LV name from it.
This prevents LVs from being named things like "lv__home".
Diffstat (limited to 'storage')
-rw-r--r--storage/__init__.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/storage/__init__.py b/storage/__init__.py
index 841877a4a..70c322766 100644
--- a/storage/__init__.py
+++ b/storage/__init__.py
@@ -800,7 +800,11 @@ class Storage(object):
if mountpoint == '/':
lvtemplate = 'lv_root'
else:
- template = "lv_%s" % (mountpoint,)
+ if mountpoint.startswith("/"):
+ template = "lv_%s" % mountpoint[1:]
+ else:
+ template = "lv_%s" % (mountpoint,)
+
lvtemplate = safeLvmName(template)
else:
if swap: