Change in vdsm[master]: define.py: remove %s from imageErr

amureini at redhat.com amureini at redhat.com
Sat Aug 17 19:09:48 UTC 2013


Allon Mureinik has uploaded a new change for review.

Change subject: define.py: remove %s from imageErr
......................................................................

define.py: remove %s from imageErr

imageErr untypically has an %s in the error message.
To make things worse, most flows do not fill it, producing messages
which are difficult to understand.

This patch removes the aforementioned %s.

Change-Id: Ia2b8534c34e8efb9d4af3c438a0a0ecc99cf16f0
Bug-Url: https://bugzilla.redhat.com/960635
Signed-off-by: Allon Mureinik <amureini at redhat.com>
---
M lib/vdsm/define.py
M vdsm/vm.py
2 files changed, 3 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/30/18230/1

diff --git a/lib/vdsm/define.py b/lib/vdsm/define.py
index ecb96b2..e38fce1 100644
--- a/lib/vdsm/define.py
+++ b/lib/vdsm/define.py
@@ -54,7 +54,7 @@
         'message': 'Fatal error during migration'}},
     'imageErr': {'status': {
         'code': 13,
-        'message': 'Drive image file %s could not be found'}},
+        'message': 'Drive image file could not be found'}},
     'outOfMem': {'status': {
         'code': 14,
         'message': 'Not enough free memory to create VM'}},
diff --git a/vdsm/vm.py b/vdsm/vm.py
index a0b7310..4f80b4c 100644
--- a/vdsm/vm.py
+++ b/vdsm/vm.py
@@ -4078,10 +4078,8 @@
     def _changeBlockDev(self, vmDev, blockdev, drivespec):
         try:
             path = self.cif.prepareVolumePath(drivespec)
-        except VolumeError as e:
-            return {'status': {'code': errCode['imageErr']['status']['code'],
-                               'message': errCode['imageErr']['status']
-                                                 ['message'] % str(e)}}
+        except VolumeError:
+            return errCode['imageErr']
         diskelem = XMLElement('disk', type='file', device=vmDev)
         diskelem.appendChildWithArgs('source', file=path)
         diskelem.appendChildWithArgs('target', dev=blockdev)


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia2b8534c34e8efb9d4af3c438a0a0ecc99cf16f0
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Allon Mureinik <amureini at redhat.com>


More information about the vdsm-patches mailing list