Author: tmckay
Date: 2013-03-19 13:21:11 +0000 (Tue, 19 Mar 2013)
New Revision: 5746
Modified:
trunk/cumin/bin/cumin-admin
Log:
Remove extra close calls for cursor/connection.
Modified: trunk/cumin/bin/cumin-admin
===================================================================
--- trunk/cumin/bin/cumin-admin 2013-03-19 13:12:17 UTC (rev 5745)
+++ trunk/cumin/bin/cumin-admin 2013-03-19 13:21:11 UTC (rev 5746)
@@ -155,9 +155,11 @@
res = handler(app, conn, cursor, opts, args[1:])
if type(res) is tuple:
conn, cursor = res
- conn.commit()
+ if not conn.closed:
+ conn.commit()
finally:
- cursor.close()
+ if not cursor.closed:
+ cursor.close()
def warn(msg):
print "Warning: %s" % msg
@@ -275,7 +277,6 @@
except SchemaMissing:
error("The schema is missing, run 'cumin-admin
create-schema'")
conn.close()
- cursor.close()
target = app.admin.get_target_schema_version()
if curr == target:
Show replies by thread