FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > CentOS > CentOS

 
 
LinkBack Thread Tools
 
Old 03-11-2009, 09:34 PM
David Lehman
 
Default Be explicit about resetting Disks' partedDisk attribute. (#489678)

We hit a case where the projected layout matches exactly the
preexisting layout, and so the equality test gives a false
positive due to pyparted's sneaky comparison methods. This
happens when you do autopart two or more times in a row on
a system.
---
storage/devices.py | 8 --------
storage/devicetree.py | 5 +++++
2 files changed, 5 insertions(+), 8 deletions(-)

diff --git a/storage/devices.py b/storage/devices.py
index cb0ba38..ae1ad09 100644
--- a/storage/devices.py
+++ b/storage/devices.py
@@ -704,20 +704,12 @@ class DiskDevice(StorageDevice):

def removePartition(self, device):
log_method_call(self, self.name, part=device.name)
- if self.partedDisk != self._origPartedDisk:
- log.debug("going to reset self.partedDisk to actual state")
- self.resetPartedDisk()
-
partition = self.partedDisk.getPartitionByPath(device.path)
if partition:
self.partedDisk.removePartition(partition)

def addPartition(self, device):
log_method_call(self, self.name, part=device.name)
- if self.partedDisk != self._origPartedDisk:
- log.debug("going to reset self.partedDisk to actual state")
- self.resetPartedDisk()
-
for part in self.partedDisk.partitions:
log.debug("disk %s: partition %s has geom %s" % (self.name,
part.getDeviceNodeName(),
diff --git a/storage/devicetree.py b/storage/devicetree.py
index d21883d..2a40fc4 100644
--- a/storage/devicetree.py
+++ b/storage/devicetree.py
@@ -607,6 +607,11 @@ class DeviceTree(object):
for action in self._actions:
log.debug("action: %s" % action)

+ log.debug("resetting parted disks...")
+ for device in self.devices.itervalues():
+ if isinstance(device, DiskDevice):
+ device.resetPartedDisk()
+
for action in self._actions:
log.info("executing action: %s" % action)
if not dryRun:
--
1.6.0.6

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 

Thread Tools




All times are GMT. The time now is 08:17 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org