David Lehman wrote:
I opted to maintain the lv information in a simple dict which we
convert to a temporary vg/lv instance set when we need to. There
is no trampling on objects, and the code is just simpler. The big
difference is that we have to go through and figure out what all
was done at the very end, right before returning to the partition
gui. So far, it is considerably more stable than the previous
implementation was.
---
iw/lvm_dialog_gui.py | 575 ++++++++++++++++++++++++++++++++------------------
1 files changed, 365 insertions(+), 210 deletions(-)
<snip>
@@ -312,7 +313,8 @@ class VolumeGroupEditor:
sw.set_policy(gtk.POLICY_NEVER, gtk.POLICY_AUTOMATIC)
sw.set_shadow_type(gtk.SHADOW_IN)
- for device in alllvmparts:
+ origpvs = self.pvs[:]
+ for device in self.availlvmparts:
# clip size to current PE
pesize = int(self.peCombo.get_active_value()) / 1024.0
size = lvm.clampSize(device.size, pesize)
Looks like an indentation error to me.
<snip>
- if usedev.format.exists and format.mountable and \
- self.storage.formatByDefault(usedev) and \
- not queryNoFormatPreExisting(self.intf):
+ if format.exists and format.mountable and format.mountpoint:
+ tempdev = StorageDevice('tmp', format=format)
+ if self.storage.formatByDefault(tempdev) and \
+ not queryNoFormatPreExisting(self.intf):
continue
I don't like the indentation with the second condition for the second if here.
@@ -734,11 +721,14 @@ class VolumeGroupEditor:
"the currently existing "
"logical volumes"), custom_icon="error")
return
-
- lv = self.storage.newLV(vg=self.vg,
- fmt_type=self.storage.defaultFSType,
- size=free)
- self.editLogicalVolume(lv, isNew = 1)
+
+ tempvg = self.getTempVG()
+ name = self.storage.createSuggestedLVName(tempvg)
+ self.lvs[name] = {'name': name,
+ 'size': free,
+ 'format': getFormat(self.storage.defaultFSType),
+ 'exists': False}
+ self.editLogicalVolume(self.lvs[name], isNew = 1)
return
The indententation seems of again here (tab vs spaces?)
The 1st 4 + lines should be indented identical to the
self.editLogicalVolume()
line I believe.
def editLogicalVolumeCB(self, widget):
@@ -761,9 +751,7 @@ class VolumeGroupEditor:
if not rc:
return
- lv = self.lvs[logvolname]
- action = ActionDestroyDevice(lv)
- self.actions.append(action)
+ del self.lvs[logvolname]
self.logvolstore.remove(iter)
self.updateVGSpaceLabels()
return
indentation again.
Review done till here, more to follow in other mail.
Regards,
Hans
_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list