Reviewed-by: Royce Lv<lvroyce(a)linux.vnet.ibm.com>
On 2014年03月26日 11:41, Aline Manera wrote:
From: Aline Manera <alinefm(a)br.ibm.com>
When YUM raises an error it does not set the message exception so while
using e.message we get an empty string.
Fix it by using str(e)
Also releases Kimchi lock before raises the exception.
Signed-off-by: Aline Manera <alinefm(a)br.ibm.com>
---
src/kimchi/repositories.py | 2 +-
src/kimchi/swupdate.py | 3 ++-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/kimchi/repositories.py b/src/kimchi/repositories.py
index 1c74f04..3407263 100644
--- a/src/kimchi/repositories.py
+++ b/src/kimchi/repositories.py
@@ -123,7 +123,7 @@ class YumRepo(object):
yb.doUnlock()
except Exception, e:
kimchiLock.release()
- raise OperationFailed(errcode, {'err': e.message})
+ raise OperationFailed(errcode, {'err': str(e)})
return repos
diff --git a/src/kimchi/swupdate.py b/src/kimchi/swupdate.py
index 9489900..ef77e3b 100644
--- a/src/kimchi/swupdate.py
+++ b/src/kimchi/swupdate.py
@@ -155,7 +155,8 @@ class YumUpdate(object):
self._pkgs = yb.doPackageLists('updates')
yb.doUnlock()
except Exception, e:
- raise OperationFailed('KCHPKGUPD0003E', {'err': e.message})
+ kimchiLock.release()
+ raise OperationFailed('KCHPKGUPD0003E', {'err': str(e)})
def getPackagesList(self):
"""