[PATCH 1/3] Save mountpoints specified for existing btrfs volumes. (#892747)
David Lehman
dlehman at redhat.com
Mon Oct 14 17:41:02 UTC 2013
---
pyanaconda/kickstart.py | 20 +++++++++++---------
1 file changed, 11 insertions(+), 9 deletions(-)
diff --git a/pyanaconda/kickstart.py b/pyanaconda/kickstart.py
index 09945c3..1fa5d60 100644
--- a/pyanaconda/kickstart.py
+++ b/pyanaconda/kickstart.py
@@ -365,6 +365,15 @@ class BTRFSData(commands.btrfs.F17_BTRFSData):
if self.mountpoint != "" and self.mountpoint[0] != '/':
raise KickstartValueError(formatErrorMsg(self.lineno, msg="The mount point \"%s\" is not valid." % (self.mountpoint,)))
+ # If a previous device has claimed this mount point, delete the
+ # old one.
+ try:
+ if self.mountpoint:
+ device = storage.mountpoints[self.mountpoint]
+ storage.destroyDevice(device)
+ except KeyError:
+ pass
+
if self.preexist:
device = devicetree.getDeviceByName(self.name)
if not device:
@@ -372,16 +381,9 @@ class BTRFSData(commands.btrfs.F17_BTRFSData):
if not device:
raise KickstartValueError(formatErrorMsg(self.lineno, msg="Specified nonexistent BTRFS volume %s in btrfs command" % self.name))
- else:
- # If a previous device has claimed this mount point, delete the
- # old one.
- try:
- if self.mountpoint:
- device = storage.mountpoints[self.mountpoint]
- storage.destroyDevice(device)
- except KeyError:
- pass
+ device.mountpoint = self.mountpoint
+ else:
request = storage.newBTRFS(name=name,
subvol=self.subvol,
mountpoint=self.mountpoint,
--
1.8.1.4
More information about the anaconda-patches
mailing list