diff options
author | David Lehman <dlehman@redhat.com> | 2009-12-15 18:40:05 -0600 |
---|---|---|
committer | David Lehman <dlehman@redhat.com> | 2009-12-16 12:26:38 -0600 |
commit | 9347d0d88be25aba4ae0ee37258c0c70ffe02af3 (patch) | |
tree | 44c3dfc1ea85d54441a667ac4986e1061c2fee1b /storage/formats/disklabel.py | |
parent | d4ac61a96989768805769777e6642d42a0fb4edb (diff) | |
download | anaconda-9347d0d88be25aba4ae0ee37258c0c70ffe02af3.tar.gz anaconda-9347d0d88be25aba4ae0ee37258c0c70ffe02af3.tar.xz anaconda-9347d0d88be25aba4ae0ee37258c0c70ffe02af3.zip |
Add __str__ methods to the DeviceFormat classes.
Diffstat (limited to 'storage/formats/disklabel.py')
-rw-r--r-- | storage/formats/disklabel.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/storage/formats/disklabel.py b/storage/formats/disklabel.py index 8917efd11..e5c563108 100644 --- a/storage/formats/disklabel.py +++ b/storage/formats/disklabel.py @@ -85,6 +85,22 @@ class DiskLabel(DeviceFormat): return new + def __str__(self): + s = DeviceFormat.__str__(self) + s += (" type = %(type)s partition count = %(count)s" + " sectorSize = %(sectorSize)s\n" + " align_offset = %(offset)s align_grain = %(grain)s\n" + " partedDisk = %(disk)r\n" + " origPartedDisk = %(orig_disk)r\n" + " partedDevice = %(dev)r\n" % + {"type": self.labelType, "count": len(self.partitions), + "sectorSize": self.partedDevice.sectorSize, + "offset": self.alignment.offset, + "grain": self.alignment.grainSize, + "disk": self.partedDisk, "orig_disk": self._origPartedDisk, + "dev": self.partedDevice}) + return s + def resetPartedDisk(self): """ Set this instance's partedDisk to reflect the disk's contents. """ log_method_call(self, device=self.device) |