Author: eevans
Date: Mon May 23 20:46:50 2011
New Revision: 1126738
URL: http://svn.apache.org/viewvc?rev=1126738&view=rev
Log:
work-around schema disagreements
Patch by eevans; review by jbellis for CASSANDRA-2649
Modified:
cassandra/branches/cassandra-0.8.0/drivers/py/cqlsh
Modified: cassandra/branches/cassandra-0.8.0/drivers/py/cqlsh
URL:
http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.8.0/drivers/py/cqlsh?rev=1126738&r1=1126737&r2=1126738&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.8.0/drivers/py/cqlsh (original)
+++ cassandra/branches/cassandra-0.8.0/drivers/py/cqlsh Mon May 23 20:46:50 2011
@@ -24,6 +24,7 @@ import sys
import readline
import os
import re
+import time
try:
import cql
@@ -129,7 +130,13 @@ class Shell(cmd.Cmd):
statement = self.get_statement(input)
if not statement: return
- self.cursor.execute(statement)
+ for i in range(1,4):
+ try:
+ self.cursor.execute(statement)
+ break
+ except cql.IntegrityError, err:
+ self.printerr("Attempt #%d: %s" % (i, str(err)), color=RED)
+ time.sleep(1*i)
if self.cursor.description is _COUNT_DESCRIPTION:
if self.cursor.result: print self.cursor.result[0]