summaryrefslogtreecommitdiffstats
path: root/storage/formats/fs.py
diff options
context:
space:
mode:
authorDavid Lehman <dlehman@redhat.com>2009-12-21 19:13:24 -0600
committerDavid Lehman <dlehman@redhat.com>2009-12-22 15:02:36 -0600
commit0ac007dda15f2fefa59924e905a919828b8fd6a4 (patch)
treeed8457a61fac942c43a5eff5e6473ff1a90769d6 /storage/formats/fs.py
parent59fae899cf0895778c8a615bb32bacd203a47a03 (diff)
downloadanaconda-0ac007dda15f2fefa59924e905a919828b8fd6a4.tar.gz
anaconda-0ac007dda15f2fefa59924e905a919828b8fd6a4.tar.xz
anaconda-0ac007dda15f2fefa59924e905a919828b8fd6a4.zip
Add a "dict" attribute to Device and DeviceFormat classes.
This attribute is a dict that describes the device or format instance with considerable detail. It is intended that the dict will be pickled using the shelve module, so values should be picklable objects. Keys should be descriptive strings.
Diffstat (limited to 'storage/formats/fs.py')
-rw-r--r--storage/formats/fs.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/storage/formats/fs.py b/storage/formats/fs.py
index 09e764d5f..b07bd4ab7 100644
--- a/storage/formats/fs.py
+++ b/storage/formats/fs.py
@@ -172,6 +172,15 @@ class FS(DeviceFormat):
"targetSize": self.targetSize})
return s
+ @property
+ def dict(self):
+ d = super(FS, self).dict
+ d.update({"mountpoint": self.mountpoint, "size": self._size,
+ "label": self.label, "targetSize": self.targetSize,
+ "mountable": self.mountable,
+ "migratable": self.migratable})
+ return d
+
def _setTargetSize(self, newsize):
""" Set a target size for this filesystem. """
if not self.exists: