fixup __str__s
authorTero Marttila <terom@paivola.fi>
Tue, 14 Feb 2012 19:38:32 +0200
changeset 10 724a90bd77b5
parent 9 c4c858043729
child 11 f8dd32bf0e89
fixup __str__s
pvl/backup/lvm.py
pvl/backup/mount.py
--- a/pvl/backup/lvm.py	Tue Feb 14 19:38:23 2012 +0200
+++ b/pvl/backup/lvm.py	Tue Feb 14 19:38:32 2012 +0200
@@ -82,6 +82,9 @@
             log.debug("cleanup: {0}".format(snapshot))
             snapshot.close()
 
+    def __str__ (self) :
+        return self.name
+
     def __repr__ (self) :
         return "LVM(name={name})".format(name=repr(self.name))
 
@@ -143,6 +146,9 @@
 
         return os.path.exists(self.dev_path)
 
+    def __str__ (self) :
+        return self.lvm_path
+
     def __repr__ (self) :
         return "LVMVolume(lvm={lvm}, name={name})".format(
                 lvm     = repr(self.lvm),
--- a/pvl/backup/mount.py	Tue Feb 14 19:38:23 2012 +0200
+++ b/pvl/backup/mount.py	Tue Feb 14 19:38:32 2012 +0200
@@ -79,6 +79,15 @@
         # umount
         command(self.UMOUNT, self.mnt)
 
+    def __repr__ (self) :
+        return "Mount(dev={dev}, mnt={mnt})".format(
+                dev     = repr(self.dev),
+                mnt     = repr(self.mnt),
+        )
+
+    def __str__ (self) :
+        return self.mnt
+
 @contextlib.contextmanager
 def mount (dev, mnt, **kwargs) :
     """