Change in vdsm[master]: volume: Fix exception re-rasing

nsoffer at redhat.com nsoffer at redhat.com
Wed Oct 1 00:56:13 UTC 2014


Nir Soffer has uploaded a new change for review.

Change subject: volume: Fix exception re-rasing
......................................................................

volume: Fix exception re-rasing

When re-raising and excepition, the correct way is:

    raise

And not:

    raise e

The later form create a new useless traceback, strating at the point were the
exception was re-raised:

    Traceback (most recent call last):
      File "raise.py", line 14, in <module>
        raise e
    Exception: testing

Instead of the original traceback, showing the original call stack:

    Traceback (most recent call last):
      File "raise.py", line 11, in <module>
        a()
      File "raise.py", line 2, in a
        b()
      File "raise.py", line 5, in b
        c()
      File "raise.py", line 8, in c
        raise Exception("testing")
    Exception: testing

Change-Id: I3f505f4ff70c528b5decd2665f9cd983eb58f605
Signed-off-by: Nir Soffer <nsoffer at redhat.com>
---
M vdsm/storage/volume.py
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/56/33556/1

diff --git a/vdsm/storage/volume.py b/vdsm/storage/volume.py
index 13bd256..0f9b335 100644
--- a/vdsm/storage/volume.py
+++ b/vdsm/storage/volume.py
@@ -437,7 +437,7 @@
                 cls.log.error("Failed to create volume: %s, volume already "
                               "exists", volPath)
                 vars.task.popRecovery()
-                raise e
+                raise
             # When the volume format is raw what the guest sees is the apparent
             # size of the file/device therefore if the requested size doesn't
             # match the apparent size (eg: physical extent granularity in LVM)


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3f505f4ff70c528b5decd2665f9cd983eb58f605
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer <nsoffer at redhat.com>


More information about the vdsm-patches mailing list