You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ts...@apache.org on 2012/10/23 11:49:18 UTC
[26/50] [abbrv] git commit: Remove redundant code in try..except block
Remove redundant code in try..except block
Signed-off-by: Prasanna Santhanam <ts...@apache.org> 1350839262 +0530
Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/fd542167
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/fd542167
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/fd542167
Branch: refs/heads/marvin-parallel
Commit: fd5421670dc214d8457078fe4d49d4b042507cdd
Parents: 43bd3c3
Author: Prasanna Santhanam <ts...@apache.org>
Authored: Sun Oct 21 22:37:42 2012 +0530
Committer: Prasanna Santhanam <ts...@apache.org>
Committed: Sun Oct 21 22:39:21 2012 +0530
----------------------------------------------------------------------
tools/marvin/marvin/dbConnection.py | 7 ++-----
1 files changed, 2 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/fd542167/tools/marvin/marvin/dbConnection.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/dbConnection.py b/tools/marvin/marvin/dbConnection.py
index eb01d73..8fa8643 100644
--- a/tools/marvin/marvin/dbConnection.py
+++ b/tools/marvin/marvin/dbConnection.py
@@ -42,13 +42,10 @@ class dbConnection(object):
with contextlib.closing(conn.cursor(buffered=True)) as cursor:
cursor.execute(sql, params)
try:
- result = cursor.fetchall()
+ resultRow = cursor.fetchall()
except errors.InterfaceError:
#Raised on empty result - DML
- result = []
- if result:
- [resultRow.append(r) for r in result]
-
+ resultRow = []
return resultRow
def executeSqlFromFile(self, fileName=None):