[PATCH 3/5] Fail gracefully when device name collisions occur in kickstart.

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

 



This just makes sure that vg and md names specified for new devices
in kickstart are not already in use.

Resolves: rhbz#691817
---
 kickstart.py |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/kickstart.py b/kickstart.py
index 8a33405..bac256f 100644
--- a/kickstart.py
+++ b/kickstart.py
@@ -990,6 +990,9 @@ class RaidData(commands.raid.F12_RaidData):
             removeExistingFormat(device, storage)
             devicetree.registerAction(ActionCreateFormat(device, kwargs["format"]))
         else:
+            if devicename and devicename in [a.name for a in storage.mdarrays]:
+                raise KickstartValueError(formatErrorMsg(self.lineno, msg="The Software RAID array name \"%s\" is already in use." % devicename))
+
             # If a previous device has claimed this mount point, delete the
             # old one.
             try:
@@ -1105,6 +1108,8 @@ class VolGroupData(commands.volgroup.FC3_VolGroupData):
             dev = devicetree.getDeviceByName(self.vgname)
             if not dev:
                 raise KickstartValueError, formatErrorMsg(self.lineno, msg="No preexisting VG with the name \"%s\" was found." % self.vgname)
+        elif self.vgname in [vg.name for vg in storage.vgs]:
+            raise KickstartValueError(formatErrorMsg(self.lineno, msg="The volume group name \"%s\" is already in use." % self.vgname))
         else:
             request = storage.newVG(pvs=pvs,
                                     name=self.vgname,
-- 
1.7.3.4

_______________________________________________
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