[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Patch. bug 186439



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,

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]