Joel Andres Granados wrote:
Joel Andres Granados wrote:
Hi All:
Temporary patch for 186439. The idea is not to crash and to give the
user a nice message to change the name of his lv or vg. The message
is thrown before kickstart creates the LogicalVolumeRequestSpec of
VolumeGroupRequestSpec objects.
Another possibility is to change the '-' character to another
acceptable character. If I had to choose one from the alphabet it
would be 't'. No particular reazon, just like the 't' (diff2).
I'll see if fixing it is possible
Regards
------------------------------------------------------------------------
--- ../FC-D/kickstart.py 2007-03-08 19:43:45.000000000 +0100
+++ kickstart.py 2007-03-16 19:00:50.000000000 +0100
@@ -257,6 +257,9 @@
elif (lvd.percent <= 0 or lvd.percent > 100) and not
lvd.preexist:
raise KickstartValueError, formatErrorMsg(self.lineno,
msg="Percentage must be between 0 and 100")
+ if "-" in lvd.name:
+ raise KickstartValueError, formatErrorMsg(self.lineno,
msg="The '-' character must not be used in logical volume names.")
+
request = partRequests.LogicalVolumeRequestSpec(filesystem,
format = lvd.format,
mountpoint = lvd.mountpoint,
@@ -605,6 +608,9 @@
if vgd.pesize not in
lvm.getPossiblePhysicalExtents(floor=1024):
raise KickstartValueError, formatErrorMsg(self.lineno,
msg="Volume group specified invalid pesize")
+ if "-" in vgd.vgname:
+ raise KickstartValueError, formatErrorMsg(self.lineno,
msg="The '-' character must not be used in volume group names.")
+
# get a sort of hackish id
uniqueID = self.handler.ksID
self.handler.ksVGMapping[vgd.vgname] = uniqueID
------------------------------------------------------------------------
--- ../FC-D/kickstart.py 2007-03-08 19:43:45.000000000 +0100
+++ kickstart.py 2007-03-16 19:07:40.000000000 +0100
@@ -257,6 +257,11 @@
elif (lvd.percent <= 0 or lvd.percent > 100) and not
lvd.preexist:
raise KickstartValueError, formatErrorMsg(self.lineno,
msg="Percentage must be between 0 and 100")
+ if "-" in lvd.name:
+ #We can also change it and not fail.
+ lvd.name.replace("-","t") +
+
request = partRequests.LogicalVolumeRequestSpec(filesystem,
format = lvd.format,
mountpoint = lvd.mountpoint,
@@ -610,6 +615,10 @@
self.handler.ksVGMapping[vgd.vgname] = uniqueID
self.handler.ksID += 1
+ if "-" in vgd.vgname:
+ #We can also change it and not fail.
+ vgd.vgname.replace("-","t") +
request = partRequests.VolumeGroupRequestSpec(vgname =
vgd.vgname,
physvols = pvs,
preexist =
vgd.preexist,
------------------------------------------------------------------------
_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
(Snip from bug 186439)
Comment From Eric Hopper (eric-bugs@xxxxxxxxxxxxxxx
<mailto:eric-bugs@xxxxxxxxxxxxxxx>) on 2007-03-16 19:15 EST
This is great, except I have LV names already that have -'s in them.
Right now
what I have to do is hand-edit the fstab file after installation to
make them
show up in the right place. I'd prefer not to have to do that.
(/Snap)
I had misunderstood the exact situation. The mishandling of the LVM
names happens not only with new kickstart names but also can happen
with inside the partition gui with preexisting lvm structures. With
this in mind I propose another patch that informs the user instead of
spitting out an ugly trace back.
The problem is not fixed but anaconda does not die if this situation
presents itself.
The diff:
--- anaconda-11.2.0.40/partitions.py 2006-08-02 00:13:08.000000000
+0200
+++ anaconda-11.2.0.40-JG/partitions.py 2007-03-27 13:52:25.000000000
+0200
@@ -916,6 +916,18 @@
usesFireWire = False
for request in self.requests:
+ if isinstance(request,
partRequests.VolumeGroupRequestSpec) and \
+ "-" in request.volumeGroupName:
+ errors.append(_("The '-' character is not permited in
the volume group %s. "
+ "Try reinstalling after changing the
volume group name. "
+ "Or try to create a new volume group
using the partition gui. ")%
+ request.volumeGroupName)
+ if isinstance(request,
partRequests.LogicalVolumeRequestSpec) and \
+ "-" in request.logicalVolumeName:
+ errors.append(_("The '-' character is not permited in
the logical volume %s. "
+ "Try reinstalling after changing the
logical volume name. "
+ "Or try to create a new logical
volume using the partition gui. ")%
+ request.logicalVolumeName)
if request.fstype and request.fstype.getName() == "swap":
foundSwap = foundSwap + 1
swapSize = swapSize + request.getActualSize(self,
diskset)
I'll post the same info on the bug.
Regards
_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
Dived into the bug a little more and came up with a possibility. The
patch worked for me in both kickstart and gui installations, but I can't
get past the fact that I may be missing something. The patch can't be
that simple :) Any idea on what I may be missing?????
Ill post my comments in bugzilla as well.
diff:
diff -ubB --exclude=tags anaconda-11.2.0.40/fsset.py
anaconda-11.2.0.40-JG/fsset.py
--- anaconda-11.2.0.40/fsset.py 2007-03-12 16:49:06.000000000 +0100
+++ anaconda-11.2.0.40-JG/fsset.py 2007-03-27 18:06:37.000000000 +0200
@@ -1816,7 +1816,7 @@
iutil.makeDMNode(root=instPath)
if not os.path.isdir(rootdir):
os.makedirs(rootdir)
- dmdev = "/dev/mapper/" +
root.device.getDevice().replace("/", "-")
+ dmdev = "/dev/mapper/" +
root.device.getDevice().replace("-","--").replace("/", "-")
if os.path.exists(instPath + dmdev):
os.unlink(instPath + dmdev)
iutil.copyDeviceNode(dmdev, instPath + dmdev)