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

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

 



David Lehman wrote:
On Tue, 2009-04-14 at 12:08 +0200, Radek Vykydal wrote:
David Lehman wrote:
On Thu, 2009-04-09 at 15:52 +0200, Radek Vykydal wrote:

volgroup vg_dhcp69 --useexisting

This means "use the volgroup vg_dhcp69". Nothing more.
ok, here is modified patch:

Combinations of --useexisting and --noformat options of ks commands logvol and
volgroup should work (I did basic tests). For volume group, --noformat and
--useexisting do the same thing as volume group is not formattable (--noformat
is redundant and docs should be updated)
---
kickstart.py |   26 +++++++-------------------
1 files changed, 7 insertions(+), 19 deletions(-)

diff --git a/kickstart.py b/kickstart.py
index 02cbc6b..87f81f9 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:
@@ -861,27 +862,14 @@ class VolGroup(commands.volgroup.FC3_VolGroup):
        if vgd.pesize not in getPossiblePhysicalExtents(floor=1024):
raise KickstartValueError, formatErrorMsg(self.lineno, msg="Volume group specified invalid pesize")

-        # If --noformat was given, there's really nothing to do.
-        if not vgd.format:
+ # If --noformat or --useexisting was given, there's really nothing to do.
+        if not vgd.format or vgd.preexist:
            if not vgd.vgname:
- raise KickstartValueError, formatErrorMsg(self.lineno, msg="--noformat used without giving a name") + raise KickstartValueError, formatErrorMsg(self.lineno, msg="--noformat or --useexisting used without giving a name")

            dev = devicetree.getDeviceByName(vgd.vgname)
            if not dev:
raise KickstartValueError, formatErrorMsg(self.lineno, msg="No preexisting VG with the name \"%s\" was found." % vgd.vgname)
-
-            return vgd
-
-        # If we were given a pre-existing VG to use, we need to verify it
-        # exists and then schedule a new format action to take place there.
-        # Also, we only support a subset of all the options on pre-existing
-        # VGs.
-        if vgd.preexist:
-            device = devicetree.getDeviceByName(vgd.vgname)
-            if not device:
- raise KicsktartValueError, formatErrorMsg(self.lineno, msg="Specified nonexistent VG %s in volgroup command" % vgd.vgname)
-
-            devicetree.registerAction(ActionCreateFormat(device))
        else:
            request = storage.newVG(pvs=pvs,
                                    name=vgd.vgname,
--
1.5.4.3

_______________________________________________
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