Skip to content

Commit

Permalink
Do not limit node name search to 50 options.
Browse files Browse the repository at this point in the history
Fix #220.
  • Loading branch information
riccardomurri committed Dec 24, 2015
1 parent 21cfcbb commit 6e4d814
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion elasticluster/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
__author__ = 'Nicolas Baer <nicolas.baer@uzh.ch>, Antonio Messina <antonio.s.messina@gmail.com>'

# System imports
import itertools
import operator
import os
import re
Expand Down Expand Up @@ -290,7 +291,7 @@ def add_node(self, kind, image_id, image_user, flavor,
if not name:
nodenames = [i.name for i in self.nodes[kind]]
numnodes = len(nodenames)
for index in range(numnodes+1, numnodes+50):
for index in itertools.count(numnodes + 1):
_name = "%s%03d" % (kind, index)
if _name in nodenames:
continue
Expand Down

0 comments on commit 6e4d814

Please sign in to comment.