Federico Simoncelli has uploaded a new change for review.

Change subject: volume: improve volume clone logging
......................................................................

volume: improve volume clone logging

This patch adds the traceback output in case of an exception,
removes the superfluous "Volume.clone:" prefixes and uses the
correct formatting.

Change-Id: Id3fb5f9cc74792c7bd94ccbc49cc39b00d464370
Signed-off-by: Federico Simoncelli <[email protected]>
---
M vdsm/storage/volume.py
1 file changed, 4 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/67/26867/1

diff --git a/vdsm/storage/volume.py b/vdsm/storage/volume.py
index 14deddc..7f1eaf1 100644
--- a/vdsm/storage/volume.py
+++ b/vdsm/storage/volume.py
@@ -266,8 +266,8 @@
         try:
             self.prepare(rw=False)
             dst_path = os.path.join(dst_image_dir, dst_volUUID)
-            self.log.debug("Volume.clone: %s to %s" %
-                           (self.volumePath, dst_path))
+            self.log.debug('cloning volume %s to %s', self.volumePath,
+                           dst_path)
             size = int(self.getMetaParam(SIZE))
             parent = self.getVolumePath()
             parent_format = fmt2str(self.getFormat())
@@ -278,12 +278,12 @@
                          size, volFormat, preallocate)
             self.teardown(self.sdUUID, self.volUUID)
         except Exception as e:
+            self.log.exception('cannot clone volume %s to %s',
+                               self.volumePath, dst_path)
             # FIXME: might race with other clones
             if wasleaf:
                 self.setLeaf()
             self.teardown(self.sdUUID, self.volUUID)
-            self.log.error("Volume.clone: can't clone: %s to %s" %
-                           (self.volumePath, dst_path))
             raise se.CannotCloneVolume(self.volumePath, dst_path, str(e))
 
     def _shareLease(self, dstImgPath):


-- 
To view, visit http://gerrit.ovirt.org/26867
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id3fb5f9cc74792c7bd94ccbc49cc39b00d464370
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Federico Simoncelli <[email protected]>
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to