Permalink
Browse files

Correct fix _wait_for_agreement in system manager

  • Loading branch information...
carlopires committed Jan 4, 2012
1 parent e7a7671 commit e96990714eb6cd88485894a8dd32355ef28b9982
Showing with 8 additions and 9 deletions.
  1. +8 −9 pycassa/system_manager.py
View
@@ -1,6 +1,5 @@
import time
import warnings
-import uuid
from pycassa.connection import Connection
from pycassa.cassandra.ttypes import IndexType, KsDef, CfDef, ColumnDef,\
@@ -590,11 +589,11 @@ def drop_index(self, keyspace, column_family, column):
def _wait_for_agreement(self):
while True:
versions = self._conn.describe_schema_versions()
- for key, _nodes in versions.items():
- try:
- uuid.UUID(key)
- except:
- continue
- else:
- return True
- time.sleep(_SAMPLE_PERIOD)
+
+ # ignore unreachable nodes
+ live_versions = [key for key in versions.keys() if key != 'UNREACHABLE']
+
+ if len(live_versions) == 1:
+ break
+ else:
+ time.sleep(_SAMPLE_PERIOD)

0 comments on commit e969907

Please sign in to comment.