[PATCH 1/1] Edit LVM LV when user has a LV selected.

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

 



* iw/lvm_dialog_gui.py (run, convertToActions): New function.  Need to
have a separate function so we can run it from the editLVMLogicalVolume
function in iw/partition_gui.py.
* iw/partition_gui.py (editCB): Call the new editLVMLogicalVolume
function.
(editLVMLogicalVolume):  New function.  Serves the same purpose as
editLVMVolumeGroup but for Logical Volumes.
---
 iw/lvm_dialog_gui.py |    2 ++
 iw/partition_gui.py  |   32 ++++++++++++++++++++++++++++++--
 2 files changed, 32 insertions(+), 2 deletions(-)

diff --git a/iw/lvm_dialog_gui.py b/iw/lvm_dialog_gui.py
index 18e140a..02dd2ed 100644
--- a/iw/lvm_dialog_gui.py
+++ b/iw/lvm_dialog_gui.py
@@ -944,7 +944,9 @@ class VolumeGroupEditor:
 
 	    # everything ok
 	    break
+        return self.convertToActions()
 
+    def convertToActions(self):
         # here we have to figure out what all was done and convert it to
         # devices and actions
         #
diff --git a/iw/partition_gui.py b/iw/partition_gui.py
index bffc5a9..dd3b2c8 100644
--- a/iw/partition_gui.py
+++ b/iw/partition_gui.py
@@ -709,7 +709,7 @@ class PartitionWindow(InstallWindow):
 		    else:
 			self.tree[iter]['Mount Point'] = ""
 		    self.tree[iter]['Size (MB)'] = "%Ld" % lv.size
-		    self.tree[iter]['PyObject'] = vg
+		    self.tree[iter]['PyObject'] = lv
 		
                     if lv.format.type == "luks" and not lv.format.exists:
                         # we're creating the LUKS header
@@ -1077,7 +1077,7 @@ class PartitionWindow(InstallWindow):
         elif device.type == "lvmvg":
             self.editLVMVolumeGroup(device)
         elif device.type == "lvmlv":
-            self.editLVMVolumeGroup(device)
+            self.editLVMLogicalVolume(device)
         elif isinstance(device, storage.devices.PartitionDevice):
             self.editPartition(device)
 
@@ -1171,6 +1171,34 @@ class PartitionWindow(InstallWindow):
 
 	vgeditor.destroy()
 
+    def editLVMLogicalVolume (self, device):
+        vgeditor = lvm_dialog_gui.VolumeGroupEditor(self.anaconda,
+                                                    self.intf,
+                                                    self.parent,
+                                                    device.vg,
+                                                    isNew = 0)
+        while 1:
+            lv = vgeditor.lvs[device.lvname]
+            vgeditor.editLogicalVolume(lv)
+            actions = vgeditor.convertToActions();
+
+            for action in actions:
+                # FIXME: handle exceptions
+                self.storage.devicetree.registerAction(action)
+
+            if self.refresh(justRedraw=True):
+                actions.reverse()
+                for action in actions:
+                    self.storage.devicetree.cancelAction(action)
+
+                if self.refresh():
+                    raise RuntimeError, ("Returning partitions to state "
+                                         "prior to edit failed")
+                continue
+            else:
+                break
+
+        vgeditor.destroy()
 
     def makeLvmCB(self, widget):
         if not getFormat("lvmpv").supported or not lvm.has_lvm():
-- 
1.6.0.6

_______________________________________________
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