Re: [PATCH] Fix ks --useexisting and --noformat options of logvol and volgroup

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

 



Radek Vykydal wrote:
Combinations of --useexisting and --noformat options
of ks commands logvol and volgroup should work (I did
basic tests). Note that volgroup --useexisting overrides
--noformat of logvol (volume group and therefore logical
volume is formatted as described in documentation).
---
 kickstart.py |   13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/kickstart.py b/kickstart.py
index 02cbc6b..6cc7f5f 100644
--- a/kickstart.py
+++ b/kickstart.py
@@ -386,9 +386,10 @@ class LogVol(commands.logvol.F9_LogVol):
             return lvd
# Make sure this LV name is not already used in the requested VG.
-        tmp = devicetree.getDeviceByName("%s-%s" % (vg.name, lvd.name))
-        if tmp:
-            raise KickstartValueError, formatErrorMsg(self.lineno, msg="Logical volume name already used in volume group %s" % vg.name)
+        if not lvd.preexist:
+            tmp = devicetree.getDeviceByName("%s-%s" % (vg.name, lvd.name))
+            if tmp:
+                raise KickstartValueError, formatErrorMsg(self.lineno, msg="Logical volume name already used in volume group %s" % vg.name)
# Size specification checks
         if not lvd.preexist:
@@ -881,7 +882,11 @@ class VolGroup(commands.volgroup.FC3_VolGroup):
             if not device:
                 raise KicsktartValueError, formatErrorMsg(self.lineno, msg="Specified nonexistent VG %s in volgroup command" % vgd.vgname)
- devicetree.registerAction(ActionCreateFormat(device))
+            for lv in device.lvs:
+                format = getFormat(lv.format.type,
+                                   mountpoint=lv.format.mountpoint,
+                                   mountopts=lv.format.mountopts)
+                devicetree.registerAction(ActionCreateFormat(lv, format))
Now I realize that I was assuming that "Use an existing logical volume and reformat it."
means format it to original format and options, moreover mountpoint setting
is wrong because mountpoint set in ks should be used

         else:
             request = storage.newVG(pvs=pvs,
                                     name=vgd.vgname,

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux